## 4 Methodology
### Case Study
#### 5.1.1 Quantum-Storing Layer Using [PERSON]'s Storage Model  
[PERSON]'s storage model is initialized by three disentangled registers as follows: \(|p\rangle\), \(|qn\rangle\), and \(|c\rangle\), the first and the second registers are composed of \(n\) qubit, while the third register is called the quantum control register that is a two-qubit system is initialized with the state \(|01\rangle\). The register \(|p\rangle\) is called the input register that stores the the classical prototype pattern \(p\in Pt\) into the quantum register \(|qn\rangle\). Now lets processed to summarize the \"quantum-sorting\" in the following eight steps [20; 38]:  
* Step 1: The quantum system is initialized by the three registers \(|p\rangle\), \(|qn\rangle\) and \(|c\rangle\) as \(|\psi_{0}\rangle\)= \(|p,qn,c\rangle\). Assuming that the input state is given by \(p=11101\), where the first pattern in Equation (9) is considered, so the initial state can be described as \(|\psi_{0}\rangle\)= \(|11101,00000,01\rangle\).
* Step 2: \(|\psi_{1}\rangle\)=\(\prod_{i=1}^{m=5}T^{2}_{p_{i}2 qn_{i}}|\psi_{0}\rangle=|11101,11101,01\rangle\), where \(T^{2}\) is the toffli gate (Equation (1)).
* Step 3: \(|\psi_{2}\rangle\)=\(\prod_{i=1}^{m=5}NOT_{qq_{i}}XOR_{p_{i}qn_{i}}|\psi_{1}\rangle=|11101,11111,01\rangle\).
* Step 4: \(|\psi_{3}\rangle\)=\(T^{q=5}_{q_{1}q_{1}q_{2}q_{3}q_{4}q_{4}q_{5}}|\psi_{2}\rangle=|11101,11111,11\rangle\).
* Step 5: \(|\psi_{4}\rangle\)=\(S^{6}_{c_{1}c_{2}}|\psi_{3}\rangle=\frac{1}{\sqrt{6}}|11101,11111,10\rangle+ \sqrt{\frac{5}{6}}|11101,11111,11\rangle\), where \(S\) is a Venture and Martinez's gate operator [10; 20] that is defined as follows: \[S^{J}=\left[\begin{array}{cccc}1&0&0&0\\ 0&1&0&0\\ 0&0&\sqrt{\frac{I-1}{J}}&\frac{1}{\sqrt{J}}\\ 0&0&\frac{-1}{\sqrt{J}}&\sqrt{\frac{I-1}{J}}\\ \end{array}\right]\] (10) where \(J\) is the index of the pattern in the patterns set \(pt\).
* Step 6: \(|\psi_{5}\rangle\)=\(T^{n=5}_{q_{1}q_{1}q_{2}q_{3}q_{4}q_{4}q_{5}}|\psi_{4}\rangle=\frac{1}{\sqrt{6}}|11101,11111,00 \rangle+\sqrt{\frac{5}{6}}|11101,11111,01\rangle\).
* Step 7: \(|\psi_{6}\rangle\)=\(\prod_{i=1}^{m=5}XOR_{p_{i}qn_{i}}NOT_{qq_{i}}|\psi_{7}=\frac{1}{\sqrt{6}}|11101,11101,00 \rangle+\sqrt{\frac{5}{6}}|11101,11101,01\rangle\).
* Step 8: \(|\psi_{7}\rangle\)=\(\prod_{i=1}^{m=5}T^{2}_{p_{i}2 qn_{i}}|\psi_{6}\rangle=\frac{1}{\sqrt{6}}|11101,11101,00 \rangle+\sqrt{\frac{5}{6}}|11101,00000,01\rangle\).  
So, it is clear that the pattern \(|11101\rangle\) is stored in the first term of the quantum system (\(|\psi_{7}\rangle\)). Since, the value of \(|c\rangle\) register is \(|01\rangle\) in the second term of the quantum system \(|\psi_{7}\rangle\), consequently the second pattern \(|11001\rangle\) will be stored in the second term of the quantum system \(|\psi_{7}\rangle\) when the quantum-storing algorithm is repeated again. The same procedure will be performed for the remaining prototype patterns. At the end of this storing phase, we will find both of the registers \(|p\rangle\) and \(|c\rangle\) are separable with the register memory \(|qn\rangle\). That means the output of the quantum-storing layer using [PERSON]'s storage model is the register \(|qn\rangle\) that stores the prototype patterns of the set \(Pt\) in a uniform superposition as follows:  
\[|qn\rangle=\frac{1}{\sqrt{6}}(|11101\rangle+|11001\rangle+|10111\rangle+|01000 \rangle+|00100\rangle+|00010\rangle). \tag{11}\]