CN108932388A - A kind of mould 2 based on quantum superposition statenSubtracter design method - Google Patents
A kind of mould 2 based on quantum superposition statenSubtracter design method Download PDFInfo
- Publication number
- CN108932388A CN108932388A CN201810748584.9A CN201810748584A CN108932388A CN 108932388 A CN108932388 A CN 108932388A CN 201810748584 A CN201810748584 A CN 201810748584A CN 108932388 A CN108932388 A CN 108932388A
- Authority
- CN
- China
- Prior art keywords
- quantum
- controlled
- subtracter
- gate
- gates
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/30—Circuit design
- G06F30/36—Circuit design at the analogue level
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Evolutionary Computation (AREA)
- Geometry (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Complex Calculations (AREA)
- Image Generation (AREA)
Abstract
Description
技术领域technical field
本发明涉及一种基于量子叠加态的模2n减法器设计方法,属量子线路设计技术领域。The invention relates to a design method of a modulo 2n subtractor based on quantum superposition state, and belongs to the technical field of quantum circuit design.
背景技术Background technique
模2n减法表示为Modulo 2 n subtraction is expressed as
MS(b-a)=sign(b-a)×[(b-a)mod 2n] (1)MS(ba)=sign(ba)×[(ba)mod 2 n ] (1)
其中a,b是n位的正整数。当b<a时,sign(b-a)=-1,当b≥a时,sign(b-a)=1。(b-a)mod 2n是(b-a)对2n进行求模运算,运算规则如下Where a, b are n-bit positive integers. When b<a, sign(ba)=-1, and when b≥a, sign(ba)=1. (ba) mod 2 n is (ba) modulo operation on 2 n , the operation rules are as follows
在量子计算中,信息单元用量子比特表示,它有两个基本量子态|0>和|1>,基本量子态简称为基态。一个量子比特可以是两个基态的线性组合,常被称为叠加态,可表示为|ψ>=a|0>+b|1>,其中a和b是两个复数。In quantum computing, the information unit is represented by a qubit, which has two basic quantum states |0> and |1>, and the basic quantum state is called the ground state for short. A qubit can be a linear combination of two ground states, often called a superposition state, which can be expressed as |ψ>=a|0>+b|1>, where a and b are two complex numbers.
张量积是将小的向量空间合在一起,构成更大向量空间的一种方法,用符号表示。对于两个基态|u>和|v>,它们的张量积常用缩写符号|uv>,|u>|v>或|u,v>表示,例如对于基态|0>和|1>,它们的张量积可表示为:Tensor product is a method of combining small vector spaces to form a larger vector space, using the symbol express. For two ground states |u> and |v>, their tensor product Commonly used abbreviations |uv>, |u>|v> or |u, v>, for example, for the ground state |0> and |1>, their tensor product can be expressed as:
对于矩阵U的n次张量积可简写成对于量子态|u>的n次张量积也可简写成 For n tensor products of matrix U Can be abbreviated as For the n times tensor product of quantum state |u> can also be abbreviated as
量子线路可以由一序列的量子比特门构成,在量子线路的表示图中,每条线都表示量子线路的连线,量子线路的执行顺序是从左到右。量子比特门可以方便的用矩阵形式表示X(非门),V、V+和单位门是三个常用的单量子比特门,它们的矩阵表示分别为:A quantum circuit can be composed of a sequence of qubit gates. In the representation diagram of a quantum circuit, each line represents the connection of the quantum circuit, and the execution order of the quantum circuit is from left to right. The qubit gate can conveniently represent X (NOT gate) in matrix form. V, V + and unit gate are three commonly used single-qubit gates. Their matrix representations are:
其中i是虚数单位。where i is the imaginary unit.
最重要的多量子比特门是受控U门,由控制量子比特和目标量子比特,当控制位为1时,用黑点表示,当控制位为0时,用白点表示。当U=X,V,V+,此时受控U门分别称为受控非门,受控V门,受控V+门,它们的符号表示如图1所示。The most important multi-qubit gate is the controlled U-gate, which consists of a control qubit and a target qubit, represented by a black dot when the control bit is 1, and a white dot when the control bit is 0. When U=X, V, V + , the controlled U gates are respectively called controlled NOT gates, controlled V gates, and controlled V + gates, and their symbols are shown in Figure 1.
可以用n量子比特来表示一个小于2n整数:|bn-1bn-2...b0>,其中bh∈{0,1},h=0,...,n-1。An integer less than 2 n can be represented by n qubits: |b n-1 b n-2 ...b 0 >, where b h ∈ {0,1}, h=0,...,n-1 .
进一步,n+m量子比特态Further, the n+m qubit state
可以存储一个大小为2m的列向量:A column vector of size 2 m can be stored:
其中b(j)是一个n位整数,j=0,...,2m-1,n和m都是正整数。Wherein b(j) is an n-bit integer, j=0,...,2 m −1, and both n and m are positive integers.
量子线路的性能指标为线路的复杂度。线路的复杂度是指线路中受控非门,受控V门,受控V+门的总的数量。The performance index of a quantum circuit is the complexity of the circuit. The complexity of the circuit refers to the total number of controlled NOT gates, controlled V gates, and controlled V + gates in the circuit.
发明内容Contents of the invention
本发明的目的是,为了解决量子叠加态的量子减法运算问题,提出一种基于量子叠加态的模2n减法器设计方法。The object of the invention is to propose a modulo 2 n subtractor design method based on the quantum superposition state in order to solve the quantum subtraction operation problem of the quantum superposition state.
本发明实现的技术方案如下,一种基于量子叠加态的模2n减法器设计方法,所述方法利用基本量子受控门实现量子半减器和复位器、量子全减器和复位器的设计方法,以及由量子半减器、量子全减器和复位器构成n位量子模2n减法器的设计方法;最后利用设计好的模2n减法器实现基于量子叠加态的模2n减法运算。所述基本量子受控门包括受控非门、受控V门和受控量子全加器V+门。The technical scheme realized by the present invention is as follows, a method for designing a modulus 2n subtractor based on quantum superposition state, said method utilizes basic quantum controlled gates to realize the design of quantum half subtractor and resetter, quantum full subtractor and resetter method, and the design method of an n-bit quantum modulus 2 n subtractor composed of quantum half subtractor, quantum full subtractor and reset device; finally, the modulo 2 n subtraction operation based on the quantum superposition state is realized by using the designed modulo 2 n subtractor . The basic quantum controlled gate includes a controlled NOT gate, a controlled V gate and a controlled quantum full adder V + gate.
所述量子半减器和复位器的设计方法如下:The design method of described quantum half reducer and resetter is as follows:
利用四个受控门实现量子半减器设计线路,用符号Q表示;四个受控门包括一个受控非门、二个受控V门和一个受控V+门;这四个受控门的连接顺序为:受控V+门、受控V门、受控非门、受控V门。Use four controlled gates to realize the design circuit of the quantum half reducer, represented by the symbol Q; the four controlled gates include a controlled NOT gate, two controlled V gates and a controlled V + gate; these four controlled The connection sequence of the gates is: controlled V + gate, controlled V gate, controlled NOT gate, controlled V gate.
将量子半减器应用到量子态|ci>|bi>|ai>,得到:Applying the quantum half reducer to the quantum state |c i >|b i >|a i >, we get:
其中是异或操作,ci,bi,ai∈{0,1},当|ci>=|0>时,由上式可知量子半减器实现减法(bi-ai),其中输出的第一个量子比特存储减法(bi-ai)的借位信息,输出的第二个量子比特存储的是减法的差;in is an XOR operation, c i , b i , a i ∈ {0,1}, When |c i >=|0>, it can be seen from the above formula that the quantum half subtractor implements subtraction ( bi -a i ) , where the first qubit output Store the borrow information of the subtraction (b i -a i ), the second qubit of the output What is stored is the difference of the subtraction;
为了将减法运算后的辅助量子位复位到初始状态,设计量子半减器的复位器,由5个受控门组成,用符号Qo表示;五个受控门包括二个受控非门、二个受控V门和一个受控V+门;这五个受控门的连接顺序为:受控V+门、受控V门、受控非门、受控V门、受控非门。In order to reset the auxiliary qubit after subtraction to the initial state, the reset device of the quantum half-subtractor is designed, which is composed of five controlled gates, represented by the symbol Q o ; the five controlled gates include two controlled NOT gates, Two controlled V gates and one controlled V + gate; the connection sequence of these five controlled gates is: controlled V + gate, controlled V gate, controlled NOT gate, controlled V gate, controlled NOT gate .
将量子半器的复位器应用到量子态得到:Applying the resetter of a quantum half-machine to a quantum state get:
其中是异或操作,ci,bi,ai∈{0,1},由式Q(|ci>|bi>|ai>)可知量子半减器的复位器将复位为|ci>;in is an XOR operation, c i , b i , a i ∈ {0,1}, From the formula Q(|c i >|b i >|a i >), it can be seen that the reset device of the quantum half reducer will reset to | ci >;
所述量子半减器的复杂度为4,相应的复位器为5。The complexity of the quantum half reducer is 4, and the corresponding resetter is 5.
所述量子全减器和复位器的设计方法如下:The design method of described quantum full subtractor and resetter is as follows:
利用六个受控门设计量子全减器设计线路,量子全减器用符号S表示;六个受控门包括二个受控非门、三个受控V门和一个受控V+门;这六个受控门的连接顺序为:受控V门、受控非门、受控V门、受控非门、受控V+门、受控V门。Utilize six controlled gates to design the design circuit of the quantum full subtractor, the quantum full subtractor is represented by the symbol S; the six controlled gates include two controlled NOT gates, three controlled V gates and one controlled V + gate; The connection sequence of the six controlled gates is: controlled V gate, controlled NOT gate, controlled V gate, controlled NOT gate, controlled V + gate, controlled V gate.
将量子全减器应用到量子态|ci>|bi>|ai>|ci-1>,得到:Applying the quantum total subtractor to the quantum state |c i >|b i >|a i >|c i-1 >, we get:
其中是异或操作,ci,bi,ai,ci-1∈{0,1},当|ci>=|0>时,由上式可知量子全减器实现减法(bi-ai-ci-1),其中输出的第一个量子比特存储减法(bi-ai-ci-1)的借位信息,输出的第二个量子比特存储的是减法的差;in is an XOR operation, c i , b i , a i , c i-1 ∈ {0,1}, When |c i >=|0>, it can be seen from the above formula that the quantum full subtractor realizes the subtraction (b i -a i -c i-1 ), in which the output of the first qubit Store the borrow information of the subtraction (b i -a i -c i-1 ), the second qubit of the output What is stored is the difference of the subtraction;
为了将减法运算后的辅助量子位复位到初始状态,量子全减器的复位器,由八个受控门组成,用符号S1表示;八个受控门包括四个受控非门、三个受控V门和一个受控V+门;这八个受控门的连接顺序为:受控V门、受控非门、受控V门、受控非门、受控V+门、受控V门、受控非门、受控非门。In order to reset the auxiliary qubit after the subtraction to the initial state, the resetter of the quantum full subtractor is made up of eight controlled gates, represented by symbol S1 ; the eight controlled gates include four controlled NOT gates, three A controlled V gate and a controlled V + gate; the connection sequence of these eight controlled gates is: controlled V gate, controlled NOT gate, controlled V gate, controlled NOT gate, controlled V + gate, Controlled V gate, controlled NOT gate, controlled NOT gate.
将量子全减器的复位器应用到量子态得到:Applying the resetter of a quantum full subtractor to a quantum state get:
其中是异或操作,ci,bi,ai,ci-1∈{0,1},由公式(6)可知量子全减器的复位器将复位为|ci>;in is an XOR operation, c i , b i , a i , c i-1 ∈ {0,1}, From the formula (6), it can be seen that the reset device of the quantum full subtractor will be reset to | ci >;
所述量子全减器的复杂度为6,相应的复位器为8。The complexity of the quantum full subtractor is 6, and the corresponding reset device is 8.
所述n量子比特的量子模2n减法器的设计方法如下:The design method of the quantum modulus 2n subtractor of described n qubit is as follows:
利用量子半减器、量子全减器及相应的复位器设计n量子比特的模2n减法器的线路,n量子比特的模2n减法器用符号MU表示;Utilize the quantum half subtractor, the quantum full subtractor and the corresponding resetter to design the circuit of the modulus 2 n subtractor of n qubits, and the modulus 2 n subtractor of n qubits is represented by the symbol M U ;
n量子比特的模2n减法器由(n-1)个量子全减器、(n-2)个量子全减器的复位器、1个量子半减器和1个量子半减器的复位器组成,它实现两个n位整数的模2n减法运算;The modulo 2 n subtractor of n qubits consists of (n-1) quantum full subtractors, resets of (n-2) quantum full subtractors, 1 quantum half subtractor and 1 reset of quantum half subtractors device, which implements the modulo 2 n subtraction of two n-bit integers;
假设n位的整数a和b存储在如下两个n量子比特的基态中:Suppose n-bit integers a and b are stored in the ground state of two n-qubits as follows:
其中,an-1an-2…a0和bn-1bn-2…b0分别是整数a和b的二进制表示,ah,bh∈{0,1},h=0,...,n-1;Among them, a n-1 a n-2 ... a 0 and b n-1 b n-2 ... b 0 are the binary representations of integers a and b respectively, a h , b h ∈ {0,1}, h=0 ,...,n-1;
添加n量子比特的量子基态最为减法运算的辅助位,并排列顺序得到|0bn- 1an-10bn-2an-2…0b0a0>作为输入;将模2n减法器应用到|0bn-1an-10bn-2an-2…0b0a0>,得到:Quantum ground state with n qubits added As the auxiliary bit of the subtraction operation, and arranged in order to get |0b n- 1 a n-1 0b n-2 a n-2 ... 0b 0 a 0 > as input; apply the modulo 2 n subtractor to |0b n-1 a n-1 0b n-2 a n-2 …0b 0 a 0 >, get:
MU|0bn-1an-10bn-2an-2…0b0a0>=|dndn-1an-10dn-2an-2…0d0a0>;M U |0b n-1 a n-1 0b n-2 a n-2 …0b 0 a 0 >=|d n d n-1 a n-1 0d n-2 a n-2 …0d 0 a 0 >
其中dn表示符号位,dn=0表示正数,dn=1表示负数,dn-1dn-2...d0是整数[(b-a)mod 2n]的二进制表示,dh∈{0,1},h=0,...,n-1。Where d n represents the sign bit, d n =0 represents a positive number, d n =1 represents a negative number, d n-1 d n-2 ... d 0 is the binary representation of an integer [(ba) mod 2 n ], d h ∈ {0,1}, h=0,...,n-1.
由上式可知,模2n减法器实现如下的模2n减法运算:It can be seen from the above formula that the modulo 2n subtractor realizes the following modulo 2n subtraction operation:
实现一个n位整数的量子模2n减法运算的复杂度为6(n-1)+8(n-2)+4+5=14n-13,n≥2。The complexity of realizing the quantum modulo 2 n subtraction of an n-bit integer is 6(n-1)+8(n-2)+4+5=14n-13, n≥2.
所述基于量子叠加态的模2n减法器运算实现方法如下:The implementation method of the modulus 2n subtractor operation based on the quantum superposition state is as follows:
2m个元素的列向量存储在如下(n+m)量子比特的量子叠加态中 column vector of 2 m elements Stored in the quantum superposition state of (n+m) qubits as follows
其中b(j)是一个n位整数,j=0,…,2m-1,n和m都是正整数;Wherein b(j) is an n-bit integer, j=0,...,2 m -1, n and m are both positive integers;
将模2n减法器MU和张量运算得到新的量子运算其中符号为张量运算符号。将应用到下式,The modulo 2n subtractor M U and Tensor operations get new quantum operations where the symbol is a tensor operation symbol. Will applied to the following formula,
得到:get:
其中an-1an-2...a0、b(j)n-1b(j)n-2...b(j)0和d(j)n-1d(j)n-2...d(j)0分别是整数a、b(j)和d(j)的二进制表示;d(j)=(b(j)-a)mod 2n;ah,b(j)h,d(j)h∈{0,1};h=0,1,...,n-1,n,m为整数;d(j)n表示d(j)-a符号位;d(j)n=0表示正数;d(j)n=1表示负数;where a n-1 a n-2 ...a 0 , b(j) n-1 b(j) n-2 ...b(j) 0 and d(j) n-1 d(j) n -2 ...d(j) 0 is the binary representation of integers a, b(j) and d(j) respectively; d(j)=(b(j)-a)mod 2 n ; a h , b( j) h ,d(j) h ∈{0,1}; h=0,1,...,n-1,n,m are integers; d(j) n represents the sign bit of d(j)-a ; d(j) n =0 represents a positive number; d(j) n =1 represents a negative number;
由上式可知,实现如下的模2n减法运算:It can be seen from the above formula, Realize the following modulo 2 n subtraction operation:
其中,即实现如下减法运算:in, That is, the following subtraction operation is realized:
所述模2n减法运算,由一个n量子比特的量子模2n减法器和m量子比特的线构成。The modulo 2n subtraction operation is composed of an n qubit quantum modulo 2n subtractor and m qubit lines.
所述模2n减法运算,用于辅助运算的n-1量子比特基态与模2n减法存储运算的量子态|ψ(a-b)>|a>不会纠缠在一起,因此在模2n减法运算结束后可移去。The modulo 2n subtraction operation is used for the n-1 qubit ground state of the auxiliary operation The quantum state |ψ (ab) >|a> stored in the modulus 2 n subtraction operation will not be entangled, so it can be removed after the modulo 2 n subtraction operation.
所述模2n减法运算线路复杂度为14n-13,能并行实现2m个n位整数模2n减法运算。The circuit complexity of the modulo 2 n subtraction operation is 14n-13, and the modulo 2 n subtraction operation of 2 m n-bit integers can be realized in parallel.
本发明的有益效果是,本发明解决了“量子叠加态的量子模2n减法运算”问题,设计了一个基于量子叠加态的量子模2n减法器。本发明体现了量子信息处理在信号处理的高效性:只需14n-13个基本操作就可实现2m个n位整数模2n减法运算,而用经典计算机实现相应的加法运算需要O(n2m)基本操作。本发明的另外一个优点是设计了复位器,使得参与运算的辅助量子基态与保存加法运算结果量子态不会纠缠在一起。The beneficial effect of the present invention is that the present invention solves the problem of "quantum modulus 2 n subtraction in quantum superposition state", and designs a quantum modulus 2 n subtractor based on quantum superposition state. The present invention embodies the high efficiency of quantum information processing in signal processing: only 14n-13 basic operations can realize 2 m n-bit integer modulo 2 n subtraction operations, while using a classical computer to realize the corresponding addition operation requires O(n2 m ) Basic operations. Another advantage of the present invention is that the resetter is designed so that the auxiliary quantum ground state participating in the operation and the quantum state storing the addition operation result will not be entangled together.
附图说明Description of drawings
图1为本发明量子比特门的名称和符号表示图;Fig. 1 is the title and symbol representation figure of qubit gate of the present invention;
图2为本发明量子半减器的量子实现线路图;Fig. 2 is the quantum realization circuit diagram of quantum half reducer of the present invention;
图3为本发明量子半减器的量子实现线路的简图;Fig. 3 is the sketch map of the quantum realization circuit of quantum half reducer of the present invention;
图4为本发明量子半减器的复位器的量子实现线路图;Fig. 4 is the quantum realization circuit diagram of the reset device of quantum half reducer of the present invention;
图5为本发明量子半减器的复位器的量子实现线路简图;Fig. 5 is the quantum realization circuit diagram of the reset device of quantum half reducer of the present invention;
图6为本发明量子全减器的量子实现线路图;Fig. 6 is the quantum realization circuit diagram of quantum full subtractor of the present invention;
图7为本发明量子全减器的量子实现线路简图;Fig. 7 is the quantum realization circuit diagram of quantum full subtractor of the present invention;
图8为本发明量子全减器的复位器的量子实现线路图;Fig. 8 is the quantum realization circuit diagram of the reset device of quantum full subtractor of the present invention;
图9为本发明量子全减器的复位器的量子实现线路简图;Fig. 9 is the quantum realization circuit diagram of the reset device of quantum full subtractor of the present invention;
图10为本发明n量子比特的量子模2n减法器的量子线路图;Fig. 10 is the quantum circuit diagram of the quantum modulus 2n subtractor of n qubit of the present invention;
图11为本发明n量子比特的量子模2n减法器的量子线路简图;Fig. 11 is the quantum circuit diagram of the quantum modulus 2n subtractor of n qubits of the present invention;
图12为本发明基于量子叠加态的模2n减法运算的量子线路图;Fig. 12 is the quantum circuit diagram of the modulus 2n subtraction operation based on the quantum superposition state of the present invention;
图13为本发明一个基于量子叠加态的模2n减法运算例子的量子实现线路图。Fig. 13 is a quantum implementation circuit diagram of an example of a modulo 2n subtraction operation based on quantum superposition states in the present invention.
具体实施方式Detailed ways
本发明的具体实施方式如下:The specific embodiment of the present invention is as follows:
本实施例一种基于量子叠加态的模2n减法器设计方法,所述方法利用基本量子受控门实现量子半减器和复位器、量子全减器和复位器的设计方法,以及由量子半减器、量子全减器和复位器构成n位量子模2n减法器的设计方法;最后利用设计好的模2n减法器实现基于量子叠加态的模2n减法运算。In this embodiment, a method for designing a modulus 2n subtractor based on a quantum superposition state, the method utilizes a basic quantum controlled gate to realize the design method of a quantum half subtractor and a resetter, a quantum full subtractor and a resetter, and the quantum The design method of the n-bit quantum modulo 2 n subtractor composed of the half subtractor, the quantum full subtractor and the reset device; finally, the modulo 2 n subtraction operation based on the quantum superposition state is realized by using the designed modulo 2 n subtractor .
1、本实施例量子半减器和复位器的设计方法1. The design method of quantum half reducer and reset device in this embodiment
本实施例利用四个受控门实现如图2所示的量子半减器设计线路,它的简图如图3所示,用符号Q表示。四个受控门包括一个受控非门、二个受控V门和一个受控V+门。In this embodiment, four controlled gates are used to realize the design circuit of the quantum half reducer as shown in FIG. The four controlled gates include a controlled NOT gate, two controlled V gates and a controlled V + gate.
将量子半减器应用到量子态|ci>|bi>|ai>,得到Applying the quantum half reducer to the quantum state |c i >|b i >|a i >, we get
其中是异或操作,ci,bi,ai∈{0,1},当|ci>=|0>时,由公式(3)可知量子半减器实现减法(bi-ai),其中输出的第一个量子比特存储减法(bi-ai)的借位信息,输出的第二个量子比特存储的是减法的差。in is an XOR operation, c i , b i , a i ∈ {0,1}, When |c i >=|0>, it can be seen from the formula (3) that the quantum half subtractor implements the subtraction ( bi -a i ) , where the first qubit output Store the borrow information of the subtraction (b i -a i ), the second qubit of the output What is stored is the difference of the subtraction.
为了将减法运算后的辅助量子位复位到初始状态,设计如图4的量子半减器的复位器,它由5个受控门组成,包括二个受控非门、二个受控V门和一个受控V+门,其简图如图5所示,用符号Qo表示。In order to reset the auxiliary qubit after the subtraction to the initial state, design the reset device of the quantum half subtractor as shown in Figure 4, which consists of 5 controlled gates, including two controlled NOT gates and two controlled V gates And a controlled V+ gate, its simplified diagram is shown in Figure 5, represented by the symbol Qo.
将量子半器的复位器应用到量子态得到Applying the resetter of a quantum half-machine to a quantum state get
其中是异或操作,ci,bi,ai∈{0,1},由公式(3)可知量子半减器的复位器将复位为|ci>。in is an XOR operation, c i , b i , a i ∈ {0,1}, From the formula (3), it can be seen that the reset device of the quantum half reducer will be Reset to | ci >.
分析图2和图4中的量子线路,可得到量子半减器的复杂度为4,相应的复位器为5。Analyzing the quantum circuit in Fig. 2 and Fig. 4, it can be obtained that the complexity of the quantum half reducer is 4, and the corresponding resetter is 5.
2、本实施例量子全减器和复位器的设计方法2. The design method of quantum total subtractor and reset device in this embodiment
本实施例利用六个受控门实现如图6所示的量子全减器设计线路,它的简图如图7所示,用符号S表示。六个受控门包括二个受控非门、三个受控V门和一个受控V+门。In this embodiment, six controlled gates are used to realize the design circuit of the quantum total subtractor as shown in FIG. 6 . The six controlled gates include two controlled NOT gates, three controlled V gates and one controlled V + gate.
将量子全减器应用到量子态|ci>|bi>|ai>|ci-1>,得到Applying the quantum total subtractor to the quantum state |c i >|b i >|a i >|c i-1 >, we get
其中是异或操作,ci,bi,ai,ci-1∈{0,1},当|ci>=|0>时,由公式(5)可知量子全减器实现减法(bi-ai-ci-1),in is an XOR operation, c i , b i , a i , c i-1 ∈ {0,1}, When |c i >=|0>, it can be seen from the formula (5) that the quantum total subtractor realizes the subtraction (b i -a i -c i-1 ),
其中输出的第一个量子比特存储减法(bi-ai-ci-1)的借位信息,输出的第二个量子比特存储的是减法的差。where the output of the first qubit Store the borrow information of the subtraction (b i -a i -c i-1 ), the second qubit of the output What is stored is the difference of the subtraction.
为了将减法运算后的辅助量子位复位到初始状态,设计如图8的量子全减器的复位器,它由8个受控门组成,包括四个受控非门、三个受控V门和一个受控V+门,其简图如图9所示,用符号S1表示。In order to reset the auxiliary qubit after the subtraction to the initial state, the reset device of the quantum full subtractor shown in Figure 8 is designed, which consists of 8 controlled gates, including four controlled NOT gates and three controlled V gates and a controlled V + gate, the simplified diagram of which is shown in Figure 9 , denoted by the symbol S1.
将量子全减器的复位器应用到量子态得到Applying the resetter of a quantum full subtractor to a quantum state get
其中是异或操作,ci,bi,ai,ci-1∈{0,1},由公式(6)可知量子全减器的复位器将复位为|ci>。in is an XOR operation, c i , b i , a i , c i-1 ∈ {0,1}, From the formula (6), it can be seen that the reset device of the quantum full subtractor will be Reset to | ci >.
分析图6和图8中的量子线路,可得到量子全减器的复杂度为6,相应的复位器为8。Analyzing the quantum circuits in Figure 6 and Figure 8, it can be obtained that the complexity of the quantum full subtractor is 6, and the corresponding reset device is 8.
3、本实施例n量子比特的量子模2n减法器的设计方法3. The design method of the quantum modulus 2n subtractor of n qubits in this embodiment
本实施例利用量子半减器、量子全减器及相应的复位器实现如图10所示的n量子比特的模2n减法器的设计线路,用符号MU表示。n量子比特的模2n减法器由(n-1)个量子全减器、(n-2)个量子全减器的复位器、1个量子半减器和1个量子半减器的复位器组成,它实现两个n位整数的模2n减法运算。In this embodiment, the quantum half subtractor, the quantum full subtractor and the corresponding reset device are used to realize the design circuit of the modulo 2 n subtractor of n qubits as shown in FIG. 10 , which is represented by the symbol M U . The modulo 2 n subtractor of n qubits consists of (n-1) quantum full subtractors, resets of (n-2) quantum full subtractors, 1 quantum half subtractor and 1 reset of quantum half subtractors device, which implements the modulo 2 n subtraction of two n-bit integers.
假设n位的整数a和b存储在如下两个n量子比特的基态中:Suppose n-bit integers a and b are stored in the ground state of two n-qubits as follows:
其中an-1an-2…a0和bn-1bn-2…b0分别是整数a和b的二进制表示,ah,bh∈{0,1},h=0,...,n-1。where a n-1 a n-2 ... a 0 and b n-1 b n-2 ... b 0 are the binary representations of integers a and b respectively, a h , b h ∈ {0,1}, h=0, ..., n-1.
添加n量子比特的量子基态最为减法运算的辅助位,并排列顺序得到|0bn- 1an-10bn-2an-2...0b0a0>作为输入。将模2n减法器应用到|0bn-1an-10bn-2an-2...0b0a0>,得到:Quantum ground state with n qubits added It is the auxiliary bit of the subtraction operation, and the sequence is arranged to get |0b n- 1 a n-1 0b n-2 a n-2 ... 0b 0 a 0 > as input. Applying the modulo 2 n subtractor to |0b n-1 a n-1 0b n-2 a n-2 ... 0b 0 a 0 > gives:
MU|0bn-1an-10bn-2an-2...0b0a0>=|dndn-1an-10dn-2an-2...0d0a0> (8)M U |0b n-1 a n-1 0b n-2 a n-2 ... 0b 0 a 0 >=|d n d n-1 a n-1 0d n-2 a n-2 ... 0d 0 a 0 > (8)
其中dn表示符号位,dn=0表示正数,dn=1表示负数,dn-1dn-2...d0是整数[(b-a)mod 2n]的二进制表示,dh∈{0,1},h=0,...,n-1,[(b-a)mod 2n]的含义如公式(1)所述。Where d n represents the sign bit, d n =0 represents a positive number, d n =1 represents a negative number, d n-1 d n-2 ... d 0 is the binary representation of an integer [(ba) mod 2 n ], d h ∈ {0,1}, h=0,...,n-1, the meaning of [(ba)mod 2 n ] is as described in formula (1).
由公式(8)可知,模2n减法器实现如下的模2n减法运算:It can be known from the formula (8) that the modulo 2n subtractor realizes the following modulo 2n subtraction operation:
因此模2n减法器的简图可以用图11的符号表示。Therefore, the simplified diagram of the modulo 2 n subtractor can be represented by the symbols in Fig. 11.
分析图10中的量子线路,可得到实现一个n位整数的量子模2n减法运算的复杂度为6(n-1)+8(n-2)+4+5=14n-13,n≥2。Analyzing the quantum circuit in Figure 10, it can be obtained that the complexity of realizing a quantum modulo 2 n subtraction of an n-bit integer is 6(n-1)+8(n-2)+4+5=14n-13, n≥ 2.
4、本实施例基于量子叠加态的模2n减法器运算实现4. In this embodiment, the implementation of the modulo 2 n subtractor operation based on the quantum superposition state
由公式(2)可知,2m个元素的列向量可以存储如下的(n+m)量子比特的量子叠加态中:From formula (2), we can see that the column vector of 2 m elements It can be stored in the quantum superposition state of the following (n+m) qubits:
其中b(j)是一个n位整数,j=0,...,2m-1,n和m都是正整数。Wherein b(j) is an n-bit integer, j=0,...,2 m −1, and both n and m are positive integers.
将模2n减法器MU和张量运算得到新的量子运算其中符号为张量运算符号。The modulo 2n subtractor M U and Tensor operations get new quantum operations where the symbol is a tensor operation symbol.
将应用到Will applicable to
得到get
其中an-1an-2…a0、b(j)n-1b(j)n-2...b(j)0和d(j)n-1d(j)n-2...d(j)0分别是整数a、b(j)和d(j)的二进制表示,d(j)=(b(j)-a)mod 2n,ah,b(j)h,d(j)h∈{0,1},h=0,1,...,n-1,n,m为整数,d(j)n表示d(j)-a符号位,d(j)n=0表示正数,d(j)n=1表示负数。where a n-1 a n-2 ... a 0 , b(j) n-1 b(j) n-2 ... b(j) 0 and d(j) n-1 d(j) n-2 ...d(j) 0 is the binary representation of the integers a, b(j) and d(j) respectively, d(j)=(b(j)-a)mod 2 n ,a h ,b(j) h ,d(j) h ∈{0,1}, h=0,1,...,n-1,n, m is an integer, d(j) n represents the sign bit of d(j)-a, d (j) n =0 indicates a positive number, and d(j) n =1 indicates a negative number.
由公式(10)可知,实现如下的模2n减法运算:From formula (10), we can see that Realize the following modulo 2 n subtraction operation:
其中即实现如下加法运算:in That is, the following addition operation is realized:
此处,MS(),sign(),mod 2n如公式(1)所示。Here, MS(), sign(), mod 2 n are as shown in formula (1).
由公式(10)可知,设计如图12中的量子线路可实现公式(12)中的模2n减法运算,它由一个n量子比特的量子模2n减法器和m量子比特的线构成。It can be seen from formula (10) that designing the quantum circuit as shown in Figure 12 can realize the modulo 2 n subtraction operation in formula (12), which consists of a quantum modulo 2 n subtractor of n qubits and lines of m qubits.
由公式(11)可知,用于辅助运算的n-1量子比特基态与模2n减法存储运算的量子态|ψ(a-b)>|a>不会纠缠在一起,因此在模2n减法运算结束后可移去。It can be seen from formula (11) that the ground state of n-1 qubits used for auxiliary operations The quantum state |ψ (ab) >|a> stored in the modulus 2 n subtraction operation will not be entangled, so it can be removed after the modulo 2 n subtraction operation.
分析图12中的量子线路,可得到基于量子叠加态的模2n减法运算线路复杂度为14n-13,它可并行实现2m个n位整数模2n减法运算,这充分体现了本发明实现模2n减法线路的高效性。Analyzing the quantum circuit in Fig. 12, it can be obtained that the circuit complexity of the modulus 2 n subtraction operation based on the quantum superposition state is 14n-13, and it can realize 2 m n-bit integer modulo 2 n subtraction operations in parallel, which fully embodies the present invention High efficiency for modulo 2n subtraction circuits is achieved.
本发明的具体实施如下:The concrete implementation of the present invention is as follows:
由公式(2)可知,当m=3,n=3时,一个23×1的整数向量[0 1 2 3 4 5 6 7]T可以存储在如下量子态中:It can be known from formula (2) that when m=3, n=3, a 2 3 ×1 integer vector [0 1 2 3 4 5 6 7] T can be stored in the following quantum state:
其中b(j)=j,j=0,1,...,7。where b(j)=j, j=0,1,...,7.
设计如图13所示的量子线路实现如下的8个模23减法运算:Design the quantum circuit shown in Figure 13 to realize the following 8 modulus 2 3 subtraction operations:
MS([0 1 2 3 4 5 6 7]T-5)=[-3 -4 -5 -6 -7 0 1 2]T (14)MS([0 1 2 3 4 5 6 7] T -5)=[-3 -4 -5 -6 -7 0 1 2] T (14)
其中[]T是矩阵的转置。where [] T is the transpose of the matrix.
图13虚框中的量子线路是3量子比特的量子加法器,它由2个量子全加器、1个量子全加器的复位器、1个量子半加器和一个量子半加器的复位器构成,因此线路的复杂度为29,即可以由29个量子基本操作实现一个3位数的模23减法。由公式(11)可知,图13中的量子线路实现如下的模23减法运算:The quantum circuit in the virtual frame of Fig. 13 is a quantum adder of 3 qubits, which consists of 2 quantum full adders, a reset device of a quantum full adder, a quantum half adder and a reset of a quantum half adder Therefore, the complexity of the circuit is 29, that is, a 3-digit modulo 2 3 subtraction can be realized by 29 quantum basic operations. It can be seen from formula (11) that the quantum circuit in Figure 13 implements the following modulo 2 3 subtraction operation:
其中: in:
由公式(15)可知,图13中的量子线路实现公式(14)中的8个模23减法运算,并且辅助量子比特不会与|ψ(b-5)>纠缠在一起。It can be seen from formula (15) that the quantum circuit in Figure 13 implements the 8 modulo 2 3 subtraction operations in formula (14), and assists the qubit will not be entangled with |ψ (b-5) >.
由于将3量子比特的量子模23减法器应用到量子叠加态并不需要增加新的量子门,因为图13中的量子线路的复杂度也为29。Since applying the 3-qubit quantum modulus 2 3 subtractor to the quantum superposition state does not need to add a new quantum gate, because the complexity of the quantum circuit in Fig. 13 is also 29.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810748584.9A CN108932388B (en) | 2018-07-10 | 2018-07-10 | Mode 2 based on quantum superposition statenDesign method of subtracter |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810748584.9A CN108932388B (en) | 2018-07-10 | 2018-07-10 | Mode 2 based on quantum superposition statenDesign method of subtracter |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN108932388A true CN108932388A (en) | 2018-12-04 |
| CN108932388B CN108932388B (en) | 2022-07-12 |
Family
ID=64448002
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810748584.9A Expired - Fee Related CN108932388B (en) | 2018-07-10 | 2018-07-10 | Mode 2 based on quantum superposition statenDesign method of subtracter |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108932388B (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109741627A (en) * | 2019-02-26 | 2019-05-10 | 湖南正维新能源科技有限责任公司 | A kind of shared parking stall data processing system and its method |
| CN112214200A (en) * | 2020-09-30 | 2021-01-12 | 合肥本源量子计算科技有限责任公司 | Quantum subtraction operation method and device, electronic device and storage medium |
| CN113222156A (en) * | 2020-01-21 | 2021-08-06 | 合肥本源量子计算科技有限责任公司 | Quantum simulation method and device for operation to be executed |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060083376A1 (en) * | 2004-10-07 | 2006-04-20 | Sony Corporation | Quantum cryptography communication method, quantum cryptography communication apparatus, and quantum cryptography communication system |
| CN103971328A (en) * | 2014-05-05 | 2014-08-06 | 华东交通大学 | Storage, design and implementation method for multi-dimensional quantum gray image and multi-dimensional quantum colorful image |
| CN107025206A (en) * | 2017-04-13 | 2017-08-08 | 广西师范大学 | A kind of method that quantum Fourier transform realizes quantum wire design |
| CN108038548A (en) * | 2017-11-17 | 2018-05-15 | 广西师范大学 | A kind of quantum of image binaryzation realizes circuit method |
| CN108198196A (en) * | 2018-01-23 | 2018-06-22 | 华东交通大学 | The design and implementation methods of quantum Image Edge-Detection based on Sobel operators |
| CN108255784A (en) * | 2018-01-15 | 2018-07-06 | 广西师范大学 | Multi-layer quantum D(4)The method that quantum wire design is realized in wavelet package transforms and inverse transformation |
-
2018
- 2018-07-10 CN CN201810748584.9A patent/CN108932388B/en not_active Expired - Fee Related
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060083376A1 (en) * | 2004-10-07 | 2006-04-20 | Sony Corporation | Quantum cryptography communication method, quantum cryptography communication apparatus, and quantum cryptography communication system |
| CN103971328A (en) * | 2014-05-05 | 2014-08-06 | 华东交通大学 | Storage, design and implementation method for multi-dimensional quantum gray image and multi-dimensional quantum colorful image |
| CN107025206A (en) * | 2017-04-13 | 2017-08-08 | 广西师范大学 | A kind of method that quantum Fourier transform realizes quantum wire design |
| CN108038548A (en) * | 2017-11-17 | 2018-05-15 | 广西师范大学 | A kind of quantum of image binaryzation realizes circuit method |
| CN108255784A (en) * | 2018-01-15 | 2018-07-06 | 广西师范大学 | Multi-layer quantum D(4)The method that quantum wire design is realized in wavelet package transforms and inverse transformation |
| CN108198196A (en) * | 2018-01-23 | 2018-06-22 | 华东交通大学 | The design and implementation methods of quantum Image Edge-Detection based on Sobel operators |
Non-Patent Citations (8)
| Title |
|---|
| ZHOU, RI-GUI等: "Quantum realization of the bilinear interpolation method for NEQR", 《SCIENTIFIC REPORTS》 * |
| ZHOU, RI-GUI等: "Quantum realization of the bilinear interpolation method for NEQR", 《SCIENTIFIC REPORTS》, vol. 7, 19 June 2017 (2017-06-19), pages 1 - 43 * |
| 王冬等: "基于多目标扩展通用Toffoli门的量子比较器设计", 《计算机科学》 * |
| 王冬等: "基于多目标扩展通用Toffoli门的量子比较器设计", 《计算机科学》, vol. 39, no. 09, 15 September 2012 (2012-09-15), pages 302 - 306 * |
| 范洪强等: "用经典计算机模拟量子计算机", 《密码学报》 * |
| 范洪强等: "用经典计算机模拟量子计算机", 《密码学报》, vol. 5, no. 03, 15 June 2018 (2018-06-15), pages 249 - 261 * |
| 黎海生等: "在纠缠量子系统中的图像几何形状存储和检索", 《华东交通大学学报》 * |
| 黎海生等: "在纠缠量子系统中的图像几何形状存储和检索", 《华东交通大学学报》, vol. 30, no. 4, 15 August 2013 (2013-08-15), pages 14 - 18 * |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109741627A (en) * | 2019-02-26 | 2019-05-10 | 湖南正维新能源科技有限责任公司 | A kind of shared parking stall data processing system and its method |
| CN113222156A (en) * | 2020-01-21 | 2021-08-06 | 合肥本源量子计算科技有限责任公司 | Quantum simulation method and device for operation to be executed |
| CN113222156B (en) * | 2020-01-21 | 2023-08-08 | 本源量子计算科技(合肥)股份有限公司 | A quantum simulation method and device for operations to be performed |
| CN112214200A (en) * | 2020-09-30 | 2021-01-12 | 合肥本源量子计算科技有限责任公司 | Quantum subtraction operation method and device, electronic device and storage medium |
| CN112214200B (en) * | 2020-09-30 | 2023-12-15 | 本源量子计算科技(合肥)股份有限公司 | Quantum subtraction operation method, device, electronic device and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108932388B (en) | 2022-07-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108984849A (en) | A kind of quantum comparison device design method based on quantum superposition state | |
| CN109002894B (en) | A Design Method of Quantum Adder Based on Quantum Superposition State | |
| CN111580782B (en) | Quantum n-bit full adder | |
| CN110474769B (en) | Quantum color image encryption method based on direction modification | |
| CN107066234B (en) | A Design Method of Quantum Multiplier | |
| CN108932388B (en) | Mode 2 based on quantum superposition statenDesign method of subtracter | |
| Pudi et al. | A bit-serial pipelined architecture for high-performance DHT computation in quantum-dot cellular automata | |
| CN101776934A (en) | Carry generation and transfer function generator and reversible and optimal addition line design method | |
| CN111832734B (en) | Design method of quantum image multiplication operation and simulation implementation method thereof | |
| Xie et al. | Efficient Hardware Implementation of Finite Field Arithmetic $ AB+ C $ A B+ C for Binary Ring-LWE Based Post-Quantum Cryptography | |
| CN103761068A (en) | Optimized Montgomery modular multiplication method, optimized modular square method and optimized modular multiplication hardware | |
| CN112989273B (en) | Method for carrying out memory operation by utilizing complementary code coding | |
| CN106683041B (en) | A Quantum Image Miscutting Method Based on NEQR Expression | |
| CN108846483B (en) | A Modulo-N Subtractor Design Method Without Destroying Source Operands | |
| CN115423688A (en) | Quantum circuit diagram and quantum color image scaling method based on bilinear interpolation | |
| Asadi et al. | Towards designing quantum reversible ternary multipliers | |
| CN107992283A (en) | A kind of method and apparatus that finite field multiplier is realized based on dimensionality reduction | |
| CN108335312B (en) | Design and Implementation of Quantum Morphological Gradient Algorithm for Grayscale Image | |
| CN108898228B (en) | Quantum adder design method without damaging source operands | |
| Khan | A recursive method for synthesizing quantum/reversible quaternary parallel adder/subtractor with look-ahead carry | |
| Haghparast et al. | Designing novel quaternary quantum reversible subtractor circuits | |
| TW448376B (en) | Circuit and method cryptographic multiplication for computing the RSA and ECC algorithms | |
| CN109388372B (en) | MSD (minimum-order-of-performance) multiplication calculation method of three-value optical processor based on minimum module | |
| CN116155498A (en) | Polynomial multiplication processing method and system applied to lattice cipher algorithm | |
| CN114978487A (en) | Quantum image encryption method based on two-dimensional cross mapping and dynamic diffusion |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20220712 |