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))
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())))
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)