Skip to content

Commit

Permalink
remove deprecated clifford get/set item (#11555)
Browse files Browse the repository at this point in the history
* remove deprecated clifford getitem and setitum

* add release note

* Update releasenotes/notes/deprecate_clifford_indexing-5e3500301a696bdc.yaml

Co-authored-by: Julien Gacon <gaconju@gmail.com>

* Update releasenotes/notes/deprecate_clifford_indexing-5e3500301a696bdc.yaml

---------

Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
Co-authored-by: Julien Gacon <gaconju@gmail.com>
  • Loading branch information
3 people authored Jan 15, 2024
1 parent 75c30e2 commit 7039037
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
19 changes: 0 additions & 19 deletions qiskit/quantum_info/operators/symplectic/clifford.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from qiskit.quantum_info.operators.operator import Operator
from qiskit.quantum_info.operators.scalar_op import ScalarOp
from qiskit.quantum_info.operators.symplectic.base_pauli import _count_y
from qiskit.utils.deprecation import deprecate_func
from qiskit.synthesis.linear import calc_inverse_matrix

from .base_pauli import BasePauli
Expand Down Expand Up @@ -228,24 +227,6 @@ def copy(self):

# pylint: disable=bad-docstring-quotes

@deprecate_func(
since="0.24.0",
package_name="qiskit-terra",
additional_msg="Instead, index or iterate through the Clifford.tableau attribute.",
)
def __getitem__(self, key):
"""Return a stabilizer Pauli row"""
return self.table.__getitem__(key)

@deprecate_func(
since="0.24.0",
package_name="qiskit-terra",
additional_msg="Use Clifford.tableau property instead.",
)
def __setitem__(self, key, value):
"""Set a stabilizer Pauli row"""
self.tableau.__setitem__(key, self._stack_table_phase(value.array, value.phase))

@property
def symplectic_matrix(self):
"""Return boolean symplectic matrix."""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
upgrade:
- |
Remove deprecated ``__getitem__``/``__setitem__`` magic methods of
:class:`~qiskit.quantum_info.operators.symplectic.Clifford`.
The methods were deprecated since Qiskit 0.44, released on July 2023. Instead, index or iterate through the :attr:`.Clifford.tableau` attribute.

0 comments on commit 7039037

Please sign in to comment.