pygsti.extras.ibmq.ibmqcore

Functions for sending experiments to IBMQ devices and converting the results to pyGSTi objects

Module Contents

Classes

IBMQExperiment

Functions

reverse_dict_key_bits(counts_dict)

partial_trace(ordered_target_indices, input_dict)

q_list_to_ordered_target_indices(q_list, num_qubits)

Attributes

_qiskit

_attribute_to_json

_attribute_to_pickle

pygsti.extras.ibmq.ibmqcore._qiskit
pygsti.extras.ibmq.ibmqcore._attribute_to_json = ['remove_duplicates', 'randomized_order', 'circuits_per_batch', 'num_shots', 'job_ids']
pygsti.extras.ibmq.ibmqcore._attribute_to_pickle = ['pspec', 'pygsti_circuits', 'pygsti_openqasm_circuits', 'qiskit_QuantumCircuits',...
pygsti.extras.ibmq.ibmqcore.reverse_dict_key_bits(counts_dict)
pygsti.extras.ibmq.ibmqcore.partial_trace(ordered_target_indices, input_dict)
pygsti.extras.ibmq.ibmqcore.q_list_to_ordered_target_indices(q_list, num_qubits)
class pygsti.extras.ibmq.ibmqcore.IBMQExperiment(edesign, pspec, remove_duplicates=True, randomized_order=True, circuits_per_batch=75, num_shots=1024)

Bases: dict

submit(self, ibmq_backend)

Submits the jobs to IBM Q, that implements the experiment specified by the ExperimentDesign used to create this object.

Parameters

ibmq_backend (qiskit.providers.ibmq.ibmqbackend.IBMQBackend) – The IBM Q backend to submit the jobs to. Should be the backend corresponding to the processor that this experiment has been designed for.

Returns

None

monitor(self)

Queries IBM Q for the status of the jobs.

retrieve_results(self)

Gets the results of the completed jobs from IBM Q, and processes them into a pyGSTi DataProtocol object (stored as the key ‘data’), which can then be used in pyGSTi data analysis routines (e.g., if this was a GST experiment, it can input into a GST protocol object that will analyze the data).

write(self, dirname=None)

Writes to disk, storing both the pyGSTi DataProtocol object in pyGSTi’s standard format and saving all of the IBM Q submission information stored in this object, written into the subdirectory ‘ibmqexperiment’.

Parameters

dirname (str) – The root directory to write into. This directory will have an ‘edesign’ subdirectory, which will be created if needed and overwritten if present. If None, then the path this object was loaded from is used (if this object wasn’t loaded from disk, an error is raised).

classmethod from_dir(cls, dirname)

Initialize a new IBMQExperiment object from dirname.

Parameters

dirname (str) – The directory name.

Returns

IBMQExperiment