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

Delete references to the removed QubitStateVector class #601

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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,8 @@

### Breaking changes 💔

* The ``qml.QubitStateVector`` template has been removed. Instead, use :class:`~pennylane.StatePrep`.
andrijapau marked this conversation as resolved.
Show resolved Hide resolved

### Deprecations 👋

### Documentation 📝
Expand All @@ -16,6 +18,8 @@

This release contains contributions from (in alphabetical order):

Andrija Paurevic

---
# Release 0.39.0

Expand Down
1 change: 0 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@
"of Google Inc."
],
"toc_overview": True,
"navbar_active_link": 3,
andrijapau marked this conversation as resolved.
Show resolved Hide resolved
"google_analytics_tracking_id": "G-C480Z9JL0D"
}

Expand Down
5 changes: 2 additions & 3 deletions pennylane_qiskit/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
"CRY": lib.CRYGate,
"CRZ": lib.CRZGate,
"PhaseShift": lib.PhaseGate,
"QubitStateVector": lib.Initialize,
"StatePrep": lib.Initialize,
"Toffoli": lib.CCXGate,
"QubitUnitary": lib.UnitaryGate,
Expand Down Expand Up @@ -527,7 +526,7 @@ def _function(*args, params: dict = None, wires: list = None, **kwargs):
elif instruction_name in inv_map:
operation_class = getattr(pennylane_ops, inv_map[instruction_name])
operation_args.extend(operation_params)
if operation_class in (qml.QubitStateVector, qml.StatePrep):
if operation_class is qml.StatePrep:
operation_args = [np.array(operation_params)]

elif isinstance(instruction, Measure):
Expand Down Expand Up @@ -747,7 +746,7 @@ def operation_to_qiskit(operation, reg, creg=None):

# Need to revert the order of the quantum registers used in
# Qiskit such that it matches the PennyLane ordering
if operation in ("QubitUnitary", "QubitStateVector", "StatePrep"):
if operation in ("QubitUnitary", "StatePrep"):
qregs = list(reversed(qregs))

if creg:
Expand Down
6 changes: 3 additions & 3 deletions pennylane_qiskit/qiskit_device_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def apply_operations(self, operations):

qregs = [self._reg[i] for i in device_wires.labels]

if operation in ("QubitUnitary", "QubitStateVector", "StatePrep"):
if operation in ("QubitUnitary", "StatePrep"):
# Need to revert the order of the quantum registers used in
# Qiskit such that it matches the PennyLane ordering
qregs = list(reversed(qregs))
Expand All @@ -327,9 +327,9 @@ def qubit_state_vector_check(self, operation):
operation (pennylane.Operation): operation to be checked

Raises:
DeviceError: If the operation is QubitStateVector or StatePrep
DeviceError: If the operation is StatePrep
"""
if operation in ("QubitStateVector", "StatePrep"):
if operation == "StatePrep":
if self._is_unitary_backend:
raise DeviceError(
f"The {operation} operation "
Expand Down
Loading