dimod.generators.halfadder_gate

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

Return a binary quadratic model with ground states corresponding to a half adder gate.

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

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

  • sum – The variable label for the sum output.

  • carry – The variable label for the carry output.

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

Returns

A binary quadratic model with ground states corresponding to a half adder gate. The model has four variables and six interactions.