Skip to content

Commit d7e25a4

Browse files
committed
docs and option name
1 parent ef9e61b commit d7e25a4

File tree

15 files changed

+42
-41
lines changed

15 files changed

+42
-41
lines changed

docs/tutorials/experiment_cloud_service.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ experiment database.
1919

2020
from qiskit_experiments.library.characterization import T1
2121
import numpy as np
22-
22+
2323
t1_delays = np.arange(1e-6, 600e-6, 50e-6)
24-
24+
2525
# Create an experiment for qubit 0,
2626
# setting the unit to microseconds,
2727
# with the specified time intervals
@@ -158,7 +158,7 @@ on by default at the experiment service level.
158158
.. jupyter-execute::
159159

160160
exp = T1(qubit=0, delays=t1_delays)
161-
161+
162162
t1_expdata = exp.run(backend=backend, shots=1000)
163163
t1_expdata.auto_save = True
164164
t1_expdata.block_for_results()
@@ -189,7 +189,7 @@ Tags and notes can be added to experiments to help identify specific experiments
189189
For example, an experiment can be tagged and made public with the following code.
190190

191191
.. jupyter-execute::
192-
192+
193193
t1_expdata.tags = ['tag1', 'tag2']
194194
t1_expdata.share_level = "public"
195195
t1_expdata.notes = "Example note."
@@ -201,7 +201,7 @@ These fields can also be updated in the web interface from the menu on the right
201201

202202
.. |web_tags_share.png| image:: ./experiment_cloud_service/web_tags_share.png
203203

204-
For more information about using the cloud database interface, please take a look at its `documentation <https://quantum-computing.ibm.com/lab/docs/iql/manage/experiments/>`__.
204+
For more information about using the cloud database interface, please take a look at its `documentation <https://quantum-computing.ibm.com/lab/docs/iql/manage/experiments/>`__.
205205

206206
Randomized Benchmarking experiment
207207
----------------------------------
@@ -211,11 +211,11 @@ Let’s now do a standard RB experiment and save the results to ResultsDB.
211211
.. jupyter-execute::
212212

213213
from qiskit_experiments.library import randomized_benchmarking as rb
214-
214+
215215
lengths = list(range(1, 1000, 200))
216216
num_samples = 10
217217
seed = 1010
218-
218+
219219
rb_exp = rb.StandardRB([0], lengths, num_samples=num_samples, seed=seed)
220220
rb_expdata = rb_exp.run(backend).block_for_results()
221221
rb_expdata.save()
@@ -242,15 +242,15 @@ Let’s do state tomography on a Hadamard state.
242242

243243
from qiskit_experiments.library import StateTomography
244244
import qiskit
245-
245+
246246
# Construct state by applying H gate
247247
qc_h = qiskit.QuantumCircuit(1)
248248
qc_h.h(0)
249-
249+
250250
qstexp = StateTomography(qc_h)
251251
qst_expdata = qstexp.run(backend).block_for_results()
252252
qst_expdata.save()
253-
253+
254254
for result in qst_expdata.analysis_results():
255255
print(result)
256256

@@ -262,7 +262,7 @@ graphical interface, but the other analysis parameters are:
262262
.. image:: ./experiment_cloud_service/tomo_experiment.png
263263

264264
|
265-
265+
266266
.. jupyter-execute::
267267

268268
import qiskit.tools.jupyter

qiskit_experiments/curve_analysis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class AnalysisB(CurveAnalysis):
312312
compute custom quantities based on the raw fit parameters.
313313
See :ref:`curve_analysis_results` for details.
314314
Afterwards, the analysis draws several curves in the Matplotlib figure.
315-
User can set custom drawer to the option ``curve_plotter``.
315+
User can set custom drawer to the option ``curve_drawer``.
316316
The drawer defaults to the :class:`MplCurveDrawer`.
317317
Finally, it returns the list of created analysis results and Matplotlib figure.
318318

qiskit_experiments/curve_analysis/base_curve_analysis.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ def parameters(self) -> List[str]:
111111
@property
112112
def drawer(self) -> BaseCurveDrawer:
113113
"""A short-cut for curve drawer instance."""
114-
return self._options.curve_plotter
114+
return self._options.curve_drawer
115115

116116
@classmethod
117117
def _default_options(cls) -> Options:
118118
"""Return default analysis options.
119119
120120
Analysis Options:
121-
curve_plotter (BaseCurveDrawer): A curve drawer instance to visualize
121+
curve_drawer (BaseCurveDrawer): A curve drawer instance to visualize
122122
the analysis result.
123123
plot_raw_data (bool): Set ``True`` to draw processed data points,
124124
dataset without formatting, on canvas. This is ``False`` by default.
@@ -156,7 +156,7 @@ def _default_options(cls) -> Options:
156156
"""
157157
options = super()._default_options()
158158

159-
options.curve_plotter = MplCurveDrawer()
159+
options.curve_drawer = MplCurveDrawer()
160160
options.plot_raw_data = False
161161
options.plot = True
162162
options.return_fit_parameters = True
@@ -173,7 +173,7 @@ def _default_options(cls) -> Options:
173173

174174
# Set automatic validator for particular option values
175175
options.set_validator(field="data_processor", validator_value=DataProcessor)
176-
options.set_validator(field="curve_plotter", validator_value=BaseCurveDrawer)
176+
options.set_validator(field="curve_drawer", validator_value=BaseCurveDrawer)
177177

178178
return options
179179

@@ -187,23 +187,25 @@ def set_options(self, **fields):
187187
KeyError: When removed option ``curve_fitter`` is set.
188188
"""
189189
# TODO remove this in Qiskit Experiments v0.4
190-
if "curve_plotter" in fields and isinstance(fields["curve_plotter"], str):
191-
plotter_str = fields["curve_plotter"]
190+
if "curve_plotter" in fields:
192191
warnings.warn(
193-
f"The curve plotter '{plotter_str}' has been deprecated. "
194-
"The option is replaced with 'MplCurveDrawer' instance. "
192+
f"The analysis option 'curve_plotter' has been deprecated. "
193+
"The option is replaced with 'curve_drawer' that takes 'MplCurveDrawer' instance. "
195194
"If this is a loaded analysis, please save this instance again to update option value. "
196-
"This warning will be removed with backport in Qiskit Experiments 0.4.",
195+
"The 'curve_plotter' argument along with this warning will be removed "
196+
"in Qiskit Experiments 0.4.",
197197
DeprecationWarning,
198198
stacklevel=2,
199199
)
200-
fields["curve_plotter"] = MplCurveDrawer()
200+
del fields["curve_plotter"]
201201

202202
if "curve_fitter" in fields:
203203
warnings.warn(
204204
"Setting curve fitter to analysis options has been deprecated and "
205205
"the option has been removed. The fitter setting is dropped. "
206-
"Now you can directly override '_run_curve_fit' method to apply custom fitter.",
206+
"Now you can directly override '_run_curve_fit' method to apply custom fitter. "
207+
"The `curve_fitter` argument along with this warning will be removed "
208+
"in Qiskit Experiments 0.4.",
207209
DeprecationWarning,
208210
stacklevel=2,
209211
)
@@ -217,7 +219,8 @@ def set_options(self, **fields):
217219
f"Option(s) {deprecated} have been moved to draw_options and will be removed soon. "
218220
"Use self.drawer.set_options instead. "
219221
"If this is a loaded analysis, please save this instance again to update option value. "
220-
"This warning will be removed with backport in Qiskit Experiments 0.4.",
222+
"These arguments along with this warning will be removed "
223+
"in Qiskit Experiments 0.4.",
221224
DeprecationWarning,
222225
stacklevel=2,
223226
)

qiskit_experiments/curve_analysis/curve_data.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
class SeriesDef:
2828
"""A dataclass to describe the definition of the curve.
2929
30-
Args:
30+
Attributes:
3131
fit_func: A callable that defines the fit model of this curve. The argument names
3232
in the callable are parsed to create the fit parameter list, which will appear
3333
in the analysis results. The first argument should be ``x`` that represents
@@ -78,7 +78,7 @@ class CurveData:
7878
This dataset can consist of X, Y values from multiple series.
7979
To extract curve data of the particular series, :meth:`get_subset_of` can be used.
8080
81-
Args:
81+
Attributes:
8282
x: X-values that experiment sweeps.
8383
y: Y-values that observed and processed by the data processor.
8484
y_err: Uncertainty of the Y-values which is created by the data processor.
@@ -130,7 +130,7 @@ def get_subset_of(self, index: Union[str, int]) -> "CurveData":
130130
class FitData:
131131
"""A dataclass to store the outcome of the fitting.
132132
133-
Args:
133+
Attributes:
134134
popt: List of optimal parameter values with uncertainties if available.
135135
popt_keys: List of parameter names being fit.
136136
pcov: Covariance matrix from the least square fitting.
@@ -182,7 +182,7 @@ def fitval(self, key: str) -> uncertainties.UFloat:
182182
class ParameterRepr:
183183
"""Detailed description of fitting parameter.
184184
185-
Args:
185+
Attributes:
186186
name: Original name of the fit parameter being defined in the fit model.
187187
repr: Optional. Human-readable parameter name shown in the analysis result and in the figure.
188188
unit: Optional. Physical unit of this parameter if applicable.

qiskit_experiments/curve_analysis/standard_analysis/error_amplification_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def _default_options(cls):
106106
considered as good. Defaults to :math:`\pi/2`.
107107
"""
108108
default_options = super()._default_options()
109-
default_options.curve_plotter.set_options(
109+
default_options.curve_drawer.set_options(
110110
xlabel="Number of gates (n)",
111111
ylabel="Population",
112112
ylim=(0, 1.0),

qiskit_experiments/curve_analysis/standard_analysis/gaussian.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class GaussianAnalysis(curve.CurveAnalysis):
7171
@classmethod
7272
def _default_options(cls) -> Options:
7373
options = super()._default_options()
74-
options.curve_plotter.set_options(
74+
options.curve_drawer.set_options(
7575
xlabel="Frequency",
7676
ylabel="Signal (arb. units)",
7777
xval_unit="Hz",

qiskit_experiments/curve_analysis/standard_analysis/resonance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ResonanceAnalysis(curve.CurveAnalysis):
7171
@classmethod
7272
def _default_options(cls) -> Options:
7373
options = super()._default_options()
74-
options.curve_plotter.set_options(
74+
options.curve_drawer.set_options(
7575
xlabel="Frequency",
7676
ylabel="Signal (arb. units)",
7777
xval_unit="Hz",

qiskit_experiments/library/characterization/analysis/cr_hamiltonian_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class CrossResonanceHamiltonianAnalysis(curve.CurveAnalysis):
196196
def _default_options(cls):
197197
"""Return the default analysis options."""
198198
default_options = super()._default_options()
199-
default_options.curve_plotter.set_options(
199+
default_options.curve_drawer.set_options(
200200
subplots=(3, 1),
201201
xlabel="Flat top width",
202202
ylabel=[

qiskit_experiments/library/characterization/analysis/drag_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _default_options(cls):
120120
descriptions of analysis options.
121121
"""
122122
default_options = super()._default_options()
123-
default_options.curve_plotter.set_options(
123+
default_options.curve_drawer.set_options(
124124
xlabel="Beta",
125125
ylabel="Signal (arb. units)",
126126
)

qiskit_experiments/library/characterization/analysis/ramsey_xy_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def _default_options(cls):
9595
descriptions of analysis options.
9696
"""
9797
default_options = super()._default_options()
98-
default_options.curve_plotter.set_options(
98+
default_options.curve_drawer.set_options(
9999
xlabel="Delay",
100100
ylabel="Signal (arb. units)",
101101
xval_unit="s",

0 commit comments

Comments
 (0)