Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

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()
[22.233040455713148, 16.539708720764434]
[1.8583730365573197, 3.8272445820851893]
{'0': [array([ 0.93582298, 22.23304046,  0.07253304]), array([ 1.04039329, 16.53970872, -0.0456975 ])]}
{'0': [array([0.04186819, 1.85837304, 0.04369236]), array([0.09622163, 3.82724458, 0.10491227])]}
../_images/characterization_2_1.png

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
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.