and_gadget

Function and_gadget 

Source
pub fn and_gadget<W>() -> LogicGadget<W>
where W: Clone + Default + From<i32>,
Expand description

Create an AND gate gadget.

3-variable SpinGlass: inputs at indices 0, 1; output at index 2. Ground states: (0,0,0), (0,1,0), (1,0,0), (1,1,1) corresponding to all valid AND truth table entries.

J = [1, -2, -2] for edges (0,1), (0,2), (1,2) h = [-1, -1, 2] (negated from Julia to account for different spin convention)

Note: Julia uses config 0 -> spin +1, 1 -> spin -1 Rust uses config 0 -> spin -1, 1 -> spin +1 So h values are negated to produce equivalent ground states.