Skip to main content
Scientific Reports logoLink to Scientific Reports
. 2017 May 31;7:2511. doi: 10.1038/s41598-017-02575-6

Quantum realization of the bilinear interpolation method for NEQR

Ri-Gui Zhou 1,#, Wenwen Hu 2, Ping Fan 2,✉,#, Hou Ian 3
PMCID: PMC5451419  PMID: 28566734

Abstract

In recent years, quantum image processing is one of the most active fields in quantum computation and quantum information. Image scaling as a kind of image geometric transformation has been widely studied and applied in the classical image processing, however, the quantum version of which does not exist. This paper is concerned with the feasibility of the classical bilinear interpolation based on novel enhanced quantum image representation (NEQR). Firstly, the feasibility of the bilinear interpolation for NEQR is proven. Then the concrete quantum circuits of the bilinear interpolation including scaling up and scaling down for NEQR are given by using the multiply Control-Not operation, special adding one operation, the reverse parallel adder, parallel subtractor, multiplier and division operations. Finally, the complexity analysis of the quantum network circuit based on the basic quantum gates is deduced. Simulation result shows that the scaled-up image using bilinear interpolation is clearer and less distorted than nearest interpolation.

Introduction

Image is an important medium for visual information transmission. Image processing is very popular because of the need to extract visual information from the natural world. With the rapid development of quantum computation and quantum information in past several decades, quantum computer has demonstrated a bright prospect over the classic computer, such as Feynman’s computation model1, Deutsch’s quantum parallelism assertion2, Shor’s integer factoring algorithm3, and Grover’s database searching algorithm4.

Quantum image processing (QIMP), a new sub-discipline of information and image processing, which is devoted to utilizing the quantum computing technologies to capture, manipulate, and recover quantum images in different formats and for different purposes. The investigation of QIMP begins with how to store and retrieve quantum images in quantum computers. Venegas-Andraca and Bose firstly proposed the quantum image representation of qubit lattice using one qubit to hold one pixel5. Then Latorre presented real ket representation using quantum superposition state to store image information6. Le et al.7 next proposed a flexible representation of quantum image (FRQI) using quantum superposition state to store the colors and the corresponding positions of an image. Further, more quantum image representations were proposed. For instance, a novel enhance quantum representation (NEQR)8 used q qubits encoding the gray-scale value from 0 to 2q − 1, which could perform the complex and elaborate color operations conveniently. Quantum log-polar image9 was proposed as a novel quantum image representation storing images sampled in log-polar coordinates. Color image representation utilized two sets of quantum states to store M colors and N coordinates, respectively10. A normal arbitrary quantum superposition state was used to represent a multi-dimensional image11. After that, a simple quantum representation of infrared images was proposed12.

In addition, some geometric transformation algorithms of quantum images were designed such as two-point swapping, flip, orthogonal rotations, entire translation, cyclic translation, global and local translation1315. Then, the quantum image scaling algorithms1618 were proposed. In paper16, Sang J et al. realized quantum image scaling for FRQI and NEQR using nearest-neighbor interpolation method. Jiang N et al. designed quantum circuits of quantum image scaling17. Furthermore, Jiang N et al. proposed the generalized quantum image representation (GQIR) and quantum image scaling up based on GQIR and nearest-neighbor interpolation with integer scaling ratio18.

In the aspects of quantum protection, some algorithms have appeared recently such as quantum image scrambling1921, quantum watermarking schemes2225, LSB steganography algorithms based on NEQR26, 27.

Preliminaries

The novel enhanced quantum representation (NEQR)

The NEQR8 is described as follows:

Supposing the range of the gray-scale value is from 0 to 2q − 1, the gray-scale value C YX of the pixel coordinate (Y, X) can be expressed by Eq. (1).

CYX=CYXq1CYXq2CYX1CYX0,CYXk{0,1},CYX[0,2q1] 1

Hence, NEQR for a 2n × 2n quantum image can be written as

|I=12nY=02n1X=02n1|CYX|Y|X=12nYX=022n1k=0q1|CYXk|YX 2

Figure 1 shows an example of a 2 × 2 image, and the corresponding NEQR of which is on the right.

Figure 1.

Figure 1

An example of 2 × 2 image and its NEQR.

Classical bilinear interpolation method

Bilinear interpolation method plays an important role in classical image scaling. In this paper, we mainly study the quantum realization of bilinear interpolation method. Thus, the classical bilinear interpolation method is reviewed.

For a W × H(width and height) image, the size of the corresponding interpolated image is W′ × H′, which can be described in two steps.

Coordinate map

The coordinate (Y′, X′) of the interpolated image is restored from the positions (Y, X), (Y + 1, X), (Y, X + 1) and (Y + 1, X + 1) in the original image. The corresponding relationship is shown in Fig. 2.

Figure 2.

Figure 2

Coordinate map relationship.

Here,

Y=Y×HH,X=X×WW,h=HHYY,w=WWXX 3

Calculating pixel value

As shown in Fig. 3, the value of the destination pixel (x, c) can be obtained by Eq. (4)

cc0xx0=c1cx1x 4

where (x 0, c 0) and (x 1, c 1) are two known pixels. That is to say,

c=(x1x)c0+(xx0)c1x1x0
Figure 3.

Figure 3

Bilinear interpolation method.

An interpolation can be described in Eq. (5)

I=S(I,rx,ry)=Sy(Sx(I,rx),ry)=Sx(Sy(I,ry),rx)n!r!(nr)! 5

where S is the scaling function, I is the original image, I′ is the interpolated image, r y is the scaling ratio in vertical, and r x is the scaling ratio in horizontal. Thus, the pixel value in position (Y′, X′) of the interpolated image shown in Fig. 2 can be calculated according to Eq. (6)

f(Y,X)=(1h)(1w)f(Y,X)+h(1w)f(Y+1,X)+(1h)wf(Y,X+1)+hwf(Y+1,X+1) 6

Quantum circuit realization

In this section, we design a series of quantum circuit modules to realize some special functions.

Basic reversible quantum gates

There are a number of existing 3 × 3 reversible gates such as Fredkin gate28, Toffoli gate29, Peres gate30 and Thapliyal Ranganathan gate31. The quantum cost32, 33 of a reversible gate is the number of 1 × 1 and 2 × 2 reversible gates required in its design. The cost of all the 1 × 1 reversible gates is assumed to be zero such as NOT gate, and the cost of all 2 × 2 reversible gates is taken as unity. Any reversible gate can be realized using 1 × 1 NOT gates and 2 × 2 reversible gates such as Controlled-V, Controlled-V + and Controlled NOT (CNOT) gates. Thus, in simple terms, the quantum cost of a reversible gate is regarded as the number of NOT, Controlled-V, Controlled-V + and CNOT gates required in its implementation circuit. Here, we briefly introduce some basic quantum gates first.

The NOT Gate (X gate) and Hadamard Gate (H gate)

The symbolic representation and matrix representation of X gate and H gate are shown in Fig. 4.

Figure 4.

Figure 4

X gate and H gate.

The function of X gate and H gate is as follows:

X|0=|1,X|1=|0

and

H|0=12(|0+|1),H|1=12(|0|1)

where |0=[10],|1=[01].

The Controlled-V and Controlled-V+ Gates

The Controlled-V and Controlled-V + gates are shown in Fig. 5. If the control signal A = 0, then the qubit B will pass through the controlled part unchangeably, i.e., Q = B. When A = 1, then the unitary operation is applied to the input B, i.e., Q = V (B) or V + (B). Where V is a square-root of X gate and V=i+12(1ii1).

Figure 5.

Figure 5

The Controlled-V and Controlled-V + gates.

The V and V + quantum gates have the following properties:

V×V=V+×V+=XV×V+=V+×V=I

where I=[1001] is an identity matrix. More details of the V and V + gates refer to the literature32, 34.

The CNOT gate

The CNOT gate shown in Fig. 6 has the mapping (A, B) to (P = A, Q = A ⊕ B), where A, B are the inputs and P, Q are the outputs, respectively.

Figure 6.

Figure 6

The CNOT gate.

The Toffoli gate (TG)

The TG and its quantum circuit realization are shown in Fig. 7. The quantum cost of TG is 5, which can be seen from Fig. 7(b).

Figure 7.

Figure 7

The TG and its quantum circuit.

The Peres gate (PG)

The PG is shown in Fig. 8(a). The quantum circuit of PG is shown in Fig. 8(b), then, we can get that the quantum cost of PG is 4.

Figure 8.

Figure 8

PG and its quantum circuit.

The Thapliyal Ranganathan gate (TR)

TR gate and its quantum circuit are shown in Fig. 9. The quantum cost of TR gate is also 4.

Figure 9.

Figure 9

TR gate and its quantum circuit.

Special adding one operation

The special adding one operation U 1 (n) module is shown in Fig. 10, where the label • and ◦ represent the control qubit value |1 and |0, respectively. When U 1 (n) works on the quantum state |an1an2a1a0, then the result is

U1(n)|an1a1a0={|an1a1a0+1,an1×an2××a1×a0{0,1}|an1a1a0,an1×an2××a1×a0={0,1}

where n is a positive natural number, n ≥ 2, a 0, a 1, …, a n−1 ∈ {0, 1}.

Figure 10.

Figure 10

Quantum circuit of U1 (n) module and its simplified graph.

The multiply Control-Not operation

The quantum circuit of the multiply Control-Not operation is shown in Fig. 11(a) and its simplified graph is shown in Fig. 11(b). It utilizes n Control-Not gates to copy the n-qubit information of |Y=|Yn1Yn2Y1Y0 into the n ancillary qubits |0n, where |Yn1,|Yn-2,,|Y1 and |Y 0〉 are the control qubits and the n ancillary qubits |0n are the target qubits. That is, the input |Y|0n is changed into the output |Y|Y by using the multiply Control-Not operation.

Figure 11.

Figure 11

Multiple Control-Not operation and its simplified graph.

The reversible parallel full-adder circuit

Islam M S et al.35 proposed the reversible full-adder based on the PG. Here, the introduction of the design of half-adder, full-adder and parallel-adder are given.

Reversible half adder (RHA)

Figure 12 shows the PG working as a half-adder and its quantum circuit, where R = A ⊕ B represents the sum of A + B and Q = AB represents the carry, respectively.

Figure 12.

Figure 12

The half-adder and its quantum circuit.

Reversible full adder (RFA)

Using two PG gates, the full-adder can be designed shown in Fig. 13(a), where R = A ⊕ B ⊕ C represents the sum of (A + B + C) and S = (A ⊕ B)C ⊕ AB represents the carry, respectively.

Figure 13.

Figure 13

The full-adder and its quantum circuit.

The quantum circuit of RFA is shown in Fig. 13(b), and its simplified graph is shown in Fig. 13(c).

Reversible parallel adder (PA)

The parallel adder adding an n-qubit Y to an n-qubit X is designed by one RHA and n-1 reversible full-adders as shown in Fig. 14. Here, the sequence SnSn1S1S0 represents the sum of X + Y. Other unremarked qubits are the garbage outputs and the input qubit 0 is the ancillary constant input. For convenience, the block diagram of PA omits the ancillary inputs and the garbage outputs.

Figure 14.

Figure 14

The reversible parallel adder and its block diagram.

The reversible parallel subtractor circuit

Thapliyal H. et al.31 designed subtractor using the reversible TR gate and further realized optimization in terms of quantum cost and delay36. Here, the concrete parallel subtractor circuit is given.

Reversible half subtractor (RHS)

As shown in Fig.15, the inputs of A and B are 1-bit binary number, and the TR gate can work as a half subtractor performing A-B operation, where the output R = A ⊕ B produces the difference between A and B and the output Q=A¯B generates the corresponding borrow bit. The quantum circuit of RHS is shown in Fig. 15(b), and its simplified graph is shown in Fig. 15(c).

Figure 15.

Figure 15

The RHS and its quantum circuit.

Reversible full subtractor (RFS)

The RFS as shown in Fig. 16 is utilized to realize the operation Y = A − B − C, where Q = A ⊕ B ⊕ C represents the difference of A − B − C, S=C(AB¯)A¯B represents the borrow bit. The quantum circuit of RFS is shown in Fig. 16(b), and its simplified graph is shown in Fig. 16(c).

Figure 16.

Figure 16

The RFS and its quantum circuit.

Reversible parallel subtractor (PS)

The PS is used to compute the difference of two n-bit numbers X and Y, where X=xn1x0 and Y=yn1y0. The PS subtracting an n-qubit Y from a n-qubit X is designed by one RHS and n-1 reversible full subtractors as shown in Fig. 17, where dndn1d1d0 is the result of X-Y, and the ancillary constant input is 0. For convenience, the block diagram of PS omits the garbage outputs.

Figure 17.

Figure 17

The PS and its block diagram.

The reversible parallel multiplier (PM)

Kotiyal S et al.37 proposed the PM based on the binary tree which optimized the ancillary and garbage bits. The block diagram of PM is shown in Fig. 18, where PM consists of multiple reversible parallel adders. The PM can implement the multiplication X × Y, where X=xn1x1x0 and Y=yn1y1y0 are the two inputs. An example of 4 × 4 PM is shown in Fig. 19.

Figure 18.

Figure 18

The block diagram of PM.

Figure 19.

Figure 19

An example of 4 × 4 PM, where PS 0 and PS 1 represent the partial sums of P 0, P 1, P 2, P 3.

The reversible divider (ND)

Khosropour A et al.38 realized quantum division circuit based on restoring division algorithm as shown in Fig. 20.

Figure 20.

Figure 20

Quantum divider circuit based on restoring division algorithm.

Here, |P=|P2n1P2P1, |D=|Dn1D2D1, |Q=|Qn1Q2Q1 are the input registers. Multiply |P by 2 can be obtained by the left shift (LSH)39 module. For realizing subtracting |D from the highest n qubits of |2P, we first act quantum Fourier transform (QFT)22 on the highest n qubits of |2P and apply a set of conditional rotation operations on the n qubits of |D. Secondly, we perform inverse QFT (QFT−1) and check if |(2PD) is either positive or negative. If it is positive, the qubit |Qn need to be initialized into state |0〉, otherwise, keep |Qn unchanged, which can be realized using a CNOT gate. If |(2PD) is diagnosed to be negative, it should be set back to the previous state |2P by simply adding |D to the highest n qubits of |2PD. Because |Qn contains the inverse of the most significant qubits in |2PD. Hence, the addition should be conditioned on |Qn. This structure should be repeated n times to fulfill the division operation. Eventually, |Q is the quotient and the highest n qubits of |P〉 is the remainder. Note that we have used only n ancillary qubits for LSH operation.

For convenience, Fig. 21 is a simplified graph of the quantum division circuit in Fig. 20, where ancillary inputs and garbage outputs are omitted, and Q is the quotient.

Figure 21.

Figure 21

The simplified graph of the quantum division circuit.

Feasibility and rationality of bilinear interpolation method

In this paper, the quantum circuit of the image scaling based on bilinear interpolation method for NEQR is designed. Therefore, the first problem is to prove the practicality. The key idea of the proposed circuits is mathematically explained in Eq. (7)

|CYX=[[2m(YY×2m)]×[2m(XX×2m)]×|CY,X+(YY×2m)×[2m(XX×2m)]×|CY+1,X+[2m(YY×2m)]×(XX×2m)×|CY,X+1+(YY×2m)×(XX×2m)×|CY+1,X+1]÷2m÷2m 7

where X=X2m,Y=Y2m.

From Eq. (7), in order to prepare the color information |CY,X in position (Y′, X′) of the resulting image, the color information |CY,X,|CY+1,X,|CY,X+1 and |CY+1,X+1 in positions (Y, X), (Y + 1, X), (Y, X + 1) and (Y + 1, X + 1) of the original image need to be prepared first. The bilinear interpolation method utilizes these four different positions of the original image to map into one position (Y′, X′) of the resulting image as shown in Fig. 2. The dimension of a given original image is known and all the pixels should have fixed color values. At the same time, the dimension of the resulting image is known under a certain scaling ratio. Therefore, (Y′, X′) can be considered as the input state when designing quantum circuits. Under the guidance of this key idea, the qualification process is as follows.

Theorem The bilinear interpolation method generated by Eq. (7) is rational for a quantum image based on NEQR.

Proof Assume that the size of an original quantum image |I is 2n × 2n, and the gray range of which is [0, 2q − 1], the NEQR of the image is expressed by Eq. (8).

|I=12nY=02n1X=02n1|CYX|Y|X=12nYX=022n1k=0q1CYXk|YX 8

Also suppose image scaling ratio in the horizontal and vertical dimensions is 2m, than is r y = r x = 2m, then the size of the resulting image |I is 2n+m × 2n+m. The concrete feasibility of the bilinear interpolation is proven through the following analysis.

Problem 1 How to build the interpolation mapping relationship between the pixel of the resulting image and the original image?

The position (Y′, X′) of the resulting image has the mapping relationship with the positions (Y, X), (Y + 1, X), (Y, X + 1) and (Y + 1, X + 1) of the original image as shown in Fig. 2.

According to Eq. (3), we derive the Eq. (9)

Y=Y×(2n2n+m)=Y2m,X=X×(2n2n+m)=X2m 9

where Y=Yn+m1Yn+m2Y1Y0 and X=Xn+m1Xn+m2X1X0.

To build the mapping relationship described in Fig. 2, the multiply Control-Not operations and special adding one operation U1(n) are chosen as the unitary operators. The function of the multiply Control-Not operators is to utilize n Control-Not gates to copy the n qubits |Yn+m1Yn+m2Ym into the n ancillary qubits |0n. The unitary operator U1(n) is used to get the nearest-neighbor position of the current position. Through these two unitary operators, the interpolation mapping relationship between the position of original image and the interpolated image has been established. The details are described in Figs 22 and 23.

Figure 22.

Figure 22

The scaling-up circuit of bilinear interpolation method for NEQR.

Figure 23.

Figure 23

The scaling-down circuit of bilinear interpolation method for NEQR.

Problem 2 How to calculate the color values of the resulting image?

The color information |CY,X of the position (Y′, X′) in the interpolated image is calculated by the four pixels value in position (Y, X), (Y + 1, X), (Y, X + 1) and (Y + 1, X + 1) of the original image. The gray range |CY,X of the interpolated imageis [0, 2q − 1], therefore, q qubits are needed to store the pixels value of |CY,X.

Firstly, four quantum oracle operators ΩY,X, ΩY+1,X, ΩY,X+1 and ΩY+1,X+1 are used to compute the original pixel values of |CY,X,|CY+1,X,|CY,X+1 and |CY+1,X+1, respectively. A quantum oracle operator ΩY,X can realize the aim of assigning color information |CY,X to the ancillary qubits |0q 8, which can be expressed by Eq. (10)

ΩY,X|0q=i=0q1(ΩY,Xi|0)=i=0q1|0CY,Xi=i=0q1|CY,Xi=|CY,X 10

where ΩY,Xi,i=0,..,q1 can be described as the following.

If CY,Xi=1, ΩY,Xi is a 2n-Control-Not qubit gate. Otherwise, it is a quantum identity gate. That is to say, every oracle operator ΩY,Xi,i=0,..,q1 is at most a 2n-Control-Not qubit gate. For other three oracle operators ΩY+1,X, ΩY,X+1, ΩY+1,X+1, the principle is also same as ΩY,X 8.

Therefore, we can calculate each pixel value in position (Y′, X′) of the resulting image using the pixel values of the four corresponding positions in the original image. From Eq. (3), Eq. (6) and Eq. (9), we can calculate the interpolated pixel value |CY,X described by the Eq. (11).

|CYX=(1h)(1w)|CY,X+h(1w)|CY+1,X+(1h)w|CY,X+1+hw|CY+1,X+1=[((1h)(1w)|CY,X+h(1w)|CY+1,X+(1h)w|CY,X+1+hw|CY+1,X+1)×2m×2m]÷2m÷2m=((2mh×2m)(2mw×2m)|CY,X+h×2m(2mw×2m)|CY+1,X+(2mh×2m)w×2m|CY,X+1+h×2m×w×2m|CY+1,X+1)÷2m÷2m=[[2m(YY×2m)]×[2m(XX×2m)]×|CY,X+(YY×2m)×[2m(XX×2m)]×|CY+1,X+[2m(YY×2m)]×(XX×2m)×|CY,X+1+(YY×2m)×(XX×2m)×|CY+1,X+1]÷2m÷2m 11

We need implement some arithmetic operations to calculate the pixel value |CY,X. According to Eq. (9), Y′ − Y × 2m and X′ − X × 2m are the remainder of Y2m=ym1ym2y0 and X2m=xm1xm2x0. The m Control-Not operations are used to copy the remainder into the m qubits |0m. Other arithmetic operations such as subtraction, multiplication, addition and division are implemented by corresponding arithmetic circuits mentioned in the preceding chapter. Hence, the pixel value of |CY,X can be derived through the analysis above, the concrete circuit is shown in Figs 22 and 23.

Quantum realization of the bilinear interpolation method

In the previous section, the theoretical feasibility of the bilinear interpolation method for NEQR is discussed using the multiply Control-Not operation, special adding one operation and a series of quantum circuit modules. This section gives the concrete quantum realization circuit of the bilinear interpolation method for NEQR, including scaling up and scaling down.

Quantum image scaling up circuit of the bilinear interpolation for NEQR

Assume that a 2n × 2n quantum image |I is scaled up to a 2n+m × 2n+m quantum image |I based on the bilinear interpolation. The scale ratio in the vertical and horizontal level is both 2m, that is to say, r y = r x = 2m.

The concrete scaling-up circuit for NEQR

Figure 22 provides the quantum image scaling-up circuit that implements the bilinear interpolation for NEQR. The concrete steps can be described as follows.

Step 1 Firstly, obtain the Y=Y2m using n Control-Not gates on the coordinate |Yn+m1Yn+m2Ym. Correspondingly, obtain the X=X2m through n Control-Not gates on the coordinate |Xn+m1Xn+m2Xm. Then, obtain the positions (Y + 1, X), (Y, X + 1) and (Y + 1, X + 1) using 6n Control-Not gates and two special adding one operators. Therefore, the coordinate mapping has been built between the position (Y′, X′) in resulting image and the positions (Y, X), (Y + 1, X), (Y, X + 1) and (Y + 1, X + 1) in original image. In addition, 4 (m + 1)-ancillary constant qubits |1|0m and 8 m Control-Not gates are needed to copy the qubits |Ym1Y0 and qubits |Xm1X0 to 8 m ancillary qubits |0m.

Step 2 Employ four oracle operators ΩY,X, ΩY+1,X, ΩY,X+1 and ΩY+1,X+1 to generate the corresponding color information |CY,X,|CY+1,X,|CY,X+1 and |CY+1,X+1.

Step 3 Calculate the pixel value |CY,X of the interpolated image through the four pixel values |CY,X,|CY+1,X,|CY,X+1 and |CY+1,X+1 as described in Eq. (10). The realization circuit is shown in Fig. 22.

Circuit complexity

The circuit network complexity depends on the number of the elementary gate in QIMP. The complexity of the basic quantum gate is considered to be 1 including NOT gate, Control-Not gate and any 2 × 2 unitary operator40. In addition, when designing the quantum circuit, introducing ancillary qubit |0 or |1 is a commonly used method. The complexity of Fig. 22 is analyzed as follows.

In step 1, it needs 8(n + m) Control-Not gates and two U1(n) operators. As shown in Fig. 10, each unitary operator U1(n) has n − 1 Not gates, n + 1 Control-Not gates, and n − 1 multi-Control-Not gates of Λ2(σx),,Λn-1(σx),Λn(σx) and one (n − 1)-Control-Not gate, where σ x is the NOT gate. According to Lemma 6.1 and Lemma 7.1 in ref. 40, for any 2 × 2 unitary matrix U and any n ≥ 3, a Λn−1(U) gate can be simulated by n qubits circuit consisting of (2n−1 − 1)Λ1(V) gates, a Λ1(V +) gate and (2n−1 − 2)Λ1(σ x) gates, where V represents the unitary operator, V + is the hermitian conjugate of V. We can deduce that the network complexity of single quantum operator U1(n) is Ο(2n+2). Thus, the total quantum cost in this step is Ο(2n+3 + 8n + 8m).

In step 2, it includes four oracle operators of ΩY,X, ΩY+1, X, ΩY,X+1 and ΩY+1,X+1. The complexity of oracle operator is Ο(q ⋅ 2n)8, therefore, the total quantum cost in this step is Ο(q ⋅ 8n).

In step 3, it includes 4 parallel subtractors, 8 parallel multipliers, 3 parallel adders, 2 reversible dividers.

The network complexity of PS

The PS realizes the subtraction between two m + 1 qubits. It needs 1 RHS and m reversible full subtractors. The quantum cost of RHS (see Fig. 15) is 6, and the quantum cost of RFS (see Fig. 16) is 7. So the quantum cost of single PS is 7 m + 6.

The quantum cost of PA

As we know, the pixel value is represented by q qubits, the resulting pixel value can be calculated by implementing ND modules twice. Thus, the three parallel adders perform the operation of q + 2m + 2 qubits plus q + 2m + 2 qubits, it needs 1 RHA and (q + 2 m + 1) reversible full adders. The quantum cost of RHA (see Fig. 12) is 4, and the quantum cost of RFA (see Fig. 13) is 8. Therefore, the quantum cost of single PA is 8q + 16 m + 20.

The network complexity of PM

As shown Fig. 22, it is easy to find there are 4 parallel multipliers, each of which performs m + 1 qubits multiply by m + 1 qubits. We can see form Fig. 19 that each PA can add two m + 1 qubits at most. Thus, the number of PA required in PM is 1+2++m+12.

In another case, the other 4 parallel multipliers perform 2 m + 2 qubits multiply by q qubits respectively (suppose q ≥ 2m + 2). We can see form Fig. 19 that each PA can add two 2(m + 1) qubits at most. Thus, the number of PA required in PM is 1+2++2m+22.

Thus, we can calculate that the network complexity of PM is

4×[(5(m+1)2+(1+2+m+12)(16m+12)+5q(2m+2)+(1+2+2m+22)(8q+16m+20)]

The network complexity of ND

According to paper38, the quantum cost of q-qubit ND is 3q 3 + 6q 2 + q.

Consequently, the complexity of the proposed scaling-up circuit shown in Fig. 22 is calculated by Eq. (12).

O(2n+3+8n+8m+8qn+4(7m+6)+3(8q+16m+20)+2(3(q+2m+2)3+2(q+2m+2)2+q+2m+2)+4(5(m+1)2+(1+2++m+12)(16m+12))+4(5q(2m+2)+(1+2++2m+22)(8q+16m+20)))O(2n+3) 12

Quantum image scaling-down circuit of the bilinear interpolation for NEQR

Assume that a 2n+m × 2n+m quantum image |I is scaled down to a 2n × 2n quantum image |I based on bilinear interpolation. The scale ratio is 12m whether in the vertical or horizontal level, that is to say ry=rx=2m=12m.

Concrete circuit for NEQR

Fig. 23 shows the quantum image scaling-up circuit that implements the bilinear interpolation for NEQR. The concrete steps are described as follows.

Step 1 First of all, obtain the positions of (Y + 1, X), (Y, X + 1) and (Y + 1, X + 1) using 6(n + m) Control-Not gates and two special adding one U 1(n + m) operators. Then, obtain the Y=Y2m acting n Control-Not gates on the coordinate |Yn+m1Yn+m2Ym. Correspondingly, obtain the X=X2m through n Control-Not gates on the coordinate |Xn+m1Xn+m2Xm. Therefore, the coordinates mapping relationship has been built between the position (Y′, X′) of the resulting image and the positions in (Y, X), (Y + 1, X), (Y, X + 1) and (Y + 1, X + 1) of the original image.

Step 2 Employ four oracle operators ΩY,X, ΩY+1,X, ΩY,X+1 and ΩY+1,X+1 to generate the color information |CY,X,|CY+1,X,|CY,X+1 and |CY+1,X+1.

Step 3 Calculate pixel value |CY,X of the interpolated image through the four pixel values of |CY,X,|CY+1,X,|CY,X+1 and |CY+1,X+1 described in Eq. (10). The concrete realization circuit is shown in Fig. 23.

Circuit complexity

In step 1, it needs 8n + 14 m Control-Not gates and 2 U 1(n + m) operators. Based on the analysis above, the complexity of a single quantum operator U 1(n + m) is Ο(2n+m+2). Thus, the total network complexity in this step is Ο(2n+m+3 + 8n + 14m).

In step 2, it includes four oracle operators of ΩY,X, ΩY+1,X, ΩY,X+1 and ΩY+1,X+1. Then, the total network complexity in this step is Ο(q8(n+m)).

In step 3, it includes 4 parallel subtractors, 8 parallel multipliers, 3 parallel adders and 2 reversible dividers.

Consequently, the network complexity of the proposed scaling-up circuit shown in Fig. 23 is

O(2n+m+3+8n+14m+8q(n+m)+4(7m+6)+3(8q+16m+20)+2(3(q+2m+2)3+2(q+2m+2)2+q+2m+2)+4(5(m+1)2+(1+2++m+12)(16m+12))+4(5q(2m+2)+(1+2++2m+22)(8q+16m+20)))O(2n+m+3)

Simulation experiments and analysis

In this section, the simulation experiments are performed to show the interpolation results. All experiments are simulated by MATLAB sofeware.

Simulation results of interpolation for NEQR

Fig. 24 gives a concrete procedure of quantum bilinear interpolation. Firstly, we need to transform a classic image into a quantum image |I expressed by NEQR. Then, the quantum image |I acts as the input image. The resulting image (the interpolated image) |I can be derived using the proposed quantum bilinear interpolation method. Finally, we can retrieve the interpolated classic image by quantum measurement.

Figure 24.

Figure 24

The concrete procedure of quantum bilinear interpolation method.

The simulation results using different interpolation method are shown in Fig. 25. Figure 25(a) is a 64 × 64 original image named Lena. Figs 25(b,c) are the corresponding 128 × 128 scaling-up NEQR images using nearest-neighbor interpolation and bilinear interpolation, respectively. The scaling ratio is r x = r y = 2, which means n = 6, m = 1 and q = 8. Figure 25(d,e) are the corresponding 256 × 256 scaling-up NEQR images using nearest-neighbor interpolation and bilinear interpolation, respectively. The scaling ratio is r x = r y = 4, which means n = 6, m = 2 and q = 8. The simulation results indicate that the scaled-up image using bilinear interpolation is clearer than nearest-neighbor interpolation.

Figure 25.

Figure 25

The simulation results using different interpolation method.

Quantum measurement of the interpolated image

An interpolated NEQR image can be described as following.

|I=12n+mY=02n+m1X=02n+m1|CYX|Y|X

Obviously, an interpolated NEQR image is a quantum superposition state, which can be regarded as a composite quantum system composed of 2n + q qubits.

Actually, the quantum state cannot be practically observed in quantum system because a measurement will destroy the superposition. What is worse, it is not allowed to make copies of the state and measure each one due to the non-cloning theorem. Hence, it is necessary to repeat constructing the states of interpolated image n (n > 1) times and measure each state to summarize the measurement results, through which we can estimate the interpolated image. We execute probability measurement on the interpolated image. Probability measurement converts the quantum information into classical information in form of probability distributions, i.e., it converts a single qubit state |ψ=α|0+β|1 into a probability classical bit M (distinguished from a qubit by drawing it as a double-line wire), which is 0 with probability α 2 or 1 with probability β 2, as shown in Fig. 26.

Figure 26.

Figure 26

Quantum circuit symbol for measurement.

Next, we analyze the impact of quantum measurements on the interpolated image. The measurement results of the 2n+m × 2n+m interpolated NEQR image with gray range [0, 2q−1] are some collection of basis states {S1,S2,...,S2(n+m)+q}. After multiple measurements, these basis states follow a probability distribution. The measurement will continue until the probability of each basis state is stabilized at a fixed value. According to law of large numbers, there is a limit to these basis states which can be used to estimate the color information of the interpolated image. The block diagram of the measurement procedure on quantum computers is shown in Fig. 27.

Figure 27.

Figure 27

The block diagram of the measurement procedure on quantum computers.

Conclusions

In this paper, the bilinear interpolation method for NEQR is proposed for the first time. The proposed method constructs an interpolated image, which mainly consists of two steps: (1) position mapping (2) calculate and generate the new color information. In the position mapping stage, the multiply Control-Not operation and special adding one operation are used to build the position mapping relationship between the position (Y′, X′) in interpolated image and the positions (Y, X), (Y + 1, X), (Y, X + 1) and (Y + 1, X + 1) in the original image. After that, exploit the oracle operator to prepare the original image pixel. Then, a series of quantum circuits designed in this paper are used to calculate the color information of the interpolated image.

The main contributions of this paper are as follows:

  1. The bilinear interpolation method for NEQR is realized and the corresponding quantum realization circuits are given.

  2. A series of unitary quantum circuit operations are designed, which can be used in future quantum computers.

  3. The quantum image scaling algorithm is developed to change the image size.

The future works mainly include:

  1. Give the bilinear interpolation method for FRQI and its realization circuit.

  2. Further realize the bicubic interpolation method for other quantum image representations such as FRQI and NEQR.

  3. Give simpler quantum interpolation realization circuit through the basic quantum gates and the quantitative analysis about the circuit complexity.

Acknowledgements

This work is supported by the National Natural Science Foundation of China under Grant No. 61463016, Program for New Century Excellent Talents in University under Grant No. NCET-13-0795, Training program of Academic and technical leaders of Jiangxi Province under Grant No. 20153BCB22002, The advantages of scientific and technological innovation team of Nanchang City under Grant No. 2015CXTD003, Project of International Cooperation and Exchanges of Jiangxi Province under Grant No. 20161BBH80034, Project of Science and Technology of Jiangxi province Grant No. 20161BAB202065, Project of Humanities and Social Sciences in colleges and universities of Jiangxi Province under Grant No. JC1507.

Author Contributions

R.G.Z. and P.F. give the core theme of this paper and main guideline on the paper writing stage. W.H. is the main writer of the manuscript paper. P.F. and H.I. are the main reviser of the manuscript, making a lot of changes to the manuscript and language correcting works. In addition, many figures are drawn by P.F. and H.I. Finally, R.G.Z., W.H., P.F. and H.I. reviewed and revised the manuscript.

Competing Interests

The authors declare that they have no competing interests.

Footnotes

Ri-Gui Zhou and Ping Fan contributed equally to this work.

Publisher's note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

References

  • 1.Feynman R. Simulating physics with computers. Int. J. Theor. Phys. 1982;21(6-7):467–488. doi: 10.1007/BF02650179. [DOI] [Google Scholar]
  • 2.Deutsch D. Quantum theory, the church-turing principle and the universal quantum computer. Proc. R. Soc. Lond. A. 1985;400:97–117. doi: 10.1098/rspa.1985.0070. [DOI] [Google Scholar]
  • 3.Shor, P. Algorithms for quantum computation: discrete logarithms and factoring. In: Proceedings of the 35th Annual Symposium on Foundations of Computer Science. 124–134 (1994).
  • 4.Grover, L. A fast quantum mechanical algorithm for database search. In: Proceedings of the 28th Annual ACM Symposium on Theory of Computing. 212–219 (1996).
  • 5.Venegas-Andraca, S., Bose, S. Storing, processing, and retrieving an image using quantum mechanics. In: Proceedings of SPIE Conference of Quantum Information and Computation. 5105, 134–147, doi:10.1117/12.485960 (2003).
  • 6.Latorre, J. Image Compression and Entanglement. arXiv:quant-ph/0510031.
  • 7.Le P, Dong F, Hirota K. A flexible representation of quantum images for polynomial preparation, image compression, and processing operations. Quantum Inf. Process. 2011;10(1):63–84. doi: 10.1007/s11128-010-0177-y. [DOI] [Google Scholar]
  • 8.Zhang Y, Lu K, Gao Y, Mao W. NEQR: a novel enhanced quantum representation of digital images. Quantum Inf. Process. 2013;12(8):2833–2860. doi: 10.1007/s11128-013-0567-z. [DOI] [Google Scholar]
  • 9.Zhang Y, Lu K, Gao Y, Xu K. A novel quantum representation for log-polar images. Quantum Inf. Process. 2013;12(9):3103–3126. doi: 10.1007/s11128-013-0587-8. [DOI] [Google Scholar]
  • 10.Li H, et al. Image storage, retrieval, compression and segmentation in a quantum system. Quantum Inf. Process. 2013;12(6):2269–2290. doi: 10.1007/s11128-012-0521-5. [DOI] [Google Scholar]
  • 11.Li H, Zhu Q, Zhou R, Song L, Yang X. Multi-dimensional color image storage and retrieval for a normal arbitrary quantum superposition state. Quantum Inf. Process. 2014;13(4):991–1011. doi: 10.1007/s11128-013-0705-7. [DOI] [Google Scholar]
  • 12.Yuan S, et al. SQR: a simple quantum representation of infrared images. Quantum Inf. Process. 2014;13(6):1353–1379. doi: 10.1007/s11128-014-0733-y. [DOI] [Google Scholar]
  • 13.Fan P, Zhou R, Jing N, Li H. Geometric transformations of multidimensional color images based on NASS. Information Sciences. 2016;340:191–208. doi: 10.1016/j.ins.2015.12.024. [DOI] [Google Scholar]
  • 14.Wang J, Jiang N, Wang L. Quantum image translation. Quantum Inf. Process. 2015;14(5):1589–1604. doi: 10.1007/s11128-014-0843-6. [DOI] [Google Scholar]
  • 15.Zhou R, Tan C, H. I. Global and Local Translation Designs of Quantum Image Based on FRQI. Int J Theor Phys. 2017;56:1382–1398. doi: 10.1007/s10773-017-3279-9. [DOI] [Google Scholar]
  • 16.Sang J, Wang S, Niu X. Quantum realization of the nearest-neighbor interpolation method for FRQI and NEQR. Quantum Inf. Process. 2016;15(1):37–64. doi: 10.1007/s11128-015-1135-5. [DOI] [Google Scholar]
  • 17.Jiang N, Wang L. Quantum image scaling using nearest neighbor interpolation. Quantum Inf. Process. 2015;14(5):1559–1571. doi: 10.1007/s11128-014-0841-8. [DOI] [Google Scholar]
  • 18.Jiang N, Wang J, Mu Y. Quantum image scaling up based on nearest-neighbor interpolation with integer scaling ratio. Quantum Inf. Process. 2015;14(11):4001–4026. doi: 10.1007/s11128-015-1099-5. [DOI] [Google Scholar]
  • 19.Jiang N, Wu WY, Wang L. The quantum realization of Arnold and Fibonacci image scrambling. Quantum Inf. Process. 2014;13(5):1223–1236. doi: 10.1007/s11128-013-0721-7. [DOI] [Google Scholar]
  • 20.Jiang N, Wang L. Analysis and improvement of the quantum Arnold image scrambling. Quantum Inf. Process. 2014;13(7):1545–1551. doi: 10.1007/s11128-014-0749-3. [DOI] [Google Scholar]
  • 21.Jiang N, Wang L, Wu WY. Quantum Hilbert image scrambling. International Journal of Theoretical Physics. 2014;53(7):2463–2484. doi: 10.1007/s10773-014-2046-4. [DOI] [Google Scholar]
  • 22.Zhang WW, Gao F, Liu B, Wen QY, Chen H. A watermark strategy for quantum images based on quantum Fourier transform. Quantum Inf. Process. 2013;12(2):793–803. doi: 10.1007/s11128-012-0423-6. [DOI] [Google Scholar]
  • 23.Song XH, Wang S, Liu S, El-Latif AAA, Niu XM. A dynamic watermarking scheme for quantum images using quantum wavelet transform. Quantum Inf. Process. 2013;12(12):3689–3706. doi: 10.1007/s11128-013-0629-2. [DOI] [Google Scholar]
  • 24.Song X, Wang S, El-Latif AAA, Niu XM. Dynamic watermarking scheme for quantum images based on Hadamard transform. Multimed. Syst. 2014;20(4):379–388. doi: 10.1007/s00530-014-0355-3. [DOI] [Google Scholar]
  • 25.Miyakel S, Nakamael K. A quantum watermarking scheme using simple and small-scale quantum circuits. Quantum Inf Process. 2016;15(5):1849–1864. doi: 10.1007/s11128-016-1260-9. [DOI] [Google Scholar]
  • 26.Jiang N, Zhao N, Wang L. LSB Based Quantum Image Steganography Algorithm. Int J Theor Phys. 2016;55(1):107–123. doi: 10.1007/s10773-015-2640-0. [DOI] [Google Scholar]
  • 27.Shahrokh H, Mosayeb N. A Novel LSB Based Quantum Watermarking. Int J Theor Phys. 2016;55(10):1–14. [Google Scholar]
  • 28.Fredkin E, Toffoli T. Conservative logic. International Journal of Theoretical Physics. 1982;21(3-4):219–253. doi: 10.1007/BF01857727. [DOI] [Google Scholar]
  • 29.Toffoli, T. Reversible computing. MIT Lab for Computer Science, Tech. Rep. Tech memo MIT/LCS/TM-151 (1980).
  • 30.Peres A. Reversible logic and quantum computers. Phys. Rev. A, Gen. Phys. 1985;32(6):3266–3276. doi: 10.1103/PhysRevA.32.3266. [DOI] [PubMed] [Google Scholar]
  • 31.Thapliyal, H. and Ranganathan, N. Design of efficient reversible binary subtractors based on a new reversible gate. In Proc. the IEEE Computer Society Annual Symposium on VLSI, Tampa, Florida. pp. 229–234 (2009).
  • 32.Hung WN, Song X, Yang G, Yang J, Perkowski M. “Optimal synthesis of multiple output boolean functions using a set of quantum gates by symbolic reachability analysis”, IEEE Trans. Computer-Aided Design. 2006;25(9):1652–1663. [Google Scholar]
  • 33.Maslov, D. and Miller, D. M. Comparison of the cost metrics for reversible and quantum logic synthesis. http://arxiv.org/abs/quantph/0511008 (2006).
  • 34.Nielsen, M. A. and Chuang, I. L. Quantum Computation and Quantum Information. New York: Cambridge Univ. Press. (2000).
  • 35.Islam MS, Rahman MM, Begum Z, Hafiz MZ. Low cost quantum realization of reversible multiplier circuit. Inf. technology journal. 2009;8(2):208–213. doi: 10.3923/itj.2009.208.213. [DOI] [Google Scholar]
  • 36.Thapliyal, H., Ranganathan, N. A new design of the reversible subtractor circuit//Nanotechnology (IEEE-NANO), 2011 11th IEEE Conference on. IEEE 1430–1435 (2011).
  • 37.Kotiyal, S., Thapliyal, H., Ranganathan, N. Circuit for Reversible Quantum Multiplier Based on Binary Tree Optimizing Ancilla and Garbage Bits//VLSI Design and 2014 13th International Conference on Embedded Systems, 2014 27th International Conference on. IEEE, 545–550 (2014).
  • 38.Khosropour, A., Aghababa, H., Forouzandeh, B. Quantum Division Circuit Based on Restoring Division Algorithm//Eighth International Conference on Information Technology: New Generations, Itng 2011, Las Vegas, Nevada, USA, 11–13 April. DBLP, 1037–1040 (2011).
  • 39.Jae-weon, L. and Eok Kyun, L. Quantum Shift Register. arXiv:quant-ph/0112107.
  • 40.Barenco A, Bennett CH, Cleve R, Margolus N, et al. Elementary gates for quantum computation. Physical review A. 1995;52(5):3457–3467. doi: 10.1103/PhysRevA.52.3457. [DOI] [PubMed] [Google Scholar]

Articles from Scientific Reports are provided here courtesy of Nature Publishing Group

RESOURCES