Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure active return check doesn't break CI #483

Merged
merged 5 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

### Bug fixes

* Ensure PennyLane has an `active_return` attribute before calling it.
[(#483)] (https://github.com/PennyLaneAI/pennylane-lightning/pull/483)

* Do no import `sqrt2_v` from `<numbers>` in `Util.hpp` to resolve issue with Lightning-GPU builds.
[(#479)](https://github.com/PennyLaneAI/pennylane-lightning/pull/479)

Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.32.0-dev11"
__version__ = "0.32.0-dev12"
4 changes: 3 additions & 1 deletion pennylane_lightning/lightning_kokkos/lightning_kokkos.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,9 @@ def adjoint_jacobian(self, tape, starting_state=None, use_device_state=False):
jac = jac.reshape(-1, len(trainable_params))
jac_r = np.zeros((jac.shape[0], processed_data["all_params"]))
jac_r[:, processed_data["record_tp_rows"]] = jac
return self._adjoint_jacobian_processing(jac_r) if qml.active_return() else jac_r
if hasattr(qml, "active_return"): # pragma: no cover
return self._adjoint_jacobian_processing(jac_r) if qml.active_return() else jac_r
return self._adjoint_jacobian_processing(jac_r)

# pylint: disable=inconsistent-return-statements, line-too-long
def vjp(self, measurements, grad_vec, starting_state=None, use_device_state=False):
Expand Down
4 changes: 3 additions & 1 deletion pennylane_lightning/lightning_qubit/lightning_qubit.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,9 @@ def adjoint_jacobian(self, tape, starting_state=None, use_device_state=False):
jac = jac.reshape(-1, len(trainable_params))
jac_r = np.zeros((jac.shape[0], processed_data["all_params"]))
jac_r[:, processed_data["record_tp_rows"]] = jac
return self._adjoint_jacobian_processing(jac_r) if qml.active_return() else jac_r
if hasattr(qml, "active_return"): # pragma: no cover
return self._adjoint_jacobian_processing(jac_r) if qml.active_return() else jac_r
return self._adjoint_jacobian_processing(jac_r)

# pylint: disable=line-too-long, inconsistent-return-statements
def vjp(self, measurements, grad_vec, starting_state=None, use_device_state=False):
Expand Down
Loading