Skip to content

Commit

Permalink
getting execution to work
Browse files Browse the repository at this point in the history
  • Loading branch information
albi3ro committed Dec 5, 2024
1 parent e724c62 commit ee64e45
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions pennylane/devices/qubit/dq_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def interpret_operation(self, op):
self.state = apply_operation(op, self.state, is_state_batched=self.is_state_batched)
if op.batch_size:
self.is_state_batched = True
return op

def interpret_measurement_eqn(self, eqn: "jax.core.JaxprEqn"):
if "mcm" in eqn.primitive.name:
Expand Down
22 changes: 11 additions & 11 deletions pennylane/ops/functions/iterative_qpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ def iterative_qpe(base, aux_wire, iters):
estimation and returns a list of mid-circuit measurements with qubit reset.
Args:
base (Operator): the phase estimation unitary, specified as an :class:`~.Operator`
aux_wire (Union[Wires, int, str]): the wire to be used for the estimation
iters (int): the number of measurements to be performed
base (Operator): the phase estimation unitary, specified as an :class:`~.Operator`
aux_wire (Union[Wires, int, str]): the wire to be used for the estimation
iters (int): the number of measurements to be performed
Returns:
list[MeasurementValue]: the abstract results of the mid circuit measurements
list[MeasurementValue]: the abstract results of the mid circuit measurements
.. seealso:: :class:`~.QuantumPhaseEstimation`, :func:`~.measure`
Expand All @@ -46,13 +46,13 @@ def iterative_qpe(base, aux_wire, iters):
@qml.qnode(dev)
def circuit():
# Initial state
qml.X(0)
# Initial state
qml.X(0)
# Iterative QPE
measurements = qml.iterative_qpe(qml.RZ(2.0, wires=[0]), aux_wire=1, iters=3)
# Iterative QPE
measurements = qml.iterative_qpe(qml.RZ(2.0, wires=[0]), aux_wire=1, iters=3)
return qml.sample(measurements)
return qml.sample(measurements)
.. code-block:: pycon
Expand Down Expand Up @@ -96,7 +96,7 @@ def cond_func(k):

qml.cond(meas, cond_func)(j)

g()
g() # pylint: disable=no-value-for-parameter

qml.Hadamard(wires=aux_wire)
m = qml.measure(wires=aux_wire, reset=True)
Expand All @@ -107,4 +107,4 @@ def cond_func(k):

return measurements, target

return f(measurements, base)[0]
return f(measurements, base)[0] # pylint: disable=no-value-for-parameter

0 comments on commit ee64e45

Please sign in to comment.