# QRLIT: Quantum Reinforcement Learning for Database Index Tuning
## 2 Background
### Quantum Computing
#### 2.2.1 Information Unit  
In the field of quantum computing, the fundamental unit of information is a quantum bit, or qubit. Similarly to classical bits, qubits operate in a two-level system, corresponding to states \(0\) and \(1\). However, in contrast to bits, which exist in a single state at a time, qubits can be simultaneously in both. This phenomenon, which is paradoxical from the perspective of classical physics, is known as superposition. According to quantum theory, the precise state of a qubit in a superposition can only be identified through an observation or measurement, at which point it will collapse to one of its fundamental states, either \(0\) or \(1\), with a certain probability [22].  
Mathematically, the state of a qubit is described in Dirac notation as a linear combination of the base states \(|0\rangle\) and \(|1\rangle\), as illustrated in Equation (3). The complex domain coefficients \(\alpha\) and \(\beta\) represent the amplitudes of each state. The base states, designated by the symbols \(|0\rangle\) and \(|1\rangle\), are described in the expressions presented in Equation (4). The amplitudes of these states are either \(0\) or \(1\), depending on the state in question. However, in the case of superposition, the values of \(\alpha\) and \(\beta\) can be included within any arbitrary value in a range between \([0,1]\).  
\[|\psi\rangle=\alpha|0\rangle+\beta|1\rangle=\begin{bmatrix}\alpha\\ \beta\end{bmatrix} \tag{3}\]  
\[|0\rangle=\begin{bmatrix}1\\ 0\end{bmatrix},|1\rangle=\begin{bmatrix}0\\ 1\end{bmatrix} \tag{4}\]  
A qubit can be represented on a sphere known as a Bloch sphere [22]. In this model, it is evident that the amplitudes of a quantum state are expressed in spherical coordinates, as described in Equation (5).  
\[|\psi\rangle=\cos\frac{\theta}{2}|0\rangle+(\cos\phi+\text{isin}\phi)\sin\frac {\theta}{2}|1\rangle \tag{5}\]Quantum state amplitudes, also known as probability amplitudes, define the probability of a superposition qubit being observed in the state \(|0\rangle\) or \(|1\rangle\). The probability of finding the qubit in the state \(|0\rangle\) is calculated using Equation (6), while the probability of finding the qubit in the state \(|1\rangle\) is determined by Equation (7).  
\[\mathrm{P}(|0\rangle)=|\alpha|^{2} \tag{6}\]  
\[\mathrm{P}(|1\rangle)=|\beta|^{2} \tag{7}\]  
\[|\alpha|^{2}+|\beta|^{2}=1 \tag{8}\]  
In order to allow for the encoding of more complex information in any computing system, it is essential to combine multiple units. In quantum computing, this combination is achieved through the tensor product of qubits. Equation (9) contains the notation for a system of two qubits, while Equation (10) presents the result of their tensor product.  
\[|\psi\rangle\otimes|\omega\rangle\equiv |\psi\rangle\,|\omega\rangle\equiv |\psi\omega\rangle\equiv |\psi,\omega\rangle \tag{9}\]  
\[|\psi\rangle\otimes|\omega\rangle=(\alpha|0\rangle+\beta|1\rangle)\otimes( \gamma|0\rangle+\delta|1\rangle)=\begin{bmatrix}\alpha\\ \beta\end{bmatrix}\otimes\begin{bmatrix}\gamma\\ \delta\end{bmatrix}=\begin{bmatrix}\alpha\times\gamma\\ \alpha\times\delta\\ \beta\times\gamma\\ \beta\times\delta\end{bmatrix} \tag{10}\]