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()
[19.75629716129194, 16.486990665451838]
[3.358580488452602, 1.291599179133599]
{'0': [array([ 0.93664502, 19.75629716, 0.08727868]), array([ 1.08052514, 16.48699067, -0.06258161])]}
{'0': [array([0.07917277, 3.35858049, 0.08321784]), array([0.03314617, 1.29159918, 0.03609343])]}
![../_images/characterization_2_1.png](../_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](../_images/characterization_3_0.png)
|
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 |