domain_wallΒΆ
- domain_wall(array: PolyArray[_Dim], label: str = '', *, ascending: bool = True) ConstraintListΒΆ
Create domain wall constraints for a variable array.
For 1D arrays, return a single constraint. For higher-dimensional arrays, apply the same construction to each slice of the last axis and return a constraint list.
- Parameters:
- Returns:
Single constraint for 1D input; otherwise one constraint per slice on the last axis.
- Return type:
- Raises:
ValueError β The last axis of the array is shorter than two elements, or the array holds a variable that is neither binary nor Ising.