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

Remove Tensor handling from device #170

Merged
merged 3 commits into from
Nov 18, 2024
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

### Breaking changes 💔

* Support for the `pennylane.operation.Tensor` observable is removed. This observable was deprecated,
and is fully removed in PennyLane 0.40.
[(#170)](https://github.com/PennyLaneAI/pennylane-rigetti/pull/170)

### Deprecations 👋

### Documentation 📝
Expand Down
3 changes: 1 addition & 2 deletions pennylane_rigetti/qpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import numpy as np
from pennylane.measurements import Expectation
from pennylane.operation import Tensor
from pennylane.ops import Prod
from pennylane.tape import QuantumTape
from pyquil import get_qc
Expand Down Expand Up @@ -142,7 +141,7 @@ def expval(self, observable, shot_range=None, bin_size=None):
pauli_obs = sZ(wire)

# Multi-qubit observable
elif len(device_wires) > 1 and isinstance(observable, (Tensor, Prod)):
elif len(device_wires) > 1 and isinstance(observable, Prod):
# All observables are rotated to be measured in the Z-basis, so we just need to
# check which wires exist in the observable, map them to physical qubits, and measure
# the product of PauliZ operators on those qubits
Expand Down
Loading