# Improving 2-5 Qubit Quantum Phase Estimation Circuits Using Machine Learning
## 1 Introduction  
Quantum Phase Estimation (QPE) is a quantum computing algorithm that estimates the phase of an eigenvalue or of multiple eigenvalues of a unitary operator \(U\). To further understand QPE and the problem addressed in this paper, we will first explore some of the mathematical background of quantum mechanics and the derivation of the QPE algorithm [1; 2; 3; 4]. Quantum mechanics describes physical particles or groups of particles using states (usually denoted with a \"ket\" \(\ket{\psi}\)) in a Hilbert space. For this application of quantum computing, the Hilbert space describes particles or groups of particles with states in a Hilbert space spanned by two basis states, \(\ket{0}\) or \(\ket{1}\). In this case, the particle or group of particles is called a \"qubit\", and a general qubit state is denoted \(\ket{\psi}=\alpha\ket{0}+\beta\ket{1}\) with complex \(\alpha\), complex \(\beta\) and \(\ket{\alpha}^{2}+\ket{\beta}^{2}=1\). When a qubit's state is measured, the wavefunction collapses into one of the basis states with probability \(\ket{\langle\phi|\psi\rangle}^{2}\), where the \"bra\" \(\bra{\phi}=\bra{0}\) or \(\bra{\phi}=\bra{1}\), with each bra being an element in the dual space to the space in which the ket \(\ket{\psi}\) liese. Changing the state of a qubit within the standard QPE circuit is mathematically represented by acting on the state of the qubit with a unitary operator, which preserves the sumof squares of all vector components. Unitary operators are operators in the Hilbert space such that \(UU\dagger^{\dagger}=U\dagger U=I\), where \(U\dagger^{\dagger}\) is the conjugate-transpose of the operator and \(I\) is the identity operator. Measurement of a qubit is a non-unitary operation, though, in this context, it is performed at the end of the circuit and is described probabilistically. While not incorporated in this simulation of QPE circuits, another application of non-unitary operations includes circuit noise analysis associated with open system dynamics [4]. It is often necessary to work with composite systems representing more than one quantum object. In this case, basis states of the whole system, \(\ket{\psi}\), are Kroncker products (a specialization of finite-dimensional tensor products) of the individual basis states, denoted, for example, with \(\ket{\psi}=\ket{0}\otimes\ket{0}\otimes\ket{0}\) or simply as \(\ket{0}\ket{0}\ket{0}\) or \(\ket{000}\). Operators on the composite state are also Kronecker products of individual operators, so \(U\ket{\psi}=U_{1}\otimes U_{2}\ket{00}=U_{1}\ket{0}\otimes U_{2}\ket{0}\). We can re-express the qubit state written as a series of \(0^{\prime}\)s and \(1^{\prime}\)s into a decimal number by assigning an order to the qubits, then converting the binary string into a decimal number. Thus, we could take the string of qubits \(q_{1},\ q_{2},\ \ldots,q_{n}\) and create the decimal number \(x=\sum_{k=1}^{n}2^{k-1}q_{k}\). Most of the paper deals with results written in this decimal form. The QPE algorithm is used in a number of quantum codes and determines the eigenvalues of a general unitary operator \(U\) with corresponding eigenvectors, \(\ket{u}\). The eigenvalues have the form \(e^{2\pi i\theta}\), where \(\theta\in[0,1)\) is the \"phase\" of the unitary operator. In this paper, we will deal with a restricted situation where we only have one phase to estimate for each unitary operator. In order to estimate the phase of some unitary operator, we must begin with a circuit with \(N\) qubits split into a first and second register with \(n\) and \(m\) qubits, respectively. Initially, all qubits in the first register are set to the \(\ket{0}\) state and the qubits in the second register are set to an eigenvector of the unitary operator \(\ket{u}_{2}\), where the subscript \(2\) denotes the fact that this ket refers to the state of the second register. This leads to an initial state of \(\ket{\psi_{1}}=\ket{0}^{\otimes n}\otimes\ket{u}_{2}\).