Beispiel #1
0
def FALSE(classical_reg):
    """
    Produce a FALSE instruction.

    :param classical_reg: A classical register to modify.
    :return: A ClassicalFalse instance.
    """
    return ClassicalFalse(unpack_classical_reg(classical_reg))
Beispiel #2
0
 def exitClassicalUnary(self, ctx):
     # type: (QuilParser.ClassicalUnaryContext) -> None
     if ctx.TRUE():
         self.result.append(ClassicalTrue(_addr(ctx.addr())))
     elif ctx.FALSE():
         self.result.append(ClassicalFalse(_addr(ctx.addr())))
     elif ctx.NOT():
         self.result.append(ClassicalNot(_addr(ctx.addr())))
Beispiel #3
0
 def classical_unary(self, op, target):
     if op == "TRUE":
         return ClassicalTrue(target)
     elif op == "FALSE":
         return ClassicalFalse(target)
     elif op == "NEG":
         return ClassicalNeg(target)
     elif op == "NOT":
         return ClassicalNot(target)