mimiqcircuits.classical.and_operation¶
Classes
|
Computes the bitwise AND of N-1 classical bits and stores the result in the first given bit. |
- class mimiqcircuits.classical.and_operation.And(N=3)[source]¶
Bases:
AbstractClassicalComputes the bitwise AND of N-1 classical bits and stores the result in the first given bit.
Examples
>>> from mimiqcircuits import * >>> And() c[?0] = c[?1] & c[?2] >>> And(8) c[?0] = & @ c[?1:?7] >>> c = Circuit() >>> c.push(And(), 0, 2, 3) 4-bit circuit with 1 instruction: └── c[0] = c[2] & c[3] >>> c = Circuit() >>> c.push(And(5), 0, 1, 2, 3, 4) 5-bit circuit with 1 instruction: └── c[0] = c[1] & c[2] & c[3] & c[4] >>> c = Circuit() >>> c.push(And(8), 0, 1, 2, 3, 4, 5, 6, 7) 8-bit circuit with 1 instruction: └── c[0] = & @ c[1, 2, 3, 4, 5, 6, 7]