dimod.binary.BinaryQuadraticModel.contract_variables#
- BinaryQuadraticModel.contract_variables(u: Hashable, v: Hashable)[source]#
Enforce u, v being the same variable in a binary quadratic model.
The resulting variable is labeled
u. Values of interactions betweenvand variables thatuinteracts with are added to the corresponding interactions ofu.- Parameters:
u – Variable in the binary quadratic model.
v – Variable in the binary quadratic model.