# Indoor-Outdoor Detection in Mobile Networks Using Quantum Machine Learning Approaches
## 2 Quantum Computing
### Gate-Based Quantum Computing  
In gate-based quantum computers, operations, which are also named gates, are used to manipulate the values of specific qubits. We introduced superposition earlier, where the qubit is a combination of the states, classically indicated as 0 and 1. This state can be denoted by \(\ket{\psi}\), which is defined by  
\[\ket{\psi}=\alpha\ket{0}+\beta\ket{1}, \tag{1}\]  
where \(\alpha\) and \(\beta\) are complex numbers. Measuring the state of the qubit, we get either the state \(\ket{0}\) or the state \(\ket{1}\). The probability that we observe each of these states is expressed by \(\ket{\alpha}^{2}\) and \(\ket{\beta}^{2}\), respectively, adding up to 1. Note that any state can be parameterised by three real-valued parameters \(\theta\in[0,\pi]\) and \(\phi,\gamma\in[0,2\pi]\):  
\[\ket{\psi}=e^{i\gamma}\bigg{(}\cos\bigg{(}\frac{\theta}{2}\bigg{)}\ket{0}+e^{ i\phi}\sin\bigg{(}\frac{\theta}{2}\bigg{)}\ket{1}\bigg{)}. \tag{2}\]  
Now gates can be applied on these prepared qubits, meaning that a rotation on the Bloch sphere (Figure 1) is executed. Using a gate on multiple qubits simultaneously is also possible. It is not possible to show this on the Bloch sphere any longer. An example of such a multi-qubit gate is the controlled NOT (CNOT) gate. This gate acts on two qubits, applying a Pauli-X gate to the target qubit if and only if the control qubit is in the \(\ket{1}\) state. Now, a quantum algorithm is a set of gates acting on qubits in a specific order. This order is visualised in a quantum circuit, and an example can be found in Figure 2. The circuit should be designed such that the resulting quantum state is useful and provides the answer to a certain problem. Note that the outcome is probabilistic, and some algorithms will ask for a number of repetitions to translate the quantum state answer to an answer that can be used for further, conventional computing. Of course, the main goal of a quantum algorithm developer is to design an algorithm that outperforms the classical counterpart of the algorithm in terms of complexity. Famous examples of such algorithms are [PERSON]'s and [PERSON]'s. [PERSON]'s algorithm [25] is a polynomial-time quantum computer algorithm for integer factorisation, which is expected to break certain types of cryptography. [PERSON]'s algorithm [26] finds with high probability the unique input to a domain of size \(N\), only demanding \(\mathcal{O}(\sqrt{N})\) function calls, whereas the classical algorithm requires \(\mathcal{O}(N)\) function calls. The paper of [23] warns about some details of the proposed quantum algorithms. The data encoding phase and translating the quantum state outcome could even nullify the gained speed-up. In most machine learning applications, data encoding is the first step in the algorithm. In Figure 2, a small example is shown of a quantum circuit, which we will use in the next sections of this paper, to encode two data points in two qubits. A quantum circuit starts at the left side. Each line in the circuit represents a qubit, meaning we have two qubits in this example. Each cube represents a gate operation. In Figure 2, on the first qubit, we first apply a Hadamard gate. This gate brings the qubit into a superposition state as explained earlier. Then a controlled rotation is used to encode the two data points \(x_{i}=(x_{i0},x_{i1})\) for \(i=0,1\) in the amplitudes of the second qubit. Here, the angles of the rotations \(\theta_{i}\) are chosen such that \(\alpha_{i}=x_{i0}\) and \(\beta_{i}=x_{i1}\). The initial state is now rotated to the desired state given by  
\[|0\rangle|0\rangle\rightarrow\frac{1}{\sqrt{2}}\big{(}|0\rangle|x_{1}\rangle+ |1\rangle|x_{2}\rangle\big{)}. \tag{3}\]  
Here, the first qubit acts as a counter, while the two features of the data point are encoded in the second qubit. Alternatively, using just two qubits, it is also possible to encode a single data point with four features.