Characterization
qiskit.ignis.characterization
Calibrations
rabi_schedules (amp_list, qubits, pulse_width) | Generates schedules for a rabi experiment using a Gaussian pulse |
drag_schedules (beta_list, qubits, pulse_amp, …) | Generates schedules for a drag experiment doing a pulse then the - pulse |
RabiFitter (backend_result, xdata, qubits, fit_p0) | Rabi Experiment fitter |
DragFitter (backend_result, xdata, qubits, fit_p0) | Drag Experiment fitter |
get_single_q_pulse (inst_map, qubits) | Get the DRAG parameters for the single qubit pulse |
update_u_gates (drag_params[, …]) | Update the cmd_def with new single qubit gate values |
Coherence
Design and analyze experiments for characterizing device coherence (e.g. T1, T2). See the following example of T1 estimation.
Generation of coherence circuits: these circuits set the qubit in the excited state, wait different time intervals, then measure the qubit.
import numpy as np
from qiskit.ignis.characterization.coherence import t1_circuits
num_of_gates = np.linspace(10, 300, 5, dtype='int')
gate_time = 0.1
# Note that it is possible to measure several qubits in parallel
qubits = [0, 2]
t1_circs, t1_xdata = t1_circuits(num_of_gates, gate_time, qubits)
Backend execution: actually performing the experiment on the device (or simulator).
import qiskit
from qiskit.providers.aer.noise.errors.standard_errors \
import thermal_relaxation_error
from qiskit.providers.aer.noise import NoiseModel
backend = qiskit.Aer.get_backend('qasm_simulator')
shots = 400
# Let the simulator simulate the following times for qubits 0 and 2:
t_q0 = 25.0
t_q2 = 15.0
# Define T\ :sub:`1` noise:
t1_noise_model = NoiseModel()
t1_noise_model.add_quantum_error(
thermal_relaxation_error(t_q0, 2*t_q0, gate_time),
'id', [0])
t1_noise_model.add_quantum_error(
thermal_relaxation_error(t_q2, 2*t_q2, gate_time),
'id', [2])
# Run the simulator
t1_backend_result = qiskit.execute(t1_circs, backend, shots=shots,
noise_model=t1_noise_model,
optimization_level=0).result()
Analysis of results: deduction of T1, based on the experiments outcomes.
import matplotlib.pyplot as plt
from qiskit.ignis.characterization.coherence import T1Fitter
plt.figure(figsize=(15, 6))
t1_fit = T1Fitter(t1_backend_result, t1_xdata, qubits,
fit_p0=[1, t_q0, 0],
fit_bounds=([0, 0, -1], [2, 40, 1]))
print(t1_fit.time())
print(t1_fit.time_err())
print(t1_fit.params)
print(t1_fit.params_err)
for i in range(2):
ax = plt.subplot(1, 2, i+1)
t1_fit.plot(i, ax=ax)
plt.show()
[24.037383005090874, 15.135887350545305]
[7.8548254799468005, 2.1017848602903797]
{'0': [array([ 0.97493845, 24.03738301, 0.02706287]), array([ 0.99312089, 15.13588735, 0.0285408 ])]}
{'0': [array([0.17826439, 7.85482548, 0.18522525]), array([0.05276076, 2.10178486, 0.05765867])]}
![../_images/characterization_2_1.png](/_next/image?url=%2Fimages%2Fapi%2Fqiskit%2F0.24%2Fcharacterization_2_1.png&w=1920&q=75)
Combine with new results:
t1_backend_result_new = qiskit.execute(t1_circs, backend,
shots=shots,
noise_model=t1_noise_model,
optimization_level=0).result()
t1_fit.add_data(t1_backend_result_new)
plt.figure(figsize=(15, 6))
for i in range(2):
ax = plt.subplot(1, 2, i+1)
t1_fit.plot(i, ax=ax)
plt.show()
![../_images/characterization_3_0.png](/_next/image?url=%2Fimages%2Fapi%2Fqiskit%2F0.24%2Fcharacterization_3_0.png&w=1920&q=75)
t1_circuits (num_of_gates, gate_time, qubits) | Generate circuits for T1 measurement. |
t2_circuits (num_of_gates, gate_time, qubits) | Generate circuits for T2 (echo) measurement, by a CPMG sequence. |
t2star_circuits (num_of_gates, gate_time, qubits) | Generate circuits for T2* measurement. |
T1Fitter (backend_result, xdata, qubits, …) | Estimate T1, based on experiments outcomes, |
T2Fitter (backend_result, xdata, qubits, …) | Estimate T2, based on experiments outcomes. |
T2StarFitter (backend_result, xdata, qubits, …) | Estimate T2*, based on experiments outcomes. |
Gates
ampcal_1Q_circuits (max_reps, qubits) | Generates circuit for measuring the amplitude error of the single qubit gates |
anglecal_1Q_circuits (max_reps, qubits[, …]) | Generates circuit for measuring the angle error of the single qubit gate |
ampcal_cx_circuits (max_reps, qubits, …) | Generates circuit for measuring the amplitude error of the cx gate |
anglecal_cx_circuits (max_reps, qubits, …) | Generates circuit for measuring the angle error of the cx gate |
AmpCalFitter (backend_result, xdata, qubits, …) | Amplitude error fitter |
AngleCalFitter (backend_result, xdata, …) | Amplitude error fitter |
AmpCalCXFitter (backend_result, xdata, …) | Amplitude error fitter |
AngleCalCXFitter (backend_result, xdata, …) | Amplitude error fitter |
Hamiltonian
zz_circuits (num_of_gates, gate_time, qubits, …) | Generates circuit for measuring ZZ. |
ZZFitter (backend_result, xdata, qubits, …) | ZZ fitter |
Base Fitters
BaseCoherenceFitter (description, …[, …]) | Base class for fitters of characteristic times |
BaseGateFitter (description, backend_result, …) | Base class for fitters of gate errors |
Was this page helpful?
Report a bug or request content on GitHub.