Skip to content

Commit

Permalink
Fix indexing in code example
Browse files Browse the repository at this point in the history
  • Loading branch information
mudit2812 committed Sep 17, 2024
1 parent 86e3dcb commit bc68858
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pennylane/templates/subroutines/arbitrary_unitary.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class ArbitraryUnitary(Operation):
.. code-block:: python
def arbitrary_nearest_neighbour_interaction(weights, wires):
for w in range(0, len(wires) - 1, 2):
ArbitraryUnitary(weights, wires=[w, w + 1])
for i, w in enumerate(range(0, len(wires) - 1, 2)):
ArbitraryUnitary(weights[i], wires=[w, w + 1])
Args:
weights (tensor_like): The angles of the Pauli word rotations, needs to have length :math:`4^n - 1`
Expand Down

0 comments on commit bc68858

Please sign in to comment.