Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs #4269

Merged
merged 12 commits into from
Jun 21, 2023
1 change: 0 additions & 1 deletion pennylane/gradients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ def circuit(weights):

ops = [
qml.RX(weights[0], wires=0),

qml.RY(weights[1], wires=1),
qml.CNOT(wires=[0, 1]),
qml.RX(weights[2], wires=1)]
Expand Down
2 changes: 1 addition & 1 deletion pennylane/operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ def compute_matrix(*params, **hyperparams): # pylint:disable=unused-argument
The canonical matrix is the textbook matrix representation that does not consider wires.
Implicitly, this assumes that the wires of the operator correspond to the global wire order.

.. seealso:: :meth:`.Operator.matrix` and :func:`qml.matrix`
.. seealso:: :meth:`.Operator.matrix` and :func:`qml.matrix() <pennylane.matrix>`

Args:
*params (list): trainable parameters of the operator, as stored in the ``parameters`` attribute
Expand Down
2 changes: 1 addition & 1 deletion pennylane/pulse/convenience_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def wrapped(p, t):
time = jnp.linspace(0, 10, 1000)
timespan=(2, 7)
y = qml.pulse.pwc(timespan)(params, time)
plt.plot(time, y, label=f"params={params},\ntimespan={timespan}")
plt.plot(time, y, label=f"params={params}, timespan={timespan}")
plt.legend()
plt.show()

Expand Down
2 changes: 1 addition & 1 deletion pennylane/tape/qscript.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class QuantumScript:
>>> s_vec = [1, 1, 2, 2, 2]
>>> qscript = QuantumScript([qml.Hadamard(0)], [qml.expval(qml.PauliZ(0))], shots=s_vec)
>>> qscript.shots.shot_vector
(ShotCopies(shots=1, copies=2), ShotCopies(shots=2, copies=3))
(ShotCopies(1 shots x 2), ShotCopies(2 shots x 3))

``ops``, ``measurements``, and ``prep`` are converted to lists upon initialization,
so those arguments accept any iterable object:
Expand Down
5 changes: 4 additions & 1 deletion pennylane/transforms/batch_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def my_transform(tape, a, b):
'''Generates two tapes, one with all RX replaced with RY,
and the other with all RX replaced with RZ.'''

ops1 = []
ops2 = []

# loop through all operations on the input tape
for op in tape._ops:
if op.name == "RX":
Expand All @@ -94,7 +97,7 @@ def my_transform(tape, a, b):
ops1.append(op)
ops2.append(op)

tape1 = qml.tape.QuantumTape(ops1, tape.measurments, tape._prep)
tape1 = qml.tape.QuantumTape(ops1, tape.measurements, tape._prep)
tape2 = qml.tape.QuantumTape(ops2, tape.measurements, tape._prep)

def processing_fn(results):
Expand Down