# A question about how does the single qubit gate simulated in simulator?

I have found the procedure of simulation process as this picture :

Image reference. So in the low-level compilers, all single-qubit gates are approximated by the universal gate set (CNOT, H, T, S).

When implementing arbitrary gates, I want to know if all simulators (like Qiskit) will do the low-level compilers job in this picture with a fixed accuracy. If so, what is the algorithm during this process? Are they using the Solovay-Kitaev Decomposition strategy (or some improved algorithm)?

Generally, a simulator does not have to do any decomposition of gates to hardware-level specifics. Simulators only follow a mathematical model of a gate (described by matrix). Since each algorithm can be described by a matrix, whole simulation can be expressed as $$|\psi_1\rangle = U |\psi_0\rangle$$, where $$|\psi_0\rangle$$ is initial state of a quantum computer, $$|\psi_1\rangle$$ is its final state and $$U$$ is a matrix describing algorithm. Hence, a simulation is reduced to matrix multiplication.

Some simulators artifically introduce noise present on real quantum hardware. This can be done by perturbation of matrices describing gates by a random variable.

Of course, it is possible to constrain a gate set on a simulator to have it more similar to real quantum processors. However, as I mentioned above, in the end you can have any gate you want, you are not constrained by quantum hardware specifics (unless you want to be) and any decomposition is not necessary.

Note: My answer is concerning gate-based computers. Adiabatic quantum computers case may be different.

• U said the simulator does not decompose a single qubit gate and the hardware can also realize any single qubit gate. If so, why so many people focus on the decomposition strategy? and As you said if I want to do so in simulator, which strategy is popular or is used in state-of-art simulators? Commented Jul 1, 2020 at 7:43
• Decomposition refers to finding the equivalent quantum circuit of a given matrix describing a gate. For example, look at the iso() function in Qiskit: qiskit.org/documentation/stubs/… Commented Jul 1, 2020 at 9:41
• The gate decomposition is necessary for actual quantum hardware as there is a constrained gate set which can be implemented on actual quantum processor. This is a reson why to seek for decomposition strategies. Commented Jul 2, 2020 at 9:44
• But the question is, Superconductors use different entangling gates, if I remember correctly IBM uses a gate called the 'Cross-Resonance gate' which I think is a ZX rotation gate, and on the Google Sycamore chip, they use a gate which ends up being a combination of CZ and iSWAP. Those gates are not constrained gate set, so do you mean the actual quantum processor first implement the ZX rotation gates(just for example) and then decompose it into constrained gate set? Commented Jul 2, 2020 at 11:26
• @Henry_Fordham: I am not expert on physical design, so I cannot give you answer. However, the original question was about simulators. Commented Jul 3, 2020 at 6:14