Skip to content

Commit 89edc3a

Browse files
committed
function signature
1 parent a13ee5c commit 89edc3a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

frontend/catalyst/from_plxpr.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,13 @@ class SubroutineInterpreter(PlxprInterpreter):
274274
* does not allocate a new register upon beginning,
275275
* does not deallocate the quantum register upon ending,
276276
* and it does not release the quantum device back to the runtime.
277+
278+
Args:
279+
device (qml.devices.Device)
280+
shots (qml.measurements.Shots)
277281
"""
278282

279-
def __init__(self, device, shots):
283+
def __init__(self, device, shots: qml.measurements.Shots | int):
280284
self._device = device
281285
self._shots = self._extract_shots_value(shots)
282286
self.stateref = None
@@ -413,10 +417,6 @@ def eval(self, jaxpr: "jax.core.Jaxpr", consts: Sequence, *args) -> list:
413417
*args (tuple[TensorLike]): The arguments for the jaxpr.
414418
Returns:
415419
list[TensorLike]: the results of the execution.
416-
"""
417-
raise NotImplementedError("Unreachable code until we add subroutine feature")
418-
419-
"""
420420
421421
# We assume we have at least one argument (the qreg)
422422
assert len(args) > 0
@@ -438,9 +438,10 @@ def eval(self, jaxpr: "jax.core.Jaxpr", consts: Sequence, *args) -> list:
438438
439439
return outvals
440440
"""
441+
raise NotImplementedError("Unreachable code until we add subroutine feature")
441442

442443

443-
class QFuncPlxprInterpreter(SubroutineInterpreter, PlxprInterpreter):
444+
class QFuncPlxprInterpreter(SubroutineInterpreter):
444445
"""An interpreter that converts plxpr into catalyst-variant jaxpr.
445446
446447
Args:
@@ -449,9 +450,6 @@ class QFuncPlxprInterpreter(SubroutineInterpreter, PlxprInterpreter):
449450
450451
"""
451452

452-
def __init__(self, device, shots: qml.measurements.Shots | int):
453-
super().__init__(device, shots)
454-
455453
def setup(self):
456454
"""Initialize the stateref and bind the device."""
457455
if self.stateref is None:

0 commit comments

Comments
 (0)