Skip to content

Commit

Permalink
avoid deprecated obs.return_type (#146)
Browse files Browse the repository at this point in the history
* avoid deprecated obs.return_type

* Update CHANGELOG.md
  • Loading branch information
timmysilv authored Nov 10, 2023
1 parent f9fd652 commit ad74b16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

### Improvements 🛠

* Use `tape.measurements` instead of `tape.observables` to identify the type of measurement process
[(#146)](https://github.com/PennyLaneAI/pennylane-rigetti/pull/146)

### Breaking changes 💔

### Deprecations 👋
Expand All @@ -16,6 +19,8 @@

This release contains contributions from (in alphabetical order):

Matthew Silverman

---
# Release 0.33.0

Expand Down
2 changes: 1 addition & 1 deletion pennylane_rigetti/qpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def expval(self, observable, shot_range=None, bin_size=None):

def execute(self, circuit: QuantumTape, **kwargs):
self._skip_generate_samples = (
all(obs.return_type == Expectation for obs in circuit.observables)
all(mp.return_type is Expectation for mp in circuit.measurements)
and not self.parametric_compilation
)

Expand Down

0 comments on commit ad74b16

Please sign in to comment.