Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@

<h3>Documentation 📝</h3>

* Small typos in the docstring for `qml.noise.partial_wires` have been corrected.
[(#8052)](https://github.com/PennyLaneAI/pennylane/pull/8052)

* Updated the code examples in the documentation of :func:`~.specs`.
[(#8003)](https://github.com/PennyLaneAI/pennylane/pull/8003)

Expand Down
12 changes: 6 additions & 6 deletions pennylane/noise/conditionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,32 +664,32 @@ def partial_wires(operation, *args, **kwargs):

>>> func = qml.noise.partial_wires(qml.RX(1.2, [12]))
>>> func(2)
qml.RX(1.2, wires=[2])
RX(1.2, wires=[2])
>>> func(qml.RY(1.0, ["wires"]))
qml.RX(1.2, wires=["wires"])
RX(1.2, wires=["wires"])

Additionally, an :class:`Operation <pennylane.operation.Operation>` class can
also be provided, while providing required positional arguments via ``args``:

>>> func = qml.noise.partial_wires(qml.RX, 3.2, [20])
>>> func(qml.RY(1.0, [0]))
qml.RX(3.2, wires=[0])
RX(3.2, wires=[0])

Moreover, one can use ``kwargs`` instead of positional arguments:

>>> func = qml.noise.partial_wires(qml.RX, phi=1.2)
>>> func(qml.RY(1.0, [2]))
qml.RX(1.2, wires=[2])
RX(1.2, wires=[2])
>>> rfunc = qml.noise.partial_wires(qml.RX(1.2, [12]), phi=2.3)
>>> rfunc(qml.RY(1.0, ["light"]))
qml.RX(2.3, wires=["light"])
RX(2.3, wires=["light"])

Finally, one may also use this with an instance of
:class:`MeasurementProcess <pennylane.measurement.MeasurementProcess>`

>>> func = qml.noise.partial_wires(qml.expval(qml.Z(0)))
>>> func(qml.RX(1.2, wires=[9]))
qml.expval(qml.Z(9))
expval(Z(9))
"""
if callable(operation):
op_class, op_type = _process_callable(operation)
Expand Down