Firstly, a *classical* computer does basic maths at the hardware level in the arithmetic and logic unit (ALU). The logic gates take low and high input voltages and uses CMOS to implement logic gates allowing for individual gates to be performed and built up to perform larger, more complicated operations. In this sense, typing on a keyboard is sending electrical signals, which eventually ends up in a command (in the form of more electrical signals) being sent to the ALU, the correct operations being performed and more signals sent back, which gets converted to display pixels in the shape of a number on your screen.

## What about a quantum computer?

There are two possible ways that quantum processors get used: by themselves, or in conjunction with a classical processor. However, most (including your example of superconducting) quantum processors don't actually use electrical signals, although this is still how your mouse, keyboard and monitor etc. transmit and receive information. So, there needs to be a way to convert the electric signal to whatever signal the quantum processor uses (which I'll get on to later), as well as some way of telling the processor what you want to do. Both these issues can be solved at once by classical pre- and post- processing, such as in IBM's QISKit. Microsoft is taking a bit more of a top-down approach in Q#, where programs for a quantum processor is written more like a 'classical' program, as opposed to a script, then compiled and potentially *optimised* for the hardware. That is, if you've got a function, it can perform classical operations, as well as make calls to the quantum processor to perform any required quantum operations. This leads me to the first point:

**If you're going to ask a computer with access to a quantum processor to calculate something such as $2+3$, one very valid solution would be to just compute it on the classical processor as per usual.**

OK, let's say that you're forcing the classical processor to use the quantum processor, which in this case is one of IBM's superconducting chips, using *transmon* qubits, let's say, the IBM QX4. This is too small to have error correction, so let's ignore that. There are three parts to using a circuit model processor: initialisation, unitary evolution and measurement, which are explained in more detail below. Before that,

## What is a transmon?

Take a superconducting loop to allow for Cooper pairs and add one or two Josephson junctions to give a Cooper pair box island in the region between the two Josephson junctions with Josephson coupling energy $E_J = I_c\Phi_0/2\pi$, where the *magnetic flux quantum* $\Phi_0 = h/2e$ and $I_c$ is the critical current of the junction. Applying a voltage $V_g$ to this box gives a 'gate capacitance' $C_g$ and makes this a *charge qubit*. For the Coulomb energy of a single Cooper pair $E_C = \left(2e\right)^2/2C$, where $C$ is the sum of the total capacitance of the island. The Hamiltonian of such a system is given by $$H = E_C\left(n - n_g\right)^2 - E_J\cos\phi,$$ where $n$ is the number of Cooper pairs, $\phi$ is the phase change across the junction and $n_g = C_gV_g/2e$. When performing unitary operations, only the two lowest states of the system are considered, $\left|n\right\rangle = \left|0\right\rangle$ and $\left|n\right\rangle = \left|1\right\rangle$ with respective energies $E_0 =\hbar\omega_0$ and $E_1 = \hbar\omega_1$ and qubit frequency $\omega = \omega_1-\omega_0$, describing the computational basis of a qubit. A typical charge qubit could have $E_C = 5E_J$. Adding a large shunting capacitance and increasing the gate capacitance switches this ratio, so that $E_J\gg E_C$ and we have a *transmon*. This has the advantage of longer coherence times, at a cost of reduced anharmonicity (where energy levels beyond the first two are closer together, potentially causing leakage).

*Finally*, we get to the main question:

## How do we initialise, evolve and measure a transmon?

**Single qubit unitary evolution:** Applying a microwave pulse $\mathcal E\left(t\right) = \mathcal E_x\left(t\right)\cos\left(\omega_dt\right) + \mathcal E_y\left(t\right)\sin\left(\omega_dt\right)$ for $0<t<t_g$ of frequency $\omega_d$ and making the rotating wave approximation gives the Hamiltonian of the qubit states (in the ideal case) as $$H =\hbar \begin{pmatrix}\omega_1-\omega_d && \frac 12\mathcal E_x\left(t\right) - \frac i2\mathcal E_y\left(t\right)\\ \frac 12\mathcal E_x\left(t\right) + \frac i2\mathcal E_y\left(t\right) && \omega_2-2\omega_d\end{pmatrix}$$ However, due to lower anharmonicity, the microwave pulses have to be shaped to reduce leakage to higher energy levels in a process known as *Derivative Removal by Adiabatic Gate (DRAG)*. By varying the pulse, different Hamiltonians can be achieved, which, depending on the time of the pulse can be used to implement different unitary operations on a single qubit.
**Measurement/readout:** A microwave resonator, with resonance frequency $\omega_r$, can be coupled to the transmon using a capacitor. This interaction causes (decaying) Rabi oscillations to occur in the transmon-resonator system. When the coupling strength of cavity and qubit, $g \ll \omega-\omega_r$, this is known as the *dispersive regime*. In this regime, the transmittance spectrum of the cavity is shifted by $\pm g^2/\left(\omega-\omega_r\right)$ depending on the state of the qubit, so applying a microwave pulse and analysing the transmittance and reflectance (by computer) can then be used to measure the qubit.
**Multiple qubit unitary evolution:** This idea of coupling a qubit to a microwave resonator can be extended by coupling the resonator to another qubit. As in the single qubit gate case, timings of the coupling as well as microwave pulses can be used allow the first qubit to couple to the cavity, which is then coupled to the second qubit and perform certain 2-qubit gates. Higher energy levels can also be used to make certain gates easier to implement due to interactions between higher levels caused by the cavity. One such example is shown here, where the cavity causes an interaction between the states of $\left|2\right>\left|0\right>$ and $\left|1\right>\left|1\right>$. An avoided crossing between these states means that a 2-qubit phase gate can be implemented, although in general 2-qubit gates are implemented less well (have a lower fidelity) than single qubit ones.
**Initialisation:** Readout, potentially followed by a single qubit Pauli $X$ gate (on each qubit measured to be in state $\left|1\right\rangle$) to ensure that all qubits start in state $\left|0\right\rangle$.

Adding 2 and 3 is now a 'simple' matter of initialising the qubits, performing the gates equivalent to a classical reversible adder and measuring the result, all implemented automatically. The measurement result is then returned by a classical computer as per usual.

**As a bonus**, it seems a little pointless to go through all that in order to implement gates that could be done on a classical computer anyway, so it turns out that it's possible to approximately implement a quantum adder, which adds two quantum (as opposed to classical) states, with some error, on one of IBM's processors.

That's a nice content. If possible, you may consider this posting this as a blog post. – hola – 2020-10-03T09:16:26.307