qat.lang.AQASM.bits.BoolFormula

class qat.lang.AQASM.bits.BoolFormula(operator, left, right=None)

Class describing boolean formulae to manipulate classical bits.

This class is not designed to be instantiated by hand, but rather via composition of Cbit via logical operators.

Formulae are created by using the classical boolean operators (and, or, xor, neg) applied on (an)other formula(e) or classical bits.

from qat.lang.AQASM import Program

prog = Program()
cbits = prog.calloc(2)

and_expr = cbits[0] & cbits[1]
print(type(and_expr))
print(and_expr)
<class 'qat.lang.AQASM.bits.BoolFormula'>
(c[0] & c[1])

These objects are used in various pyAQASM instructions.