Quantum Image Searching Based on Probability Distributions

A quantum image searching method is proposed based on the probability distributions of the readouts from the quantum measurements. It is achieved by using low computational resources which are only a single Hadamard gate combined with m + 1 quantum measurement operations. To validate the proposed method, a simulation experiment is used where the image with the highest similarity value of 0.93 to the particular test image is retrieved as the search result from 4 × 4 binary image database. The proposal provides a basic step for designing a search engine on quantum computing devices where the image in the database is retrieved based on its similarity to the test image


Introduction
Research on quantum image processing has started from proposals on quantum image representations such as Qubit Lattice [1], Real Ket [2], and Flexible Representation of Quantum Image (FRQI) [3].On the basis of these image representations, basic quantum operations can be realized by applying the elementary gates such as Pauli-X and Hadamard gates combined with appropriate quantum measurements [4,5].For example, several processing transformations have been proposed based on the FRQI representation such as the geometric transformations, GTQI [6], and the CTQI [7], which focuses on the color information.In addition, a method to analyze the similarity between two FRQI quantum images of the same size is suggested in [8], which advances a fundamental step towards image searching on quantum mechanical systems.
Inspired by the image searching on conventional computers, the research on quantum image searching is also an indispensible field on quantum image processing.In order to improve the limitation of the traditional searching, e.g.only text based and time consuming, the quantum image searching on the strength of the content of the images can be executed in parallel to realize more efficient computation.
A quantum image searching method is proposed whereby an image could be retrieved as a search result from a database based on the extent of its similarity in comparison with the particular test image.The searching result is provided by the probability distributions from two types of quantum measurements, the first of which, Z-axis measurement, represents the similarity between two current images being compared; the second type, S-axis measurements, gives the position of the compare-ing results in Z-axis measurement.Succinctly put, the main contributions of this work include the analysis of the similarity between multiple pairs of images simultaneously and the proposal of the whole scheme for the image searching on quantum mechanical systems.
The searching process is based on "parallel compareson", where 2 m pairs of quantum images are compared in parallel.In addition, the method is executed using low computational resources in comparison with performing the same task on traditional computing devices, since only a single Hadamard gate as well as m + 1 quantum measurement operations could transform the entire information encoding the quantum images in a strip simultaneously.
The Z-Strip is defined based on the flexible representtation of quantum images (FRQI) in 2. The proposed scheme to realize image searching on quantum mechanical systems is presented in 3. The simulation experiment and its discussion are shown in 4.

Representation of Z-Strip to Indicate Multiple FRQI Images
For the quantum image processing, a good deal of opera-tions are done by relying on the corresponding applicaitons on classical image processing as reference [3,9].The flexible representation for quantum images, FRQI [3], which is similar to the pixel representation for images on conventional computers, captures the essential information about the colors as well as the corresponding positions of every point in an image and integrates them into a quantum state having its formula in (1), cos 0 sin 1 , where 0 and 1 are 2-D computational basis quantum states, i , are 2n-D computational basis quantum states and , is the vector of angles encoding colors.There are two parts in the FRQI representation of an image; 2 0,1, , 2 1 and i which encode information about the colors and corresponding positions in the image, respectively.
A dexterous property of Z-strip representation encoding 2 m+1 -ending FRQI images is its ability to utilize the parallelism inherent to quantum computation in order to transform multiple images using very few quantum resources.The Z-strip representation is defined in Definition 1.
Definition 1 A Z-strip,   , Z m n , is a horizontal combination of two strips [10], which are located on the left and right side, respectively.The state of Z-strip is defined by , , , , , , cos 0 sin 1 , , , , , , , cos 0 sin 1 , As seen in Figure 1, the size of a Z-strip in the representation captures the input state comprising 2 m+1 quantum images.The Z-axis differentiates the strip which is located on the left and the right position.Each image in the Z-strip is an FRQI state while the combination of such states in the Z-strip is best represented as a Z-FRQI state.
The Z-FRQI state represents 2 m + 1 quantum images using only m + 2n + 2 qubits since all of the images are of the same size on this Z-strip.A notation "○" for "0" or "•" for "1" control-condition on Z-axis or S-axis, is sufficient to specify any quantum image in the Z-strip.In addition, combining with the control-conditions from the position y x to the color wire; every pixel in this strip can be accessed.The representation also facilitates the quantum operation to all the images in this strip.
An example that has two 2 × 2 images on both the left and right side of the Z-strip, respectively, including its circuit structure and Z-FRQI state is shown in Figure 2.

Image Searching on Quantum Mechanical Systems
Inspired by the image searching on conventional computer, quantum image searching from a database is also an indispensable field in quantum image processing [11,12].A first step towards realizing that would be to propose a scheme so as to evaluate the extent to which two or more images are similar to one another.The parallel computation on quantum computer leads us to find a way      1 0 s s P P that comparing many pairs of images in parallel.The proposal of the Z-strip comprising 2 m+1 images in the Definition 1 provides us a crucial condition to make the parallel comparison of quantum images possible because the operation on the strip wires can transform the information in every image simultaneously.The generalized circuit structure of comparing 2 m pairs of FRQI quantum images in parallel is presented in Figure 3.
 , as they should.
Definition 2 Pixel difference in position i, where , , l s i  and , , r s i  represent the color information at position i of the two images which are at the sth position of the Z-strip, respectively.The input of this circuit is the Z-FRQI state as defined in (4), a Hadamard gate, which maps the basis state 0 to   , is applied on the Z-axis to obtain the new mathematical expressions between the two images being compared.The final step in the circuit consists of m + 1 measurements from which the similarity can be retrieved in each pair of images.
It is apparent that, arising from (15) and ( 16), the pixel difference , s i  is related to the probability of getting readout of 1 from the Z-axis,   , in the measurement and   will increase when pixel difference increases.Furthermore, the similarity between the two images, which is the function of the pixel differences at every position, depends on   as given by When n experiments are performed, the measurement results on the Z-axis follow a binomial distribution.The probability of obtaining k readouts of 1 in n experiments is given by the probability mass function  is defined in (15), and , 0 where X is the incident that the result of measurement is 1, p is the probability of 1 when the results on the Z-axis are measured, .0,1, , Two special cases of the similarity between two quantum images are listed as follows: .
Meanwhile, the measurement results on the S-axis, , give the position of probabilities of the measurements on the Z-axis.According to the readouts on both the measurements, the similarity between each pair of images on the Z-strip can be assessed, from which the quantum image searching can be realized.Corresponding to the circuit shown in Figure 3, the state of quantum system after applying the Hadamard gate on the strip wire can be shown in ( 12) and (13).
Obviously, the result of the measurement depends on the disparities between In the same manner, that of state 1 on the same wire is The probabilities of these two states sum up to 1, where Based on the comparison method and the probability distributions introduced above, the scheme to accomplish the image searching on quantum mechanical systems is presented in Figure 4.
The quantum images are prepared from the classical images using FRQI representation [3,8,10,13].The color information as well as the corresponding positions of every point in the classical image is integrated into the quantum state, and 2 m+1 quantum images being compared are combined as a Z-strip.Because of the superposition property of quantum computation, such a work can be realized using only a few quantum resources.
The Z-strip prepared in the preceding period is transformed using a gate array comprising of geometric, GTQI [6], and color, CTQI [7], transformations on all the images in the strip.For this particular application, the transformations are built in a way to allow the recovery of the pixel difference as defined in ( 16).This transformation unit combines with measurement operations that follow it to convert the quantum information into the classical form as probability distributions.The Z-strip is prepared n (n > 1) times to compare the similarity between two quantum images in parallel since a measurement would destroy the superposition state in the quantum system [5].Extracting and analyzing the distributions gives information that the similarity values between the quantum images being compared, so that the image with the highest similarity to the particular test image could be retrieved as a result from the database.
The operation to search image on quantum mechanical systems is realized by using only a single Hadamard gate and several measurements.Such an image searching scheme, however, can only be achieved on a classical computer by comparing one pair of images at a time.Hence, the proposed method offers a significant speed-up compared to how it is performed using classical computing resources.

A Simulation Experiment to Search Quantum Images from Database
A conventional desktop computer with Intel Core i7, 2 Duo 2.80 GHz CPU, 4GB RAM and 64bit operating system is used to simulate the experiment.The simulation experiment is based on linear algebra with complex vectors as quantum states and unitary matrices as unitary transformations using Matlab, and the program is encoded by means of equations as well as the definitions that are introduced in earlier sections of this paper.The purpose of this experiment is that to search the image from a database which has the highest similarity with the test image.s is constituted as shown in Figure 5.
The corresponding circuit structure to realize such an image searching is presented in Figure 6.There are three steps to achieve this comparison:  is prepared from the classical version using FRQI representation and integraed to a Z-strip state with the images D in the databse.
Step 2. A Hadamard operation is applied on the Z-axis in order to compare the test image   The foregoing experiment provides the foundation for the next step in quantum image processing based on the FRQI representation.The results as indicated in this section show that the quantum image searching on quantum mechanical systems is feasible and practical.Furthermore, the target area to apply the proposed method is the development of the search engine on quantum computing devices.

Conclusions
The simulation experiment is performed to search for a target image from an original database comprising of sixty-four (64) binary images.There are 12 qubits which encodes each image in the Z-strip and 7 quantum measurements which are for converting the quantum information to the classical form as probability distributions in the circuit.According to the readouts from the measurements, the similarity of each pair between the test image and the images in the database is calculated.For the simulation-based database used in this paper, the 38th image,   37 2 D , with the highest similarity value of 0.93 is retrieved as search result.It is concluded that the more images in the database, the better the ability of the proposed method.This is because m qubits on the strip wires can represent 2 m quantum images in the Z-strip,and  only one qubit on the Z-axis can represent the images on both the left and right side of Z-strip.This further demonstrates the low computational resources of the proposed method compared to performing the same task on traditional computing devices.
As for future work, the proposal will be applied on designing a search engine on such quantum computing devices that the image in the database is retrieved based on its similarity to the test image.Most of the search engines recently are only based on the text to realize the searching.Even some searching is developed based on the content of the images.It is, however, usually time-consuming.This work, which realizes the searching based on the content of the images and is executed in parallel, proposes a basic step for the quantum image searching, especially when a database comprising of a huge amount of data is confronted.quality of the manuscript and opened numerous perspectives geared toward improving the work in the future.

Figure 1 .
Figure 1. Circuit structure to encode the Z-strip input.

Figure 2 .
Figure 2.An example of Z-strip, its circuit structure and Z-FRQI state.
the two images being compared, two images are exactly the same, where i = 0, 1, •••, 2 2n − 1, , s i  is the pixel difference at position i as defined in Definition 2.

Figure 3 .
Figure 3. Generalized circuit structure for parallel comparison of quantum images.

Figure 4 .
Figure 4. Block diagram of scheme to realize image searching on quantum mechanical systems.
An original database which includes sixty-four (64) 4 × 4 binary image data is used, then the Z-strip comprising of

Figure 5 .
Figure 5. Image searching from database D .

3 . 2 TFigure 8 .
The measurements which convert the quantum information to the classical form are used on the S-axis and Z-axis to distribute the readouts from which the histogram is built to reflect the similarity of the 64 pairs of images.The circuit comprises of 12 qubits of which 6 are used to address positions of the image, 1 qubit is reserved for storing the information about the colors, and the remaining qubits are prepared for representing the Z-strip wire where the Hadamard gate and measurement M Z are applied.A simulation of a single Hadamard gate and 7 measurement operations are used to obtain the similarities for these 64 pairs of images based on the probabilities of getting the readouts on the Z-axis and S-axis in the measurements as shown in the Figure 7. From the histogram, the image   37 2 D , which manifests the highest similarity value of 0.93 to the test image   is retrieved as the search result.There is only one different grid between the test image and It is testified from that the quantum image searching is based on the pixel difference between the test image and the images in the database.

Figure 7 .
Figure 7. Similarities among different pairs of images in Z-strip.

Figure 8
Figure 8.The test image   2 T and the retrieved image