Skip to content

Commit

Permalink
Fix bad Sphinx syntax in several release notes and in API documentait…
Browse files Browse the repository at this point in the history
…on (#12604)

* Fix ' into `

* More typos on release notes and on API documentation

* change `self.filter` for `Schedule.filter`

* change `Schedule` -> `ScheduleBlock` in its `filter()` reference
  • Loading branch information
GuillermoAbadLopez authored Jul 1, 2024
1 parent 5db984a commit 05d5b98
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions qiskit/pulse/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def children(self) -> tuple[tuple[int, "ScheduleComponent"], ...]:
Notes:
Nested schedules are returned as-is. If you want to collect only instructions,
use py:meth:`~Schedule.instructions` instead.
use :py:meth:`~Schedule.instructions` instead.
Returns:
A tuple, where each element is a two-tuple containing the initial
Expand Down Expand Up @@ -490,7 +490,7 @@ def exclude(
) -> "Schedule":
"""Return a ``Schedule`` with only the instructions from this Schedule *failing*
at least one of the provided filters.
This method is the complement of py:meth:`~self.filter`, so that::
This method is the complement of :py:meth:`~Schedule.filter`, so that::
self.filter(args) | self.exclude(args) == self
Expand Down Expand Up @@ -1300,7 +1300,7 @@ def exclude(
):
"""Return a new ``ScheduleBlock`` with only the instructions from this ``ScheduleBlock``
*failing* at least one of the provided filters.
This method is the complement of py:meth:`~self.filter`, so that::
This method is the complement of :py:meth:`~ScheduleBlock.filter`, so that::
self.filter(args) + self.exclude(args) == self in terms of instructions included.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
features_pulse:
- |
It is now possible to assign parameters to pulse :class:`.Schedule`and :class:`.ScheduleBlock` objects by specifying
It is now possible to assign parameters to pulse :class:`.Schedule` and :class:`.ScheduleBlock` objects by specifying
the parameter name as a string. The parameter name can be used to assign values to all parameters within the
`Schedule` or `ScheduleBlock` that have the same name. Moreover, the parameter name of a `ParameterVector`
can be used to assign all values of the vector simultaneously (the list of values should therefore match the
Expand Down
42 changes: 21 additions & 21 deletions releasenotes/notes/1.1/pauli-apply-layout-cdcbc1bce724a150.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ features_quantum_info:
- |
Added a new :meth:`~.Pauli.apply_layout` method that is equivalent to
:meth:`~.SparsePauliOp.apply_layout`. This method is used to apply
a :class:`~.TranspileLayout` layout from the transpiler to a :class:~.Pauli`
a :class:`~.TranspileLayout` layout from the transpiler to a :class:`~.Pauli`
observable that was built for an input circuit. This enables working with
:class:`~.BaseEstimator` / :class:`~.BaseEstimatorV2` implementations and
local transpilation when the input is of type :class:`~.Pauli`. For example::
from qiskit.circuit.library import RealAmplitudes
from qiskit.primitives import BackendEstimatorV2
from qiskit.providers.fake_provider import GenericBackendV2
from qiskit.quantum_info import Pauli
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
from qiskit.circuit.library import RealAmplitudes
from qiskit.primitives import BackendEstimatorV2
from qiskit.providers.fake_provider import GenericBackendV2
from qiskit.quantum_info import Pauli
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager
psi = RealAmplitudes(num_qubits=2, reps=2)
H1 = Pauli("XI")
backend = GenericBackendV2(num_qubits=7)
estimator = BackendEstimatorV2(backend=backend)
thetas = [0, 1, 1, 2, 3, 5]
pm = generate_preset_pass_manager(optimization_level=3, backend=backend)
transpiled_psi = pm.run(psi)
permuted_op = H1.apply_layout(transpiled_psi.layout)
res = estimator.run([(transpiled_psi, permuted_op, thetas)]).result()
psi = RealAmplitudes(num_qubits=2, reps=2)
H1 = Pauli("XI")
backend = GenericBackendV2(num_qubits=7)
estimator = BackendEstimatorV2(backend=backend)
thetas = [0, 1, 1, 2, 3, 5]
pm = generate_preset_pass_manager(optimization_level=3, backend=backend)
transpiled_psi = pm.run(psi)
permuted_op = H1.apply_layout(transpiled_psi.layout)
res = estimator.run([(transpiled_psi, permuted_op, thetas)]).result()
where an input circuit is transpiled locally before it's passed to
:class:`~.BaseEstimator.run`. Transpilation expands the original
circuit from 2 to 7 qubits (the size of ``backend``) and permutes its layout,
which is then applied to ``H1`` using :meth:`~.Pauli.apply_layout`
to reflect the transformations performed by ``pm.run()``.
where an input circuit is transpiled locally before it's passed to
:class:`~.BaseEstimator.run`. Transpilation expands the original
circuit from 2 to 7 qubits (the size of ``backend``) and permutes its layout,
which is then applied to ``H1`` using :meth:`~.Pauli.apply_layout`
to reflect the transformations performed by ``pm.run()``.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
features:
- |
The :class:'.StabilizerState' class now has a new method
:meth:'~.StabilizerState.probabilities_dict_from_bitstring' allowing the
The :class:`.StabilizerState` class now has a new method
:meth:`~.StabilizerState.probabilities_dict_from_bitstring` allowing the
user to pass single bitstring to measure an outcome for. Previouslly the
:meth:'~.StabilizerState.probabilities_dict' would be utilized and would
:meth:`~.StabilizerState.probabilities_dict` would be utilized and would
at worst case calculate (2^n) number of probability calculations (depending
on the state), even if a user wanted a single result. With this new method
the user can calculate just the single outcome bitstring value a user passes
Expand Down

0 comments on commit 05d5b98

Please sign in to comment.