dimod.generators.and_gate

and_gate(in0: Hashable, in1: Hashable, out: Hashable, *, strength: float = 1.0) dimod.binary.binary_quadratic_model.BinaryQuadraticModel[source]

Return a binary quadratic model with ground states corresponding to an AND gate.

Parameters
  • in0 – The variable label for one of the inputs.

  • in1 – The variable label for one of the inputs.

  • out – The variable label for the output.

  • strength – The energy of the lowest-energy infeasible state.

Returns

A binary quadratic model with ground states corresponding to an AND gate. The model has three variables and three interactions.