QPanda3
0.1.0
Supported by OriginQ
|
Prev Tutorial: Quantum Simulator
Next Tutorial: Quantum Circuit Transpiler
Noise Simulation in Quantum Virtual Machines In real quantum computers, computational errors are inevitable due to the physical properties of qubits. To better simulate these errors in quantum virtual machines, QPanda2 introduces a noisy quantum virtual machine on the basis of QuantumMachine. The simulation of noisy quantum virtual machines is closer to real quantum computers. By customizing the types of supported logic gates and their corresponding noise models, the quantum programs we develop with QPanda2 will achieve a higher degree of realism in practical applications.
The amplitude_damping_error represents the relaxation noise model of a qubit. Its Kraus operators are defined as follows:
\[ K_1 = \begin{bmatrix} 1 & 0 \\ 0 & \sqrt{1 - p} \end{bmatrix}, \quad K_2 = \begin{bmatrix} 0 & \sqrt{p} \\ 0 & 0 \end{bmatrix} \]
This model requires a single noise parameter.
The phase_damping_error represents the dephasing noise model of a qubit. Its Kraus operators are defined as follows:
\[ K_1 = \begin{bmatrix} \sqrt{1 - p} & 0 \\ 0 & \sqrt{1 - p} \end{bmatrix}, \quad K_2 = \begin{bmatrix} \sqrt{p} & 0 \\ 0 & -\sqrt{p} \end{bmatrix} \]
This model requires a single noise parameter.
The decoherence_error combines the above two models (relaxation and dephasing noise). Their relationship is described as follows:
\[ P_{\text{damping}} = 1 - e^{-\frac{t_{\text{gate}}}{T_1}}, \quad P_{\text{dephasing}} = 0.5 \times \big(1 - e^{-(\frac{t_{\text{gate}}}{T_2} - \frac{t_{\text{gate}}}{2T_1})}\big) \]
The combined Kraus operators are:
\[ K_1 = K_{1_{\text{damping}}} K_{1_{\text{dephasing}}}, \quad K_2 = K_{1_{\text{damping}}} K_{2_{\text{dephasing}}}, \quad K_3 = K_{2_{\text{damping}}} K_{1_{\text{dephasing}}}, \quad K_4 = K_{2_{\text{damping}}} K_{2_{\text{dephasing}}} \]
This model requires three noise parameters.
The depolarizing_error represents depolarizing noise, where a single qubit may collapse into a completely mixed state (I/2) with a certain probability. The Kraus operators are:
\[ K_1 = \sqrt{1 - 3p/4} \cdot I, \quad K_2 = \sqrt{p}/2 \cdot X, \quad K_3 = \sqrt{p}/2 \cdot Y, \quad K_4 = \sqrt{p}/2 \cdot Z \]
Here, \(I, X, Y, Z \) represent the quantum logic gate matrices.
This model requires a single noise parameter.
The pauli_x_error represents pauli_x_error noise. Its Kraus operators are defined as follows:
\[ K_1 = \begin{bmatrix} \sqrt{1 - p} & 0 \\ 0 & \sqrt{1 - p} \end{bmatrix}, \quad K_2 = \begin{bmatrix} 0 & \sqrt{p} \\ \sqrt{p} & 0 \end{bmatrix} \]
This model requires a single noise parameter.
The pauli_y_error represents bit-phase flip noise. Its Kraus operators are:
\[ K_1 = \begin{bmatrix} \sqrt{1 - p} & 0 \\ 0 & \sqrt{1 - p} \end{bmatrix}, \quad K_2 = \begin{bmatrix} 0 & -i \times \sqrt{p} \\ i \times \sqrt{p} & 0 \end{bmatrix} \]
This model requires a single noise parameter.
The phase_damping_error represents phase damping noise. Its Kraus operators are:
\[ K_1 = \begin{bmatrix} 1 & 0 \\ 0 & \sqrt{1 - p} \end{bmatrix}, \quad K_2 = \begin{bmatrix} 0 & 0 \\ 0 & \sqrt{p} \end{bmatrix} \]
This model requires a single noise parameter.
The noise errors and noise models in pyqpanda3 are separated. Firstly, we need to construct the noise errors, and then set them through the noise model. In the morning, the model can be set to support which quantum bits and specific quantum logic gates
The NoiseModel can be used to set noise errors, including specific applications to quantum bits and quantum logic gates