Introduction

Random quantum states, sampled from Haar measure, have broad applications in quantum supremacy1,2, quantum communication3, quantum metrology4, and fidelity benchmarking5,6. In addition, reduced density matrices of random states have also attracted extensive interest owing to the strong connection between quantum chaos and black hole physics7,8,9,10. Entanglement is a crucial property of quantum states11,12,13,14,15,16,17, and it is expected that random quantum states may hold universal entanglement characteristics, which can be classified into different phases18,19,20,21,22.

The classification of phases is based on the entanglement between two subsystems of a tripartite random state, with the remaining party regarded as an environment. The entanglement between subsystems is quantified by the negativity, which is an effectively computable measure of entanglement for quantum states, particularly for mixed states23,24,25,26,27. Negativity also plays a significant role in diagnosing finite-temperature topological order of toric code28, entanglement properties of diffusive fermion model29, replica symmetry breaking in holography30 and finite-temperature phase transitions31. By modifying the sizes of subsystems and environment, a transition from positive partial transpose (PPT) states with a vanishing negativity to negative partial transpose (NPT) states with a non-zero negativity was numerically predicted in the large Hilbert space limit19,20. Recently, another phase transition between two types of NPT states was uncovered theoretically22. However, the experimental observation is still absent since the complexity of the generation of random quantum states grows exponentially with the system size32, and the measurement of entanglement is experimentally challenging33,34,35,36,37,38,39,40,41,42.

In this work, we report our experiments in probing entanglement negativity transition for pseudo-random quantum states using a fully connected superconducting quantum processor. A fully connected quantum processor may enhance the entangling power of shallow circuits compared with short-range connected processors and facilitate the realization of random quantum states. We apply the parallel entangling gates to realize the pseudo-random quantum circuits for generating pseudo-random states of 7–15 qubits, which can mimic specific statistical properties of random states43,44,45,46,47,48,49,50. The all-to-all architecture of our processor, which has been suggested to realize polynomial or exponential improvements in some quantum algorithms51,52, helps to decrease the circuit depth and exposure to noise. Then, we utilize the quantum state tomography (QST) to directly obtain reduced density matrices of subsystems with six qubits53,54,55,56,57,58 and calculate the negativity spectra. Other proposals to explore negativity require either multiple copies of target states25,27 or global random unitary operators59, which are both demanding for the present noisy intermediate-scale quantum devices. Our results represent the first experimental investigation of the entanglement negativity transition for random quantum states. It should be noted that many efforts have been made in studying negativity experimentally60,61. Our results are established on the reconstruction of reduced density matrices, which contain complete entanglement information in the mixed states.

Results

Our processor contains 20 frequency-tunable transmon qubits and one central resonator. We use 15 qubits in the experiments and tune the frequencies of remaining qubits lower than 4 GHz. All qubits are capacitively coupled to the central resonator, as shown in Fig. 1a, where qubits used in the experiments are labeled by \({Q}_{j}\) with \(j\in \{{{{{\mathrm{1,2}}}}},\ldots,15\}\) and the central resonator is denoted as \({{{{{\mathcal{R}}}}}}\). Each qubit can be addressed by its separate XY line and Z line, which allows us to apply single-qubit or multi-qubit gates to specified qubits. Each layer of the pseudo-random circuit is composed of N random single-qubit gates sampled from Haar measure on the SU(2) group and a global entangling gate U. By controlling the amplitudes and phases of Gaussian-enveloped microwave pulses transmitted by the XY lines, as shown in Fig. 1b, we can fulfill different rotation gates \({R}_{\varphi }(\theta )\) within a 15 ns duration \({\tau }_{{{{{{\rm{rot}}}}}}}\), where \({R}_{\varphi }\left(\theta \right)={e}^{-i({{\cos }}\varphi {\sigma }^{x}+{{\sin }}\varphi {\sigma }^{y})/2}\). In order to realize a random single-qubit gate, we decompose each single-qubit gate into two successive rotation gates \({R}_{\varphi }(\theta )\) of which rotation axes both lie in the xy plane62. The global entangling gate U acting on the N qubits is defined as

$$U={{\exp }}\left[-i{\tau }_{{{{{{\rm{ent}}}}}}}\mathop{\sum }_{i\, < \,j}^{N}{J}_{{ij}}\left({\sigma }_{i}^{+}{\sigma }_{j}^{-}+{\sigma }_{j}^{+}{\sigma }_{i}^{-}\right)\right],$$
(1)

where \({\sum }_{i \, < \, j}^{N}\,\,{J}_{{ij}}({\sigma }_{i}^{+}{\sigma }_{j}^{-}+{\sigma }_{j}^{+}{\sigma }_{i}^{-})\) is the effective Hamiltonian of selective N qubits by equally detuning them from resonator \({{{{{\mathcal{R}}}}}}\) with the other qubits being far off-resonant63,64. \({\sigma }_{j}^{+}\) (\({\sigma }_{j}^{-}\)) is the raising (lowering) operator for \({Q}_{j}\), \({J}_{{ij}}\) is the effective coupling strength between \({Q}_{i}\) and \({Q}_{j}\) (Fig. 1c), and \({\tau }_{{{{{{\rm{ent}}}}}}}\) is the evolution time of about 40 ns. As the layer of circuits increases, the measure over pseudo-random circuits converges to the Haar measure exponentially though the rate of convergence decreases exponentially with the number of qubits43,65.

Fig. 1: Quantum simulator and experimental pulse sequences.
figure 1

a False-color optical micrograph with highlighting various circuit elements. Qubits (yellow) are labeled from \({Q}_{1}\) to \({Q}_{15}\) and the central resonator (red) capacitively coupled to all qubits is labeled as \({{{{{\mathcal{R}}}}}}\). Each labeled qubit can be controlled by its XY line (red) and Z line (blue), and measured through the readout resonator (green). The device used here is the same one used in refs. 63, 69. b The pulse sequences of a pseudo-random circuit and its equivalent gate model. \(U\) is a global entangling gate and each cubic box is a random single-qubit gate. c The schematic representation of the effective coupling graph of 15 qubits with an equal detuning \(\Delta /2\pi \approx -360\) MHz from the central resonator.

By dividing all qubits into three parts, \({A}_{1}\), \({A}_{2}\) and \(B\), which are comprised of \({N}_{{A}_{1}}\), \({N}_{{A}_{2}}\) and \({N}_{B}\) qubits, respectively, we regard the union of \({A}_{1}\) and \({A}_{2}\) as a system \(A\) and \(B\) as the environment of \(A\). After applying a \(d\)-layer pseudo-random circuit to the initial state \({\left|0\right\rangle }^{\otimes N}\), we perform QST on the system qubits to estimate the reduced density matrix \({\rho }_{A}\). The tomography of states relies on measuring all system qubits in the eigenvectors of \({\sigma }_{j}^{x}\), \({\sigma }_{j}^{y}\), and \({\sigma }_{j}^{z}\). The measurement of \({\sigma }_{j}^{z}\) is direct by defining \({\sigma }_{j}^{z}\equiv|{0}_{j}\rangle \langle {0}_{j}|-|{1}_{j}\rangle \langle {1}_{j}|\). By inserting a \(\pi /2\) rotation pulse X/2 (Y/2) before the readout pulse of \({Q}_{j}\), we can measure the state in the \({\sigma }_{j}^{y}\) (\({\sigma }_{j}^{x}\)) basis. The whole pulse sequence for the QST including the state generation, the tomography operation, and the readout takes about two \(\mu\)s. With \({3}^{{N}_{A}}\) tomography operations and \({2}^{{N}_{A}}\) probabilities for each operation, we can reconstruct the state of system qubits (see Supplementary Note 5). Then we calculate the negativity \({{{{{{\mathcal{N}}}}}}}_{{A}_{1}:{A}_{2}}\) between \({A}_{1}\) and \({A}_{2}\) according to

$${{{{{{\mathcal{N}}}}}}}_{{A}_{1}:{A}_{2}}=\frac{{{||}{\rho }_{A}^{{T}_{1}}{||}}_{1}-1}{2},$$
(2)

where \({{||O||}}_{1}={{{{{\rm{Tr}}}}}}(\sqrt{{{{{O}}}}^{{{\dagger}} }{{{O}}}})\) is the trace norm and \({\rho }_{A}^{{T}_{1}}\) represents the partial transpose of the density matrix of \(A\) with respect to the subsystem \({A}_{1}\). \({{{{{{\mathcal{N}}}}}}}_{{A}_{1}:{A}_{2}}\) can also be written as the absolute value of sum of all negative eigenvalues of \({\rho }_{A}^{{T}_{1}}\). All eigenvalues of \({\rho }_{A}^{{T}_{1}}\) constitute the negativity spectrum. Another associated entanglement measure, logarithmic negativity, can be deduced from negativity by \({{{{{{\mathcal{E}}}}}}}_{{A}_{1}:{A}_{2}}={{\log }}(2{{{{{{\mathcal{N}}}}}}}_{{A}_{1}:{A}_{2}}+1)\). In the following context, the negativity is referred to as the logarithmic negativity.

The volume or size \({L}_{i}\) of part \(i\) is defined as the dimension \({2}^{{N}_{i}}\) of the Hilbert space \({{{{{{\mathcal{H}}}}}}}_{i}\) where \(i\) = \({A}_{1}\), \({A}_{2}\) and \(B\). \({\rho }_{A}\) is a PPT state if \({L}_{A}\equiv {2}^{{N}_{A}}={2}^{{{N}_{A}}_{1}+{N}_{{A}_{2}}} > {L}_{B}/4\); otherwise, it is an NPT state19,20,22. NPT states can be furthermore classified into maximally entangled (ME) states and entanglement saturation (ES) states via negativity22. The phase diagram of the reduced density matrix \({\rho }_{A}\) (when \(N\to \infty\)) shown in Fig. 2a, is divided into three phase regions PPT (I), ME (II), and ES (III), dependent on the ratio \({N}_{{A}_{1}}/{N}_{A}\) and \({N}_{A}/N\) 22. To characterize the transition from PPT to NPT, which occurs at \({N}_{B}={N}_{A}+2\) 19,20,22, we fix the sizes of two subsystems as \({N}_{{A}_{1}}=2\) and \({N}_{{A}_{2}}=4\), and decrease the number of environment qubits \({N}_{B}\) from 9 to 7 by biasing the unused qubits far off-resonant, as shown in Fig. 2b. After drawing 20 instances of pseudo-random circuits with five layers, of which depth is enough to capture statistical features in the simulation (see Supplementary Note. 3), the negativity spectra of \({\rho }_{A}\) for different environment sizes are illustrated in Fig. 2d–f. The distribution of the negativity spectrum is in close agreement with the semi-circle law18,19,20,21,22, i.e.,

$$P\left(\xi \right)=\frac{2{L}_{A}}{\pi {a}^{2}}\sqrt{{a}^{2}-{\left(\xi -\frac{1}{{L}_{A}}\right)}^{2}},\left|\xi -\frac{1}{{L}_{A}}\right| < a,$$
(3)

where \(P(\xi )\) is the probability density of negativity spectrum and \(a\equiv 2/\sqrt{{L}_{A}{L}_{B}}\) is the radius. Note that \({N}_{{A}_{1}}\), \({N}_{{A}_{2}}\) and \({N}_{B}\) are chosen to satisfy \({L}_{B}{L}_{A_2}\gg {L}_{{A}_{1}}\) to meet the prerequisite of semi-circle law19,20,22. When \({N}_{B}=9\), the negativity spectrum contains no negative values, which indicates that the system belongs to the PPT phase. Then we remove one environment qubit, sample new pseudo-random circuits, and apply them to the remaining qubits. Now the minimum of the negativity spectrum is close to zero, which shows an expected correspondence with the phase transition condition. Repeating the above procedure for seven environment qubits yields the distribution of the negativity spectrum which partly covers the negative domain, ensuring the existence of non-zero negativity between subsystems.

Fig. 2: Phase diagram and negativity spectra.
figure 2

a Analytical phase diagram of reduced density matrix \({\rho }_{A}\) when \(N\to \infty\). Green arrow indicates a path along which the negativity is plotted in Fig. 3a. Blue or brown arrows indicate paths along which the negativity is plotted in Fig. 3b. b, c Cartoons of subsystems and environment. Green, blue, and orange sectors represent subsystems \({A}_{1}\), \({A}_{2}\) and environment \(B\), respectively. d–f Negativity spectra sampled from pseudo-random circuits where \({N}_{{A}_{1}}=2\), \({N}_{{A}_{2}}=4\) and \({N}_{B}=\) 9, 8, or 7. gi Negativity spectra sampled from pseudo-random circuits where \({N}_{{A}_{1}}=2\), \({{N}_{A}}_{2}=4\) and \({N}_{B}=\) 3, 2 or 1. One of the density matrices sampled from circuits with different sizes of environment is shown in the northeast corner of di.

The second phase transition from ES to ME occurs at \(\left|{N}_{{A}_{1}}-{N}_{{A}_{2}}\right |={N}_{B}\). We still keep \({N}_{{A}_{1}}=2\) and \({N}_{{A}_{2}}=4\), and lower \({N}_{B}\) from 3 to 1 to detect the phase transition. The negativity spectra drawn from 20 instances of four-layer pseudo-random circuits are shown in Fig. 2g–i. In contrast with the negativity spectra obtained for \({N}_{B}\ge 7\), the negativity spectrum for \({N}_{B}=3\) has a wider distribution and the center of the distribution is close to zero, as displayed in Fig. 2g. In Fig. 2h, we can observe a sharp peak located at zero emerging in the distribution of negativity spectrum with \({N}_{B}=2\), which is diverging for \(N\to \infty\) 22. Next, we set \({N}_{B}=1\) and show the distribution of negativity spectra in Fig. 2i where we exclude some eigenvalues in the vicinity of zero (see Supplementary Note. 4). The remaining eigenvalues are split into two disjoint parts. The distribution of each part can be approximated by the Marčenko-Pastur distribution22.

Figure 3a incorporates the logarithmic negativities derived from the negativity spectra for different environment sizes. We average the negativities over all combinations of subsystem qubits for each sampled density matrix. We also show the negativities derived from the density matrices modified to alleviate decoherence errors in Fig. 3, where we use truncated eigenvalue decomposition such that the purity of the modified density matrix is close to the mean purity of density matrices sampled without decoherence errors (see Supplementary Note. 6). We start from the PPT (I) phase with zero negativity, enter the ES (III) phase at \({N}_{B}=8\), and arrive at the ME (II) phase when \({N}_{B}=2\). The related path in the phase diagram can be described by the vertical green line shown in Fig. 2a. To distinguish the ME and SE phases, we change the ratio between the two subsystems \({A}_{1}\) and \({A}_{2}\), but keep the environment invariant. Another benefit of QST is that we can compute the negativity between any two parts of the system without additional measurements. As a comparison to the aforementioned results, we also measure the density matrices of six system qubits without environment qubits. When \({N}_{B}=0\), the negativity grows linearly with the number of \({N}_{{A}_{1}}\), which resembles a Page curve. However, the growth of negativity is depressed and saturated at \({N}_{{A}_{1}}={N}_{{A}_{2}}=3\) when considering three environment qubits. These results can be interpreted heuristically as follows: First, if there exists no environment \(B\), system \(A\) is totally entangled. Thus, the entanglement between two subsystems is proportional to the size of the minimal one. Second, if subsystem \({A}_{1}\) is larger than \({A}_{2}\) plus \(B\), \({A}_{2}\) and \(B\) will be entangled entirely to \({A}_{1}\). Then we can deduce that there are \({N}_{{A}_{2}}\) pairs of entangled qubits in system \(A\). Since the number of maximally entangled pairs between \({A}_{1}\) and \({A}_{2}\) is \({N}_{{A}_{2}}\), we call this phase the maximally entangled phase. Third, if \({A}_{1}\) and \({A}_{2}\) are comparable in size and \(({N}_{{A}_{1}}+{N}_{{A}_{2}}) \, > \, {N}_{B}\), environment \(B\) will be entangled with \({A}_{1}\) and \({A}_{2}\) in a way where \({A}_{1}\) and \({A}_{2}\) have the same number of remaining qubits to entangle with each other. Hence, the entanglement between \({A}_{1}\) and \({A}_{2}\) is roughly \(({N}_{A}-{N}_{B})/2\), and we call this phase the entanglement saturation phase. Finally, these results can be recapped by the following formula22

$$\left\langle {{{{{{\mathcal{E}}}}}}}_{{A}_{1}:{A}_{2}}\right \rangle \approx \left\{\begin{array}{ll}0,\quad \quad \quad \quad \quad \quad & {N}_{A} \, < \,{N}_{B},\hfill \\ \frac{1}{2}\left({N}_{A}-{N}_{B}\right)+c,& {N}_{{A}_{s}} \, < \,\frac{N}{2},\,s=1,2\,{{{{{\rm{and}}}}}}\,{N}_{A} \, > \,{N}_{B},\\ {{\min }}\left({{N}_{A}}_{1},\,{N}_{{A}_{2}}\right),& {{{{{\rm{otherwise}}}}}},\hfill\end{array}\right.$$
(4)

where \(c=\log (8/3\pi )\).

Fig. 3: Averaged logarithmic negativity \(\langle {{{{{{\boldsymbol{ {\mathcal E}}}}} }}}_{{{{{{{\boldsymbol{A}}}}}}}_{1}:{{{{{{\boldsymbol{A}}}}}}}_{2}}\rangle\).
figure 3

The error bars represent standard error of the mean over circuit instances. a Fix \({N}_{{A}_{1}}=2\) and \({N}_{{A}_{2}}=4\), then decrease \({N}_{B}\) from 9 to 1. b Fix \({N}_{B}=\) 3 or 0 and increase \({N}_{{A}_{1}}\) from 0 to 6. When \({N}_{B}=0\), the negativity approximately obeys volume law. In contrast, the negativity is saturated from \({N}_{{A}_{1}}=2\) to 4 when \({N}_{B}=3\).

Another distinctive aspect of random circuits is that the output bit-string probabilities \(p\left(x\right) \equiv {\left|\langle {x|}\psi \rangle \right|}^{2}\) approaches the Porter-Thomas (PT) distribution, i.e., \(\Pr ({Lp})={e}^{ - {Lp}}\), with increasing depth, where \(|\psi \rangle\) is the output state of a circuit and x {0, 1}N 1,2,66,67,68. Figure 4a illustrates three histograms of the full output bit-string probabilities collected from 300 pseudo-random circuit instances for nine qubits with layers \(d=2\), \(3\) and \(4\), where small probabilities \(( < 1/L)\) show more often compared to the large probabilities \(( > 4/L)\). The dark solid line in Fig. 4a represents the PT distribution. It is clear that the distribution from three-layer circuits is closest to the PT distribution. To quantify the distance between the measured distribution and the PT distribution over layers, we use the Kullback-Leibler divergence, defined as \({D}_{{{{{{\rm{KL}}}}}}}=S\left({P}_{{{{{{\rm{meas}}}}}}},{P}_{{{{{{\rm{PT}}}}}}}\right)-S({P}_{{{{{{\rm{meas}}}}}}})\) where \(S({P}_{{{{{{\rm{meas}}}}}}},{P}_{{{\rm{PT}}}})\) is the cross entropy between the measured distribution \({P}_{{{{{{\rm{meas}}}}}}}\) and the PT distribution \({P}_{{{{{{\rm{PT}}}}}}}\), and \(S({P}_{{{{{{\rm{meas}}}}}}})\) is the self-entropy of the measured distribution67,69. \({D}_{{{{{{\rm{KL}}}}}}}(\ge 0)\) is zero if and only if two distributions are identical. As shown in Fig. 4b, \({D}_{{{{{{\rm{KL}}}}}}}\) reaches the minimum after three layers, which verifies the observation. Then \({D}_{{{{{{\rm{KL}}}}}}}\) increases over layers attributed to the decoherence errors67,69. Although the output of three-layer circuits for nine qubits is closest to the PT distribution in experiments, we observe that three-layer circuits are not deep enough for the negativity spectra to converge (see Supplementary Note. 3), suggesting the states to be not random enough, hence we implement deeper circuits in the negativity experiments. See also Supplementary Note. 9 where we discuss the effect of decoherence on bitstring probability distributions.

Fig. 4: Histograms of output bit-string probabilities sampling from pseudo-random circuits for nine qubits and KL divergence.
figure 4

a Three histograms are sampled from two, three and four layers of circuits. Dark solid line represents the PT distribution. b The KL divergence between the sampling distribution and the PT distribution over layers.

Discussion

We investigate the negativity spectrum of pseudo-random mixed states through QST on a fully-connected quantum processor. On account of the flexibility of tuning qubits, we can observe two phase transitions, from the PPT phase to the ES phase and from the ES phase to the ME phase, by biasing specified qubits far off-resonant. From the PPT phase to the ES phase, the distributions of negativity spectra can be well described by the semi-circle law19,20,22. From the ES phase to the ME phase, the distributions of negativity spectra in experiments are more concentrated at zero than in simulations due to decoherence errors. We also check the randomness of our circuits over different layers by comparing the distribution of probabilities of output bit-string with the Porter-Thomas distribution. The KL divergence between two distributions over layers decreases from 1 to 3 and increases from 3 to 8. Decoherence errors are the main obstructions in precisely measuring the negativity in experiments, which mix a random density matrix with a maximally mixed state and diminish the entanglement1,2. However, major features of the negativity spectrum of different phases can still be captured by our processor. Based on the pseudo-random circuit approach proposed in this work, our processor can also be a promising platform to study the measurement-induced phase transitions in all-to-all circuits by inserting local measurements70,71, which can be realized after suppressing decoherence errors of the processor in the future.

Methods

Experimental device

As shown in Fig. 1a, the device consists of 20 transmon qubits coupled to a central resonator bus \({{{{{\mathcal{R}}}}}}\) . In our experiment, we choose 15 qubits of them labeled by \({Q}_{j}\) with \(j\in \{{{{{\mathrm{1,2}}}}},...,15\}\), which can be individually controlled by their XY lines and Z lines. The anharmonicities of qubits \({\eta }_{j}\) all lie within the range −260 MHz <\({\eta }_{j}/2\pi\) <−240 MHz. After arranging the idle frequency \({\omega }_{j}\) of each qubit by its Z line, we can decrease the crosstalk of XY lines between different qubits when performing single rotation gates such as X gates to all qubits simultaneously. In Supplementary Table 1, we list more details of 15 qubits used in the experiment. The frequency of central resonator \({{{{{\mathcal{R}}}}}}\) is fixed at \({\omega }_{r}/2\pi\) = 5.51 GHz. The full Hamiltonian of the device can be written as (\(\hslash=1\))

$$H={\omega }_{r}{a}_{r}^{{{\dagger}} }{a}_{r}+\mathop{\sum }_{j=1}^{15}\left[{\omega }_{j}|{1}_{j}\right\rangle \left\langle {1}_{j} |+{g}_{j}\left({\sigma }_{j}^{+}{a}_{r}+{a}_{r}^{{{\dagger}} }{\sigma }_{j}^{-}\right)\right]+\mathop{\sum }_{i \, < \, j}^{15}\,{J}_{{ij}}^{c}\left({\sigma }_{i}^{+}{\sigma }_{j}^{-}+{\sigma }_{j}^{+}{\sigma }_{i}^{-}\right),$$
(5)

where \({a}_{r}\) (\({a}_{r}^{{{\dagger}} }\)) denotes the annihilation (creation) operator of \({{{{{\mathcal{R}}}}}}\), \({\sigma }_{j}^{-}\) (\({\sigma }_{j}^{+}\)) denotes the lowering (raising) operator of qubit \({Q}_{j}\), \({g}_{j}\) represents the coupling strength between qubit \({Q}_{j}\) and resonator \({{{{{\mathcal{R}}}}}}\), and \({J}_{{ij}}^{c}\) represents the small direct coupling between \({Q}_{i}\) and \({Q}_{j}\). By equally detuning the frequencies of all qubits from that of \({{{{{\mathcal{R}}}}}}\) by \(\Delta\) and eliminating the resonator mode, we can realize the interactions between all pairs of qubits through the resonator. Now the Hamiltonian can be written as

$$H=\mathop{\sum }_{i \, < \, j}^{15}\,{J}_{{ij}}\left({\sigma }_{i}^{+}{\sigma }_{j}^{-}+{\sigma }_{j}^{+}{\sigma }_{i}^{-}\right),$$
(6)

where \({J}_{{ij}}={J}_{{ij}}^{c}+{g}_{i}{g}_{j}/\Delta\). The effective coupling strength \({J}_{{ij}}\), as shown in Supplementary Fig. 1, can be determined in the experiment through the single photon swapping process between \({Q}_{i}\) and \({Q}_{j}\).

Sample from the Haar measure on SU(2)

As shown in the main text, we decompose an arbitrary SU(2) operator into two rotations of which rotation axes both lie in the \({xy}\) plane, so that the SU(2) operator can be described by the following parameters:

  1. 1.

    \(\varphi\), the angle between the rotation axe of the first rotation and \(x\) axis;

  2. 2.

    \(\theta\), the rotation angle of the first rotation;

  3. 3.

    \(\phi\), the angle between the rotation axis of the second rotation and x axis.

The rotation angle of the second rotation is always \(\pi\). Then the total operation can be written as

$${R}_{\phi }\left(\pi \right){R}_{\varphi }\left(\theta \right)= -{{\sin }}\frac{\theta }{2}{{\cos }}\left(\varphi -\phi \right)-i\,{{\cos }}\phi \,{{\cos }}\frac{\theta }{2}{\sigma }^{x}\\ -i\,{{\sin }}\phi \,{{\cos }}\frac{\theta }{2}{\sigma }^{y}-i\,{{\sin }}\frac{\theta }{2}{{\sin }}\left(\varphi -\phi \right){\sigma }^{z}.$$
(7)

Since any SU(2) operator sampled from Haar measure can be written as32,72

$$\left(\begin{array}{ll}\cos \alpha \,{e}^{i\beta } & \sin \alpha \,{e}^{i\gamma }\\ -\,\sin \alpha \,{e}^{-i\gamma } & \cos \alpha \,{e}^{-i\beta }\end{array}\right)= \,\cos \alpha \,\cos \beta+i\,\sin \alpha \,\sin \gamma \,{\sigma }^{x}\\ + i\,\sin \alpha \,\cos \gamma \,{\sigma }^{y}+i\,\cos \alpha \,\sin \beta \,{\sigma }^{z},$$
(8)

where \(\alpha\), \(\beta\) and \(\gamma\) are taken from the intervals

$$0\le \alpha \le \frac{\pi }{2},0\le \beta < 2\pi,0\le \gamma \, < \,2\pi,$$
(9)

we obtain

$$\theta=\pi -2\alpha,\quad \phi=\frac{\pi }{2}-\gamma,\quad\varphi=\phi+\beta .$$
(10)

For each random single-qubit gate in experiments, we firstly draw \(\beta\) and \(\gamma\) uniformly from the intervals in Eq. (9), then we draw another parameter \(\xi\) from \([{{{{\mathrm{0,1}}}}}]\) uniformly and take the angle \(\alpha\) as arcsin \((\sqrt{\xi })\) 32,72. Then we can obtain the experiment parameters \(\theta\), \(\phi\) and \(\varphi\) by substituting \(\alpha\), \(\beta\) and \(\gamma\) into Eq. (10). Besides, virtual \({R}_{z}\) gates are applied to each qubit after each frequency switch between the idle frequency \({\omega }_{j}\) and the entanglement frequency \({\omega }_{{{{{{\rm{ent}}}}}}}\).