Exemple #1
0
def TRUE(classical_reg):
    """
    Produce a TRUE instruction.

    :param classical_reg: A classical register to modify.
    :return: A ClassicalTrue instance.
    """
    return ClassicalTrue(unpack_classical_reg(classical_reg))
Exemple #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())))
Exemple #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)