Skip to content

Commit

Permalink
Small fix for transform program and previous device API + typo (#4696)
Browse files Browse the repository at this point in the history
**Description of the Change:**

Successive QNode call with the previous device API would generate too
many expand functions. For the previous device the program is
initialized.
  • Loading branch information
rmoyard authored Oct 19, 2023
1 parent 8adc6ab commit 5f246a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pennylane/qnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,8 +982,8 @@ def __call__(self, *args, **kwargs) -> qml.typing.Result:
device_transform_program, config = self.device.preprocess(execution_config=config)
full_transform_program = self.transform_program + device_transform_program
else:
full_transform_program = self.transform_program
# Add the gradient expand to the porgram if necessary
full_transform_program = qml.transforms.core.TransformProgram(self.transform_program)
# Add the gradient expand to the program if necessary
if (
isinstance(self.gradient_fn, qml.transforms.core.TransformDispatcher)
and self.gradient_fn.expand_transform
Expand Down

0 comments on commit 5f246a9

Please sign in to comment.