# Metric for Estimating Congruity between Quantum Images +
## 2 Strip Representation and Its Use in the Probability-Based Comparison of Images
In accordance with the measurement postulate used in [23], the probability of state \(\left|0\right\rangle\) on this strip wire is:  
\[P_{S_{0}}\left|0\right\rangle=\frac{1}{\left(2^{2n+1}\right)^{2}}\sum_{i=0}^{ 2^{2n}-1}\left[1+\cos(\theta_{0,i}-\theta_{1,i})^{2}+(\sin\theta_{0,i}+\cos \theta_{1,0})^{2}\right]=\frac{1}{\left(2^{2n+1}\right)^{2}}\sum_{i=0}^{2^{2n }-1}\left[1+\cos(\theta_{0,i}-\theta_{1,i})\right]\text{.}\]  
Therefore:  
\[P_{S_{0}}\left|0\right\rangle=\frac{1}{2}+\frac{1}{2^{2n}+1}\sum_{i=0}^{2^{2n }-1}\cos\omega_{0,1}^{i} \tag{6}\]  
In the same manner, the probability of state \(\left|1\right\rangle\) on the same wire is:  
\[P_{S_{0}}\left|1\right\rangle=\frac{1}{2}-\frac{1}{2^{2n}+1}\sum_{i=0}^{2^{2n }-1}\cos\omega_{0,1}^{i} \tag{7}\]  
The probabilities of these two states sum up to 1, i.e., \(P_{S_{0}}\left|0\right\rangle+P_{S_{0}}\left|1\right\rangle=1\), as they should [22]. It is apparent that, arising from Equations (6) and (7), the pixel difference \(\omega_{0,1}^{i}\) is related to the probability of obtaining a readout of 1 from the strip wire \(S_{0}\), \(P_{S_{0}}(\left|1\right\rangle)\), in the measurement and that this probability \(P_{S_{0}}(\left|1\right\rangle)\) will increase when the pixel difference increases. Furthermore, the similarity between two images, which is a function of the pixel differences at every position, depends on \(P_{S_{0}}(\left|1\right\rangle)\) as given in Equation (8) [23]:  
\[Sim\left(\left|I_{0}\right\rangle,\left|I_{1}\right\rangle\right)=1-2P_{S_{0}} (\left|1\right\rangle)=\frac{1}{2^{2n}}\sum_{i=0}^{2^{2n}-1}\cos\omega_{0,1}^{ i} \tag{8}\]  
where \(\left|I_{0}(n)\right\rangle\) and \(\left|I_{1}(n)\right\rangle\) are the two images being compared, \(P_{S_{0}}(\left|1\right\rangle)\) is in the form defined in Equation (7), and \(Sim(\left|I_{a}\right\rangle,\left|I_{b}\right\rangle)\in[0,1]\). The similarity between the states \(\left|I_{0}(n)\right\rangle\) and \(\left|I_{1}(n)\right\rangle\) that are encoded in the strip agrees with the definition of similarity between two FRQI quantum images in Equation (5), therefore:  
\[f(\sigma_{a,b}^{0},\sigma_{a,b}^{1},\cdots,\sigma_{a,b}^{2^{2n}-1})=\frac{1}{ 2^{2n}}\sum_{i=0}^{2^{2n}-1}\cos\omega_{0,1}^{i}\text{.} \tag{9}\]  
\[\ket{I_{s}(n)}=\frac{1}{2^{n}}{\sum_{i=0}^{2^{2n}-1}}\ket{c_{s,i}}\otimes\ket{i} \tag{2}\]0 Circuit structure for comparing similarity between two FRQI quantum images (figure adapted from [15; 23]). Figure 2 shows the generalised circuit required to compare similarity between multiple FRQI quantum images in a strip. The circuit shows that \(G_{S}\) operations on the \(m\) strip wires; \(m\) (0 or 1 controlled operations that are depicted using the half-moon notation that is further explained in Section 3); \(\mathrm{G}_{I}\) operations that lead to geometric exchanges between \(2^{m}\) images encoded in the strip; and zero (0) or one (1) \(2n\)-control condition Hadamard operations followed by \(m\) measurement operations are needed in order to compare the similarity between multiple quantum images. It should be noted that the measurements \(M_{0}\) to \(M_{m-1}\) that are depicted in Figure 2 are standard measurement operations that lead to the collapse of the quantum state, and as such the images encoded on the strip are lost after each measurement cycle is executed [14]. As highlighted in [14], in the QIP context, complexity is analysed in terms of three parameters. These parameters are: firstly, cost, which is expressed in terms of the basic quantum gates used to accomplish any transformation on an image; secondly, the width of circuit, which depends on the size of the image and is usually fixed for any \(N\times N\) image; and thirdly, the depth of the circuit, which represents the number of layers into which the entire circuit can be efficiently partitioned. In other words, complexity is influenced by the dimension and types of control operations required to execute an operation. As seen in Figure 2, [PERSON] et al.