Japanese
言語
English
Japanese
German
Korean
Shortcuts

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()
[18.472210999887746, 13.792156828663265]
[3.262829763514867, 2.8763158896666923]
{'0': [array([ 0.85553878, 18.472211  ,  0.13325509]), array([ 0.96573963, 13.79215683,  0.03730951])]}
{'0': [array([0.07030611, 3.26282976, 0.07500348]), array([0.07022313, 2.87631589, 0.07743676])]}
../_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