Skip to main contentIBM Quantum Documentation


qiskit.synthesis.SolovayKitaevDecomposition(basic_approximations=None) GitHub(opens in a new tab)

Bases: object(opens in a new tab)

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 for more information.


basic_approximations (str(opens in a new tab) |dict(opens in a new tab)[str(opens in a new tab), np.ndarray] | list(opens in a new tab)[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.



find_basic_approximation(sequence) GitHub(opens in a new tab)

Finds gate in self._basic_approximations that best represents sequence.


sequence (GateSequence) – The gate to find the approximation to.


Gate in basic approximations that is closest to sequence.

Return type



load_basic_approximations(data) GitHub(opens in a new tab)

Load basic approximations.


data (list(opens in a new tab) |str(opens in a new tab) |dict(opens in a new tab)) – 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}. 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]]}.


A list of basic approximations as type GateSequence.


ValueError(opens in a new tab) – If the number of gate combinations and associated matrices does not match.

Return type

list(opens in a new tab)[GateSequence]


run(gate_matrix, recursion_degree, return_dag=False, check_input=True) GitHub(opens in a new tab)

Run the algorithm.



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

Return type

QuantumCircuit’ | ‘DAGCircuit

Was this page helpful?
Report a bug or request content on GitHub.