mimiqcircuits.classical.setbits¶
Classes
|
Set a classical bit to 0, whatever its value. |
|
Set a classical bit to 1, whatever its value. |
- class SetBit0[source]¶
Bases:
AbstractClassicalSet a classical bit to 0, whatever its value.
Acts on one classical bit.
Examples
>>> from mimiqcircuits import * >>> SetBit0().name 'set0' >>> # set bit 1 to 0 >>> c = Circuit() >>> c.push(SetBit0(), 1) 2-bit circuit with 1 instruction: └── c[1] = 0
- inverse()[source]¶
Return
SetBit1().Setting a bit is not invertible; this pairing only mirrors the opposite operation.
- class SetBit1[source]¶
Bases:
AbstractClassicalSet a classical bit to 1, whatever its value.
Acts on one classical bit.
Examples
>>> from mimiqcircuits import * >>> SetBit1().name 'set1' >>> # set bit 1 to 1 >>> c = Circuit() >>> c.push(SetBit1(), 1) 2-bit circuit with 1 instruction: └── c[1] = 1
- inverse()[source]¶
Return
SetBit0().Setting a bit is not invertible; this pairing only mirrors the opposite operation.