Skip to content

Commit 5530e5a

Browse files
yaelbhnkanazawa1989knzwnao
authored
Adjust T1 doc strings to automatic template (#260)
* Adjust T1 doc strings to automatic template * fixes to t1_analysis doc strings * reverting previous changes to init files * changes to init * Update qiskit_experiments/library/characterization/t1_analysis.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Update qiskit_experiments/library/characterization/t1_analysis.py Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * document t1 options * black * typo fix * moved experiment options doc to the correct location * black * minor fix Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: knzwnao <knzwnao@jp.ibm.com>
1 parent 3a8fe20 commit 5530e5a

File tree

4 files changed

+42
-21
lines changed

4 files changed

+42
-21
lines changed

qiskit_experiments/library/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
5050
.. autosummary::
5151
:toctree: ../stubs/
52+
:template: autosummary/experiment.rst
5253
5354
~characterization.T1
5455
~characterization.T2Ramsey

qiskit_experiments/library/characterization/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
===========
2222
.. autosummary::
2323
:toctree: ../stubs/
24+
:template: autosummary/experiment.rst
2425
2526
T1
2627
T2Ramsey
@@ -32,6 +33,7 @@
3233
3334
.. autosummary::
3435
:toctree: ../stubs/
36+
:template: autosummary/analysis.rst
3537
3638
T1Analysis
3739
T2RamseyAnalysis

qiskit_experiments/library/characterization/t1.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,35 @@ class T1(BaseExperiment):
2828
r"""
2929
T1 experiment class
3030
31-
Experiment Options:
32-
* delays: delay times of the experiments
33-
* unit: Optional, unit of the delay times. Supported units are
34-
's', 'ms', 'us', 'ns', 'ps', 'dt'.
31+
# section: overview
32+
33+
Design and analyze experiments for estimating T\ :sub:`1` relaxation time of the qubit.
34+
35+
Each experiment consists of the following steps:
36+
37+
1. Circuits generation: the circuits set the qubit in the excited state,
38+
wait different time intervals, then measure the qubit.
3539
36-
Design and analyze experiments for estimating T\ :sub:`1` of the device.
40+
2. Backend execution: actually running the circuits on the device
41+
(or simulator).
3742
38-
Each experiment consists of the following steps:
39-
1. Circuits generation: the circuits set the qubit in the excited state,
40-
wait different time intervals, then measure the qubit.
41-
2. Backend execution: actually running the circuits on the device
42-
(or simulator).
43-
3. Analysis of results: deduction of T\ :sub:`1`\ , based on the outcomes,
44-
by fitting to an exponential curve.
43+
3. Analysis of results: deduction of T\ :sub:`1`\ , based on the outcomes,
44+
by fitting to an exponential curve.
4545
4646
"""
4747

4848
__analysis_class__ = T1Analysis
4949

5050
@classmethod
5151
def _default_experiment_options(cls) -> Options:
52+
"""Default experiment options.
53+
54+
Experiment Options:
55+
delays (Iterable[float]): Delay times of the experiments.
56+
unit (str): Unit of the delay times. Supported units are
57+
's', 'ms', 'us', 'ns', 'ps', 'dt'.
58+
"""
59+
5260
return Options(delays=None, unit="s")
5361

5462
def __init__(

qiskit_experiments/library/characterization/t1_analysis.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,36 @@
3131
class T1Analysis(BaseAnalysis):
3232
r"""A class to analyze T1 experiments.
3333
34-
Fit Model
34+
# section: fit_model
3535
The fit is based on the following decay function.
3636
3737
.. math::
3838
3939
F(x) = a e^{-x/t1} + b
4040
41-
Fit Parameters
42-
- :math:`amplitude`: Height of the decay curve
43-
- :math:`offset`: Base line of the decay curve
44-
- :math:`t1`: This is the fit parameter of main interest
41+
# section: fit_parameters
42+
defpar a:
43+
desc: Height of the decay curve.
44+
init_guess: Determined by :math:`(y_0 - b)`.
4545
46-
Initial Guesses
47-
- :math:`amplitude\_guess`: Determined by :math:`(y_0 - offset\_guess)`
48-
- :math:`offset\_guess`: Determined by the last :math:`y`
49-
- :math:`t1\_guess`: Determined by the mean of the data points
46+
defpar b:
47+
desc: Base line of the decay curve.
48+
init_guess: Determined by the last :math:`y`.
49+
50+
defpar t1:
51+
desc: This is the fit parameter of main interest.
52+
init_guess: Determined by the mean of the data points.
5053
"""
5154

5255
@classmethod
5356
def _default_options(cls):
57+
"""Default analysis options
58+
Analysis Options:
59+
t1_guess (float): Initial guess of T1.
60+
amplitude_guess (float): Initial guess of the amplitude.
61+
offset_guess (float): Initial guess of the offset.
62+
"""
63+
5464
return Options(
5565
t1_guess=None,
5666
amplitude_guess=None,

0 commit comments

Comments
 (0)