SpinQ Gemini: a desktop quantum computing platform for education and research

SpinQ Gemini is a commercial desktop quantum computing platform designed and manufactured by SpinQ Technology. It is an integrated hardware-software system. The first generation product with two qubits was launched in January 2020. The hardware is based on NMR spectrometer, with permanent magnets providing ∼1 T magnetic field. SpinQ Gemini operates under room temperature (0–30°C), highlighting its lightweight (55 kg with a volume of 70×40×80 cm3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$70\times 40 \times 80\text{ cm}^{3}$\end{document}), cost-effective (under 50k USD), and maintenance-free. SpinQ Gemini aims to provide real-device experience for quantum computing education for K-12 and at the college level. It also features quantum control design capabilities that benefit the researchers studying quantum control and quantum noise. Since its first launch, SpinQ Gemini has been shipped to institutions in Canada, Taiwan and Mainland China. This paper introduces the system of design of SpinQ Gemini, from hardware to software. We also demonstrate examples for performing quantum computing tasks on SpinQ Gemini, including one task for a variational quantum eigensolver of a two-qubit Heisenberg model. The next generations of SpinQ quantum computing devices will adopt models of more qubits, advanced control functions for researchers with comparable cost, as well as simplified models for much lower cost (under 5k USD) for K-12 education. We believe that low-cost portable quantum computing products will facilitate hands-on experience for teaching quantum computing at all levels, well-prepare younger generations of students and researchers for the future of quantum technologies.

Traditional NMR quantum computing is performed on commercial spectrometers with a superconducting magnet. Those spectrometers are expensive (almost 1 million USD), large (can be as high as ∼3 meters), and need to work in specially designed labs. They also require regular liquid nitrogen and helium refills for maintenance. These issues on cost, weight, volume and extreme physical conditions also in general exist on other systems for quantum computing, making them hard to be accessible for users in real life, but instead with only possible access on cloud, such as IBM Q [32], IonQ [33] and Rigetti. 1 As an example, superconducting qubits need to work in dilution fridges which usually cost almost 1 million USD. Similar to the superconducting NMR systems, they require special lab conditions and are not portable. Furthermore, special training is needed for operations of dilution fridges [34][35][36][37][38][39][40].
With the development of permanent magnet technology in recent years [41], it is possible to bring down the size and cost of NMR spectrometers [42][43][44][45][46]. This then makes the NMR technology an ideal choice for building portable quantum platforms. By using a permanent magnet providing 1 T magnetic fields, SpinQ Gemini highlights its lightweight (55 kg with a volume of 70 × 40 × 80 cm 3 ) and cost-effective (under 50k USD) features, and maintenance-free, making it portable almost like a desktop PC.
Customised quantum algorithm circuit design and programming are supported on SpinQ Gemini using its software SpinQuasar (Fig. 1). SpinQ Gemini also provides demonstrations of > 10 famous quantum algorithms, such as Deutsch algorithm [47], Grover algorithm [48,49], and HHL algorithm [50]. It also has build-in teaching examples for quantum mechanic, such as Rabi oscillation observation and decoherence time measurement.
Gemini not only provides a very friendly platform for non-specialists who aim to learn quantum computing basics and quantum programming fast, but also serves as a powerful tool for quantum computing related research.
In this paper, we introduce the system of the first generation SpinQ Gemini. In Sec. 2, we discuss the system design, from hardware to software. In Sec. 3, we discuss how to perform quantum computing with SpinQ Gemini. We give two concrete examples of quantum computing tasks performed on SpinQ Gemini, one on the measurement of geometric phase of mixed state in Sec. 4, and the other on a variational quantum eigensolver for a two-qubit Heisenberg model in Sec. 5. A discussion on future plans of next generations products will follow in Sec. 6.
We believe that low-cost portable quantum computing products will facilitate handson experience for teaching quantum computing at all levels, well-prepare younger generations for the future of quantum technologies. It will also be accessible to a wider range of researchers to operate under real world conditions for quantum computers, benefiting them for further studies on quantum control and quantum noise.

System
The overall schematic diagram is shown in Fig. 2. Gemini is composed of a PC with Spin-Quasar, a control system on the master board, a radio frequency (RF) system, a temperature control module, a pair of permanent magnets, a field shimming system, and a tube of sample.
The PC with SpinQuasar and the master board together realize the algorithms and interfaces to all the functions. The magnets provide stable static magnetic field. The field Figure 2 The overview of the schematic diagram of Gemini system and the interface SPINQUASAR. The master board equipped with an FPGA, provides the control logic of Gemini. SPINQUASAR communicates with FPGA through USB so that the user can access Gemini. The magnets, together with the temperature control unit and the field shimming system provide a stable static homogeneous magnetic field. The RF module provides the function required to control and measure the qubits Software structure. The software could be divided into two parts: one (the left block) we called SPINQUASAR provides an interface for users with access to all the functions of Gemini, the other (the right block) realizes the algorithms and controls required for Gemini to function properly. These two parts communicate with each other through USB shimming system and temperature control system together make the field stable and homogeneous enough for nuclear magnetic resonance as well as quantum computing. The RF system provides generation, modulation, amplification, transmission, detection and reception of the RF pulses and signals so that we can control and measure the quantum system.
The PC with SpinQuasar and the master board altogether realize the software part. The modules are shown in Fig. 3. The software SpinQuasar provides an interface for a user to communicate with Gemini. The master board, of which the core device is an FPGA, realizes all the algorithms to control the pulses (hence control the quantum state), the temperature and shimming of the field (hence generate a stable homogeneous field). SpinQuasar and the master board communicate with each other through USB.

SpinQuasar
The left half of Fig. 3 shows the structure of SpinQuasar. It is composed of five modules: the quantum computing module, the NMR spectroscopy module, the instrument calibration module, the task management module and the dynamic library module. These modules can be easily accessed from the homepage of SpinQuasar, as shown in Fig. 1(b).
The quantum computing module provides an interface of a two-qubit quantum computer and will be discussed later in Sec. 3.
The NMR spectroscopy module provides an interface of direct accessing to the 1 H and 31 P nuclear magnetic resonance signal of our sample. It provides the direct control of the pulse parameters on the two nuclei. Also, it provides both the free induction decay (FID) signals and the spectra after fast Fourier transform (FFT). This interface provides a good demonstration of a modern FFT based NMR spectrometer.
The instrument calibration module provides an interface for users to calibrate the parameters of the spectrometer, such as field shimming, phase calibration, and the temperature control for the system.
Gemini also supports cloud quantum computing where one can access to it from the Internet [51]. For cloud quantum computing, the tasks are managed by the task management module. Also, to support more complicated control, such as the variational quantum eigensolver (VQE) which requires adjusting the parameters of the pulses, we provide the APIs for programmable control, and embedded these into the dynamic library.

Master board
The master board integrates the digital parts of the hardware, including an FPGA, an analog-digital converter (ADC) and a digital-analog converter (DAC). The digital parts, as shown in the right block of Fig. 3, altogether realize the algorithms required to generate the RF pulse, measure the readout signal, control the temperature and shimming. These algorithms will be described further in the introduction of each module. The ADC converts the readout signal from the RF part as measurement, while the DAC generates the initial RF signal for state manipulation.

Magnets
The permanent magnets provide a stable static homogeneous magnetic field, which split the nuclei with spin-half into two energy levels and therefore the spin becomes a qubit. The permanent magnets are two NdFeB plates. The field generated is ∼1 Tesla. The field near the center of the two magnets is roughly homogeneous: the homogeneity generated by such magnets can reach a level of ∼20 ppm. Compared with modern commercial NMR spectrometers, of which the magnet is generated by the superconducting coil that requires a large cryogenic storage dewar and regular refilling of liquid helium and nitrogen, the magnets of Gemini work under room temperature, hence are maintenance free and portable. The disadvantages are that the magnitude of the magnetic field could only reach about 2 T, and it is highly sensitive to the temperature of the magnets themselves.

Sample
The sample we use is Dimethylphosphite ((CH 3 O) 2 PH). The 31 P and 1 H atom are connected directly and provide a two-qubit quantum processor. Both 31 P and 1 H nuclei have a 1/2-spin, and therefore have two energy levels. The Lamor frequency of 31

RF pulse generation
The states of the nuclei could be manipulated by irradiating electro-magnetic waves (pulses) with frequencies close to there Larmor frequency (the physics behind this will be described later). Since the Larmor frequencies of the two nuclei lie in the range of RF range, an RF system is designed and manufactured to operate the quantum state and realize the quantum gates. The largest RF power that can be applied is ∼2 W, and the linear range of the power amplifier is 0∼1 W. Pulses as short as 10 us and 20 us can be applied to realize 90 degree rotations of the 1 H and 31 P spins. While the default built-in sample in Gemini is Dimethylphosphite and the band-pass filters are optimized for 1 H and 31 P signals, the RF transmission and NMR reception parts as shown in Fig. 5 can work in the frequency range of 0∼100 MHz. This means it is possible to use this RF system to perform NMR spectroscopy on other nuclear species whose frequencies fall in this range after adjusting the band-pass filters. Only the 1 H spin that is directly corrected to the 31 P spin is used as a qubit. The J coupling between the 1 H and 31 P nuclear spins is 697.4 Hz. The control pulses are on resonance with 1 H and 31 P spins and thus their frequency offsets are both 0 Hz. The spin Hamiltonian is The Fourier transform spectrum of the 1 H spin which is directly connected to 31 P, obtained using Gemini. The small spikes between the two major peaks are due to non-idea removal of the signals of the 1 H spins in the methyl groups. The inset shows the thermal spectrum of all the 1 H spins. The peaks (labeled as 'P') of methyl 1 H spins are fitted using Lorentzian line shapes and removed on purpose in signal processing to get a clear signal of the 1 H of interest. (c) The Fourier transform spectrum of the 31 P spin obtained using Gemini After the wave is generated, it is power amplified and sent to the control coil (see Fig. 2) so that the quantum state can be manipulated. After the RF pulse irradiation, the electro-magnetic signal induced during spin relaxation is picked up by the coil, and then is sent to the preamplifier. After the signal is amplified, it is sent to the ADC and processed by the master board

Temperature control
The field generated by the permanent magnets is highly sensitive to the temperature of the permanent magnets themselves. Therefore, a temperature control system is required to guarantee that the field does not drift following the room temperature. The architechture of the temprature control unit is shown in Fig. 6.

Field shimming
The homogeneity of the static magnetic field generated by the permanent magnets is ∼20 ppm, which is too large. To compensate this inhomogeneity, we designed a field shimming system to reduce the homogeneity to less than ∼1 ppm. The best homogeneity could reach ∼0.3 ppm. As a comparison, the homogeneity of a commercial NMR spectrometer with a superconducting magnet is ∼0.01 ppm. The struture of the shimming unit is shown in Fig. 7.

Quantum computation 3.1 The spin system
Gemini contains two qubits which are the two connected 31 P and 1 H nuclear spins in Dimethylphosphite ((CH 4 O) 2 PH) molecules (Fig. 4). The molecules are placed in the center of the parallel permanent magnets. The 31 P and 1 H Larmor frequencies are 17.2 MHz and 42.6 MHz, respectively. The 31 P spin has a T 1 and T 2 of 7.2 s and 0.5 s, respectively. The 1 H spin has a T 1 and T 2 of 4 s and 0.3 s, respectively. The J coupling between the two spins is 697.4 Hz. The control pulses are on resonance with 1 H and 31 P spins and thus their frequency offsets are both 0 Hz. The spin Hamiltonian in the rotating frame is where J = 697.4 Hz.

The gate set
Single-qubit 90 degree rotation gates can be realized using square pulses of 20 us and 10 us for 31 P and 1 H, respectively. The hardware-level pulse design and engineering are available in later versions of Gemini which provide an arbitrary waveform generation function to users. In the current paper, all quantum gates are realized using square pulses which are resonant with 1 H or 31 P and combined with free evolution. The available quantum gates contain single-qubit and two-qubit gates. The single-qubit gates are as follows: Here, α, β and γ are the rotation angles defined by users. The two-qubit gates are as follows where CX gate is the famous control NOT (CNOT) gate. Here, the delay gate is a free evolution gate with the duration t defined by users. It should be noted that when t is comparable to T * 2 , noise plays a non-negligible role and the action of this gate is not ideal as the form in the above equation. The single-qubit gate fidelity is estimated to be ∼0.99 and the two-qubit gate fidelity is estimated to be ∼0.98.

The pseudo-pure state
The initial state of the two-qubit system is prepared to be a pseudo-pure state (PPS) [3]. The thermal equilibrium state of a liquid-state NMR system is subject to Boltzmann distribution and at room temperature can be expressed as follow: The pulse sequence for pseudo-pure state preparation. The first four pulses realize a basis permutation gate. After it is a long delay within which the natural relaxation takes effect. By properly choosing the repetition number, N, and the duration of the delay, t, the system can be steered to the pseudo-pure state |00 from the thermal equilibrium state Here, H s is the spin Hamiltonian in the lab frame, and n is the number of qubits. The part n k=1 1 2 k σ k z gives NMR signals. At room temperature ∼ e -5 is small and thus this is a highly mixed state. To implement quantum computation, researchers [3] proposed to use PPS as the initial state which has the following form, |ψ is a pure state. The PPS above has the same unitary dynamics and observable effects as the pure state |ψ except for the factor η. PPS is widely used in NMR quantum computation.
Gemini utilizes the relaxation method in Ref. [52] to prepare the two-qubit PPS starting from the thermal equilibrium state. As shown in Fig. 8, the first four pulses realize a basis permutation gate which can be expressed as U permute permutes the basis |01 , |10 and |11 and leaves |00 unchanged upon a phase. The relaxation method in Ref. [52] combines U permute and a delay after it during which T1 relaxation takes effect. By properly choosing the number of the repetitions of this combination and the delay time t, the system can reach a state whose dominantly occupied basis is |00 and the other three base have the same but smaller probability. This obtained state is a PPS and can be used as the initial state |00 in NMR quantum computing.

Density matrix reconstruction
Gemini implements quantum state tomography [53] to reconstruct the density matrix of the quantum state after a certain gate sequence is applied. Any two-qubit density matrix Figure 9 The readout pulses, observed spins and the obtained c ij of the six experiments needed to reconstruct a density matrix in the form of Eq. (7) can be expressed in the following way, Here σ 0 = I is the 2 × 2 identity matrix. To reconstruct a density matrix, one need to measure all the c ij which are c ij = Tr(ρσ i σ j ), in other words, the expectation values of the Pauli matrices σ i σ j . There are total 15 of σ i σ j . But only {σ x I, σ x σ z , σ y I, σ y σ z , Iσ x , σ z σ x , Iσ y , σ z σ y } are observables in NMR. Additional readout pulses are needed to transform the unobservable components to be observable. For example, by applying a readout pulse Y 90 to the first qubit prior to measurement, c z0 can be obtained, c z0 = Tr(Y 90ρY 90 † σ x I). In Gemini, the reconstruction is realized by repeating an experiment six times, each time with a different readout pulse and observing either 31 P or 1 H. The readout pulses and c ij obtained in each of the six repetitions are listed in Fig. 9. The reconstructed initial PPS has a fidelity of higher than 0.99.

Software interface
The user can use the quantum computing interface of SpinQuasar to access the quantum computing function of Gemini (Fig. 10). The structure and flow-chart of quantum computing is shown in Fig. 11. This system wraps up the calibrated pulses into the quantum gates aforementioned. Users can drag the supported gates into the circuits and press Run, the two-qubit quantum computer will start running. The final result will be shown in the form of density matrix which is reconstructed in the way discussed in last section. There is also a noiseless simulator embedded in this system so that one can easily compare the experimental results with theoretical results.

Theory
Geometric phase [55] is a very important concept in quantum mechanics. It is a type of phase gained by a system that is determined by the geometry of the system's evolution path. The most famous geometric phase is Berry phase [56] which is associated with cyclic adiabatic evolution. Here we use a spin half system as an example. A spin in a magnetic field is aligned with the field and is in the state |0 . If the field direction changes slowly and the adiabatic conditions are satisfied, the spin direction changes also adiabatically and is always along the field direction. When the magnetic field returns to its initial direction, the spin returns to its initial direction as well. However, the spin state gains a global phase and is e i(α+β) |0 , where α is the dynamic phase and β is the Berry phase. α and β have expressions as follows: E(t) is the energy of |0 at the time t and is determined by the instant Hamiltonian. is the solid angle enclosed by the path. If the initial state is in |1 , and the magnetic field changes along the same path, then the geometric phase gained by the spin is /2. This is because the spin is opposite in this case and hence its path encloses a solid angle of -. Berry phase is discussed above in the context of adiabatic evolution. Researchers have proved that adiabatic evolution is not a necessary condition for geometric phase [57]. Geometric phase stays the same as long as the geometry of the evolution path stays the same, and is not affected by the Hamiltonian that drives this evolution.
Geometric phase is believed to be robust to local noise and fluctuations of Hamiltonian parameters because of its connection with the path geometry. Therefore, geometric quantum computation is proposed as a candidate for fault-tolerant quantum computation [21,[58][59][60][61][62][63][64][65][66][67]. Geometric phase in noisy environments is also studied. When the environment is noisy, quantum systems are always in mixed states due to the interaction with the environment. The work in Ref. [68] provides a definition for the geometric phase of a mixed state: It is the phase shift of the interference oscillations in interferometry gained by the mixed state after a unitary evolution. The unitary evolution must satisfy the parallel transport requirement [55,68]: The state at any instant is in-phase with the state after an infinitesimal time. It can be proved that the dynamical phase is 0 if the parallel transport requirement can be satisfied. After such a unitary evolution, each eigen state of the density matrix of the initial mixed state gains a phase denoted as γ n , and has the interference visibility ν n . The geometric phase γ of the mixed state and its interference visibility ν satisfy the following equation: Here, p n is the eigen value of the nth eigen state of the density matrix.

Experimental protocol
We adapt the protocol used in Ref. [69] to measure the geometric phase in mixed states as defined in Eq. (10). A two-qubit system is used in this protocol. The first qubit is an ancilla qubit and the second qubit is in the mixed states whose geometric phase is to be measured. The mixed state is a mix of |+ = √ 2(|0 + |1 )/2 and |-= √ 2(|0 -|1 )/2. The initial mixed state is: Here r is the Bloch vector, and r is its length that corresponds to the purity of the state. If r = 1, the state is a pure state which is |-. If r = 0, the state is totally mixed. |and |+ are the two eigen states of the above density matrix with eigen values of (1 + r)/2 and (1r)/2. Here we steer the state along the path (A-B-C-D-A) which encloses a solid angle as shown in Fig. 12. Because the path is made up of geodesic curves, the parallel transport requirement can be satisfied and thus the dynamical phase is zero. The |and |+ states gain geometric phases of -/2 and /2, and change to e -i /2 |and e i /2 |+ , respectively. It can be proved that the interference visibilities of the two eigen states are both 1. Then the geometric phase γ of the mixed state satisfies In order to measure γ , the ancilla qubit is prepared in the state √ 2(|0 a + |1 a )/2, which has the density matrix (I + σ a x )/2. We control the two-qubit system so that when the ancilla qubit is in |1 a , the mixed state undergoes the unitary evolution and when the ancilla qubit is in |0 a nothing happens. The phases gained by |and |+ in the mixed state (which are ∓ /2) are passed to the ancilla qubit. Thus after the controlled evolution, the state of the ancilla qubit is √ 2(|0 a + e ∓i /2 |1 a )/2. The weighted average phase gained by the ancilla qubit has the form of Eq. (13).
Next, we discuss how to prepare a mixed state in the form of Eq. (11) from the initial PPS state |00 . The most used method in NMR to prepare such a mixed state is to use a pulsed gradient field, which can dephase the spin polarization in the x-y plane fast. However, there is no pulsed gradient field in Gemini. Considering the time scale of dephasing caused by the static field inhomogeneity as well as T 2 is much smaller than T 1 , we exploit the natural dephasing to remove the unwanted polarization. To prepare a state in Eq. (11), first the state (I + rσ z )/2 is prepared from |0 : The -√ 1r 2 σ y part in the above equation can be removed using natural dephasing and we can get (I + rσ z )/2. Then, rotate (I + rσ z )/2 about y axis by -π/2, we get (Irσ x )/2.
The |1 a -controlled unitary can be realized using the following sequence: Figure 13 The experimental circuit for the measurement of the geometric phase for mixed states θ is the angle between either of the two half paths and the x-y plane, θ = /4. R x (-θ ) operation rotates the first half of the path to the x < 0 half of the x-y plane. CZ is the controlled-Z gate. When the ancilla qubit is in |0 a , CZ does nothing; when the ancilla qubit is in |1 a , CZ rotates the mixed state about z axis by π counterclockwise, which means the mixed state evolves along the first half of the path. R x (2θπ) rotates the second half of the path to the x > 0 half of the x-y plane. The CZ after it realizes the evolution of the mixed state along the second half of the path when the ancilla qubit is |1 a . In this way, the mixed state undergoes a closed path evolution conditional on the |1 a state of the ancilla qubit. CZ can be further decomposed as here 1/2J refers to the free evolution for a duration of 1/2J under the J coupling between the two qubits. The R x (π/2) gate in CZ can be combined with the R x (-θ ) and R x (2θπ) operations in Eq. (15) and simplified. After this simplification, the quantum circuit is shown in Fig. 13. The first qubit is the ancilla qubit. φ 1 = π/2θ , φ 2 = 2θπ/2. The geometric phase γ can be measured by measuring the phase change of the ancilla qubit after implementing the circuit in Fig. 13.

Results
Experiments with = 180 • and = 240 • are carried out. In each situation, r is chosen to be [0.26, 0.50, 0.71, 0.87, 0.97]. And for each of the r values, the experiment is repeated for five times to get a mean value of the measured phases as the result of γ (Fig. 14).
The main error sources are the non-ideal initial mixed state and RF pulse imperfections, such as finite pulse width. The large fluctuations in the experimental results come from the uncertainty in fitting the NMR spectra. In spite of those errors and imperfections in experiments, the change trend of the geometric phase as a function of the purity and the solid angle of the path can be observed from the results.

Application: variational quantum eigensolver
In this section, we implement a variational quantum eigensolver for a two-qubit Heisenberg model.

Background
Quantum algorithms such as the Grover search [48], Shor factorization [70,71] and HHL [50], have proven advantages over their best known classical counterparts. However, these algorithms cannot be efficiently implemented on near-term quantum devices due to inevitable physical noises in quantum gates. Variational quantum algorithms (VQA) [72][73][74][75][76][77][78], a class of algorithms under the hybrid quantum-classical framework, are more promising to have practical applications on noisy intermediate-scale quantum computers [79]. VQA use a parameterized quantum circuit to estimate the cost function C(θ ) and update θ with a classical optimizer. Variational quantum eigensolver (VQE) [73,80] is a paradigmatic example of VQA that aims to find the ground state and ground state energy of a given Hamiltonian H. In this section, we will demonstrate the experimental realization of VQE on Gemini.

Algorithm
In classical computaitional physics (chemistry), we usually estimate the ground state energy of H through variational approaches: parameterize a wave function |ψ = |ψ(θ) , update θ to minimize the expectation value ψ(θ )|H|ψ(θ) until convergence. VQE facilitates the above procedure with a quantum computer. The wave function is parameterized with a quantum circuit U(θ ) applied to the initial state |0 = |0 ⊗n , and we optimize θ to minimize the expectation value, The classical optimizer can either be gradient-based methods like SGD, Adam, RMSprop, BFGD, or gradient-free methods like Nelder-Mead, Powell. Hardware-efficient ansatz [73], unitary coupled clustered ansatz [81], and Hamiltonian variational ansatz [82,83] are common choices for U(θ). In VQE, the gradient can be directly estimated via the Page 16 of 23 parameter-shift rule [84,85], i.e.,

∂E(θ )
where θ ± i = θ ± π 2 e i , e i is the ith unit vector in the parameter space. Higher order deriva- , which are required in some optimizers, can be estimated in a similar way [86].

Experimental protocol
In this work, we apply VQE to find the ground state of 2-qubit Heisenberg model. The Hamiltonian is where X j , Y j , Z j are the Pauli operators on the jth qubit. The hardware efficient circuit is shown in Fig. 15.

Figure 15
The hardware efficient circuit for 2-qubit VQE. θ 1 -θ 4 are the parameters to be optimized The experimental procedures are as follows: • Initialize the circuit parameters θ , • Estimate the derivatives of θ via parameter-shift rule, ∂E(θ ) • Update the parameters with gradient descent, θ = θα · ∇E(θ ); • Estimate the expectation value 0|U † (θ )HU(θ)|0 ; • Repeat steps 2-4 until convergence. Figure 17 (a) shows the original result of VQE experiment on SpinQ Gemini and IBMQ Yorktown, respectively. The ground state energy of H H is -3, which is shown by the red line. SpinQ Gemini and IBM Q Yorktown perform similar, both converge to E(θ) ≈ -2.6 after enough iterations, as shown by the blue dot line and the green square line, respectively. According to our simulations and analysis, the error for Gemini mainly comes from the inhomogeneity of the magnetic field, while the error of IBMQ mainly comes from the readout error.

Results and simulation
The noise in quantum computer cannot be neglected. To study the noise effect and stability of SpinQ Gemini, we construct a noise model to capture the quantum error of the SpinQ Genimi. In the realistic noisy NMR quantum device, the basic noise channels are dephasing and amplitude damping. For an initial state ρ of the system and the quantum circuit unitary transformation U, the local noise model for single-qubit and two-qubit quantum gates can be described by the Kraus representation where E k s are the Kraus operators and k E k E † k = I. The E k s act on the same single qubit and two qubits as U acts on. The amplitude damping noise can be characterized by the Kraus operators, where I 2 is the two dimensional identity matrix and σ Z is Pauli operator. We model the noise consisting of single-qubit thermal relaxation error and two-qubit thermal relaxation error. The thermal relaxation error model applies the amplitude damping noise and dephasing noise after each one-or two-qubit gate. This thermal relaxation error model is characterized through the parameters (T 1 , T * 2 , t q ) and the noise probability is formulated by where γ = t q T * 2 -t q 2T 1 . When the thermal relaxation error model is applied to single-qubit gates, t q = t 1q and t q = t 2q for two-qubit gates. The final noise model to approximate the noise of NMR quantum device is characterized by the parameters {T 1 , T * 2 , t 1q , t 2q }. We set {T 1 = 5.6 s, T * 2 = 0.025 s, t 1q = 25 μs, t 2q = 800 μs} in the noise simulation for the NMR platform. In NMR system, the dephasing effect is caused by both the spin relaxation and the field inhomogeneity. T 2 is used to measure the spin transversal relaxation rate, while T * 2 is used to measure the field inhomogeneity. The T 2 data is measured using the technique called spin echo, which can refocus the magnetisation and remove the effect of inhomogeneous field. In our VQE experiment, we did not use such technique, so we use T * 2 instead of T 2 . With the noise model described above, we first record every parameters θ in each iteration of the SpinQ Gemini VQE experiment. Then we take these parameters θ as the parameters of quantum circuit ansatz (Fig. 15) and calculate the energy of the Hamiltonian with respect to the ideal circuit and noisy circuit output in each iteration. As shown in Fig. 17 (b), the noisy circuit result shows great consistancy to the experiment data. The paramaters θ found by SpinQ Gemini is close to the parameters for ground state. These results indicate that our desktop quantum computing platform can run VQE algorithm well.

Error mitigation
Quantum error mitigation [88][89][90] is a technique to diminish the influence of errors from the statistical perspective.
From the comparison and the simulation described above, we can see that the dephasing error caused by the inhomogeneous magnetic field is dominant. Our circuit consists of four single-qubit rotations and one CNOT gate. The time for a CNOT gate is about 800 μs and for single-qubit gates is ∼20 μs. Therefore, the imperfections of the CNOT gate causes primary error. Consider the error model: where E k s are the Kraus operators, ρ is the ideal density matrix, and ρ f is the measured density matrix. Error mitigation is a procedure that for a given ρ f obtained from the experiment, finds a density matrix ρ 0 , which is as close to ρ as possible, so that the final experiment result could be improved. Here, we employ the superoperator formalism to obtain ρ 0 . This formalism works as follows. First, let us rewrite the density matrix ρ from an n × n matrix into an n 2 × 1 vector ρ : Then the final state ρ f , which is also an n 2 × 1 vector is whereŜ is the superoperator. With known Kraus operators E k , it can be obtained aŝ Therefore, with known ρ f andŜ, we can get The original result and the mitigated result of Gemini is shown in Fig. 17 For the IBMQ devices, the readout errors are dominant. Here we consider the simplest linear algebra measurement error mitigation scheme. On IBMQ Santiago we do projective measurement and obtain one of the strings {0, 1} ⊗2 . Through tomography of measurement process, we get the probability of string S j becoming S k , denoted by P kj . Suppose we repeat the same measurement many times and have the string probability distribution C noisy , then C mitigated = P -1 C noisy (29) provides the probability distribution with measurement error mitigated, although P -1 is not a physical operation. Measurement error mitigation can efficiently improve the performance of VQE on IBMQ Santiago, as shown in Fig. 17(a).

Discussion
For the next generations of SpinQ desktop quantum computing products, we will develop products running with more qubits (3∼4). Currently, the design of a 3-qubit machine is underway and the product is expected to be released in the second quarter of 2021, with a comparable price as SpinQ Gemini (i.e. under 50k USD). Along the way, compatible software modules with advanced pulse control functions will also be developed, providing more powerful abilities for quantum algorithm/control/error mitigation designs to meet the research needs of advanced users. Meanwhile, another direction is to make a simplified version of the current model, making it more portable with much lower cost (under 5k USD). This simplified version is expected to be released in the fourth quarter of 2021, such that it can be more affordable for most K-12 schools around the world.

Conclusion
In this work, we described a desktop and maintenance free quantum computing platform: SpinQ Gemini. We discussed the technique details for both hardware and software parts of it. We demonstrated how quantum computation is accomplished by Gemini, and realized measurement of geometric phase of mixed states as well as variational quantum eigensolver. To obtain a better accuracy in VQE, we also developed an error mitigation algorithm and realized it. In a word, we think SpinQ Gemini is a powerful tool for quantum computation education as well as research.