Experiment: \(T_\varphi\) characterization¶
\(\Gamma_\varphi\) is defined as the rate of pure dephasing or depolarization in the \(x - y\) plane. We compute \(\Gamma_\varphi\) by computing \(\Gamma_2*\), the transverse relaxation rate, and subtracting \(\Gamma_1\), the longitudinal relaxation rate. The pure dephasing time is defined by \(T_\varphi = 1/\Gamma_\varphi\). Or more precisely, \(1/T_\varphi = 1/T_{2*} - 1/2T_1\)
We therefore create a composite experiment consisting of a \(T_1\) experiment and a \(T_2*\) experiment. From the results of these two, we compute the results for \(T_\varphi.\)
import numpy as np
import qiskit
from qiskit_experiments.library.characterization import Tphi, TphiAnalysis, T1Analysis, T2RamseyAnalysis
# An Aer simulator
from qiskit.test.mock import FakeVigo
from qiskit.providers.aer import AerSimulator
from qiskit.providers.aer.noise import NoiseModel
# Create a pure relaxation noise model for AerSimulator
noise_model = NoiseModel.from_backend(
FakeVigo(), thermal_relaxation=True, gate_error=False, readout_error=False
)
# Create a fake backend simulator
backend = AerSimulator.from_backend(FakeVigo(), noise_model=noise_model)
# Time intervals to wait before measurement for t1 and t2
delays_t1 = np.arange(1e-6, 300e-6, 10e-6)
delays_t2 = np.arange(1e-6, 50e-6, 2e-6)
# Create an experiment for qubit 0 with the specified time intervals
exp = Tphi(qubit=0, delays_t1=delays_t1, delays_t2=delays_t2, osc_freq=1e5)
tphi_analysis = TphiAnalysis([T1Analysis(), T2RamseyAnalysis()])
expdata = exp.run(backend=backend, analysis=tphi_analysis, seed_simulator=101).block_for_results()
result = expdata.analysis_results("T_phi")
# Print the result for T_phi
print(result)
DbAnalysisResultV1
- name: T_phi
- value: (1.80+/-0.08)e-05
- quality: good
- extra: <1 items>
- device_components: ['Q0']
- verified: False
# It is possible to see the results of the sub-experiments:
print(expdata)
---------------------------------------------------
Experiment: Tphi
Experiment ID: 1c5b8f16-9dae-470b-8ab7-9896893076c7
Status: ExperimentStatus.DONE
Backend: aer_simulator(fake_vigo)
Data: 55
Analysis Results: 6
Figures: 2
print(expdata.analysis_results("T1"))
DbAnalysisResultV1
- name: T1
- value: 0.0001249+/-0.0000031
- χ²: 1.14380750726049
- quality: good
- extra: <3 items>
- device_components: ['Q0']
- verified: False
display(expdata.figure(0))
<Figure size 800x500 with 1 Axes>
print(expdata.analysis_results("T2star"))
DbAnalysisResultV1
- name: T2star
- value: (1.68+/-0.07)e-05
- χ²: 0.6764757054675752
- quality: good
- extra: <3 items>
- device_components: ['Q0']
- verified: False
display(expdata.figure(1))
<Figure size 800x500 with 1 Axes>
import qiskit.tools.jupyter
%qiskit_copyright
This code is a part of Qiskit
© Copyright IBM 2017, 2022.
This code is licensed under the Apache License, Version 2.0. You may
obtain a copy of this license in the LICENSE.txt file in the root directory
of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
Any modifications or derivative works of this code must retain this
copyright notice, and modified files need to carry a notice indicating
that they have been altered from the originals.