Skip to content

Commit

Permalink
manual merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dwierichs committed May 7, 2024
1 parent 0e4b609 commit bb8102d
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 230 deletions.
4 changes: 2 additions & 2 deletions pennylane/gradients/parameter_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def _single_meas_grad(result, coeffs, unshifted_coeff, r0):
If an unshifted term exists, its contribution is added to the gradient.
"""
if isinstance(result, (list, tuple)) and (result == [] or result == ()):
if isinstance(result, tuple) and result == ():
if unshifted_coeff is None:
raise ValueError(
"This gradient component neither has a shifted nor an unshifted component. "
Expand Down Expand Up @@ -424,7 +424,7 @@ def processing_fn(results):
grads.append(None)
continue
# The gradient for this parameter is computed from r0 alone.
g = _evaluate_gradient(tape_specs, [], data, r0, batch_size)
g = _evaluate_gradient(tape_specs, (), data, r0, batch_size)
grads.append(g)
continue

Expand Down
Loading

0 comments on commit bb8102d

Please sign in to comment.