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.
- パラメータ:
- 戻り値:
Single constraint for 1D input; otherwise one constraint per slice on the last axis.
- 戻り値の型:
- 例外:
ValueError -- The last axis of the array is shorter than two elements, or the array holds a variable that is neither binary nor Ising.