Devices

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.

AbstractDevice
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 Basic Instruction Set Architecture specification.
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='CZ')[source]

Generate an ISA object from a NetworkX graph.

Parameters:
  • graph (Graph) – The graph
  • oneq_type – The type of 1-qubit gate. Currently ‘Xhalves’
  • twoq_type – The type of 2-qubit gate. One of ‘CZ’ or ‘CPHASE’.
Return type:

ISA

pyquil.device.specs_from_graph(graph)[source]

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

Parameters:graph (Graph) – The graph
pyquil.device.isa_to_graph(isa)[source]

Construct a NetworkX qubit topology from an ISA object.

This discards information about supported gates.

Parameters:isa (ISA) – The ISA.
Return type:Graph
pyquil.device.gates_in_isa(isa)[source]

Generate the full gateset associated with an ISA.

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