StabilizerTable.unique

StabilizerTable.unique(return_index=False, return_counts=False)[source]

Return unique stabilizers from the table.

Example

from qiskit.quantum_info.operators import StabilizerTable

st = StabilizerTable.from_labels(['+X', '+I', '-I', '-X', '+X', '-X', '+I'])
unique = st.unique()
print(unique)
StabilizerTable: ['+X', '+I', '-I', '-X']
Parameters
  • return_index (bool) – If True, also return the indices that result in the unique array. (Default: False)

  • return_counts (bool) – If True, also return the number of times each unique item appears in the table.

Returns

unique

the table of the unique rows.

unique_indices: np.ndarray, optional

The indices of the first occurrences of the unique values in the original array. Only provided if return_index is True.

unique_counts: np.array, optional

The number of times each of the unique values comes up in the original array. Only provided if return_counts is True.

Return type

StabilizerTable