Abstract
Multi-dimensional color image processing has two difficulties: One is that a large number of bits are needed to store multi-dimensional color images, such as, a three-dimensional color image of \(1024 \times 1024 \times 1024\) needs \(1024 \times 1024 \times 1024 \times 24\) bits. The other one is that the efficiency or accuracy of image segmentation is not high enough for some images to be used in content-based image search. In order to solve the above problems, this paper proposes a new representation for multi-dimensional color image, called a \((n\,+\,1)\)-qubit normal arbitrary quantum superposition state (NAQSS), where \(n\) qubits represent colors and coordinates of \({2^n}\) pixels (e.g., represent a three-dimensional color image of \(1024 \times 1024 \times 1024\) only using 30 qubits), and the remaining 1 qubit represents an image segmentation information to improve the accuracy of image segmentation. And then we design a general quantum circuit to create the NAQSS state in order to store a multi-dimensional color image in a quantum system and propose a quantum circuit simplification algorithm to reduce the number of the quantum gates of the general quantum circuit. Finally, different strategies to retrieve a whole image or the target sub-image of an image from a quantum system are studied, including Monte Carlo sampling and improved Grover’s algorithm which can search out a coordinate of a target sub-image only running in \(O(\sqrt{N/r} )\) where \(N\) and \(r\) are the numbers of pixels of an image and a target sub-image, respectively.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Avoid common mistakes on your manuscript.
1 Introduction
Quantum computing [1] which has the unique computing performance of quantum coherence, entanglement, superposition of quantum states and other inherent characteristics quickly becomes an international research focus. In fact, utilizing the unique properties, Shor’s discrete logarithms and integer factoring algorithms in polynomial time [2], Deutsh’s parallel computing algorithm with quantum parallelism and coherence [3] and Grover’s quadratic speedup for unordered database search algorithm [4] are insurmountable so far by any known classical algorithms.
Since the amplitude or phase of a quantum state can be used to store information [16], a quantum system is superior to a classical computer for information storage (e.g., we may consider a system of n qubits which can store \({2^n}\) complex numbers. For \(n=500,\,{2^{500}}\), this number is lager than the estimated number of atoms in the Universe! Trying to store all these complex numbers would not possible on any conceivable computer [12]). In a quantum system, frequency of the physical nature of color could represent a color instead of the RGB model or the HIS model, so a color was represented by only a 1-qubit quantum state [5] and an image was stored in a quantum array [5, 6]. A quantum composite state (FRQI state) stored the colors and the coordinates of a 2D gray image of \({2^n}\) pixels with (\(n+1\)) qubits [7]. A set of quantum states (QSMC) was proposed to represent \(M\) colors in an image and discussed how to retrieve images stored in a quantum system [8]. The phase-space distribution functions (Wigner and Husimi functions) were used to store an image in a quantum system [10].
Quantum computing can be realized by quantum gate operations. A finite set of basic gate operations was used to construct any quantum gate operation [11]. Universal quantum gates were expressed as the combination of one-bit gate and two-bit gates [12, 13], and two-bit gates were universal for quantum computing [14]. An efficient scheme was proposed for initializing a quantum register with an arbitrary superposed state, and application of the scheme in three special cases was discussed [15].
Many scholars have studied Grover search algorithms. Grover’s algorithm was generalized to deal with an arbitrary initial amplitude distribution, and a bound of the success probability of searching a marked state was derived [17]. For the known number of solutions, the rotation phase \(\pi \) in Grover’s algorithm was replaced with an arbitrary phase of the rotation and modified algorithm’s properties were analyzed by recursion equations [18]. In order to search out marked states with the maximum success probability, rotational phases of Grover algorithm must satisfy certain matching conditions [9, 19, 20].
Content-based image search is an emerging technology [21], and the image segmentation is a key technology. Significant progress had been made in field of image segmentation, for example, snake- and region growing were combined with a principled framework [21]. But for content-based image search, the accuracy or efficiency of image segmentation is not high enough for some images by employing classical segmentation algorithms. Such as, snake [22], region growing [23], clustering [24], these algorithms search out a coordinate of a target object in \(o(N)\) where \(N\) is the number of pixels. For some special images (e.g., overlapping target objects [6], the target object and the background whose colors are similar [25]), classical algorithms are difficult to segment target objects. In order to improve the efficiency and accuracy of content-based image search, image segmentation information is extracted from an original image by using classic segmentation algorithms in advance. For some special images (e.g., overlapping target objects), we can get segmentation information of target objects from the image with human–computer interaction (e.g., using Photoshop software). And then, we store the colors, coordinates and segmentation information of an image in a quantum system. It is a motivation to propose that a (\(n+1\))-qubit normal arbitrary quantum superposition state (NAQSS) represents a multi-dimensional color image (including segmentation information) in this paper. On the basis of the color treatment strategy in the paper [8], we design a generic quantum circuit to transform a simple initial state \({\left| 0 \right\rangle ^{ \otimes (n + 1)}}\) into a NAQSS state to realize an image storage. And the generic quantum circuit is optimized by a quantum circuit simplification (QCS) algorithm. For the purpose of retrieving the entire image from a quantum system, we measure directly the NAQSS state with a set of projection measurement operators and calculate the maximum number of measurements (namely, Monte Carlo sampling). We adopt an improved Grover search algorithm with arbitrary rotation phases and an arbitrary initial state to efficiently retrieve a target sub-image of an image (e.g., search out a coordinate of a target sub-image only running in \(O(\sqrt{N/r})\)).
The paper is organized as follows: An image representation are presented in Sect. 2. The realizations of image storage and quantum circuit optimization are discussed in Sect. 3. Multi-dimensional color image retrievals are described in detail in Sect. 4. Conclusion is shown in Sect. 5.
2 Basic quantum gates and representation of a quantum image
2.1 Representation of a quantum image
We describe briefly an angle how to represent a color [8] as follows.
A bijective function \({F_1}\) which sets up a one-to-one relationship between color and angle is created
where \(Color = \{ colo{r_1}, colo{r_2}, \cdots ,colo{r_M}\},\,colo{r_i}\) corresponds to the \(ith\) color in ordered \(M\) colors, \(\phi = \{ {\phi _1},{\phi _2}, \ldots ,{\phi _M}\},\,{\phi _i} = \frac{{\pi (i - 1)}}{{2(M - 1)}},\,i \in \{ 1,2, \ldots ,M\}\). For grayscale images, \(M = 256\), colors are sorted in ascending order by the grayscale values. For example, \(colo{r_1}\) and \(colo{r_{256}}\) correspond to grayscale values 0 and 255, respectively. For color images, \(M = {2^{24}}\), we make \(x, y, z\) be the values of \(R, G, B\) in 24-bit RGB true color, and let \(i = x \times 256 \times 256 + y \times 256 + z + 1\), thus, \(colo{r_i}\) corresponds to the value \((x,y,z)\) of \(RGB\). For instance, \(colo{r_1}\) and \(colo{r_{16777216}}\) correspond to RGB values (0,0,0) and (255,255,255).
If \(V\) is a k-dimensional Euclidean space spanned by the orthogonal basis vectors \({b_1},{b_2}, \ldots {b_k}\), a k-dimensional digital image is represented as the function \(f:V \rightarrow R\) where \(V\) notates the position information of an image and \(f\left( V \right) \) is a color set of pixels corresponding to the position \(V\). Let \(f\left( V \right) \subset color\) in this paper, we obtain that the angle set \(\phi \) represents colors of a k-dimensional digital image by (1).
A quantum superposition state in \({2^n}\) dimensional Hilbert space may be expressed as \(\left| {{\psi _a}} \right\rangle = \sum \nolimits _{i = 0}^{{2^n} - 1} {{a_{i}}\left| i \right\rangle } \) where \(\left| i \right\rangle ,\,i = 0,1, \cdots {2^n} - 1\), is a set of orthogonal basis and \({a_i}\) is an arbitrary real.
In order to represent a k-dimensional color digital image, \(\left| {{\psi _a}} \right\rangle = \sum \nolimits _{i = 0}^{{2^n} - 1} {{a_{i}}\left| i \right\rangle } \) is changed
where \(i = {i_1} \cdots {i_j}{i_{j + 1}} \cdots {i_l} \cdots {i_m} \cdots {i_n},\,{v_1} = {i_1} \cdots {i_j},\,{v_{2}} = {i_{j + 1}} \cdots {i_l}\) and \({v_k} = {i_m} \cdots {i_n}\) are the binary expansions for \(i,\ {v_1},\ {v_2}\) and \({v_k}\), respectively; \(\left| i \right\rangle = \left| {{v_1}} \right\rangle \left| {{v_2}} \right\rangle \cdots \left| {{v_k}} \right\rangle \) is a coordinate \(\left( {{v_1},{v_2}, \ldots ,{v_k}} \right) \) in the k-dimensional space \(V\) and \({a_i} \in \phi \) (see (1)) notates the color of pixel corresponding to the coordinate.
To normalize the state \(\left| {{\psi _\phi }} \right\rangle \) in (2), we set
Substituting (3) for \({a_i}\) in (2), we obtain a state \(\left| {{\psi _N}} \right\rangle \)
where \((\sum \nolimits _{i = 0}^{{2^n} - 1} {\theta _{i}^2} ) = 1\) and \(i = {v_1}{v_2} \cdots {v_k}\).
Thus, the state \(\left| {{\psi _N}} \right\rangle \) can represent a k-dimensional color image. For the sake of storing image segmentation information in a quantum state, we create a bijective function \({F_2}\) which sets up a one-to-one relationship between an angle and an integer
where \(Angle = \{ {\beta _0},{\beta _2}, \ldots ,{\beta _{m - 1}}\}\) is an angle set, and \(Number = \{ 1,2, \ldots ,m\}\) is a set of integers, \({\beta _i} = \frac{{i\pi }}{{2(m - 1)}},\,i \in \{ 0,1, \ldots ,m - 1\}\); if \(m = 1\), let \({\beta _0} = 0\).
Assuming that an image is divided into \(m\) sub-images numbered as \(1,2, \ldots m\), we define a quantum state \(\left| \psi \right\rangle \) by changing (4) to represent the whole image (including segmentation information)
where \(\left| {{\chi _i}} \right\rangle = \cos {\gamma _i}\left| 0 \right\rangle + \sin {\gamma _i}\left| 1 \right\rangle ,\,{\gamma _i} \in Angle\) corresponding to an integer from (5), represents the serial number of the sub-image which contains the pixel corresponding to the coordinate \(\left| {{v_1}} \right\rangle \left| {{v_2}} \right\rangle \cdots \left| {{v_k}} \right\rangle \).
Since \(\left\| {\left| \psi \right\rangle } \right\| = \sqrt{\sum \nolimits _{i = 0}^{{2^n} - 1} {\theta _i^2(\cos ^{2}{\gamma _i} + \sin ^{2}{\gamma _i})}} = 1,\,\left| \psi \right\rangle \) is called a normal arbitrary quantum superposition state (NAQSS).
3 Realizations of image storage and circuit optimization
Two unitary matrixes are defined as
\({R_x}(\theta )\) and \({R_y}(\theta )\) have the following properties
where \(I,H,X\) are an identity matrix, a Hadamard matrix and a pauli-x matric, respectively.
A sequence of angles is given as follows
where \(j = 2,3, \ldots n\) and \({i_1}{i_2} \cdots {i_{j - 1}}\) is the binary expansion of an integer. For instance, when \(j = 2\), (11) is rewritten
A controlled-\({R_{xyi}}\) operation is defined
The controlled-\({R_{xyi}}\) operation is a unitary matrix, since \({R_{xyi}}R_{xyi}^ + = {I^{ \otimes j}}\). A unitary matrix \({R_{xj}}\) is given for \(j = 1\) and \(j \ge 2\)
and
Applying successively the unitary matrix \({R_{xj}}\) on the initial state \({\left| 0 \right\rangle ^{ \otimes n}}\), we acquire that \(\left| {{\psi _N}} \right\rangle = (\prod \nolimits _{j = 1}^n {{R_{xj}}} ){\left| 0 \right\rangle ^{ \otimes n}} = \sum \nolimits _{i = 0}^{{2^n} - 1} {{\theta _{i}}\left| {{v_1}} \right\rangle \left| {{v_2}} \right\rangle \cdots \left| {{v_k}} \right\rangle }\).
A controlled-\({R_{yi}}\) operation is defined
Applying successively the unitary matrix \({R_{yi}}\) on the initial state \(\left| {{\psi _N}} \right\rangle \otimes \left| 0 \right\rangle \), we achieve a NAQSS state \(\left| \psi \right\rangle \)
\(\left| \psi \right\rangle \) is realized by the quantum circuit shown in Fig. 1. The circuit is built with (\({{2}^{{n + 1}}}-1\)) quantum gates which can be constructed by one-bit and two-bit gates whose total number is \(o(Nlo{g^2}N)\) where \(N = {2^n}\) is the pixel’s number of an image. Usually, an image may have many same colors or be locally symmetric, and a large number of pixels belong to a sub-image, so we design QCS algorithm (see Algorithm 1) to reduce the quantum gates in Fig. 1. The computational complexity of this algorithm is \(o({N^2}\log N)\).
In order to make the above algorithm explicit, let us consider a \(4 \times 4 \times 2\) image shown in Fig. 2 as an example. From formulas (7)–(18) and Fig. 2, values of \({\alpha _{j,{i_1} \cdots {i_{j - 1}}}}\) are given and QCS algorithm implementation is shown in Table 1. The optimized quantum circuit for the image is shown in Fig. 3.
4 Image retrieval
In order to retrieve images from a quantum system, we adopt two strategies: direct measurement (namely retrieve a whole image by Monte Carlo sampling), retrieve target sub-images whose amplitudes are amplified by applying improved improved Grover’s algorithm. To be simply, we substitute \(\left| i \right\rangle \) for \(\left| {{v_1}} \right\rangle \cdots \left| {{v_k}} \right\rangle \) in (6) in the section, i.e., the NAQSS state is expressed as
We define \(\dim (\left| {{v_i}} \right\rangle )\) as the dimensions of the subspace \(\left| {{v_i}} \right\rangle \), i.e., \(\left| {{v_i}} \right\rangle \) is expressed with \(\dim (\left| {{v_i}} \right\rangle )\) 1-qubit states. To successfully retrieve images, suppose we have a documentation, including the following known information: the values of \(k\) and \(\dim (\left| {{v_i}} \right\rangle )\) of \(\left| i \right\rangle = \left| {{v_1}} \right\rangle \cdots \left| {{v_k}} \right\rangle \), the value of \(\sqrt{\sum \nolimits _{{i}=0}^{{2^n} - 1} {a_i^2} } \), the number of sub-images, the number of pixels of each sub-image, average and variance of color values of each sub-image, projection measurement operator.
4.1 Retrieving a whole image from a quantum system
We define the observable operator \(M = \sum \nolimits _{j = 0}^{{2^{n + 1}} - 1} {{m_j}{P_j}} \) where \({P_j} = \left| j \right\rangle \left\langle j \right| \), apply \(M\) to measure the quantum state \(\left| {\psi } \right\rangle \) in Eq. (19), and obtain result \({m_j}\) with probability \(p({m_j}) = \left\langle {\psi } \right. \left| {{P_j}} \right| \left. {\psi } \right\rangle = \theta _j^2\) , i.e.,
Define \({n_s}\) as the number of samples and suppose that the results of \({n_s}\) measurements are \({n_j}\) times of \({m_j}\), set \(\hat{p}(m_j) = n_j {\big /} n_s \), so we know that \(\hat{p}({m_j}),\,{\widehat{\theta }_j}\) are the estimates of \(p({m_j})\) and \({\theta _j}\), i.e.,
Assuming that a quantum state is detected with the probability of \(1 - \alpha \) in \({n_{\max }}\) measurements, now, we describe how to solve the value of \({n_{\max }}\) (i.e., how many measurements are necessary to acquire the correct value of \({\theta _j}\)) by appropriately changing the method in Sect. 2.2 of paper [8].
Set
Since \(Z\) is either 1 or 0, \(Z\) is a Bernoulli random variable. The probability mass function of random variable \(Z\) is given by
where \(\widetilde{{m_j}}\) notates result of measurement is not \({m_j}\).
The expectation \(\mu \) and variance \(\sigma \) of \(Z\) are \(\mu = p\) and \({\sigma ^2} = p(1 - p)\), respectively. Suppose that \({Z_1},{Z_2}, \cdots {Z_{{n_s}}}\) are \({n_s}\) samples of \(Z\) and \({n_s}\) is sufficiently large, then \({{{(\sum \nolimits _{i = 1}^{{n_s}} {{Z_i} - {n_s}p)}}{\big /} {\sqrt{{n_s}p(1 - p)} }}} = {{{({n_s}\overline{Z} - {n_s}p)}{\big /}{\sqrt{{n_s}p(1 - p)}}}}\) has approximately a standard normal distribution by the Central Limit Theorem. Thus, \(P\{\left| ({n_s}\overline{Z} - {n_s}p) {\big /} {\sqrt{{n_s}p(1 - p)}} \right| < Z_{\alpha /2}^{2}\}\approx 1 - \alpha \) where \(1 - \alpha \) is a confidence level (the value of \(Z_{\alpha {\big /}2}\) can be found in standard normal distribution lookup tables: e.g., when \(\alpha = 0.05\), we can obtain \(Z_{\alpha /2}= 1.96\)). Solving the inequality \(\left| ({n_s}\overline{Z} - {n_s}p) {\big /} {\sqrt{{n_s}p(1 - p)}} \right| < Z_{\alpha /2}^{2}\), we obtain that the confidence interval of \(p\) is \([{p_{\min }},{p_{\max }}]\) with approximate confidence level \(1 - \alpha \). \({p_{\min }}\) and \({p_{\max }}\) are expressed as follows
and
where \(\lambda = Z_{\alpha /2}^2\).
The size of the confidence interval \([{p_{\min }},{p_{\max }}]\) is
Define
where \(\varDelta \theta = {\theta _{\max }} - {\theta _{\min }}\).
Since \(\overline{Z} = {\sum \nolimits _{i = 1}^{{n_s}} {{Z_i}}}{\big /}n_s\) and \(\hat{p}({m_j}) = \overline{Z} \), we know that \({\widehat{\theta }_j} = \sqrt{\overline{Z} }\) and \(\overline{Z} \approx p\) by Law of Large Numbers. The confidence interval of \(p\) is \([{p_{\min }},{p_{\max }}]\); therefore, \(\overline{Z} \in [{p_{\min }},{p_{\max }}]\) and \(p \in [{p_{\min }},{p_{\max }}]\) are with the approximate probability of \(1 - \alpha \). Thus
By (29), we find
Since \({a_j} = {\theta _j}\sqrt{\sum \nolimits _{i = 0}^{{2^n} - 1} {a_i^2} }\) (see (3)), from (29) and (30), we yield
and
where \({G_\phi } = \sqrt{\sum \nolimits _{i = 0}^{{2^n} - 1} {a_i^2}}\) and \({\widehat{a}}_j = {\widehat{\theta }}_j\sqrt{\sum \nolimits _{i = 0}^{{2^n} - 1} {a_i^2}}\).
According to (1), we calculate
where \(i \in \{ 1,2, \cdots (M - 1)\},\,M = {2^{24}}\) or \(M = 256\).
Suppose
Let \(\varDelta \widehat{\phi }= \left| {{a_j} - {{\widehat{a} }_j}} \right| \), from (28), (31), (32) and (34), we see
\(\varDelta \widehat{\phi },\,\varDelta \phi ,\,{a_j},\,{\hat{a}_j},\,{G_\phi }{\theta _{\min }},\,{G_\phi }{\theta _{\max }}\) and \({G_\phi }\varDelta \theta \) are shown in Fig. 4.
Formula (34) is equivalent to
where \(y = \frac{{\varDelta \phi }}{{{G_\phi }}}\).
Solving (36), two solutions are
where \(\lambda \!=\! Z_{{\alpha {\big /}2}}^2,\,y \!=\! \frac{{\varDelta \phi }}{{{G_\phi }}},\,\varDelta \phi \!=\! \frac{\pi }{{2(M - 1)}},\,{G_\phi } \!=\! \sqrt{\sum \nolimits _{i = 0}^{{2^n} - 1} {a_i^2} } \) and \(\overline{Z} \!=\! {{{\sum \nolimits _{i = 1}^{{n_s}} {{Z_i}} }{\big /} n}_s}\).
Let
where \(\left\lceil \cdot \right\rceil \) means rounding up.
Since \({n_ -} \le 0\) in (37), \({n_ - }\) is not selected. Thus, we can acquire the correct quantum state after at most \({n_{\max }}\) (see Eq. (39)) measurements with the approximate probability of \(1 - \alpha \).
Defining \(\overline{a} = \frac{{\sum \nolimits _{i = 0}^{{2^n} - 1} {a_i^2} }}{{{2^n}}}\), we have
Since \({a_i} \in [0,\frac{\pi }{2}]\) (see (2)), we yield that \(\sqrt{\overline{a} } \in [0,\frac{\pi }{2}]\) and \(\sqrt{\overline{a} } \) can be seen as a number which is irrelevant to the size of the number \(n\). From (22), (23) and (40), we infer
Substitute \(\varDelta \phi = \frac{\pi }{{2(M - 1)}},\,{G_\phi } = \sqrt{2^n} \sqrt{\overline{a}}\) and \(\overline{z} \approx \frac{{a_j^2}}{{{2^n}\overline{a}}}\) into (39), so that
where \(N = {2^n}\) (suppose \(N \gg 1\)) is the number of pixels and \(M\) is the number of colors (\(M = {2^{24}}\) for color images and \(M = 256\) for grayscale images).
We can conclude that \({n_{\max }}\) is proportional to \(N{(M - 1)^4}\) by (42).
4.2 Retrieving a target sub-image from a quantum system
Suppose an image is only divided into two sub-images (i.e., target and background), in the case, \(Angle = \left\{ {{\beta _0} = 0,{\beta _1} = {\pi /2}} \right\} \) in (5), let \({\gamma _i} = {\beta _0}\) for \(i \in B\) and \({\gamma _i} = {\beta _1}\) for \(i \in A\), the NAQSS state \(\left| {\psi } \right\rangle \) in (19) is rewritten
where \(A\) and \(B\) are defined as sets contain coordinates of the target and background in an image, respectively. That is to say, \(A\) is a set of marked states and \(B\) is a set of unmarked states. We employ Grover search algorithm to efficiently search out the target sub-image corresponding to marked states. Synthesizing papers [9] and [17–20], we propose an improved Grover’s algorithm which is suitable for the NAQSS state \(\left| {\psi (r)} \right\rangle \) in (43) and describe in detail the Grover search algorithm how to search out the marked states with the minimum number of iterations and the largest success probability.
We assume : \(N = {2^n}\) is a total of states, and \(r\) is a number of marked states; \(A\) and \(B\) are sets of marked and unmarked states, respectively; \({I_r}\) is the rotation operator of marked states, and \({I_0}\) is the rotation operator of the initial state \(\left| {\psi (r)} \right\rangle \) in (43). So Grover search operator is expressed as \({G_\psi } = G \otimes I = - {H^{ \otimes n}}{I_0}{({H^{ \otimes n}})^{ - 1}}{I_r} \otimes I\) where \(H\) and \(I\) are Hadamard and identity matrixes, respectively. \(A,\,B\) , \({I_0}\) and \({I_r}\) are listed as follows
where \(f( \cdot )\) is a quantum oracle (a blank box) of Grover’s algorithm , \(f({i_1}{i_2} \cdots {i_n}1) = 1,\,f({i_1}{i_2} \cdots {i_n}0) = 0,\,i = {i_1}{i_2} \cdots {i_n}\) and \({i_1},{i_2}, \ldots {i_n},j \in \left\{ {0,1} \right\} \).
where \(\alpha \) is a rotation angle of marked and initial states in (45) and (46).
Applying Grover search operator \({G_\psi }\) on \(\left| \psi (r) \right\rangle \)
The state \(\left| \psi (r) \right\rangle \) after \(t\) iterations of \({G_\psi }\) is changed into
We denote the averages of the amplitudes as follows
The recursion equations of the amplitudes take
and
Accumulating (52) and (53) from \(i = 0\) to \(i = N - 1\) , we gain another recursion equations
and
Solving the recurrence Eqs. (54) and (55) to give
and
where \(d = {e^{i\alpha }}{\sin ^2}\theta + {\cos ^2}\theta ,\,\sin \theta = \sqrt{\frac{r}{N}} ,\cos \theta = \sqrt{\frac{{N - r}}{N}} \) ( \(0 \le \theta \le \pi /2\)), and \(\cos \beta = 1 - 2{\sin ^2}\theta {\sin ^2}(\alpha {\big /}2)\) ( \(0 \le \beta \le 2\pi ,0 < \alpha < 2\pi \)).
Subtracting (52) from (54) and subtracting (53) from (55), we find
and
So, we acquire the solutions of (52) and (53) from (58) and (59)
and
From (58) and (59), we can denote the variances of the amplitudes as follows
and
Set \({P_t}\) is the probability of success after \(t\) iterations to search out marked states
Since \({\sigma _l}(t) = {\sigma _l}(0)\), (64) can be rewritten as
When \(\overline{l} (t) = 0\), we define
Simplifying the equation \(\overline{l} (t) = 0\), results are
and
Since \(0 < \alpha < 2\pi \) and \(\cos \theta \ne 0\) (otherwise, the search space is composed by the marked states), we rewrite (67) as
Solving (69), the optimal iterations of Grover is
Where \(\lfloor \rfloor \) means rounding down.
Substitute \(t = 1\) in (69), we derive that the rotation angle \(\alpha \) satisfies
Thus, \({P_t} = {P_{\max }}\) after applying just one iteration when \( - 1 \le \cos \alpha < 1\), i.e.,
Substitute \(t = 2\) in (69), we derive that the rotation angle \(\alpha \) satisfies
Thus, \({P_t} = {P_{\max }}\) after applying just two iterations when
If (72) or (74) are not satisfied, we take \(\alpha = \pi \) in (70) and \({P_t} \approx {P_{\max }}\) after
iterations.
When \({r}\ll N,\,t\) is in maximum. Setting \({r} \ll N\) , from (75), we infer
Therefore, the minimum number of iterations \(t\) is in \(O(\sqrt{N/r} )\) from (71), (73) and (76).
Suppose that
So \(\sum \nolimits _{i \in A} {{P}_t^i} = {{P}_t}\) , \(\sum \nolimits _{i \in A} {{P}_0^i} = {{P}_0}\) from (64). We rewrite (60) as
By (72), (74) or (75), taking appropriate \(t\) and \(\alpha \) in (56), we calculate \(\overline{k} (t)\). Since \({k_i}(0)\) and \(\overline{k} (0)\) are real , by (78), we can suppose
For \({k_i}(0) > 0 (i = 0,1, \ldots (N - 1))\), Grover search algorithm increases the total probability of the marked states and keeps the relative amplitude among the marked states, so \({a} \times {{c}_i} > 0\) (i.e., the signs of \(a\) and \({{c}_i}\) are the same). Hence, from (77) and (79), we yield
Therefore, select \(\alpha \), after \(t\) iterations, \({P_t} = {P_{\max }}\) or \({P_t} \approx {P_{\max }}\). We detect the state \({({G_\phi })^t}(\left| \psi \right\rangle )\) to acquire values of \({\left| {{k_i}(t)} \right| ^2} (i = 0,1, \ldots (N - 1))\) by the method shown in Sect. 4.1 in this paper, and further get values of \({k_i}(0)\) (i.e., amplitudes of the initial state \(\left| \psi (r) \right\rangle \)) from (80), (81) and (82). When \(\sigma _l^2(0) \approx 0\) (colors of the background sub-image are similar), \({P_t} \approx 1\) , in this case, measuring \({({G_\phi })^t}(\left| \psi \right\rangle ) \approx \sum \limits _{i \in A} {{k_i}(t)} \left| i \right\rangle \left| 1 \right\rangle \), we retrieve a coordinate of the marked sub-image with approximate probability 100 % every time.
In order to make the above description explicit, let us consider a \(512 \times 512\) image shown on the left of Fig. 5 as an example. We consider two cases: Only retrieve the coordinates of the edge of the airplane (see the middle of Fig. 5) and retrieve the whole airplane including colors and coordinates (see the right of Fig. 5). The process of the example consists of the following steps.
-
(1)
Store the original image on the left of Fig. 5 in quantum systems as a quantum state \(\left| {\psi (1)} \right\rangle \) or \(\left| {\psi (2)} \right\rangle \).
-
(2)
Apply improved Grover’s algorithm on a quantum state \(\left| {\psi (1)} \right\rangle \) or \(\left| {\psi (2)} \right\rangle \).
-
(3)
Measure the quantum state after \(t\) iterations of Grover and retrieve the target sub-image.
In (1) step, first, we represent colors of the original image by using angles \(\left\{ {{a_i}} \right\} \) (see Eq. (2)). Second, calculating \({\theta _{i}} = \frac{{{a_i}}}{{{G_\phi }}}\) where \({G_\phi } = \sqrt{\sum \nolimits _{y = 0}^{N - 1} {a_y^2} } \) and \(N = 262144\) , we acquire a quantum state (\(\left| {\psi (1)} \right\rangle \) or \(\left| {\psi (2)} \right\rangle \)) as the representation of the original image for No. 1 (the edge of an airplane) or No. 2 (the whole airplane) case.
where \(B\) and \(A\) are defined as two sets containing coordinates of the background sub-image and the edge of the airplane (see the middle of Fig. 5), respectively.
where \(B\) and \(A\) are defined as two sets contain coordinates of the background sub-image and the whole airplane (see the right of Fig. 5), respectively. Third, we create the quantum state (\(\left| {\psi (1)} \right\rangle \) or \(\left| {\psi (2)} \right\rangle \)) by the quantum circuit in Fig. 1. Finally, we store some priori data in quantum systems shown in Table 2.
In (2) step, \(\alpha \) (a rotation angle of marked and unmarked states corresponding to the target sub-image and the background sub-image), \(t\) (the number of iterations of Grover), \({P_{\max }}\) (the max probability of success after t iterations to search out marked states) are calculated by Eqs. (71–75), (66) and shown in Table 3. And then, we design the quantum circuit of the improved Grover’s algorithm shown in Fig. 6.
In (3) step, for No. 1 case, we retrieve a coordinate of the edge of the airplane with probability 94.13 % by measuring the first 19 qubits in (a) of Fig. 6 every time. For No. 2 case, we know that \(\left| {\psi (t)} \right\rangle = \sum \nolimits _{i \in B} {{l_i}(t)} \left| i \right\rangle \left| 0 \right\rangle + \sum \nolimits _{i \in A} {{k_i}(t)} \left| i \right\rangle \left| 1 \right\rangle \) after \(t\) Grover iterations where \({k_i}(t)\) and \({l_i}(t)\) are amplitudes of the marked and unmarked states, and obtain \({\left| {{k_i}(t)} \right| ^2}\) by measuring the first 19 qubits in (b) of Fig. 6. Then, we get \({k_i}(0)\) (i.e., \({\theta _i}\)) by Eqs. (77–82) and calculate \({a_i} = {\theta _{i}} \times {G_\phi }\) which represents a color. We can retrieve a coordinate of the airplane with probability 95.59 % by measuring (b) of Fig. 6 every time, but we retrieve a coordinate of the airplane with probability 8.63 % (\(\sum \nolimits _{i \in A}^{} {{{({\theta _i})}^2}} = 0.0863\)) by measuring directly the original image in Fig. 5.
If the number of sub-images \(2 < m \le 8\), the NAQSS state \(\left| \psi (r) \right\rangle \) in (43) is small changed into
For example, suppose \(m = 4\), let us consider a \(4 \times 4 \times 2\) image shown in Fig. 7 as an example. Grover search algorithm for state \(\left| {{\psi _m}} \right\rangle \) in (85) just needs to redefine the quantum Oracles as following: \(f({i_1}{i_2} \cdots {i_n}00) = 1,\,f({i_1}{i_2} \cdots {i_n}01) = 1,\,f({i_1}{i_2} \cdots {i_n}10) = 1\) and \(f({i_1}{i_2} \cdots {i_n}11) = 1\) correspond, respectively, to No. 0, 1, 2, 3 sub-images in Fig. 7. For example, we retrieve No. 0 sub-image using Grover search algorithm by redefined \(A\) and \(B\)
where \(f({i_1}{i_2} \cdots {i_n}00) = 1, f({i_1}{i_2} \cdots {i_n}{j_1}{j_2}) = 0\) for \({j_1}{j_2} \ne 00,\,i = {i_1}{i_2} \cdots {i_n}\) and \({i_1},{i_2}, \ldots {i_n},{j_1},{j_2} \in \left\{ {0,1} \right\} \).
5 Conclusion
In this paper, a (\(n+1\))-qubit NAQSS state can represent a k-dimensional color image, where \(n\) qubits represent colors and coordinates of \({2^n}\) pixels and 1 qubit represents an image segmentation information to improve the accuracy of image segmentation, while only the image (not including additional segmentation information) is represented by (\(n+1\))-qubits in paper [7]. And we design a general quantum circuit to store an image in quantum systems and study the different strategies to retrieve images from quantum systems. So, the NAQSS provides a foundation not only to represent images but also to explore theoretical and practical aspects of image processing on quantum computers.
References
Feynman, R.P.: Simulating physics with computers. Int. J. Theor. Phys. 21, 467–488 (1982)
Shor, P.W.: Algorithms for quantum computation: discrete logarithms and factoring. In: Proceedings of the 35th Annual IEEE Symposium on Foundations of Computer Science, pp. 124–134. (1994)
Deutsch, D.: Quantum theory, the church-turing principle and the universal quantum computer. Proc. R. Soc. Lond. A 400, 97–117 (1985)
Grover, L.K.: A fast quantum mechanical algorithm for database search. In: Proceedings of the 28th Annual ACM Symposium on Theory of Computing, pp. 212–219. (1996)
Venegas-Andraca, S.E., Bose, S.: Storing, processing and retrieving an image using quantum mechanics. Proc. SPIE Conf. Quantum Inf. Comput. 5105, 137–147 (2003)
Venegas-Andraca, S.E., Ball, J.L.: Processing images in entangled quantum systems. Quantum Inf. Process. 9(1), 1–11 (2010)
Le, P.Q., Dong, F., Hirota, K.: A flexible representation of quantum images for polynomial preparation, image compression, and processing operations. Quantum Inf. Process. 10, 63–84 (2011)
Li, H.-S., Zhu, Q., Lan, S., Shen, C.-Y., Zhou, R., et al.: Image storage, retrieval, compression and segmentation in a quantum system. Quantum Inf. Process. 12(6), 2269–2290 (2013)
Li, H.-S., Zhu, Q., Lan, S., Wu, Q.: The quantum search algorithms for all solutions. Int. J. Theor. Phys. 52(6), 1893–1907 (2013)
Terraneo, M., Georgeot, B., Shepelyansky, D.L.: Quantum computation and analysis of Wigner and Husimi functions: toward a quantum image treatment. Phys. Rev. E 7164, 066215 (2005)
Deutsch, D.: Quantum computational networks. Proc. R. Soc. Lond. A. 425, 73–90 (1989)
Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information. Cambridge University Press, Cambridge (2000)
Barenco, A., Bennett, C.H., et al.: Elementary gates for quantum computation. Phys. Rev. A. 52, 3457–3467 (1995)
DiVincenzo, D.P.: Two-bit gates are universal for quantum computation. Phys. Rev. A. 51, 1015–1022 (1995)
Long, G.-L., Sun, Y.: Efficient Scheme for Initializing a quantum register with an arbitrary superposed state. Phys. Rev. A. 64:014303 (2001) [Foundations of Computer Science 124–134 (1994)]
Ahn, J., Weinacht, T.C., Bucksbaum, P.H.: Information storage and retrieval through quantum phase. Science. 287, 463–465 (2000)
Biron, D., Biham, O., Biham, E., Grassl, M., et al.: Generalized grover search algorithm for arbitrary initial amplitude distribution. In: Quantum Computing and Quantum Communications Lecture Notes in Computer Science. vol. 1509, pp. 140–147. (1999)
Biham, E., Biham, O., Biron, D., Grassl, M., et al.: Analysis of generalized Grover quantum search algorithms using recursion equations. Phys. Rev. A. 63, 012310 (2000)
Li, P.C., Li, S.Y.: Phase matching in Grover’s algorithm. Phys. Lett. A 366(1–2), 42–46 (2007)
Long, G.L., Li, Y.S., Zhang, W.L.: Phase matching in quantum searching. Phys. Lett. A 262, 27–34 (1999)
Datta, R., Joshi, D., LI, J. and WANG, J.Z.: Image retrieval: ideas, influences, and trends of the new age. ACM Comput. Surv. 40(2), Article 5 (2008).
Canny, J.: A computational approach to edge detection. Trans. Pattern Anal. Mach. Intell. PAMI-8(6), 679–698 (1986)
Hojjatoleslami, S.A., Kittler, J.: Region growing: a new approach. IEEE Trans. Image Process. 7(7), 1079–1084 (1998)
Xu, R., Wunseh, D.: Survey of clustering algorithm. IEEE Trans. Neural Netw. 16(3), 645–678 (2005)
Zhang, H., Fritts, J.E., Goldman, S.A.: Image segmentation evaluation: a survey of unsupervised methods. Comput. Vis. Image Underst. 110(2), 260–280 (2008)
Acknowledgments
This work is supported by the 2013 outstanding doctoral academic support plan of University of Electronic Science and Technology of China under Grant No. YBXSZC20131037, Program for New Century Excellent Talents in University (NCET), the Key Project of Chinese Ministry of Education under Grant No. 212094, Humanities and Social Sciences planning project of Ministry of Education under Grant No. 12YJAZH050, Project of Science and Technology of Jiangxi province Grant No. 2012BBE50086, Project of the science and technique funds of Nanchang city Grant No. 2012-KJZC-GY-CXYHZKF-001 and the item of science and technology awarded by Education Bureau of Jiangxi province under Grant Nos. GJJ13361, GJJ13338 and GJJ12311, the National Natural Science Foundation of China under No.71361009.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Li, HS., Zhu, Q., Zhou, RG. et al. Multi-dimensional color image storage and retrieval for a normal arbitrary quantum superposition state. Quantum Inf Process 13, 991–1011 (2014). https://doi.org/10.1007/s11128-013-0705-7
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11128-013-0705-7