# Metric for Estimating Congruity between Quantum Images +
## 2 Strip Representation and Its Use in the Probability-Based Comparison of Images  
The strip representation \(\ket{S(m,n)}\) was first formulated in [14] as an array comprising \(2^{m}\) flexible representation for quantum images (FRQI, [12]) images each of \(2^{n}\times 2^{n}\) size in the form defined in Equation (1):  
\[\ket{S(m,n)}=\frac{1}{2^{\frac{n}{2}}}{\sum_{s=0}^{2^{m-1}}}\ket{I_{s}(n)} \otimes\ket{k} \tag{1}\]  
where:  
\[\ket{I_{s}(n)}=\frac{1}{2^{n}}{\sum_{i=0}^{2^{2n}-1}}\ket{c_{s,i}}\otimes\ket{i} \tag{2}\]  
with:  
\[\ket{c_{s,i}}=\text{cos}\theta_{s,i}\ket{0}+\text{sin}\theta_{s,i}\ket{1} \tag{3}\]  
\[\theta_{s,i}\in\left[0,\frac{\pi}{2}\right],\;i=0,1,\cdots,2^{2n}-1\;\;\text{ and}\;s=0,1,\cdots,2^{m}-1 \tag{4}\]  
where \(\ket{k}\) is the position of each image in the strip, \(m\) is the number of qubits required to encode the images being compared, \(\ket{I_{k}(n)}\) is a FRQI image as defined in Equation (1) at position \(\ket{k}\), \(\ket{c_{k,i}}\) and \(\ket{i}\) encode the information about the colours and their corresponding positions in the image \(\ket{I_{k}(n)}\). It is trivial to see that the state \(\ket{S(m,n)}\) is a normalised one capable of encoding \(2^{m}\) quantum images using only \(m+2n+1\) qubits. As mentioned earlier, the strip representation was first conceived in [14] where it was utilised as the backbone for the framework to represent and produce quantum movies. Later, it was used to compare similarity between images [23], in database search [15], and in quantum video encryption and decryption [22]. Inspired by the utility of image search and retrieval on digital computers, the studies in [15; 19; 23] explored the possibility of undertaking similar tasks on quantum computers. Therein, similarity between two FRQI quantum images \(\ket{I_{a}(n)}\) and \(\ket{I_{b}(n)}\) (as a function of their pixel information \(\sigma_{a,b}\)) was obtained by traversing every position in the image. In this context, similarity (\(Sim\)), is defined in Equation (5):  
\[Sim\left(\ket{I_{a}},\ket{I_{b}}\right)=f(\sigma_{a,b}^{0},\sigma_{a,b}^{1}, \cdots,\sigma_{a,b}^{2^{2n}-1}), \tag{5}\]  
where \(Sim(\ket{I_{a}},\ket{I_{b}})\in[0,1]\). Based on the definition in Equation (5), two special cases of the similarity between two quantum images can be deduced as follows:  
1. if \(\forall i,\sigma_{a,b}^{i}=\pi/2\), then \(Sim(\ket{I_{a}},\ket{I_{b}})=0\) and the two images are considered as being totally different (or dissimilar), where \(i=0,1,\cdots,2^{2n}-1\;\sigma_{a,b}^{i}\) is the joint pixel information retrieved from the reference and test image pair;
2. if \(\forall i,\sigma_{a,b}^{i}=0\), then \(Sim(\ket{I_{a}},\ket{I_{b}})=1\) and the two images are considered as exact matches, where \(i=0,1,\cdots,2^{2n}-1\), \(\sigma_{a,b}^{i}\) is the joint pixel information retrieved from the reference and test image pair. The circuit structure to compare these two FRQI quantum images (shown in Figure 1) requires a Hadamard gate, \(H\) that maps the basis states \(\left|0\right\rangle\) to \((\left|0\right\rangle+\left|1\right\rangle)/\sqrt{2}\) and \(\left|1\right\rangle\) to \((\left|0\right\rangle-\left|1\right\rangle)/\sqrt{2}\) that are applied on the strip wire, which is a combination of a reference image \(\left|I_{0}(n)\right\rangle\) and a test image \(\left|I_{1}(n)\right\rangle\). The final step in the circuit is the measurement operation \(M_{0}\) (always shown with two parallel lines exiting a small rectangular box), which is used to recover the final readout resulting from the operations. Based on the foregoing, it is obvious that the result of the measurement operation \(M_{0}\) depends on the disparities between \(\left|I_{0}(n)\right\rangle\) and \(\left|I_{1}(n)\right\rangle\). The states \(\left|0\right\rangle\) and \(\left|1\right\rangle\) subsist on the strip wire \(S_{0}\) at a certain probability.