How to use the rpcq.messages.TargetDevice 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
"""

        if not endpoint.startswith("tcp://"):
            raise ValueError(
                f"PyQuil versions >= 2.4 can only talk to quilc "
                f"versions >= 1.4 over network RPCQ.  You've supplied the "
                f"endpoint '{endpoint}', but this doesn't look like a network "
                f"ZeroMQ address, which has the form 'tcp://domain:port'. "
                f"You might try clearing (or correcting) your COMPILER_URL "
                f"environment variable and removing (or correcting) the "
                f"compiler_server_address line from your .forest_config file."
            )

        self.endpoint = endpoint
        self.client = Client(endpoint, timeout=timeout)
        self.target_device = TargetDevice(isa=device.get_isa().to_dict(), specs=None)

        try:
            self.connect()
        except QuilcNotRunning as e:
            warnings.warn(f"{e}. Compilation using quilc will not be available.")