Characterization (qiskit.ignis.characterization
)¶
Calibrations¶
|
Generates schedules for a rabi experiment using a Gaussian pulse |
|
Generates schedules for a drag experiment doing a pulse then the - pulse |
|
Rabi Experiment fitter |
|
Drag Experiment fitter |
|
Get the DRAG parameters for the single qubit pulse |
|
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()
[20.387477708397842, 15.911648881724071]
[6.838825364287641, 1.1350551736137686]
{'0': [array([ 0.88740997, 20.38747771, 0.11572595]), array([ 9.82462992e-01, 1.59116489e+01, -1.13297798e-02])]}
{'0': [array([0.15008093, 6.83882536, 0.15790438]), array([0.0267562 , 1.13505517, 0.02935192])]}

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()

|
Generate circuits for T1 measurement. |
|
Generate circuits for T2 (echo) measurement, by a CPMG sequence. |
|
Generate circuits for T2* measurement. |
|
Estimate T1, based on experiments outcomes, |
|
Estimate T2, based on experiments outcomes. |
|
Estimate T2*, based on experiments outcomes. |
Gates¶
|
Generates circuit for measuring the amplitude error of the single qubit gates |
|
Generates circuit for measuring the angle error of the single qubit gate |
|
Generates circuit for measuring the amplitude error of the cx gate |
|
Generates circuit for measuring the angle error of the cx gate |
|
Amplitude error fitter |
|
Amplitude error fitter |
|
Amplitude error fitter |
|
Amplitude error fitter |
Hamiltonian¶
|
Generates circuit for measuring ZZ. |
|
ZZ fitter |
Base Fitters¶
|
Base class for fitters of characteristic times |
|
Base class for fitters of gate errors |