Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions qiskit_experiments/library/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

.. autosummary::
:toctree: ../stubs/
:template: autosummary/experiment.rst

~characterization.T1
~characterization.T2Ramsey
Expand Down
2 changes: 2 additions & 0 deletions qiskit_experiments/library/characterization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
===========
.. autosummary::
:toctree: ../stubs/
:template: autosummary/experiment.rst

T1
T2Ramsey
Expand All @@ -32,6 +33,7 @@

.. autosummary::
:toctree: ../stubs/
:template: autosummary/analysis.rst

T1Analysis
T2RamseyAnalysis
Expand Down
32 changes: 20 additions & 12 deletions qiskit_experiments/library/characterization/t1.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,35 @@ class T1(BaseExperiment):
r"""
T1 experiment class

Experiment Options:
* delays: delay times of the experiments
* unit: Optional, unit of the delay times. Supported units are
's', 'ms', 'us', 'ns', 'ps', 'dt'.
# section: overview

Design and analyze experiments for estimating T\ :sub:`1` relaxation time of the qubit.

Each experiment consists of the following steps:

1. Circuits generation: the circuits set the qubit in the excited state,
wait different time intervals, then measure the qubit.

Design and analyze experiments for estimating T\ :sub:`1` of the device.
2. Backend execution: actually running the circuits on the device
(or simulator).

Each experiment consists of the following steps:
1. Circuits generation: the circuits set the qubit in the excited state,
wait different time intervals, then measure the qubit.
2. Backend execution: actually running the circuits on the device
(or simulator).
3. Analysis of results: deduction of T\ :sub:`1`\ , based on the outcomes,
by fitting to an exponential curve.
3. Analysis of results: deduction of T\ :sub:`1`\ , based on the outcomes,
by fitting to an exponential curve.

"""

__analysis_class__ = T1Analysis

@classmethod
def _default_experiment_options(cls) -> Options:
"""Default experiment options.

Experiment Options:
delays (Iterable[float]): Delay times of the experiments.
unit (str): Unit of the delay times. Supported units are
's', 'ms', 'us', 'ns', 'ps', 'dt'.
"""

return Options(delays=None, unit="s")

def __init__(
Expand Down
28 changes: 19 additions & 9 deletions qiskit_experiments/library/characterization/t1_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,36 @@
class T1Analysis(BaseAnalysis):
r"""A class to analyze T1 experiments.

Fit Model
# section: fit_model
The fit is based on the following decay function.

.. math::

F(x) = a e^{-x/t1} + b

Fit Parameters
- :math:`amplitude`: Height of the decay curve
- :math:`offset`: Base line of the decay curve
- :math:`t1`: This is the fit parameter of main interest
# section: fit_parameters
defpar a:
desc: Height of the decay curve.
init_guess: Determined by :math:`(y_0 - b)`.

Initial Guesses
- :math:`amplitude\_guess`: Determined by :math:`(y_0 - offset\_guess)`
- :math:`offset\_guess`: Determined by the last :math:`y`
- :math:`t1\_guess`: Determined by the mean of the data points
defpar b:
desc: Base line of the decay curve.
init_guess: Determined by the last :math:`y`.

defpar t1:
desc: This is the fit parameter of main interest.
init_guess: Determined by the mean of the data points.
"""

@classmethod
def _default_options(cls):
"""Default analysis options
Analysis Options:
t1_guess (float): Initial guess of T1.
amplitude_guess (float): Initial guess of the amplitude.
offset_guess (float): Initial guess of the offset.
"""

return Options(
t1_guess=None,
amplitude_guess=None,
Expand Down