How to use the rpcq.messages.NativeQuilRequest function in rpcq

To help you get started, we’ve selected a few rpcq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rigetti / pyquil / pyquil / api / _compiler.py View on Github external
def quil_to_native_quil(self, program: Program, *, protoquil=None) -> Program:
        self.connect()
        request = NativeQuilRequest(quil=program.out(), target_device=self.target_device)
        response = self.client.call(
            "quil_to_native_quil", request, protoquil=protoquil
        ).asdict()  # type: Dict
        nq_program = parse_program(response["quil"])
        nq_program.native_quil_metadata = response["metadata"]
        nq_program.num_shots = program.num_shots
        return nq_program