Skip to content

Commit ad70b0d

Browse files
Wording edits
Co-authored-by: Daniel J. Egger <[email protected]>
1 parent a7f5375 commit ad70b0d

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

qiskit_experiments/curve_analysis/curve_analysis.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,11 @@ def __init_subclass__(cls, **kwargs):
244244

245245
super().__init_subclass__(**kwargs)
246246

247-
# Create fit model:
248-
# The fit model is created only once when the sub-class, i.e. type, is initialized.
249-
# This removes overhead of instantiating the same fit model object multiple times.
250-
# Its impact is significant especially when user creates a parallel experiment instance,
251-
# where the curve analysis subclass is instantiated multiple times along with fit model.
247+
# Create the fit model, i.e. the function(s) to which the data is fit:
248+
# The fit model is created only once when the sub-class is initialized.
249+
# This removes the overhead of instantiating the same fit model object multiple times.
250+
# This may occur in, e.g., parallel experiments where the curve analysis subclass is
251+
# instantiated multiple times.
252252
model_source = collections.defaultdict(list)
253253
for series in cls.__series__:
254254
model_source["fit_functions"].append(series.fit_func)
@@ -313,7 +313,7 @@ def curve_fit(
313313
314314
This is the scipy curve fit wrapper to manage named fit parameters and
315315
return outcomes as ufloat objects with parameter correlation computed based on the
316-
covariance matrix obtained from the fitting. Result is returned as
316+
covariance matrix obtained from the fitting. The result is returned as
317317
:class:`~qiskit_experiments.curve_analysis.FitData` which is a special data container
318318
for curve analysis. This method can perform multi-objective optimization with
319319
multiple data series with related fit models.

qiskit_experiments/curve_analysis/curve_data.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ class SeriesDef:
5252
signature: List[str] = dataclasses.field(init=False)
5353

5454
def __post_init__(self):
55-
"""Parse the fit function signature to extract the names of the variables."""
56-
# Parse parameter names defiend in the fit function.
57-
# Note that fit function usually takes arguments F(x, p0, p1, p2, ...)
58-
# thus the first value should be excluded.
55+
"""Parse the fit function signature to extract the names of the variables.
56+
57+
Fit functions take arguments F(x, p0, p1, p2, ...) thus the first value should be excluded.
58+
"""
5959
signature = list(inspect.signature(self.fit_func).parameters.keys())
6060
fitparams = signature[1:]
6161

qiskit_experiments/curve_analysis/fit_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class FitModel(ABC):
2828
2929
This class ties together the fit function and associated parameter names to
3030
perform correct parameter mapping among multiple objective functions with different signatures,
31-
in which some parameters may be excluded from the fitting when they are fixed.
31+
in which some parameters may be excluded from the fitting when their values are fixed.
3232
3333
Examples:
3434

releasenotes/notes/add-fit-model-and-remove-curve_fitter-arg-4a0effb5f9b88ba9.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ features:
1818
upgrade:
1919
- |
2020
Analysis option `curve_fitter` of the :class:`CurveAnalysis` has been removed
21-
because of the serialization problem. To use custom curve fitting library,
21+
because callable lambda functions are not serializable. To use a custom curve fitting library,
2222
one must directly override the class method :meth:`CurveAnalysis.curve_fit`.
2323
developer:
2424
- |

test/curve_analysis/test_curve_analysis_base_class.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class MyCurveFit(CurveAnalysis):
253253

254254
instance = MyCurveFit()
255255

256-
# both par0 and par1 is excluded
256+
# both par0 and par1 are included
257257
self.assertListEqual(instance.parameters, ["par0", "par1"])
258258

259259
# par1 is excluded

0 commit comments

Comments
 (0)