Skip to content

Commit

Permalink
Delete references to the removed QubitStateVector class (#601)
Browse files Browse the repository at this point in the history
* remove qsv and update changelog

* try to fix sphinx

* Update CHANGELOG.md

Co-authored-by: Mudit Pandey <[email protected]>

---------

Co-authored-by: Mudit Pandey <[email protected]>
  • Loading branch information
andrijapau and mudit2812 authored Nov 14, 2024
1 parent 08ef9e6 commit 0122cce
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

### Breaking changes 💔

* The ``qml.QubitStateVector`` template has been removed. Instead, use :class:`~pennylane.StatePrep`.
[(#601)](https://github.com/PennyLaneAI/pennylane-qiskit/pull/601)

### Deprecations 👋

### Documentation 📝
Expand All @@ -16,6 +19,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,
"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

0 comments on commit 0122cce

Please sign in to comment.