Skip to content

Commit 4d4f442

Browse files
committed
Updated docstrings
1 parent 1d3f78f commit 4d4f442

File tree

6 files changed

+23
-29
lines changed

6 files changed

+23
-29
lines changed

qiskit_algorithms/gradients/base/base_estimator_gradient.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,9 @@ def run(
103103
parameters in the corresponding circuit are calculated.
104104
precision: Precision to be used by the underlying Estimator. If a single float is
105105
provided, this number will be used for all circuits. If a sequence of floats is
106-
provided, they will be used on a per-circuit basis. If none is provided, the
107-
gradient's default precision will be used for all circuits. If this number is
108-
also set to None, the underlying primitive's default precision will be used
109-
for all circuits.
106+
provided, they will be used on a per-circuit basis. If not set, the gradient's default
107+
precision will be used for all circuits, and if that is None (not set) then the
108+
underlying primitive's (default) precision will be used for all circuits.
110109
111110
Returns:
112111
The job object of the gradients of the expectation values. The i-th result corresponds to

qiskit_algorithms/gradients/base/base_qgt.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,9 @@ def run(
125125
each circuit are calculated.
126126
precision: Precision to be used by the underlying Estimator. If a single float is
127127
provided, this number will be used for all circuits. If a sequence of floats is
128-
provided, they will be used on a per-circuit basis. If none is provided, the
129-
gradient's default precision will be used for all circuits. If this number is
130-
also set to None, the underlying primitive's default precision will be used
131-
for all circuits.
128+
provided, they will be used on a per-circuit basis. If not set, the gradient's default
129+
precision will be used for all circuits, and if that is None (not set) then the
130+
underlying primitive's (default) precision will be used for all circuits.
132131
133132
Returns:
134133
The job object of the QGTs of the expectation values. The i-th result corresponds to

qiskit_algorithms/gradients/base/base_sampler_gradient.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def __init__(self, sampler: BaseSamplerV2, shots: int | None = None):
4444
Args:
4545
sampler: The sampler used to compute the gradients.
4646
shots: Number of shots to be used by the underlying Sampler. If provided, this number
47-
takes precedence over the default precision of the primitive. If None, the default
48-
number of shots of the primitive is used.
47+
takes precedence over the default number of shots of the primitive. Otherwise, the
48+
default number of shots of the primitive is used.
4949
"""
5050
self._sampler: BaseSamplerV2 = sampler
5151
self._shots = shots
@@ -69,12 +69,11 @@ def run(
6969
``circuits``. Defaults to None, which means that the gradients of all parameters in
7070
each circuit are calculated. None in the sequence means that the gradients of all
7171
parameters in the corresponding circuit are calculated.
72-
shots: Number of shots to be used by the underlying sampler. If a single integer is
72+
shots: Number of shots to be used by the underlying Sampler. If a single integer is
7373
provided, this number will be used for all circuits. If a sequence of integers is
74-
provided, they will be used on a per-circuit basis. If none is provided, the
75-
fidelity's default number of shots will be used for all circuits. If this number is
76-
also set to None, the underlying primitive's default number of shots will be used
77-
for all circuits.
74+
provided, they will be used on a per-circuit basis. If not set, the gradient's default
75+
number of shots will be used for all circuits, and if that is None (not set) then the
76+
underlying primitive's default number of shots will be used for all circuits.
7877
Returns:
7978
The job object of the gradients of the sampling probability. The i-th result
8079
corresponds to ``circuits[i]`` evaluated with parameters bound as ``parameter_values[i]``.

qiskit_algorithms/gradients/qfi.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ def run(
6666
each circuit are calculated.
6767
precision: Precision to be used by the underlying Estimator. If a single float is
6868
provided, this number will be used for all circuits. If a sequence of floats is
69-
provided, they will be used on a per-circuit basis. If none is provided, the
70-
gradient's default precision will be used for all circuits. If this number is
71-
also set to None, the underlying primitive's default precision will be used
72-
for all circuits.
69+
provided, they will be used on a per-circuit basis. If not set, the gradient's default
70+
precision will be used for all circuits, and if that is None (not set) then the
71+
underlying primitive's (default) precision will be used for all circuits.
7372
7473
Returns:
7574
The job object of the QFIs of the expectation values. The i-th result corresponds to

qiskit_algorithms/state_fidelities/base_state_fidelity.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,11 @@ def _run(
276276
circuits_2: (Parametrized) quantum circuits preparing :math:`|\phi\rangle`.
277277
values_1: Numerical parameters to be bound to the first set of circuits
278278
values_2: Numerical parameters to be bound to the second set of circuits.
279-
shots: Number of shots to be used by the underlying sampler. If a single integer is
279+
shots: Number of shots to be used by the underlying Sampler. If a single integer is
280280
provided, this number will be used for all circuits. If a sequence of integers is
281-
provided, they will be used on a per-circuit basis. If none is provided, the
282-
fidelity's default number of shots will be used for all circuits. If this number is
283-
also set to None, the underlying primitive's default number of shots will be used
284-
for all circuits.
281+
provided, they will be used on a per-circuit basis. If not set, the fidelity's default
282+
number of shots will be used for all circuits, and if that is None (not set) then the
283+
underlying primitive's default number of shots will be used for all circuits.
285284
286285
Returns:
287286
A newly constructed algorithm job instance to get the fidelity result.

qiskit_algorithms/state_fidelities/compute_uncompute.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,11 @@ def _run(
140140
circuits_2: (Parametrized) quantum circuits preparing :math:`|\phi\rangle`.
141141
values_1: Numerical parameters to be bound to the first circuits.
142142
values_2: Numerical parameters to be bound to the second circuits.
143-
shots: Number of shots to be used by the underlying sampler. If a single integer is
143+
shots: Number of shots to be used by the underlying Sampler. If a single integer is
144144
provided, this number will be used for all circuits. If a sequence of integers is
145-
provided, they will be used on a per-circuit basis. If none is provided, the
146-
fidelity's default number of shots will be used for all circuits. If this number is
147-
also set to None, the underlying primitive's default number of shots will be used
148-
for all circuits.
145+
provided, they will be used on a per-circuit basis. If not set, the fidelity's default
146+
number of shots will be used for all circuits, and if that is None (not set) then the
147+
underlying primitive's default number of shots will be used for all circuits.
149148
150149
Returns:
151150
An AlgorithmJob for the fidelity calculation.

0 commit comments

Comments
 (0)