pygsti.extras.devices

Exteneral Device Specifications Sub-package

Submodules

Package Contents

Classes

ExperimentalDevice

Specification of an experimental device.

Functions

get_device_specs(devname)

basic_device_information(devname)

edgelist(device)

create_clifford_processor_spec(device, one_qubit_gates)

TODO: docstring

create_processor_spec(device, one_qubit_gates[, ...])

todo

create_error_rates_model(caldata, device, one_qubit_gates)

calformat: 'ibmq-v2018', 'ibmq-v2019', 'rigetti', 'native'.

create_local_depolarizing_model(caldata, device, ...)

todo

pygsti.extras.devices.get_device_specs(devname)
pygsti.extras.devices.basic_device_information(devname)
pygsti.extras.devices.edgelist(device)
pygsti.extras.devices.create_clifford_processor_spec(device, one_qubit_gates, qubitsubset=None, removeedges=(), clifford_compilation_type='absolute', what_to_compile=('1Qcliffords',), verbosity=0)

TODO: docstring

Parameters

device one_qubit_gates qubitsubset removeedges clifford_compilation_type what_to_compile verbosity

Returns

QubitProcessorSpec

pygsti.extras.devices.create_processor_spec(device, one_qubit_gates, qubitsubset=None, removeedges=())

todo

clifford compilation type & what_to_compile = {‘paulieq’: (‘1Qcliffords’,),

‘absolute’: (‘paulis’, ‘1Qcliffords’)}

pygsti.extras.devices.create_error_rates_model(caldata, device, one_qubit_gates, one_qubit_gates_to_native=None, calformat=None, model_type='TwirledLayers', idle_name=None)

calformat: ‘ibmq-v2018’, ‘ibmq-v2019’, ‘rigetti’, ‘native’.

pygsti.extras.devices.create_local_depolarizing_model(caldata, device, one_qubit_gates, one_qubit_gates_to_native=None, calformat=None, qubits=None)

todo

Note: this model is * NOT * suitable for optimization: it is not aware that it is a local depolarization with non-independent error rates model.

class pygsti.extras.devices.ExperimentalDevice(qubits, graph, gate_mapping=None)

Bases: object

Specification of an experimental device.

Initialize an IBMQ device from qubits and connectivity info.

Parameters

qubits: list

Qubit labels

graph: QubitGraph

QubitGraph depicting device connectivity.

gate_mapping: dict, optional

Mapping between pyGSTi gate names (keys) and IBM native gates (values). If None, simply use {‘Gcnot’: ‘cx’} to recover legacy behavior.

qubits
graph
gate_mapping
classmethod from_qiskit_backend(backend, gate_mapping=None)

Construct a ExperimentalDevice from Qiskit provider backend information.

Provider backends can be obtained via:

IBMQ.load_account() provider = IBMQ.get_provider() # with potential optional kwargs backend = provider.get_backend(<device name>)

Parameters
backend: IBMQBackend

Backend obtained from IBMQ

gate_mapping: dict, optional

Mapping between pyGSTi gate names (keys) and IBM native gates (values). If None, simply use {‘Gcnot’: ‘cx’} to recover legacy behavior.

Returns

Initialized ExperimentalDevice

classmethod from_legacy_device(devname)

Create a ExperimentalDevice from a legacy pyGSTi pygsti.extras.devices module.

Parameters
devname: str

Name of the pygsti.extras.devices module to use

Returns

Initialized ExperimentalDevice

create_processor_spec(gate_names=None, qubit_subset=None, subset_only=False, remove_edges=None)

Create a QubitProcessorSpec from user-specified gates and device connectivity.

Parameters
gate_names: list of str

List of one-qubit and two-qubit gate names. If None, use the keys of self.gate_mapping.

qubit_subset: list

A subset of qubits to include in the processor spec. If None, use self.qubits.

subset_only: bool

Whether or not to include all the device qubits in the processor spec (False, default) or just qubit_subset (True).

remove_edges: list

A list of edges to drop from the connectivity graph.

Returns

The created QubitProcessorSpec

create_error_rates_model(caldata=None, calformat='ibmq-v2019', model_type='TwirledLayers', idle_name=None)

Create an error rates model (OplessModel) from calibration data.

Parameters
caldata: dict

Calibration data. Currently, this can be retrieved via backend.properties().to_dict().

calformat: One of [‘ibmq-v2018’, ‘ibmq-v2019’, ‘rigetti’, ‘native’]

Calibration data format, defaults to ibmq-v2019. TODO: It seems this has been changed, what version are we actually on?

model_type: One of [‘TwirledLayers’, ‘TwirledGates’, ‘AnyErrorCausesFailure’, ‘AnyErrorCausesRandomOutput’]

Type of OplessModel to create

idle_name: str

Name for the idle gate

Returns

OplessModel

create_local_depolarizing_model(caldata=None, calformat='ibmq-v2019', qubits=None)

Create a LocalNoiseModel with depolarizing noise based on calibration data.

Note: this model is * NOT * suitable for optimization: it is not aware that it is a local depolarization with non-independent error rates model.

Parameters
caldata: dict

Calibration data. Currently, this can be retrieved via backend.properties().to_dict().

calformat: One of [‘ibmq-v2018’, ‘ibmq-v2019’, ‘rigetti’, ‘native’]

Calibration data format, defaults to ibmq-v2019. TODO: It seems this has been changed, what version are we actually on?

qubits: list

Qubit labels to include in the model

Returns

OplessModel