---
title: SolovayKitaevDecomposition (v1.3)
description: API reference for qiskit.synthesis.SolovayKitaevDecomposition in qiskit v1.3
source: https://quantum.cloud.ibm.com/docs/en/api/qiskit/1.3/qiskit.synthesis.SolovayKitaevDecomposition
---

# SolovayKitaevDecomposition

*class* `qiskit.synthesis.SolovayKitaevDecomposition(basic_approximations=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.3/qiskit/synthesis/discrete_basis/solovay_kitaev.py#L24-L185)

Bases: [`object`](https://docs.python.org/3/library/functions.html#object)

The Solovay Kitaev discrete decomposition algorithm.

This class is called recursively by the transpiler pass, which is why it is separeted. See [`qiskit.transpiler.passes.SolovayKitaev`](/docs/api/qiskit/1.3/qiskit.transpiler.passes.SolovayKitaev "qiskit.transpiler.passes.SolovayKitaev") for more information.

**Parameters**

**basic\_approximations** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*dict*](https://docs.python.org/3/library/stdtypes.html#dict)*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*, np.ndarray] |* [*list*](https://docs.python.org/3/library/stdtypes.html#list)*\[GateSequence] | None*) – A specification of the basic SU(2) approximations in terms of discrete gates. At each iteration this algorithm, the remaining error is approximated with the closest sequence of gates in this set. If a `str`, this specifies a `.npy` filename from which to load the approximation. If a `dict`, then this contains `{gates: effective_SO3_matrix}` pairs, e.g. `{"h t": np.array([[0, 0.7071, -0.7071], [0, -0.7071, -0.7071], [-1, 0, 0]]}`. If a list, this contains the same information as the dict, but already converted to `GateSequence` objects, which contain the SO(3) matrix and gates.

## Methods

### find\_basic\_approximation

`find_basic_approximation(sequence)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.3/qiskit/synthesis/discrete_basis/solovay_kitaev.py#L170-L185)

Find `GateSequence` in `self._basic_approximations` that approximates `sequence`.

**Parameters**

**sequence** (*GateSequence*) – `GateSequence` to find the approximation to.

**Returns**

`GateSequence` in `self._basic_approximations` that approximates `sequence`.

**Return type**

*GateSequence*

### load\_basic\_approximations

*static* `load_basic_approximations(data)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.3/qiskit/synthesis/discrete_basis/solovay_kitaev.py#L54-L96)

Load basic approximations.

**Parameters**

**data** ([*list*](https://docs.python.org/3/library/stdtypes.html#list)  *|*[*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*dict*](https://docs.python.org/3/library/stdtypes.html#dict)) – If a string, specifies the path to the file from where to load the data. If a dictionary, directly specifies the decompositions as `{gates: matrix}` or `{gates: (matrix, global_phase)}`. There, `gates` are the names of the gates producing the SO(3) matrix `matrix`, e.g. `{"h t": np.array([[0, 0.7071, -0.7071], [0, -0.7071, -0.7071], [-1, 0, 0]]}` and the `global_phase` can be given to account for a global phase difference between the U(2) matrix of the quantum gates and the stored SO(3) matrix. If not given, the `global_phase` will be assumed to be 0.

**Returns**

A list of basic approximations as type `GateSequence`.

**Raises**

[**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError) – If the number of gate combinations and associated matrices does not match.

**Return type**

[list](https://docs.python.org/3/library/stdtypes.html#list)\[GateSequence]

### run

`run(gate_matrix, recursion_degree, return_dag=False, check_input=True)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.3/qiskit/synthesis/discrete_basis/solovay_kitaev.py#L98-L137)

Run the algorithm.

**Parameters**

- **gate\_matrix** (*np.ndarray*) – The 2x2 matrix representing the gate. This matrix has to be SU(2) up to global phase.
- **recursion\_degree** ([*int*](https://docs.python.org/3/library/functions.html#int)) – The recursion degree, called $n$ in the paper.
- **return\_dag** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – If `True` return a [`DAGCircuit`](/docs/api/qiskit/1.3/qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit"), else a [`QuantumCircuit`](/docs/api/qiskit/1.3/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit").
- **check\_input** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – If `True` check that the input matrix is valid for the decomposition.

**Returns**

A one-qubit circuit approximating the `gate_matrix` in the specified discrete basis.

**Return type**

QuantumCircuit’ | ‘DAGCircuit
