An appropriate Device is automatically created when using get_qc() and it is stored on the QuantumComputer object as the device attribute.

There are properties of real quantum computers that go beyond the quantum abstract machine (QAM) abstraction. Real devices have performance specs, limited ISAs, and restricted topologies. AbstractDevice provides an abstract interface for accessing properties of a real quantum device or for mocking out relevant properties for a more realistic QVM.

Device(name, raw) A device (quantum chip) that can accept programs.
NxDevice(topology) A shim over the AbstractDevice API backed by a NetworkX graph.

The data structures used are documented here

ISA(qubits, edges) Basic Instruction Set Architecture specification.
Specs(qubits_specs, edges_specs) Basic specifications for the device, such as gate fidelities and coherence times.

Utility functions

pyquil.device.isa_from_graph(graph, oneq_type='Xhalves', twoq_type=None)[source]

Generate an ISA object from a NetworkX graph.

  • graph (Graph) – The graph
  • oneq_type (str) – The type of 1-qubit gate. Currently ‘Xhalves’
  • twoq_type (Union[List[str], str, None]) – The type of 2-qubit gate. One or more of ‘CZ’, ‘CPHASE’, ‘ISWAP’, ‘XY’. The default, None, is a synonym for [“CZ”, “XY”].
Return type:



Generate a Specs object from a NetworkX graph with placeholder values for the actual specs.

Parameters:graph (Graph) – The graph
Return type:Specs

Construct a NetworkX qubit topology from an ISA object.

This discards information about supported gates.

Parameters:isa (ISA) – The ISA.
Return type:Graph

Generate the full gateset associated with an ISA.

Parameters:isa (ISA) – The instruction set architecture for a QPU.
Return type:List[Gate]
Returns:A sequence of Gate objects encapsulating all gates compatible with the ISA.