diff --git a/doc/development/adding_operators.rst b/doc/development/adding_operators.rst
index f70a41e2ba6..f8391929c5b 100644
--- a/doc/development/adding_operators.rst
+++ b/doc/development/adding_operators.rst
@@ -204,7 +204,7 @@ knows a native implementation for ``FlipAndRotate``). It also defines an adjoint
# as the class differs from the standard `__init__` call signature of
# (*data, wires=wires, **hyperparameters), the _unflatten method that
# must be defined as well
- # _unflatten recreates a opeartion from the serialized data and metadata of ``Operator._flatten``
+ # _unflatten recreates a operation from the serialized data and metadata of ``Operator._flatten``
# copied_op = type(op)._unflatten(*op._flatten())
wires = metadata[0]
hyperparams = dict(metadata[1])
diff --git a/doc/index.rst b/doc/index.rst
index 85c20538942..045a381670b 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -137,7 +137,7 @@ If you are having issues, please let us know by posting the issue on our GitHub
We encourage contributions — simply fork the PennyLane repository, and then make a
`pull request `_ containing
-your contribution. All contributers to PennyLane will be listed as authors on the releases.
+your contribution. All contributors to PennyLane will be listed as authors on the releases.
To chat directly with the team designing and building PennyLane, as well as members of
our community — ranging from quantum machine learning researchers, to students, to those
diff --git a/doc/introduction/interfaces/numpy.rst b/doc/introduction/interfaces/numpy.rst
index ebef5748c89..1b16a2053ad 100644
--- a/doc/introduction/interfaces/numpy.rst
+++ b/doc/introduction/interfaces/numpy.rst
@@ -170,7 +170,7 @@ the following QNode that accepts two arguments ``data`` and ``weights``:
qml.CNOT(wires=[0, 2])
return qml.expval(qml.PauliZ(0))
- rng = np.random.default_rng(seed=42) # make the results reproducable
+ rng = np.random.default_rng(seed=42) # make the results reproducible
data = rng.random([2 ** 3], requires_grad=False)
weights = np.array([0.1, 0.2, 0.3], requires_grad=True)
diff --git a/doc/introduction/measurements.rst b/doc/introduction/measurements.rst
index 2f6e6c693fe..214a132951f 100644
--- a/doc/introduction/measurements.rst
+++ b/doc/introduction/measurements.rst
@@ -282,7 +282,7 @@ circuit:
.. code-block:: python
- # fix seed to make results reproducable
+ # fix seed to make results reproducible
np.random.seed(1)
dev = qml.device("default.qubit", wires=1)
diff --git a/doc/introduction/templates.rst b/doc/introduction/templates.rst
index 9593e203830..01a24cbf3e0 100644
--- a/doc/introduction/templates.rst
+++ b/doc/introduction/templates.rst
@@ -426,7 +426,7 @@ The shape can for example be used to construct random weights at the beginning o
return qml.expval(qml.PauliZ(0))
shape = BasicEntanglerLayers.shape(n_layers=2, n_wires=n_wires)
- np.random.seed(42) # to make the result reproducable
+ np.random.seed(42) # to make the result reproducible
weights = np.random.random(size=shape)
>>> circuit(weights)
diff --git a/doc/releases/changelog-dev.md b/doc/releases/changelog-dev.md
index d48f921304d..6f0ce3fe82f 100644
--- a/doc/releases/changelog-dev.md
+++ b/doc/releases/changelog-dev.md
@@ -7,7 +7,7 @@
* A new `qml.vn_entanglement_entropy` measurement process has been added which measures the
Von Neumann entanglement entropy of a quantum state.
[(#5911)](https://github.com/PennyLaneAI/pennylane/pull/5911)
-
+
Improvements 🛠
* PennyLane is now compatible with NumPy 2.0.
@@ -20,7 +20,7 @@
* `qml.qchem.excitations` now optionally returns fermionic operators.
[(#6171)](https://github.com/PennyLaneAI/pennylane/pull/6171)
-* The `diagonalize_measurements` transform now uses a more efficient method of diagonalization
+* The `diagonalize_measurements` transform now uses a more efficient method of diagonalization
when possible, based on the `pauli_rep` of the relevant observables.
[#6113](https://github.com/PennyLaneAI/pennylane/pull/6113/)
@@ -142,8 +142,11 @@
Documentation 📝
+* Fixed spelling in a number of places across the documentation.
+ [(#6280)](https://github.com/PennyLaneAI/pennylane/pull/6280)
+
* Add `work_wires` parameter to `qml.MultiControlledX` docstring signature.
- [(#6271)](https://github.com/PennyLaneAI/pennylane/pull/6271)
+ [(#6271)](https://github.com/PennyLaneAI/pennylane/pull/6271)
Bug fixes 🐛
@@ -158,7 +161,7 @@
* The `qml.QSVT` template now orders the `projector` wires first and the `UA` wires second, which is the expected order of the decomposition.
[(#6212)](https://github.com/PennyLaneAI/pennylane/pull/6212)
-
+
* The `qml.Qubitization` template now orders the `control` wires first and the `hamiltonian` wires second, which is the expected according to other templates.
[(#6229)](https://github.com/PennyLaneAI/pennylane/pull/6229)
diff --git a/pennylane/circuit_graph.py b/pennylane/circuit_graph.py
index c93be7f74c4..7e8365eaecb 100644
--- a/pennylane/circuit_graph.py
+++ b/pennylane/circuit_graph.py
@@ -89,7 +89,7 @@ class CircuitGraph:
par_info (Optional[list[dict]]): Parameter information. For each index, the entry is a dictionary containing an operation
and an index into that operation's parameters.
trainable_params (Optional[set[int]]): A set containing the indices of parameters that support
- differentiability. The indices provided match the order of appearence in the
+ differentiability. The indices provided match the order of appearance in the
quantum circuit.
"""
diff --git a/pennylane/compiler/qjit_api.py b/pennylane/compiler/qjit_api.py
index c87d6f70ded..c849677a415 100644
--- a/pennylane/compiler/qjit_api.py
+++ b/pennylane/compiler/qjit_api.py
@@ -53,7 +53,7 @@ def qjit(fn=None, *args, compiler="catalyst", **kwargs): # pylint:disable=keywo
Please see the :doc:`Catalyst documentation ` for more details on
supported devices, operations, and measurements.
- CUDA Quantum supports ``softwareq.qpp``, ``nvidida.custatevec``, and ``nvidia.cutensornet``.
+ CUDA Quantum supports ``softwareq.qpp``, ``nvidia.custatevec``, and ``nvidia.cutensornet``.
Args:
fn (Callable): Hybrid (quantum-classical) function to compile
@@ -77,7 +77,7 @@ def qjit(fn=None, *args, compiler="catalyst", **kwargs): # pylint:disable=keywo
elements of this list are named sequences of MLIR passes to be executed. A ``None``
value (the default) results in the execution of the default pipeline. This option is
considered to be used by advanced users for low-level debugging purposes.
- static_argnums(int or Seqence[Int]): an index or a sequence of indices that specifies the
+ static_argnums(int or Sequence[Int]): an index or a sequence of indices that specifies the
positions of static arguments.
abstracted_axes (Sequence[Sequence[str]] or Dict[int, str] or Sequence[Dict[int, str]]):
An experimental option to specify dynamic tensor shapes.
diff --git a/pennylane/data/__init__.py b/pennylane/data/__init__.py
index e6bb4ba9baf..2f07debe26d 100644
--- a/pennylane/data/__init__.py
+++ b/pennylane/data/__init__.py
@@ -152,12 +152,12 @@
... doc="The hamiltonian of the system"))
>>> dataset.eigen = qml.data.attribute(
... {"eigvals": eigvals, "eigvecs": eigvecs},
-... doc="Eigenvalues and eigenvectors of the hamiltonain")
+... doc="Eigenvalues and eigenvectors of the hamiltonian")
This metadata can then be accessed using the :meth:`Dataset.attr_info` mapping:
>>> dataset.attr_info["eigen"]["doc"]
-'Eigenvalues and eigenvectors of the hamiltonain'
+'Eigenvalues and eigenvectors of the hamiltonian'
Declarative API
diff --git a/pennylane/data/base/attribute.py b/pennylane/data/base/attribute.py
index e1eefbf9b07..ebcbaa8110c 100644
--- a/pennylane/data/base/attribute.py
+++ b/pennylane/data/base/attribute.py
@@ -426,12 +426,12 @@ def attribute(
... doc="The hamiltonian of the system"))
>>> dataset.eigen = qml.data.attribute(
... {"eigvals": eigvals, "eigvecs": eigvecs},
- ... doc="Eigenvalues and eigenvectors of the hamiltonain")
+ ... doc="Eigenvalues and eigenvectors of the hamiltonian")
This metadata can then be accessed using the :meth:`~.Dataset.attr_info` mapping:
>>> dataset.attr_info["eigen"]["doc"]
- 'Eigenvalues and eigenvectors of the hamiltonain'
+ 'Eigenvalues and eigenvectors of the hamiltonian'
"""
return match_obj_type(val)(val, AttributeInfo(doc=doc, py_type=type(val), **kwargs))
diff --git a/pennylane/devices/device_api.py b/pennylane/devices/device_api.py
index 83bb43d0b2c..60d14afa8fb 100644
--- a/pennylane/devices/device_api.py
+++ b/pennylane/devices/device_api.py
@@ -63,7 +63,7 @@ class Device(abc.ABC):
Shot information is no longer stored on the device, but instead specified on individual input :class:`~.QuantumTape`.
The old devices defined a :meth:`~.Device.capabilities` dictionary that defined characteristics of the devices and controlled various
- preprocessing and validation steps, such as ``"supports_broadcasting"``. These capabilites should now be handled by the
+ preprocessing and validation steps, such as ``"supports_broadcasting"``. These capabilities should now be handled by the
:meth:`~.Device.preprocess` method. For example, if a device does not support broadcasting, ``preprocess`` should
split a quantum script with broadcasted parameters into a batch of quantum scripts. If the device does not support mid circuit
measurements, then ``preprocess`` should apply :func:`~.defer_measurements`. A set of default preprocessing steps will be available
@@ -77,7 +77,7 @@ class Device(abc.ABC):
to certain inputs.
Versioning should be specified by the package containing the device. If an external package includes a PennyLane device,
- then the package requirements should specify the minimium PennyLane version required to work with the device.
+ then the package requirements should specify the minimum PennyLane version required to work with the device.
.. details::
:title: The relationship between preprocessing and execution
diff --git a/pennylane/fourier/qnode_spectrum.py b/pennylane/fourier/qnode_spectrum.py
index 6eff1514503..366c9b7f16c 100644
--- a/pennylane/fourier/qnode_spectrum.py
+++ b/pennylane/fourier/qnode_spectrum.py
@@ -372,7 +372,7 @@ def circuit(x, y, z):
Note that the values of the output are dictionaries instead of the spectrum lists, that
they include the prefactors introduced by classical preprocessing, and
that we would not be able to compute the advanced spectrum for ``x`` because it is
- preprocessed non-linearily in the gate ``qml.RX(0.5*x**2, wires=0, id="x")``.
+ preprocessed non-linearly in the gate ``qml.RX(0.5*x**2, wires=0, id="x")``.
"""
# pylint: disable=too-many-branches,protected-access
diff --git a/pennylane/gradients/parameter_shift_cv.py b/pennylane/gradients/parameter_shift_cv.py
index e76833d8546..481530e305c 100644
--- a/pennylane/gradients/parameter_shift_cv.py
+++ b/pennylane/gradients/parameter_shift_cv.py
@@ -561,7 +561,7 @@ def param_shift_cv(
If ``None``, the default gradient recipe containing the two terms
:math:`[c_0, a_0, s_0]=[1/2, 1, \pi/2]` and :math:`[c_1, a_1,
s_1]=[-1/2, 1, -\pi/2]` is assumed for every parameter.
- fallback_fn (None or Callable): a fallback grdient function to use for
+ fallback_fn (None or Callable): a fallback gradient function to use for
any parameters that do not support the parameter-shift rule.
f0 (tensor_like[float] or None): Output of the evaluated input tape. If provided,
and the gradient recipe contains an unshifted term, this value is used,
diff --git a/pennylane/gradients/parameter_shift_hessian.py b/pennylane/gradients/parameter_shift_hessian.py
index b1dd2f1982e..704fa6c8919 100644
--- a/pennylane/gradients/parameter_shift_hessian.py
+++ b/pennylane/gradients/parameter_shift_hessian.py
@@ -490,7 +490,7 @@ def param_shift_hessian(
in the QNode execution.
- Note: By default a QNode with the keyword ``hybrid=True`` computes derivates with respect to
+ Note: By default a QNode with the keyword ``hybrid=True`` computes derivatives with respect to
QNode arguments, which can include classical computations on those arguments before they are
passed to quantum operations. The "purely quantum" Hessian can instead be obtained with
``hybrid=False``, which is then computed with respect to the gate arguments and produces a
diff --git a/pennylane/gradients/pulse_gradient_odegen.py b/pennylane/gradients/pulse_gradient_odegen.py
index 7c49ab5ac1d..2cd2ead6537 100644
--- a/pennylane/gradients/pulse_gradient_odegen.py
+++ b/pennylane/gradients/pulse_gradient_odegen.py
@@ -48,7 +48,7 @@
def _one_parameter_generators(op):
r"""Compute the effective generators :math:`\{\Omega_k\}` of one-parameter groups that
- reproduce the partial derivatives of a parameterized evolution.
+ reproduce the partial derivatives of a parametrized evolution.
In particular, compute :math:`U` and :math:`\partial U / \partial \theta_k`
and recombine them into :math:`\Omega_k = U^\dagger \partial U / \partial \theta_k`
@@ -460,7 +460,7 @@ def pulse_odegen(
**Example**
- Consider the parameterized Hamiltonian
+ Consider the parametrized Hamiltonian
:math:`\theta_0 Y_{0}+f(\boldsymbol{\theta_1}, t) Y_{1} + \theta_2 Z_{0}X_{1}`
with parameters :math:`\theta_0 = \frac{1}{5}`,
:math:`\boldsymbol{\theta_1}=\left(\frac{3}{5}, \frac{1}{5}\right)^{T}` and
diff --git a/pennylane/io.py b/pennylane/io.py
index f19bd150ddf..c003ab881e3 100644
--- a/pennylane/io.py
+++ b/pennylane/io.py
@@ -134,18 +134,18 @@ def circuit():
operator.
See below for more information regarding how to translate more complex circuits from Qiskit to
- PennyLane, including handling parameterized Qiskit circuits, mid-circuit measurements, and
+ PennyLane, including handling parametrized Qiskit circuits, mid-circuit measurements, and
classical control flows.
.. details::
- :title: Parameterized Quantum Circuits
+ :title: Parametrized Quantum Circuits
- A Qiskit ``QuantumCircuit`` is parameterized if it contains
+ A Qiskit ``QuantumCircuit`` is parametrized if it contains
`Parameter `__ or
`ParameterVector `__
references that need to be given defined values to evaluate the circuit. These can be passed
to the generated quantum function as keyword or positional arguments. If we define a
- parameterized circuit:
+ parametrized circuit:
.. code-block:: python
@@ -182,7 +182,7 @@ def circuit():
>>> qml.grad(circuit, argnum=[0, 1])(np.pi/4, np.pi/6)
(array(-0.61237244), array(-0.35355339))
- The ``QuantumCircuit`` may also be parameterized with a ``ParameterVector``. These can be
+ The ``QuantumCircuit`` may also be parametrized with a ``ParameterVector``. These can be
similarly converted:
.. code-block:: python
@@ -363,7 +363,7 @@ def from_qiskit_op(qiskit_op, params=None, wires=None):
.. details::
:title: Usage Details
- You can convert a parameterized ``SparsePauliOp`` into a PennyLane operator by assigning
+ You can convert a parametrized ``SparsePauliOp`` into a PennyLane operator by assigning
literal values to each coefficient parameter. For example, the script
.. code-block:: python
diff --git a/pennylane/math/multi_dispatch.py b/pennylane/math/multi_dispatch.py
index 2c4684571f7..0468cfe6858 100644
--- a/pennylane/math/multi_dispatch.py
+++ b/pennylane/math/multi_dispatch.py
@@ -58,7 +58,7 @@ def eye(*args, like=None, **kwargs):
def multi_dispatch(argnum=None, tensor_list=None):
- r"""Decorater to dispatch arguments handled by the interface.
+ r"""Decorator to dispatch arguments handled by the interface.
This helps simplify definitions of new functions inside PennyLane. We can
decorate the function, indicating the arguments that are tensors handled
diff --git a/pennylane/math/utils.py b/pennylane/math/utils.py
index a03954b3746..9d716062382 100644
--- a/pennylane/math/utils.py
+++ b/pennylane/math/utils.py
@@ -194,7 +194,7 @@ def get_interface(*values):
cannot both be present.
* Autograd tensors *may* be present alongside Torch, TensorFlow and Jax tensors,
- but Torch, TensorFlow and Jax take precendence; the autograd arrays will
+ but Torch, TensorFlow and Jax take precedence; the autograd arrays will
be treated as non-differentiable NumPy arrays. A warning will be raised
suggesting that vanilla NumPy be used instead.
diff --git a/pennylane/ops/cv.py b/pennylane/ops/cv.py
index 38698477105..43258bb47fc 100644
--- a/pennylane/ops/cv.py
+++ b/pennylane/ops/cv.py
@@ -640,7 +640,7 @@ class InterferometerUnitary(CVOperation):
This operation implements a **fixed** linear interferometer given a known
unitary matrix.
- If you instead wish to parameterize the interferometer,
+ If you instead wish to parametrize the interferometer,
and calculate the gradient/optimize with respect to these parameters,
consider instead the :func:`pennylane.template.Interferometer` template,
which constructs an interferometer from a combination of beamsplitters
diff --git a/pennylane/ops/op_math/prod.py b/pennylane/ops/op_math/prod.py
index 284e193d9e2..46ab54a531d 100644
--- a/pennylane/ops/op_math/prod.py
+++ b/pennylane/ops/op_math/prod.py
@@ -186,7 +186,7 @@ class Prod(CompositeOp):
0. +0.j , 0. +0.j ]])
The Prod operation can be used inside a `qnode` as an operation which,
- if parameterized, can be differentiated.
+ if parametrized, can be differentiated.
.. code-block:: python
@@ -204,7 +204,7 @@ def circuit(theta):
tensor(-0.9424888, requires_grad=True)
The Prod operation can also be measured as an observable.
- If the circuit is parameterized, then we can also differentiate through the
+ If the circuit is parametrized, then we can also differentiate through the
product observable.
.. code-block:: python
diff --git a/pennylane/ops/op_math/sprod.py b/pennylane/ops/op_math/sprod.py
index 3ab57061c19..64fcdbdfd72 100644
--- a/pennylane/ops/op_math/sprod.py
+++ b/pennylane/ops/op_math/sprod.py
@@ -112,7 +112,7 @@ class SProd(ScalarSymbolicOp):
:title: Usage Details
The SProd operation can also be measured inside a qnode as an observable.
- If the circuit is parameterized, then we can also differentiate through the observable.
+ If the circuit is parametrized, then we can also differentiate through the observable.
.. code-block:: python
diff --git a/pennylane/ops/op_math/sum.py b/pennylane/ops/op_math/sum.py
index c70adadfbcb..40ed5f229c3 100644
--- a/pennylane/ops/op_math/sum.py
+++ b/pennylane/ops/op_math/sum.py
@@ -171,7 +171,7 @@ class Sum(CompositeOp):
.. details::
:title: Usage Details
- We can combine parameterized operators, and support sums between operators acting on
+ We can combine parametrized operators, and support sums between operators acting on
different wires.
>>> summed_op = Sum(qml.RZ(1.23, wires=0), qml.I(wires=1))
@@ -186,7 +186,7 @@ class Sum(CompositeOp):
0. +0.j , 1.81677345+0.57695852j]])
The Sum operation can also be measured inside a qnode as an observable.
- If the circuit is parameterized, then we can also differentiate through the
+ If the circuit is parametrized, then we can also differentiate through the
sum observable.
.. code-block:: python
diff --git a/pennylane/ops/op_math/symbolicop.py b/pennylane/ops/op_math/symbolicop.py
index 3053e58c8c8..24f81e52e93 100644
--- a/pennylane/ops/op_math/symbolicop.py
+++ b/pennylane/ops/op_math/symbolicop.py
@@ -28,7 +28,7 @@ class SymbolicOp(Operator):
"""Developer-facing base class for single-operator symbolic operators.
Args:
- base (~.operation.Operator): the base operation that is modified symbolicly
+ base (~.operation.Operator): the base operation that is modified symbolically
id (str): custom label given to an operator instance,
can be useful for some applications where the instance has to be identified
@@ -155,7 +155,7 @@ class ScalarSymbolicOp(SymbolicOp):
scalar coefficient.
Args:
- base (~.operation.Operator): the base operation that is modified symbolicly
+ base (~.operation.Operator): the base operation that is modified symbolically
scalar (float): the scalar coefficient
id (str): custom label given to an operator instance, can be useful for some applications
where the instance has to be identified
diff --git a/pennylane/ops/qubit/non_parametric_ops.py b/pennylane/ops/qubit/non_parametric_ops.py
index 973fa44d83a..86715feedf9 100644
--- a/pennylane/ops/qubit/non_parametric_ops.py
+++ b/pennylane/ops/qubit/non_parametric_ops.py
@@ -1188,7 +1188,7 @@ def is_hermitian(self) -> bool:
class ECR(Operation):
r""" ECR(wires)
- An echoed RZX(pi/2) gate.
+ An echoed RZX(:math:`\pi/2`) gate.
.. math:: ECR = {\frac{1}{\sqrt{2}}} \begin{bmatrix}
0 & 0 & 1 & i \\
diff --git a/pennylane/ops/qubit/parametric_ops_multi_qubit.py b/pennylane/ops/qubit/parametric_ops_multi_qubit.py
index fcbd8f2ad4f..f53af311124 100644
--- a/pennylane/ops/qubit/parametric_ops_multi_qubit.py
+++ b/pennylane/ops/qubit/parametric_ops_multi_qubit.py
@@ -14,7 +14,7 @@
# pylint: disable=too-many-arguments
"""
This submodule contains the discrete-variable quantum operations that are the
-core parameterized gates.
+core parametrized gates.
"""
# pylint:disable=abstract-method,arguments-differ,protected-access,invalid-overridden-method
import functools
diff --git a/pennylane/ops/qubit/parametric_ops_single_qubit.py b/pennylane/ops/qubit/parametric_ops_single_qubit.py
index ce829e24153..fe02238bafd 100644
--- a/pennylane/ops/qubit/parametric_ops_single_qubit.py
+++ b/pennylane/ops/qubit/parametric_ops_single_qubit.py
@@ -14,7 +14,7 @@
# pylint: disable=too-many-arguments
"""
This submodule contains the discrete-variable quantum operations that are the
-core parameterized gates.
+core parametrized gates.
"""
# pylint:disable=abstract-method,arguments-differ,protected-access,invalid-overridden-method
import functools
diff --git a/pennylane/ops/qutrit/parametric_ops.py b/pennylane/ops/qutrit/parametric_ops.py
index 074b6f14d57..119ebde5aab 100644
--- a/pennylane/ops/qutrit/parametric_ops.py
+++ b/pennylane/ops/qutrit/parametric_ops.py
@@ -14,7 +14,7 @@
# pylint: disable=too-many-arguments
"""
This submodule contains the discrete-variable quantum operations that are the
-core parameterized gates for qutrits.
+core parametrized gates for qutrits.
"""
import functools
diff --git a/pennylane/optimize/adaptive.py b/pennylane/optimize/adaptive.py
index 0c6dd38af71..cf9da9f2d68 100644
--- a/pennylane/optimize/adaptive.py
+++ b/pennylane/optimize/adaptive.py
@@ -24,7 +24,7 @@
@transform
def append_gate(tape: QuantumScript, params, gates) -> tuple[QuantumScriptBatch, PostprocessingFn]:
- """Append parameterized gates to an existing tape.
+ """Append parametrized gates to an existing tape.
Args:
tape (QuantumTape or QNode or Callable): quantum circuit to transform by adding gates
@@ -156,7 +156,7 @@ def __init__(self, param_steps=10, stepsize=0.5):
@staticmethod
def _circuit(params, gates, initial_circuit):
- """Append parameterized gates to an existing circuit.
+ """Append parametrized gates to an existing circuit.
Args:
params (array[float]): parameters of the gates to be added
diff --git a/pennylane/optimize/qng.py b/pennylane/optimize/qng.py
index 9952caaff23..fb3af80b90d 100644
--- a/pennylane/optimize/qng.py
+++ b/pennylane/optimize/qng.py
@@ -71,7 +71,7 @@ class QNGOptimizer(GradientDescentOptimizer):
where :math:`|\psi_\ell\rangle = V(\theta_1, \dots, \theta_{i-1})|0\rangle`
(that is, :math:`|\psi_\ell\rangle` is the quantum state prior to the application
- of parameterized layer :math:`\ell`).
+ of parametrized layer :math:`\ell`).
Combining the quantum natural gradient optimizer with the analytic parameter-shift
rule to optimize a variational circuit with :math:`d` parameters and :math:`L` layers,
diff --git a/pennylane/optimize/qnspsa.py b/pennylane/optimize/qnspsa.py
index 75b773e5f9b..7a34b766550 100644
--- a/pennylane/optimize/qnspsa.py
+++ b/pennylane/optimize/qnspsa.py
@@ -61,7 +61,7 @@ class QNSPSAOptimizer:
where :math:`F(\mathbf{x}', \mathbf{x}) = \bigr\rvert\langle \phi(\mathbf{x}') | \phi(\mathbf{x}) \rangle \bigr\rvert ^ 2`
measures the state overlap between :math:`\phi(\mathbf{x}')` and :math:`\phi(\mathbf{x})`,
- where :math:`\phi` is the parameterized ansatz. The finite difference :math:`\delta F` is
+ where :math:`\phi` is the parametrized ansatz. The finite difference :math:`\delta F` is
computed from the two perturbations:
.. math::
@@ -110,7 +110,7 @@ class QNSPSAOptimizer:
Keyword Args:
stepsize (float): the user-defined hyperparameter :math:`\eta` for learning rate (default: 1e-3)
- regularization (float): regularitzation term :math:`\beta` to the Fubini-Study metric tensor
+ regularization (float): regularization term :math:`\beta` to the Fubini-Study metric tensor
for numerical stability (default: 1e-3)
finite_diff_step (float): step size :math:`\epsilon` to compute the finite difference
gradient and the Fubini-Study metric tensor (default: 1e-2)
diff --git a/pennylane/optimize/rms_prop.py b/pennylane/optimize/rms_prop.py
index 70990aa59fd..ddf7a35af4c 100644
--- a/pennylane/optimize/rms_prop.py
+++ b/pennylane/optimize/rms_prop.py
@@ -20,8 +20,8 @@
class RMSPropOptimizer(AdagradOptimizer):
r"""Root mean squared propagation optimizer.
- The root mean square progation optimizer is a modified
- :class:`Adagrad optimizer `,
+ The root mean square propagation optimizer is a modified
+ :class:`Adagrad optimizer `,
with a decay of learning rate adaptation.
Extensions of the Adagrad optimization method generally
@@ -36,10 +36,10 @@ class RMSPropOptimizer(AdagradOptimizer):
Args:
stepsize (float): the user-defined hyperparameter :math:`\eta`
- used in the Adagrad optmization
+ used in the Adagrad optimization
decay (float): the learning rate decay :math:`\gamma`
eps (float): offset :math:`\epsilon` added for numerical stability
- (see :class:`Adagrad `)
+ (see :class:`Adagrad `)
"""
diff --git a/pennylane/pauli/grouping/graph_colouring.py b/pennylane/pauli/grouping/graph_colouring.py
index d7e528eb5ce..787271c2d51 100644
--- a/pennylane/pauli/grouping/graph_colouring.py
+++ b/pennylane/pauli/grouping/graph_colouring.py
@@ -38,7 +38,7 @@ def largest_first(binary_observables, adj):
Args:
binary_observables (array[int]): the set of Pauli words represented by a column matrix
- of the Pauli words in binary vector represenation
+ of the Pauli words in binary vector representation
adj (array[int]): the adjacency matrix of the Pauli graph
Returns:
@@ -87,7 +87,7 @@ def recursive_largest_first(binary_observables, adj): # pylint:disable=too-many
Args:
binary_observables (array[int]): the set of Pauli words represented by a column matrix of
- the Pauli words in binary vector represenation
+ the Pauli words in binary vector representation
adj (array[int]): the adjacency matrix of the Pauli graph
Returns:
diff --git a/pennylane/pauli/grouping/group_observables.py b/pennylane/pauli/grouping/group_observables.py
index 27ff9df5939..948d35e50f7 100644
--- a/pennylane/pauli/grouping/group_observables.py
+++ b/pennylane/pauli/grouping/group_observables.py
@@ -173,7 +173,7 @@ def complement_graph(self) -> rx.PyGraph:
Edge ``(i,j)`` is present in the graph if ``observable[i]`` and ``observable[j]`` do **not** satisfy
the ``grouping_type`` strategy.
- The nodes are the observables (can only be accesssed through their integer index).
+ The nodes are the observables (can only be accessed through their integer index).
"""
# Use upper triangle since adjacency matrix is symmetric and we have an undirected graph
edges = list(zip(*np.where(np.triu(self.adj_matrix, k=1))))
diff --git a/pennylane/pulse/__init__.py b/pennylane/pulse/__init__.py
index 8bbafb5af6d..b1e6fd53e09 100644
--- a/pennylane/pulse/__init__.py
+++ b/pennylane/pulse/__init__.py
@@ -85,7 +85,7 @@
parameters :math:`p` and time :math:`t`.
Defining a :class:`~.ParametrizedHamiltonian` requires coefficients and operators, where some of the coefficients
-are callables. The callables defining the parameterized coefficients must have the call signature ``(p, t)``, where ``p`` can be a ``float``,
+are callables. The callables defining the parametrized coefficients must have the call signature ``(p, t)``, where ``p`` can be a ``float``,
``list`` or ``jnp.array``. These functions should be defined using ``jax.numpy`` rather than ``numpy`` where relevant.
.. code-block:: python
diff --git a/pennylane/pulse/parametrized_hamiltonian.py b/pennylane/pulse/parametrized_hamiltonian.py
index f241ac38e76..88e31b567ad 100644
--- a/pennylane/pulse/parametrized_hamiltonian.py
+++ b/pennylane/pulse/parametrized_hamiltonian.py
@@ -138,7 +138,7 @@ def f2(p, t):
Internally we are computing ``f1([4.6, 2.3], 0.5)`` and ``f2(1.2, 0.5)``.
Parametrized coefficients can be any callable that takes ``(p, t)`` and returns a scalar. It is not a
- requirement that both ``p`` and ``t`` be used in the callable: for example, the convenince function
+ requirement that both ``p`` and ``t`` be used in the callable: for example, the convenience function
:func:`~pulse.constant` takes ``(p, t)`` and returns ``p``.
.. warning::
diff --git a/pennylane/qaoa/cost.py b/pennylane/qaoa/cost.py
index 7ffc65be5e7..a30bcc421e7 100644
--- a/pennylane/qaoa/cost.py
+++ b/pennylane/qaoa/cost.py
@@ -560,7 +560,7 @@ def max_weight_cycle(graph: Union[nx.Graph, rx.PyGraph, rx.PyDiGraph], constrain
where :math:`E` are the edges of the graph, :math:`x_{ij}` is a binary number that selects
whether to include the edge :math:`(i, j)` and :math:`c_{ij}` is the corresponding edge weight.
- Our objective is to maximimize :math:`P`, subject to selecting the :math:`x_{ij}` so that
+ Our objective is to maximize :math:`P`, subject to selecting the :math:`x_{ij}` so that
our subset of edges composes a `cycle `__.
Args:
diff --git a/pennylane/qaoa/cycle.py b/pennylane/qaoa/cycle.py
index 0edfb4b9146..05310a44916 100644
--- a/pennylane/qaoa/cycle.py
+++ b/pennylane/qaoa/cycle.py
@@ -20,7 +20,7 @@
from typing import Union
import networkx as nx
-import numpy as np
+import numpy as np # pylint: disable=wrong-import-order
import rustworkx as rx
import pennylane as qml
@@ -302,7 +302,7 @@ def loss_hamiltonian(graph: Union[nx.Graph, rx.PyGraph, rx.PyDiGraph]) -> qml.op
where :math:`E` are the edges of the graph, :math:`x_{ij}` is a binary number that selects
whether to include the edge :math:`(i, j)` and :math:`c_{ij}` is the corresponding edge weight.
- Our objective is to maximimize :math:`P`, subject to selecting the :math:`x_{ij}` so that
+ Our objective is to maximize :math:`P`, subject to selecting the :math:`x_{ij}` so that
our subset of edges composes a cycle.
The product of edge weights is maximized by equivalently considering
diff --git a/pennylane/qchem/tapering.py b/pennylane/qchem/tapering.py
index 8dccd068f0a..4c7c9b8fd7c 100644
--- a/pennylane/qchem/tapering.py
+++ b/pennylane/qchem/tapering.py
@@ -575,7 +575,7 @@ def _build_generator(operation, wire_order, op_gen=None):
+ (0.25) [X0 Y1]
"""
if op_gen is None:
- if operation.num_params < 1: # Non-parameterized gates
+ if operation.num_params < 1: # Non-parametrized gates
gen_mat = 1j * scipy.linalg.logm(qml.matrix(operation, wire_order=wire_order))
op_gen = qml.pauli_decompose(
gen_mat, wire_order=wire_order, hide_identity=True, pauli=True
diff --git a/pennylane/qcut/cutstrategy.py b/pennylane/qcut/cutstrategy.py
index 2e92a8cdb87..f5986c8e09b 100644
--- a/pennylane/qcut/cutstrategy.py
+++ b/pennylane/qcut/cutstrategy.py
@@ -366,7 +366,7 @@ def _infer_probed_cuts(
ks = list(range(k_lower, k_upper + 1))
if len(ks) > self.HIGH_PARTITION_ATTEMPTS:
- warnings.warn(f"The numer of partition attempts seems high ({len(ks)}).")
+ warnings.warn(f"The number of partition attempts seems high ({len(ks)}).")
else:
# When the by-fragment wire and/or gate limits are supplied, derive k and imbalance and
# return a single partition config.
diff --git a/pennylane/tape/qscript.py b/pennylane/tape/qscript.py
index 7cc6809ff82..6e3e46fc1b0 100644
--- a/pennylane/tape/qscript.py
+++ b/pennylane/tape/qscript.py
@@ -542,7 +542,7 @@ def data(self) -> list[TensorLike]:
@property
def trainable_params(self) -> list[int]:
r"""Store or return a list containing the indices of parameters that support
- differentiability. The indices provided match the order of appearence in the
+ differentiability. The indices provided match the order of appearance in the
quantum circuit.
Setting this property can help reduce the number of quantum evaluations needed
@@ -942,7 +942,7 @@ def expand(
The ``stop_at`` callable allows the specification of terminal
operations that should no longer be decomposed. In this example, the ``X``
- operator is not decomposed becasue ``stop_at(qml.X(0)) == True``.
+ operator is not decomposed because ``stop_at(qml.X(0)) == True``.
>>> def stop_at(obj):
... return isinstance(obj, qml.X)
@@ -1281,7 +1281,7 @@ def make_qscript(
Returns:
function: The returned function takes the same arguments as the quantum
function. When called, it returns the generated quantum script
- without any queueing occuring.
+ without any queueing occurring.
**Example**
diff --git a/pennylane/tape/tape.py b/pennylane/tape/tape.py
index 2a247ecdf58..20c8e3bd9c1 100644
--- a/pennylane/tape/tape.py
+++ b/pennylane/tape/tape.py
@@ -188,7 +188,7 @@ def expand_tape(tape, depth=1, stop_at=None, expand_measurements=False):
The ``stop_at`` callable allows the specification of terminal
operations that should no longer be decomposed. In this example, the ``X``
- operator is not decomposed becasue ``stop_at(qml.X(0)) == True``.
+ operator is not decomposed because ``stop_at(qml.X(0)) == True``.
>>> def stop_at(obj):
... return isinstance(obj, qml.X)
diff --git a/pennylane/templates/layers/cv_neural_net.py b/pennylane/templates/layers/cv_neural_net.py
index 5978211f90b..f5b9517d314 100644
--- a/pennylane/templates/layers/cv_neural_net.py
+++ b/pennylane/templates/layers/cv_neural_net.py
@@ -26,7 +26,7 @@ class CVNeuralNetLayers(Operation):
The layer consists
of interferometers, displacement and squeezing gates mimicking the linear transformation of
a neural network in the x-basis of the quantum system, and uses a Kerr gate
- to introduce a 'quantum' nonlinearity.
+ to introduce a 'quantum' non-linearity.
The layers act on the :math:`M` modes given in ``wires``,
and include interferometers of :math:`K=M(M-1)/2` beamsplitters. The different weight parameters
diff --git a/pennylane/templates/state_preparations/basis_qutrit.py b/pennylane/templates/state_preparations/basis_qutrit.py
index 8568d0141d4..fb79eddb0f4 100644
--- a/pennylane/templates/state_preparations/basis_qutrit.py
+++ b/pennylane/templates/state_preparations/basis_qutrit.py
@@ -94,7 +94,7 @@ def compute_decomposition(basis_state, wires): # pylint: disable=arguments-diff
.. math:: O = O_1 O_2 \dots O_n.
- .. seealso:: :meth:`~.BasisState.decomposition`.
+ .. seealso:: :meth:`~.BasisState.decomposition`.
Args:
basis_state (array): Input array of shape ``(len(wires),)``
diff --git a/pennylane/templates/subroutines/controlled_sequence.py b/pennylane/templates/subroutines/controlled_sequence.py
index 517129556cc..2fb9afc0c2e 100644
--- a/pennylane/templates/subroutines/controlled_sequence.py
+++ b/pennylane/templates/subroutines/controlled_sequence.py
@@ -165,8 +165,8 @@ def circuit():
2: ─│────────────│────────────╭●───────────┤ State
3: ─╰(RX(1.00))──╰(RX(0.50))──╰(RX(0.25))──┤ State
- To display the operators as powers of the base operator without further simplifcation,
- the `compute_decompostion` method can be used with `lazy=True`.
+ To display the operators as powers of the base operator without further simplification,
+ the `compute_decomposition` method can be used with `lazy=True`.
.. code-block:: python
diff --git a/pennylane/templates/subroutines/qrom.py b/pennylane/templates/subroutines/qrom.py
index 8396fc9c6e0..7816cbf0e1d 100644
--- a/pennylane/templates/subroutines/qrom.py
+++ b/pennylane/templates/subroutines/qrom.py
@@ -96,7 +96,7 @@ def circuit():
Then, :math:`k = l \cdot (\lambda-1)` work wires are needed,
where :math:`l` is the length of the bitstrings.
- The QROM template has two variants. The first one (``clean = False``) is based on [`arXiv:1812.00954 `__] that alterates the state in the ``work_wires``.
+ The QROM template has two variants. The first one (``clean = False``) is based on [`arXiv:1812.00954 `__] that alternates the state in the ``work_wires``.
The second one (``clean = True``), based on [`arXiv:1902.02134 `__], solves that issue by
returning ``work_wires`` to their initial state. This technique can be applied when the ``work_wires`` are not
initialized to zero.
diff --git a/pennylane/templates/swapnetworks/ccl2.py b/pennylane/templates/swapnetworks/ccl2.py
index 9595e577e0c..6e2e45fc6a4 100644
--- a/pennylane/templates/swapnetworks/ccl2.py
+++ b/pennylane/templates/swapnetworks/ccl2.py
@@ -34,7 +34,7 @@ class TwoLocalSwapNetwork(Operation):
stored in physical wires provided by `wires` before they are swapped apart.
Parameters for the operation are specified using `param`, and any additional
keyword arguments for the callable should be provided using the ``kwargs`` separately
- weights (tensor): weight tensor for the parameterized acquaintances of length
+ weights (tensor): weight tensor for the parametrized acquaintances of length
:math:`N \times (N - 1) / 2`, where `N` is the length of `wires`
fermionic (bool): If ``True``, qubits are realized as fermionic modes and :class:`~.pennylane.FermionicSWAP` with :math:`\phi=\pi` is used instead of :class:`~.pennylane.SWAP`
shift (bool): If ``True``, odd-numbered layers begins from the second qubit instead of first one
@@ -162,7 +162,7 @@ def compute_decomposition(
.. seealso:: :meth:`~.TwoLocalSwapNetwork.decomposition`.
Args:
- weights (tensor): weight tensor for the parameterized acquaintances of length :math:`N \times (N - 1) / 2`, where `N` is the length of `wires`
+ weights (tensor): weight tensor for the parametrized acquaintances of length :math:`N \times (N - 1) / 2`, where `N` is the length of `wires`
wires (Iterable or Wires): ordered sequence of wires on which the swap network acts
acquaintances (Callable): callable `func(index, wires, param=None, **kwargs)` that returns a two-local operation, which is applied on a pair of logical wires specified by `index`. This corresponds to applying the operation on physical wires provided by `wires` before any SWAP gates occurred. Parameters for the operation are specified using `param`, and any additional keyword arguments for the callable should be provided using the ``kwargs`` separately
fermionic (bool): If ``True``, qubits are realized as fermionic modes and :class:`~.pennylane.FermionicSWAP` with :math:`\phi=\pi` is used instead of :class:`~.pennylane.SWAP`
@@ -224,7 +224,7 @@ def compute_decomposition(
@staticmethod
def shape(n_wires):
- r"""Returns the shape of the weight tensor required for using parameterized acquaintances in the template.
+ r"""Returns the shape of the weight tensor required for using parametrized acquaintances in the template.
Args:
n_wires (int): Number of qubits
Returns:
diff --git a/pennylane/transforms/decompositions/clifford_t_transform.py b/pennylane/transforms/decompositions/clifford_t_transform.py
index ff43181eacd..9473a5c115a 100644
--- a/pennylane/transforms/decompositions/clifford_t_transform.py
+++ b/pennylane/transforms/decompositions/clifford_t_transform.py
@@ -263,7 +263,7 @@ def _two_qubit_decompose(op):
def _merge_param_gates(operations, merge_ops=None):
- """Merge the provided parameterized gates on the same wires that are adjacent to each other"""
+ """Merge the provided parametrized gates on the same wires that are adjacent to each other"""
copied_ops = operations.copy()
merged_ops, number_ops = [], 0
@@ -472,7 +472,7 @@ def circuit(x, y):
else:
raise NotImplementedError(
- f"Currently we only support Solovay-Kitaev ('sk') decompostion, got {method}"
+ f"Currently we only support Solovay-Kitaev ('sk') decomposition, got {method}"
)
decomp_ops = []
diff --git a/pennylane/transforms/defer_measurements.py b/pennylane/transforms/defer_measurements.py
index 8a9aeed9624..60f1446b111 100644
--- a/pennylane/transforms/defer_measurements.py
+++ b/pennylane/transforms/defer_measurements.py
@@ -199,7 +199,7 @@ def qfunc(par):
>>> qml.grad(qnode)(par)
tensor(-0.49622252, requires_grad=True)
- Reusing and reseting measured wires will work as expected with the
+ Reusing and resetting measured wires will work as expected with the
``defer_measurements`` transform:
.. code-block:: python3
diff --git a/pennylane/transforms/split_non_commuting.py b/pennylane/transforms/split_non_commuting.py
index 7082602ecf4..3f2775bba18 100644
--- a/pennylane/transforms/split_non_commuting.py
+++ b/pennylane/transforms/split_non_commuting.py
@@ -109,7 +109,7 @@ def circuit(x):
1: ──RX(0.79)─┤ ╰
Note that the observable ``Y(1)`` occurs twice in the original QNode, but only once in the
- transformed circuits. When there are multiple expecatation value measurements that rely on
+ transformed circuits. When there are multiple expectation value measurements that rely on
the same observable, this observable is measured only once, and the result is copied to each
original measurement.
diff --git a/pennylane/workflow/interfaces/autograd.py b/pennylane/workflow/interfaces/autograd.py
index cb5731ddc8b..f38132f7862 100644
--- a/pennylane/workflow/interfaces/autograd.py
+++ b/pennylane/workflow/interfaces/autograd.py
@@ -67,7 +67,7 @@ def grad_fn(dy):
is called, we are forced to reproduce the calculation for ``exponent * x ** (exponent-1)``,
only to multiply it by a different vector. When executing quantum circuits, that quantity
can potentially be quite expensive. Autograd would naively
-request indepedent vjps for each entry in the output, even though the internal circuits will be
+request independent vjps for each entry in the output, even though the internal circuits will be
exactly the same.
When caching is enabled, the expensive part (re-executing identical circuits) is
diff --git a/pennylane/workflow/interfaces/jax.py b/pennylane/workflow/interfaces/jax.py
index 398124c7682..f74d230c213 100644
--- a/pennylane/workflow/interfaces/jax.py
+++ b/pennylane/workflow/interfaces/jax.py
@@ -120,7 +120,7 @@ def f_and_jvp(primals, tangents):
Currently, :class:`~.QuantumScript` is a valid pytree *most* of the time. Once it is a valid pytree *all* of the
time and can store tangents in place of the variables, we can use a batch of tapes as our trainable argument. Until then, the tapes
-must be a non-pytree non-differenatible argument that accompanies the tree leaves.
+must be a non-pytree non-differentiable argument that accompanies the tree leaves.
"""
import dataclasses
diff --git a/pennylane/workflow/return_types_spec.rst b/pennylane/workflow/return_types_spec.rst
index 6e9ba4c915e..90233e8bedd 100644
--- a/pennylane/workflow/return_types_spec.rst
+++ b/pennylane/workflow/return_types_spec.rst
@@ -134,7 +134,7 @@ tuple where each entry corresponds to a different shot value.
({'0': 1}, {'0': 10}, {'0': 100})
Let's look at an example with all forms of nesting. Here, we have a tape with a batch size of ``3``, three
-diferent measurements with different fundamental shapes, and a shot vector with three different values.
+different measurements with different fundamental shapes, and a shot vector with three different values.
>>> op = qml.RX((1.2, 2.3, 3.4), 0)
>>> ms = (qml.expval(qml.Z(0)), qml.probs(wires=0), qml.counts())
diff --git a/tests/circuit_graph/test_circuit_graph.py b/tests/circuit_graph/test_circuit_graph.py
index 10886f559f2..f307cbf8735 100644
--- a/tests/circuit_graph/test_circuit_graph.py
+++ b/tests/circuit_graph/test_circuit_graph.py
@@ -58,8 +58,8 @@ def circuit_fixture(ops, obs):
return CircuitGraph(ops, obs, Wires([0, 1, 2]))
-@pytest.fixture(name="parameterized_circuit_gaussian")
-def parameterized_circuit_gaussian_fixture(wires):
+@pytest.fixture(name="parametrized_circuit_gaussian")
+def parametrized_circuit_gaussian_fixture(wires):
def qfunc(a, b, c, d, e, f):
qml.Rotation(a, wires=wires[0])
qml.Rotation(b, wires=wires[1])
@@ -248,11 +248,11 @@ def test_op_indices(self, circuit):
assert circuit.wire_indices(2) == op_indices_for_wire_2
@pytest.mark.parametrize("wires", [["a", "q1", 3]])
- def test_layers(self, parameterized_circuit_gaussian, wires):
+ def test_layers(self, parametrized_circuit_gaussian, wires):
"""A test of a simple circuit with 3 layers and 6 trainable parameters"""
dev = qml.device("default.gaussian", wires=wires)
- qnode = qml.QNode(parameterized_circuit_gaussian, dev)
+ qnode = qml.QNode(parametrized_circuit_gaussian, dev)
qnode(*pnp.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6], requires_grad=True))
circuit = qnode.qtape.graph
layers = circuit.parametrized_layers
@@ -267,11 +267,11 @@ def test_layers(self, parameterized_circuit_gaussian, wires):
assert layers[2].param_inds == [6, 7]
@pytest.mark.parametrize("wires", [["a", "q1", 3]])
- def test_iterate_layers(self, parameterized_circuit_gaussian, wires):
+ def test_iterate_layers(self, parametrized_circuit_gaussian, wires):
"""A test of the different layers, their successors and ancestors using a simple circuit"""
dev = qml.device("default.gaussian", wires=wires)
- qnode = qml.QNode(parameterized_circuit_gaussian, dev)
+ qnode = qml.QNode(parametrized_circuit_gaussian, dev)
qnode(*pnp.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6], requires_grad=True))
circuit = qnode.qtape.graph
result = list(circuit.iterate_parametrized_layers())
diff --git a/tests/circuit_graph/test_qasm.py b/tests/circuit_graph/test_qasm.py
index 9521b1c8bb9..11787ee1c98 100644
--- a/tests/circuit_graph/test_qasm.py
+++ b/tests/circuit_graph/test_qasm.py
@@ -711,7 +711,7 @@ def qnode():
@pytest.mark.tf
def test_tf_interface_information_removed(self):
"""Test that interface information from tensorflow is not included in the
- parameter string for parameterized operators"""
+ parameter string for parametrized operators"""
import tensorflow as tf
dev = qml.device("default.qubit")
diff --git a/tests/devices/default_qubit/test_default_qubit_preprocessing.py b/tests/devices/default_qubit/test_default_qubit_preprocessing.py
index 74c30f8661d..89691125852 100644
--- a/tests/devices/default_qubit/test_default_qubit_preprocessing.py
+++ b/tests/devices/default_qubit/test_default_qubit_preprocessing.py
@@ -977,7 +977,7 @@ def test_valid_tape_with_expansion(self):
assert qs.shots == qs_valid.shots
def test_untrainable_operations(self):
- """Tests that a parameterized QubitUnitary that is not trainable is not expanded"""
+ """Tests that a parametrized QubitUnitary that is not trainable is not expanded"""
@qml.qnode(qml.device("default.qubit", wires=3), diff_method="adjoint")
def circuit(x):
diff --git a/tests/devices/qubit/test_adjoint_jacobian.py b/tests/devices/qubit/test_adjoint_jacobian.py
index 72e4379155e..16d80ad3ce5 100644
--- a/tests/devices/qubit/test_adjoint_jacobian.py
+++ b/tests/devices/qubit/test_adjoint_jacobian.py
@@ -66,7 +66,7 @@ def test_pauli_rotation_gradient(self, G, theta, tol):
@pytest.mark.autograd
@pytest.mark.parametrize("theta", np.linspace(-2 * np.pi, 2 * np.pi, 7))
def test_Rot_gradient(self, theta, tol):
- """Tests that the device gradient of an arbitrary Euler-angle-parameterized gate is
+ """Tests that the device gradient of an arbitrary Euler-angle-parametrized gate is
correct."""
params = np.array([theta, theta**3, np.sqrt(2) * theta])
prep_op = qml.StatePrep(np.array([1.0, -1.0]) / np.sqrt(2), wires=0)
diff --git a/tests/devices/qubit/test_apply_operation.py b/tests/devices/qubit/test_apply_operation.py
index 49abf3e462b..ec4a31804bb 100644
--- a/tests/devices/qubit/test_apply_operation.py
+++ b/tests/devices/qubit/test_apply_operation.py
@@ -301,7 +301,7 @@ class TestApplyParametrizedEvolution:
"""Test that apply_operation works with ParametrizedEvolution"""
@pytest.mark.parametrize("method", methods)
- def test_parameterized_evolution_time_independent(self, method):
+ def test_parametrized_evolution_time_independent(self, method):
"""Test that applying a ParametrizedEvolution gives the expected state
for a time-independent hamiltonian"""
@@ -329,7 +329,7 @@ def test_parameterized_evolution_time_independent(self, method):
assert np.allclose(new_state, new_state_expected, atol=0.002)
@pytest.mark.parametrize("method", methods)
- def test_parameterized_evolution_time_dependent(self, method):
+ def test_parametrized_evolution_time_dependent(self, method):
"""Test that applying a ParametrizedEvolution gives the expected state
for a time dependent Hamiltonian"""
diff --git a/tests/gradients/core/test_adjoint_diff.py b/tests/gradients/core/test_adjoint_diff.py
index d064fafe192..6d9e585b1a8 100644
--- a/tests/gradients/core/test_adjoint_diff.py
+++ b/tests/gradients/core/test_adjoint_diff.py
@@ -148,7 +148,7 @@ def test_pauli_rotation_gradient(self, G, theta, tol, dev):
@pytest.mark.autograd
@pytest.mark.parametrize("theta", np.linspace(-2 * np.pi, 2 * np.pi, 7))
def test_Rot_gradient(self, theta, tol, dev):
- """Tests that the device gradient of an arbitrary Euler-angle-parameterized gate is
+ """Tests that the device gradient of an arbitrary Euler-angle-parametrized gate is
correct."""
params = np.array([theta, theta**3, np.sqrt(2) * theta])
diff --git a/tests/gradients/core/test_hadamard_gradient.py b/tests/gradients/core/test_hadamard_gradient.py
index ab225109fa9..9b0e01c5d2e 100644
--- a/tests/gradients/core/test_hadamard_gradient.py
+++ b/tests/gradients/core/test_hadamard_gradient.py
@@ -174,7 +174,7 @@ def test_pauli_rotation_gradient(self, G, theta, tol):
@pytest.mark.parametrize("theta", np.linspace(-2 * np.pi, 2 * np.pi, 7))
def test_rot_gradient(self, theta, tol):
- """Tests that the automatic gradient of an arbitrary Euler-angle-parameterized gate is correct."""
+ """Tests that the automatic gradient of an arbitrary Euler-angle-parametrized gate is correct."""
dev = qml.device("default.qubit", wires=2)
params = np.array([theta, theta**3, np.sqrt(2) * theta])
@@ -283,7 +283,7 @@ def test_ising_gradient(self, G, theta, tol):
@pytest.mark.parametrize("theta", np.linspace(-2 * np.pi, np.pi, 7))
def test_CRot_gradient_with_expansion(self, theta, tol):
- """Tests that the automatic gradient of an arbitrary controlled Euler-angle-parameterized
+ """Tests that the automatic gradient of an arbitrary controlled Euler-angle-parametrized
gate is correct."""
dev = qml.device("default.qubit", wires=3)
a, b, c = np.array([theta, theta**3, np.sqrt(2) * theta])
diff --git a/tests/gradients/parameter_shift/test_parameter_shift.py b/tests/gradients/parameter_shift/test_parameter_shift.py
index e680149aba6..8d8d17bfaa7 100644
--- a/tests/gradients/parameter_shift/test_parameter_shift.py
+++ b/tests/gradients/parameter_shift/test_parameter_shift.py
@@ -1373,7 +1373,7 @@ def test_pauli_rotation_gradient(self, mocker, G, theta, shift, tol):
@pytest.mark.parametrize("theta", np.linspace(-2 * np.pi, 2 * np.pi, 7))
@pytest.mark.parametrize("shift", [np.pi / 2, 0.3, np.sqrt(2)])
def test_Rot_gradient(self, mocker, theta, shift, tol):
- """Tests that the automatic gradient of an arbitrary Euler-angle-parameterized gate is correct."""
+ """Tests that the automatic gradient of an arbitrary Euler-angle-parametrized gate is correct."""
spy = mocker.spy(qml.gradients.parameter_shift, "_get_operation_recipe")
dev = qml.device("default.qubit", wires=1)
params = np.array([theta, theta**3, np.sqrt(2) * theta])
@@ -1447,7 +1447,7 @@ def test_controlled_rotation_gradient(self, G, tol):
@pytest.mark.parametrize("theta", np.linspace(-2 * np.pi, np.pi, 7))
def test_CRot_gradient(self, theta, tol):
- """Tests that the automatic gradient of an arbitrary controlled Euler-angle-parameterized
+ """Tests that the automatic gradient of an arbitrary controlled Euler-angle-parametrized
gate is correct."""
dev = qml.device("default.qubit", wires=2)
a, b, c = np.array([theta, theta**3, np.sqrt(2) * theta])
@@ -2714,7 +2714,7 @@ def test_pauli_rotation_gradient(self, mocker, G, theta, shift, tol):
@pytest.mark.parametrize("theta", np.linspace(-2 * np.pi, 2 * np.pi, 7))
@pytest.mark.parametrize("shift", [np.pi / 2, 0.3, np.sqrt(2)])
def test_Rot_gradient(self, mocker, theta, shift, tol):
- """Tests that the automatic gradient of an arbitrary Euler-angle-parameterized gate is correct."""
+ """Tests that the automatic gradient of an arbitrary Euler-angle-parametrized gate is correct."""
spy = mocker.spy(qml.gradients.parameter_shift, "_get_operation_recipe")
dev = qml.device("default.qubit", wires=1)
params = np.array([theta, theta**3, np.sqrt(2) * theta])
@@ -2784,7 +2784,7 @@ def test_controlled_rotation_gradient(self, G, tol):
@pytest.mark.parametrize("theta", np.linspace(-2 * np.pi, np.pi, 7))
def test_CRot_gradient(self, theta, tol):
- """Tests that the automatic gradient of an arbitrary controlled Euler-angle-parameterized
+ """Tests that the automatic gradient of an arbitrary controlled Euler-angle-parametrized
gate is correct."""
dev = qml.device("default.qubit", wires=2)
a, b, c = np.array([theta, theta**3, np.sqrt(2) * theta])
diff --git a/tests/gradients/parameter_shift/test_parameter_shift_shot_vec.py b/tests/gradients/parameter_shift/test_parameter_shift_shot_vec.py
index 6b855c01363..4ad2b84007f 100644
--- a/tests/gradients/parameter_shift/test_parameter_shift_shot_vec.py
+++ b/tests/gradients/parameter_shift/test_parameter_shift_shot_vec.py
@@ -556,7 +556,7 @@ def test_pauli_rotation_gradient(self, mocker, G, theta, shift, broadcast):
@pytest.mark.parametrize("theta", angles)
@pytest.mark.parametrize("shift", [np.pi / 2, 0.3])
def test_Rot_gradient(self, mocker, theta, shift, broadcast):
- """Tests that the automatic gradient of an arbitrary Euler-angle-parameterized gate is correct."""
+ """Tests that the automatic gradient of an arbitrary Euler-angle-parametrized gate is correct."""
spy = mocker.spy(qml.gradients.parameter_shift, "_get_operation_recipe")
shot_vec = tuple([1000000] * 2)
@@ -646,7 +646,7 @@ def test_controlled_rotation_gradient(self, G, broadcast):
@pytest.mark.parametrize("theta", angles)
def test_CRot_gradient(self, theta, broadcast):
- """Tests that the automatic gradient of an arbitrary controlled Euler-angle-parameterized
+ """Tests that the automatic gradient of an arbitrary controlled Euler-angle-parametrized
gate is correct."""
shot_vec = tuple([1000000] * 2)
dev = qml.device("default.qubit", wires=2, shots=shot_vec)
diff --git a/tests/logging/test_logging_autograd.py b/tests/logging/test_logging_autograd.py
index 8ae7a9baaa2..f1468358935 100644
--- a/tests/logging/test_logging_autograd.py
+++ b/tests/logging/test_logging_autograd.py
@@ -106,7 +106,7 @@ def circuit(params):
"diff_method,num_records", [("parameter-shift", 23), ("backprop", 14), ("adjoint", 18)]
)
def test_dq_qnode_execution_grad(self, caplog, diff_method, num_records):
- "Test logging of QNode with parameterised gradients"
+ "Test logging of QNode with parametrized gradients"
dev = qml.device("default.qubit", wires=2)
params = qml.numpy.array(0.1234)
diff --git a/tests/measurements/test_sample.py b/tests/measurements/test_sample.py
index d31ce97d4a5..9bf45028e46 100644
--- a/tests/measurements/test_sample.py
+++ b/tests/measurements/test_sample.py
@@ -458,7 +458,7 @@ class TestJAXCompatibility:
@pytest.mark.parametrize("samples", (1, 10))
def test_jitting_with_sampling_on_subset_of_wires(self, samples):
"""Test case covering bug in Issue #3904. Sampling should be jit-able
- when sampling occurs on a subset of wires. The bug was occuring due an improperly
+ when sampling occurs on a subset of wires. The bug was occurring due an improperly
set shape method."""
import jax
diff --git a/tests/ops/op_math/test_adjoint.py b/tests/ops/op_math/test_adjoint.py
index c8d20ead0b7..725537e8bcf 100644
--- a/tests/ops/op_math/test_adjoint.py
+++ b/tests/ops/op_math/test_adjoint.py
@@ -844,7 +844,7 @@ def test_error_adjoint_on_noncallable(obj):
class TestAdjointConstructorPreconstructedOp:
- """Test providing an already initalized operator to the transform."""
+ """Test providing an already initialized operator to the transform."""
@pytest.mark.parametrize(
"base", (qml.IsingXX(1.23, wires=("c", "d")), qml.QFT(wires=(0, 1, 2)))
diff --git a/tests/ops/op_math/test_prod.py b/tests/ops/op_math/test_prod.py
index 7963ce3fb6c..bebc7112f93 100644
--- a/tests/ops/op_math/test_prod.py
+++ b/tests/ops/op_math/test_prod.py
@@ -966,7 +966,7 @@ class DummyOp(Operator): # pylint:disable=too-few-public-methods
prod_op = prod(qml.Identity(wires=0), DummyOp(wires=0))
assert prod_op._queue_category is None
- def test_eigendecompostion(self):
+ def test_eigendecomposition(self):
"""Test that the computed Eigenvalues and Eigenvectors are correct."""
diag_prod_op = Prod(qml.PauliZ(wires=0), qml.PauliZ(wires=1))
eig_decomp = diag_prod_op.eigendecomposition
diff --git a/tests/ops/op_math/test_sum.py b/tests/ops/op_math/test_sum.py
index 85e6fd2bba3..c63fb0a4753 100644
--- a/tests/ops/op_math/test_sum.py
+++ b/tests/ops/op_math/test_sum.py
@@ -689,7 +689,7 @@ def test_eigvals_Identity_no_wires(self):
op2 = qml.X(0) + 2 * qml.I(0)
assert qml.math.allclose(sorted(op1.eigvals()), sorted(op2.eigvals()))
- def test_eigendecompostion(self):
+ def test_eigendecomposition(self):
"""Test that the computed Eigenvalues and Eigenvectors are correct."""
diag_sum_op = Sum(qml.PauliZ(wires=0), qml.Identity(wires=1))
eig_decomp = diag_sum_op.eigendecomposition
diff --git a/tests/ops/qubit/test_hamiltonian.py b/tests/ops/qubit/test_hamiltonian.py
index 77639be562c..b977a2f9f7a 100644
--- a/tests/ops/qubit/test_hamiltonian.py
+++ b/tests/ops/qubit/test_hamiltonian.py
@@ -1094,7 +1094,7 @@ def test_hermitian_tensor_prod(self):
assert isinstance(ham, qml.Hamiltonian)
def test_hamiltonian_pauli_rep(self):
- """Test that the pauli rep is set for a hamiltonain that is a linear combination of paulis."""
+ """Test that the pauli rep is set for a hamiltonian that is a linear combination of paulis."""
h = qml.Hamiltonian([1.0, 2.0], [qml.X(0) @ qml.Y(1), qml.Z(0) @ qml.Z(2)])
pw1 = qml.pauli.PauliWord({0: "X", 1: "Y"})
diff --git a/tests/optimize/test_qnspsa.py b/tests/optimize/test_qnspsa.py
index 602aa71adf1..66fa613cdd6 100644
--- a/tests/optimize/test_qnspsa.py
+++ b/tests/optimize/test_qnspsa.py
@@ -103,7 +103,7 @@ def get_metric_from_single_input_qnode(params, finite_diff_step, tensor_dirs):
perturb2 = dir2 * finite_diff_step
def get_state_overlap(params1, params2):
- # analytically computed state overlap between two parameterized ansatzes
+ # analytically computed state overlap between two parametrized ansatzes
# with input params1 and params2
return (
np.cos(params1[0][0] / 2) * np.cos(params2[0][0] / 2)
diff --git a/tests/optimize/test_riemannian_gradient_optimizer.py b/tests/optimize/test_riemannian_gradient_optimizer.py
index 74af2b24775..d3d3a91f71f 100644
--- a/tests/optimize/test_riemannian_gradient_optimizer.py
+++ b/tests/optimize/test_riemannian_gradient_optimizer.py
@@ -29,7 +29,7 @@ def circuit_1():
def circuit_2():
- """Simply parameterized circuit."""
+ """Simply parametrized circuit."""
qml.RX(0.1, wires=[0])
qml.RY(0.5, wires=[1])
qml.CNOT(wires=[0, 1])
diff --git a/tests/tape/test_tape.py b/tests/tape/test_tape.py
index dd9e6f99c86..734df641229 100644
--- a/tests/tape/test_tape.py
+++ b/tests/tape/test_tape.py
@@ -132,7 +132,7 @@ def test_tensor_observables_matmul(self):
def test_tensor_observables_rmatmul(self):
"""Test that tensor observables are correctly processed from the annotated
queue. Here, we test multiple tensor observables constructed via matmul
- with the observable occuring on the left hand side."""
+ with the observable occurring on the left hand side."""
with QuantumTape() as tape:
op_ = qml.RX(1.0, wires=0)
diff --git a/tests/templates/test_subroutines/test_commuting_evolution.py b/tests/templates/test_subroutines/test_commuting_evolution.py
index 96950dcc265..629bdadcab5 100644
--- a/tests/templates/test_subroutines/test_commuting_evolution.py
+++ b/tests/templates/test_subroutines/test_commuting_evolution.py
@@ -202,13 +202,13 @@ def test_differentiable_hamiltonian(self):
diff_coeffs = np.array([1.0, -1.0], requires_grad=True)
frequencies = (2, 4)
- def parameterized_hamiltonian(coeffs):
+ def parametrized_hamiltonian(coeffs):
return qml.Hamiltonian(coeffs, obs)
@qml.qnode(dev)
def circuit(time, coeffs):
qml.PauliX(0)
- qml.CommutingEvolution(parameterized_hamiltonian(coeffs), time, frequencies)
+ qml.CommutingEvolution(parametrized_hamiltonian(coeffs), time, frequencies)
return qml.expval(qml.PauliZ(0))
x_vals = [np.array(x, requires_grad=True) for x in np.linspace(-np.pi, np.pi, num=10)]
diff --git a/tests/templates/test_subroutines/test_qdrift.py b/tests/templates/test_subroutines/test_qdrift.py
index 8cb9a67cd52..83ef2e55ccb 100644
--- a/tests/templates/test_subroutines/test_qdrift.py
+++ b/tests/templates/test_subroutines/test_qdrift.py
@@ -58,7 +58,7 @@ def test_queuing(self):
@pytest.mark.parametrize("seed", (None, 1234, 42))
@pytest.mark.parametrize("coeffs, ops", test_hamiltonians)
def test_init_correctly(self, coeffs, ops, time, n, seed): # pylint: disable=too-many-arguments
- """Test that all of the attributes are initalized correctly."""
+ """Test that all of the attributes are initialized correctly."""
h = qml.dot(coeffs, ops)
op = qml.QDrift(h, time, n=n, seed=seed)
diff --git a/tests/templates/test_subroutines/test_trotter.py b/tests/templates/test_subroutines/test_trotter.py
index c4f65e31bc1..6ac6e2bd65f 100644
--- a/tests/templates/test_subroutines/test_trotter.py
+++ b/tests/templates/test_subroutines/test_trotter.py
@@ -415,7 +415,7 @@ def test_error_order(self, order):
@pytest.mark.parametrize("hamiltonian", test_hamiltonians)
def test_init_correctly(self, hamiltonian):
- """Test that all of the attributes are initalized correctly."""
+ """Test that all of the attributes are initialized correctly."""
time, n, order = (4.2, 10, 4)
op = qml.TrotterProduct(hamiltonian, time, n=n, order=order, check_hermitian=False)
diff --git a/tests/test_operation.py b/tests/test_operation.py
index a9938b66817..7d14d85a951 100644
--- a/tests/test_operation.py
+++ b/tests/test_operation.py
@@ -2948,7 +2948,7 @@ def test_use_legacy_opmath_fixture():
assert not qml.operation.active_new_opmath()
-CONVERT_HAMILTONAIN = [
+CONVERT_HAMILTONIAN = [
(
[1.5, 0.5, 1, 1],
[
@@ -2986,7 +2986,7 @@ def test_use_legacy_opmath_fixture():
@pytest.mark.usefixtures("use_new_opmath")
-@pytest.mark.parametrize("coeffs, obs", CONVERT_HAMILTONAIN)
+@pytest.mark.parametrize("coeffs, obs", CONVERT_HAMILTONIAN)
def test_convert_to_hamiltonian(coeffs, obs):
"""Test that arithmetic operators can be converted to Hamiltonian instances"""
diff --git a/tests/transforms/test_cliffordt_transform.py b/tests/transforms/test_cliffordt_transform.py
index 08184b9c075..ee6d685bdc1 100644
--- a/tests/transforms/test_cliffordt_transform.py
+++ b/tests/transforms/test_cliffordt_transform.py
@@ -285,7 +285,7 @@ def test_raise_with_cliffordt_decomposition(self):
@pytest.mark.parametrize("op", [qml.U1(1.0, wires=["b"])])
def test_raise_with_rot_decomposition(self, op):
- """Test that exception is correctly raise when decomposing parameterized gates for which we already don't have a recipe"""
+ """Test that exception is correctly raise when decomposing parametrized gates for which we already don't have a recipe"""
with pytest.raises(
ValueError,
@@ -314,7 +314,7 @@ def qfunc():
with pytest.raises(
NotImplementedError,
- match=r"Currently we only support Solovay-Kitaev \('sk'\) decompostion",
+ match=r"Currently we only support Solovay-Kitaev \('sk'\) decomposition",
):
decomposed_qfunc()
diff --git a/tests/transforms/test_defer_measurements.py b/tests/transforms/test_defer_measurements.py
index 52a65f924a5..b85de016d3f 100644
--- a/tests/transforms/test_defer_measurements.py
+++ b/tests/transforms/test_defer_measurements.py
@@ -918,7 +918,7 @@ def test_hermitian_queued(self):
assert isinstance(meas_op1, qml.CNOT)
assert meas_op1.wires == qml.wires.Wires([0, 5])
- # Check the underlying CNOT for reseting measured wire
+ # Check the underlying CNOT for resetting measured wire
meas_op1 = tape.operations[1]
assert isinstance(meas_op1, qml.CNOT)
assert meas_op1.wires == qml.wires.Wires([5, 0])
diff --git a/tests/transforms/test_transpile.py b/tests/transforms/test_transpile.py
index 4e77010e01e..aa2e7530ff8 100644
--- a/tests/transforms/test_transpile.py
+++ b/tests/transforms/test_transpile.py
@@ -63,7 +63,7 @@ def test_transpile_invalid_coupling(self):
with pytest.raises(ValueError, match=err_msg):
transpiled_qnode(0.1, 0.2, 0.3)
- def test_transpile_raise_not_implemented_hamiltonain_mmt(self):
+ def test_transpile_raise_not_implemented_hamiltonian_mmt(self):
"""test that error is raised when measurement is expectation of a Hamiltonian"""
dev = qml.device("default.qubit", wires=[0, 1, 2, 3])
coeffs = [1]