Skip to content

Commit

Permalink
[skip ci] Removing skips from more vjp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mudit2812 committed Mar 19, 2024
1 parent 2a7ff4f commit aeee6ae
Show file tree
Hide file tree
Showing 2 changed files with 433 additions and 405 deletions.
6 changes: 6 additions & 0 deletions pennylane_lightning/lightning_qubit/_adjoint_jacobian.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ def calculate_vjp(self, tape: QuantumTape, grad_vec):
"Adjoint differentiation does not support State measurements."
)

if any(m.return_type is not Expectation for m in tape.measurements):
raise QuantumFunctionError(
"Adjoint differentiation method does not support expectation return type "
"mixed with other return types"
)

# Proceed, because tape_return_type is Expectation.
if len(grad_vec) != len(measurements):
raise ValueError(
Expand Down
Loading

0 comments on commit aeee6ae

Please sign in to comment.