# Z2Symmetries

`qiskit.quantum_info.Z2Symmetries(symmetries, sq_paulis, sq_list, tapering_values=None, *, tol=1e-14)`

GitHub(opens in a new tab)

Bases: `object`

(opens in a new tab)

The $Z_2$ symmetry converter identifies symmetries from the problem hamiltonian and uses them to provide a tapered - more efficient - representation of operators as Paulis for this problem. For each identified symmetry, one qubit can be eliminated in the Pauli representation at the cost of having to test two symmetry sectors (for the two possible eigenvalues - tapering values - of the symmetry). In certain problems such as the finding of the main operator’s ground state, one can a priori identify the symmetry sector of the solution and thus effectively reduce the computational overhead.

The following attributes can be read and updated once the `Z2Symmetries`

object has been constructed.

### tapering_values

Values determining the sector.

**Type**

list(opens in a new tab)[int(opens in a new tab)] or None

### tol

The tolerance threshold for ignoring real and complex parts of a coefficient.

**Type**

**References**

**[1]: Bravyi, S., et al, “Tapering off qubits to simulate fermionic Hamiltonians”**

arXiv:1701.08213(opens in a new tab)

**Parameters**

**symmetries**(*Iterable[**Pauli**]*) – Object representing the list of $Z_2$ symmetries. These correspond to the generators of the symmetry group $langle tau_1, tau_2dots rangle>$.**sq_paulis**(*Iterable[**Pauli**]*) – Object representing the list of single-qubit Pauli $sigma^x_{q(i)}$ anti-commuting with the symmetry $tau_i$ and commuting with all the other symmetries $tau_{jneq i}$. These operators are used to construct the unitary Clifford operators.**sq_list**(*Iterable[**int*(opens in a new tab)*]*) – The list of indices $q(i)$ of the single-qubit Pauli operators used to build the Clifford operators.**tapering_values**(*Iterable[**int*(opens in a new tab)*] | None*) – List of eigenvalues determining the symmetry sector for each symmetry.**tol**(*float*(opens in a new tab)) – Tolerance threshold for ignoring real and complex parts of a coefficient.

**Raises**

**QiskitError** – Invalid paulis. The lists of symmetries, single-qubit paulis support paulis and tapering values must be of equal length. This length is the number of applied symmetries and translates directly to the number of eliminated qubits.

## Attributes

### cliffords

Get clifford operators, built based on symmetries and single-qubit X.

**Returns**

A list of unitaries used to diagonalize the Hamiltonian.

### settings

Return operator settings.

### sq_list

Return sq list.

### sq_paulis

Return sq paulis.

### symmetries

Return symmetries.

## Methods

### convert_clifford

`convert_clifford(operator)`

This method operates the first part of the tapering. It converts the operator by composing it with the clifford unitaries defined in the current symmetry.

**Parameters**

**operator** (*SparsePauliOp*) – The to-be-tapered operator.

**Returns**

`SparsePauliOp`

corresponding to the converted operator.

**Return type**

### find_z2_symmetries

`classmethod find_z2_symmetries(operator)`

Finds Z2 Pauli-type symmetries of a `SparsePauliOp`

.

**Returns**

A `Z2Symmetries`

instance.

**Return type**

### is_empty

`is_empty()`

Check the z2_symmetries is empty or not.

**Returns**

Empty or not.

**Return type**

### taper

`taper(operator)`

Taper an operator based on the z2_symmetries info and sector defined by tapering_values. Returns operator if the symmetry object is empty.

The tapering is a two-step algorithm which first converts the operator into a `SparsePauliOp`

with same eigenvalues but where some qubits are only acted upon with the Pauli operators I or X. The number M of these redundant qubits is equal to the number M of identified symmetries.

The second step of the reduction consists in replacing these qubits with the possible eigenvalues of the corresponding Pauli X, giving 2^M new operators with M less qubits. If an eigenvalue sector was previously identified for the solution, then this reduces to 1 new operator with M less qubits.

**Parameters**

**operator** (*SparsePauliOp*) – The to-be-tapered operator.

**Returns**

[`SparsePauliOp`

]; otherwise, `SparsePauliOp`

.

**Return type**

If tapering_values is None

### taper_clifford

`taper_clifford(operator)`

Operate the second part of the tapering. This function assumes that the input operators have already been transformed using `convert_clifford()`

. The redundant qubits due to the symmetries are dropped and replaced by their two possible eigenvalues.

**Parameters**

**operator** (*SparsePauliOp*) – Partially tapered operator resulting from a call to `convert_clifford()`

.

**Returns**

[`SparsePauliOp`

]; otherwise, `SparsePauliOp`

.

**Return type**

If tapering_values is None