## Introduction

Not all quantum devices can realize all quantum gates. In practice this is not an issue since any quantum gate can be constructed from a series of universal quantum gates provided the device can execute them. The downside is that the combination of gates takes longer to perform and hence introduces a higher error rate.

For example, on spin-qubit devices the CNOT gate is not directly available. We can however realize this gate by a combination of single qubit rotations and a CZ gate. In this section the restrictions of Spin-2 are specified.

## Topology and allowed gate set

Each of the quantum processors has a specific topology the way the qubits are connected) and a specific allowed gate set (supported qubit operations).

Spin-2 has two qubits (q0, q1) which are connected. You can execute the following single-and two-qubit gates on this system (native operations are given in **bold**, other operations are decomposed using specific decomposition rules for this quantum processor):

- All single-qubit operations in cQASM
`X`

,`Y`

,`Z`

,`I`

`H`

`S`

,`Sdag`

,`T`

,`Tdag`

`X90`

,`Y90`

,`mX90`

,`mY90`

,`Rx(angle)`

`Ry(angle)`

,`Rz(angle)`

- All two-qubit gates in cQASM
,`CZ`

`CNOT`

,`SWAP`

,`CR`

,`CRk`

- All measure commands
,`measure_z`

`measure`

,`measure_all`

,`measure_x`

,`measure_y`

- All prep/initialization commands
,`prep_z`

`prep_y`

,`prep_x`

More specific, the following operations and commands are *not* allowed

`Display`

`Display_binary`

`Not`

- Binary controlled operations
`c-`

`Toffoli`

## Gate decompositions

Spin-2 basically has five operations that can be executed directly on the chip (native operations):

- Initialization of the qubits in the ground state with
`prep_z`

- single-qubit rotation around the z-axis with
`Rz(angle)`

, executed as a virtual operation - a single-qubit rotation around the x-axis with
`Rx(angle)`

- two-qubit
`CZ`

gate - measurement of the qubits in z using
`measure_z`

The compiler/transpiler decomposes all other allowed operations into this native gate set using the following methods:

- Two-qubit operations
`CNOT`

,`SWAP`

,`CR`

and`CRk`

are decomposed to`CZ`

operations in combination with single-qubit operations - Sequences of single-qubit operations on one qubit are decomposed using the method described in McKay - Efficient Z-Gates for Quantum Computing resulting in a sequence of five single-qubit operations, namely three
`Rz(..)`

operations with different angles of rotation and two`Rx(pi/2)`

operations. - Consecutive operations which result in identity are removed from the algorithm (such as two consecutive
`CZ`

operations).

## Initialization, execution and readout

The qubits are initialized in the ground state at the start of each shot.
The single-qubit `Rx()`

operations are executed by sending a microwave pulse of the required duration, amplitude and phase to the qubits. The `Rz()`

operation is executed by a phase-update (virtual Z-gate) of the the microwave signals. The two-qubit `CZ`

operation is executed by a calibrated exchange interaction between the qubits which results in a controlled 180 degree phase change of the |11> state of the qubits. Single-qubit operations on two different qubits are executed in sequence, not in parallel. At the end of the algorithm both qubits are measured.