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

Removed old return types #50

Merged
merged 6 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
* Support for Python 3.8 has been removed.
[(#49)](https://github.com/PennyLaneAI/pennylane-honeywell/pull/49)

* The old return type system has been removed.
[(#50)](https://github.com/PennyLaneAI/pennylane-honeywell/pull/50)

### Improvements

### Documentation
Expand Down
5 changes: 1 addition & 4 deletions pennylane_honeywell/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,7 @@ def execute(self, tape, **kwargs):
self._samples = self.generate_samples()

# compute the required statistics
if not qml.active_return():
results = self._statistics_legacy(tape)
else:
results = self.statistics(tape)
results = self.statistics(tape)

# Ensures that a combination with sample does not put
# expvals and vars in superfluous arrays
Expand Down
9 changes: 1 addition & 8 deletions tests/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,13 +882,9 @@ def circuit(x, y):
([0, 1, 1], REF_RESULTS_011),
],
)
@pytest.mark.parametrize("old_return", [True, False])
def test_reference_results_correct_expval(self, wire_flip_idx, ref_result, old_return, monkeypatch):
def test_reference_results_correct_expval(self, wire_flip_idx, ref_result, monkeypatch):
"""Tests that a simple circuit with a known specific result from the platform leads to the proper
expectation value in PennyLane."""
if old_return:
qml.disable_return()

num_wires = len(wire_flip_idx)
dev = qml.device(
"honeywell.hqs",
Expand Down Expand Up @@ -918,9 +914,6 @@ def circuit():
expected = (-1) ** np.array(wire_flip_idx)
assert np.all(expected == res)

if old_return:
qml.enable_return()

def test_analytic_error(self):
"""Test that instantiating the device with `shots=None` results in an error"""
with pytest.raises(ValueError, match="does not support analytic"):
Expand Down
Loading