# Metric for Estimating Congruity between Quantum Images +
## 3 A Measure for Fidelity between Quantum Images
### Fidelity Check Operation (FCO)
#### 3.3.2 Bit Error Rate Operation (BO)  
In addition to domiciling the assessment of fidelity between two images to the quantum computing domain, being a pixel difference-based image quality measure, our proposed QIFM metric must be capable of computing the difference in the chromatic (or greyscale, in the strict sense) values of the content of the test and reference image pair whose fidelity is being measured [1]. To do this, we utilise the bit error rate (\(BER\)) measure that is widely used in other engineering and computer science domains. In order to execute this, we adduce the need for a \(BER\) transformation sub-circuit, (which we shall refer to as the \(BER\) operation or simply \(BO\) operation) which, as shown in Figure 4, is executed on ancillary information about the \(2^{n}\times 2^{n}\) pixels encoding the reference and test images.  
Similar to other formulations in FRQI QIP [13; 14; 20], we assume that this ancillary information is obtained from the classical versions of the reference and test image pair. The process of interacting the ancillary content with a separately prepared quantum register without disrupting the \"quantumness\" of the overall setup was highlighted in Figure 3B and is well documented in available in the literature, notably in [14; 17; 24].  
Relying on this formalism, we further assume that the ancillary information about the reference and test image pair can be safely interacted with the content of the strip in Figure 6. For brevity, however, only the ancillary information (i.e., without the interaction with the strip that was shown earlier in Figure 4) is presented in Figure 7.  
Figure 6: QIFM sub-circuit to execute the Binary check operation (\(BCO\)) of the QIFM image metric.  
The different colours used in the figure are meant to denote the different layers of the ancillary control-conditions and are only meant to separate the ancillary information about the reference image from those of the test image.  
Similar to its use earlier in this section, the half-moon control-condition (\(\blacklozenge\)) depicts that a control-condition could be either a 1-control (\(\blacklozenge\)) or 0-control (\(\Circle\)) as determined by the binary value of each pixel in the reference and test image pair, \(b\).  
The readout shown in the short-dashed rectangle in Figure 7 provides the (0 or 1) output required to compute the \(BER_{j}\) for the corresponding \(i\)th pixel in the \(j\)th pair of the reference and test images as defined in Equation (12):  
\[B_{j}=\frac{\sum BER_{j}}{8N} \tag{12}\]  
where \(B_{j}\) computes the total pixel-wise variation (i.e., discordance) in the \(j\)th pair of images, each comprising of \(N\) = \(2^{n}\times 2^{n}\) pixels.  
As seen from the \(BO\) sub-circuit in Figure 7, the \(BO\) operation requires a total of 9 qubits to encode; and \(m\times 2^{n-s}\) controlled (\(8+(m+(n-s)\)) condition measurements are required to confine the operation to any predetermined \(2^{s}\times 2^{s}\) ROI in a strip consisting of \(2^{m}\) FRQI images, each of size \(N\) = \(2^{n}\times 2^{n}\)[1].  
By combining the two sub-circuits that were presented earlier (i.e., the \(BCO\) sub-circuit in Figure 6 and the \(BO\) sub-circuit in Figure 7) into the generalised circuit in Figure 7, we realise our QIFM circuit, which performs the fidelity check operation (\(FCO\)) needed to assess the fidelity between two images.  
Utilising the different measurements in the operation, we quantify the fidelity between the reference and test images in the \(j\)th pair of images using Equation (13):  
\[F_{j}=D_{j}+(1-B_{j})\times I_{j} \tag{13}\]  
Equation (13) can be expressed in the form of a percentage as presented in Equation (14):  
\[F_{j}^{\%}=\frac{F_{j}}{N}\times 100 \tag{14}\]  
In order to validate the utility of the proposed QIFM technique as an effective to tool assess the fidelity between FRQI quantum images, we applied the framework described in this study on a dataset of popularly used real images. The results and discussions on this are presented in the next section.