Quantum circuit construction method, target quantum circuit and related system and device
By adopting the quantum circuit construction method based on Karatsuba algorithm in quantum computers, and using CNOT gate to replace the TOFFOLI gate, the existing polynomial multiplication quantum circuit gate is solved, and more efficient and stable quantum computing is achieved.
Patent Information
- Application Number
- CN202311489892.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-07
- Publication Date
- 2025-05-09
AI Technical Summary
Existing polynomial multiplication quantum circuits require complex quantum gates, such as TOFFOLI gates, and the depth of the gate may reach an exponential order, resulting in difficulty and inefficiency in real quantum computers.
The quantum line construction method based on the Karatsuba algorithm is adopted to simplify the line construction through CNOT gates, reduce the use of TOFFOLI gates, thereby reducing the physical implementation requirements of quantum computers.
It reduces the depth and operation complexity of the quantum gate, makes the implementation of polynomial multiplication and addition efficient and concise, and improves the execution efficiency and stability of quantum computers.
Smart Images

Figure CN119962698A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of quantum computing, and in particular to a quantum circuit construction method, a target quantum circuit, a quantum chip system, a quantum computer, and a classical computer. Background Art
[0002] Quantum computers are physical devices that follow the laws of quantum mechanics to perform high-speed mathematical and logical operations, store and process quantum information. When a device processes and calculates quantum information and runs quantum algorithms, it is a quantum computer. Quantum computers have become a key technology under research because they have the ability to process mathematical problems more efficiently than ordinary computers. For example, they can speed up the time to crack RSA keys from hundreds of years to a few hours.
[0003] Existing polynomial multiplication quantum circuits usually require complex quantum gates, such as TOFFOLI gates, and the depth of the gates may reach exponential levels, making their implementation on actual quantum computers difficult and inefficient.
[0004] Based on this, the present application provides a quantum circuit construction method, a target quantum circuit, a quantum chip system, a quantum computer and a classical computer to improve related technologies. Summary of the invention
[0005] The present application provides a quantum circuit construction method, a target quantum circuit, a quantum chip system, a quantum computer and a classical computer, which reduces the use of TOFFOLI gates, reduces the required quantum gate depth and the physical implementation requirements of quantum computers.
[0006] In a first aspect, the present application provides a method for constructing a quantum circuit, the method comprising:
[0007] Constructed to realize H(x)+(1+x k )The target quantum circuit for the calculation of F(x)G(x);
[0008] Wherein, the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, k is a positive integer, and the quantum operation in the target quantum circuit includes a CNOT operation.
[0009] In a second aspect, the present application provides a target quantum circuit for realizing H(x)+(1+x k )Calculation of F(x)G(x);
[0010] Wherein, the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, k is a positive integer, and the quantum operation in the target quantum circuit includes a CNOT operation.
[0011] In a third aspect, the present application provides a quantum chip system, comprising at least one quantum processor, wherein the at least one quantum processor is used to execute quantum operations corresponding to a quantum program to implement the following steps:
[0012] Through the target quantum circuit, H(x)+(1+x k )F(x)G(x) is calculated;
[0013] Wherein, the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, k is a positive integer, and the quantum operation in the target quantum circuit includes a CNOT operation.
[0014] In a fourth aspect, the present application provides a quantum computer, the quantum computer comprising:
[0015] A quantum chip system, the quantum chip system comprising at least one quantum processor, the at least one quantum processor being used to execute quantum operations corresponding to a quantum program to process quantum bits, thereby performing a quantum operation on H(x)+(1+x) through a target quantum circuit. k )F(x)G(x) is calculated; wherein the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, k is a positive integer, and the quantum operation in the target quantum circuit includes a CNOT operation;
[0016] A measurement and control system, the measurement and control system comprising a control device and a measuring device, the control device is used to convert the quantum program corresponding to the target quantum circuit into a corresponding control signal and send it to the quantum processor, and the measuring device is used to measure the quantum bit;
[0017] A support system for providing working environment conditions to ensure the operation of the quantum chip system;
[0018] An operating system is used to provide a software system to enable interaction between a user and the quantum chip system and the measurement and control system.
[0019] In a fifth aspect, the present application provides a classical computer, the classical computer comprising:
[0020] Memory for storing computer programs;
[0021] At least one processor is configured to execute the computer program to implement the following steps:
[0022] Get the coefficient arrays of F(x), G(x) and H(x); wherein the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, and the polynomial coefficients in the coefficient arrays are arranged in descending order of degree.
[0023] According to the quantum circuit construction method, target quantum circuit, quantum chip system, quantum computer and classical computer provided by the present application, the use of CNOT gates in quantum circuits simplifies the construction of quantum circuits and reduces the use of TOFFOLI gates, thereby reducing the physical implementation requirements of quantum computers. It not only makes the implementation of polynomial multiplication and addition efficient and concise, but also greatly reduces the required quantum gate depth and operation complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The present application is further described below in conjunction with the accompanying drawings and specific implementation methods.
[0025] Figure 1 It is a flow chart of a quantum circuit construction method provided in an embodiment of the present application.
[0026] Figure 2 It is a schematic diagram of a process for constructing the target quantum circuit provided in an embodiment of the present application.
[0027] Figure 3 It is a schematic diagram of the structure of a quantum chip system provided in an embodiment of the present application.
[0028] Figure 4 It is a schematic diagram of the structure of a quantum computer provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0030] In the description of the embodiments of the present application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0031] Quantum computers are hybrid structures consisting of two parts: one is the classical computing part, which is responsible for performing classical computing and control; the other is the quantum computing part, which is responsible for running quantum programs and realizing quantum computing. A quantum program is a sequence of instructions written in a quantum language such as QRunes that can be run on a quantum computer, supporting quantum logic gate operations and ultimately realizing quantum computing. Specifically, a quantum program is a sequence of instructions that operate quantum logic gates in a certain sequence.
[0032] Quantum circuits, as a manifestation of quantum programs, are also called quantum logic circuits. They are the most commonly used general quantum computing model. They represent circuits that operate on quantum bits in an abstract concept. They are composed of quantum bits, circuits (timelines), and various quantum logic gates. Finally, the results often need to be read out through quantum measurement operations.
[0033] Unlike traditional circuits that are connected by metal wires to transmit voltage or current signals, in quantum circuits, the circuits can be seen as connected by time, that is, the state of the quantum bit evolves naturally over time, following the instructions of the Hamiltonian operator until it encounters a logic gate and is operated.
[0034] A quantum program as a whole corresponds to a total quantum circuit, and the quantum program refers to the total quantum circuit, wherein the total number of quantum bits in the total quantum circuit is the same as the total number of quantum bits in the quantum program. It can be understood that a quantum program can be composed of a quantum circuit, measurement operations on quantum bits in the quantum circuit, registers for storing measurement results, and control flow nodes (jump instructions). A quantum circuit can contain dozens, hundreds, or even thousands of quantum logic gate operations. The execution process of a quantum program is the process of executing all quantum logic gates in a certain time sequence. It should be noted that the time sequence is the time order in which a single quantum logic gate is executed.
[0035] It should be noted that in classical computing, the most basic unit is the bit, and the most basic control mode is the logic gate, which can achieve the purpose of controlling the circuit through the combination of logic gates. Similarly, the way to process quantum bits is quantum logic gates. Using quantum logic gates, quantum states can evolve. Quantum logic gates are the basis of quantum circuits. Quantum logic gates include: single-bit quantum logic gates, such as Hadamard gates (H gates, Hadamard gates), Pauli-X gates (X gates), Pauli-Y gates (Y gates), Pauli-Z gates (Z gates), RX gates, RY gates, RZ gates, etc.; multi-bit quantum logic gates, such as CNOT gates, CR gates, iSWAP gates, TOFFOLI gates, etc. Quantum logic gates are generally represented by unitary matrices, and unitary matrices are not only in matrix form, but also a kind of operation and transformation. The general function of quantum logic gates on quantum states is to calculate by multiplying the unitary matrix on the left by the matrix corresponding to the right vector of the quantum state.
[0036] With the advancement of quantum computing technology, the efficiency and feasibility of quantum algorithms have become particularly important. In the field of polynomial computing, how to achieve effective quantum circuit construction, especially for polynomial multiplication, has become a hot topic of research. Existing polynomial multiplication quantum circuits usually require complex quantum gates, such as TOFFOLI gates, and the depth of the gates may reach exponential levels, making their implementation on actual quantum computers difficult and inefficient.
[0037] The Karatsuba algorithm is a classic algorithm for solving polynomial multiplication. Its basic idea is to divide the two polynomials to be multiplied into two segments for multiplication and addition, thereby reducing the complexity of multiplication. This application proposes a quantum circuit implementation based on the Karatsuba algorithm for solving the h+f*g quantum circuit. Specifically, the quantum circuit based on the Karatsuba polynomial multiplication is designed, and the number of TOFFOLI gates is n less than the gate depth of the general polynomial multiplication quantum circuit. 1 / 3 Here, the Karatsuba algorithm is converted into a quantum circuit, and the required quantum gate depth is reduced by n compared to the previous polynomial multiplication. 1 / 3 Moreover, building this quantum circuit only requires a simple CNOT gate.
[0038] This application provides a quantum circuit construction method, a target quantum circuit, a quantum chip system, a quantum computer and a classical computer to improve related technologies. This application implements a quantum circuit based on the Karatsuba algorithm, which only requires CNOT gates to implement, greatly reducing the gate depth compared to the previous polynomial multiplication quantum circuit.
[0039] It should be noted that the present application takes finite fields in cryptography as an example, such as the Diffie-Hellman cryptographic algorithm on finite fields, the elliptic curve cryptography system on finite fields, the application of binary field towers in block ciphers, etc. In addition, the present application can also be applied to computing scenarios in other technical fields, such as digital signal processing, computer graphics, sound and image compression, polynomial kernel methods in machine learning, efficient neural network weight training in deep learning, efficient operation of complex data structures in big data analysis, star trajectory calculation in astronomy, DNA sequence matching and gene editing in bioinformatics, risk model construction and high-frequency trading strategies in financial mathematics, seismic data processing and analysis in geophysics, and high-resolution image reconstruction in medical imaging, etc. The present application does not limit this.
[0040] The present application relates to a quantum computer, and its system operating environment is suitable for, for example, a high-performance computing center, a research laboratory or a specialized quantum technology company.
[0041] The present application does not limit the type of quantum computer, which may include but is not limited to the following types.
[0042] Quantum computers based on superconducting circuits: use superconducting circuits to implement quantum bits, with high integration and fast operation speed.
[0043] Ion-trap-based quantum computers: Use ion traps to implement quantum bits, with higher fidelity and longer coherence time.
[0044] Quantum computers based on optical systems: Using optical systems to implement quantum bits has high parallelism and fast operation speed.
[0045] Quantum computers based on topological systems: quantum bits are realized using topological systems, which have higher fault tolerance and longer coherence time.
[0046] (Quantum circuit construction method)
[0047] See also Figure 1 , Figure 1 It is a flow chart of a quantum circuit construction method provided in an embodiment of the present application.
[0048] An embodiment of the present application provides a method for constructing a quantum circuit, the method comprising step S101.
[0049] Step S101: construct a method for implementing H(x)+(1+x k )F(x)G(x) is the target quantum circuit for the calculation of
[0050] Wherein, the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, k is a positive integer, and the quantum operation in the target quantum circuit includes a CNOT operation.
[0051] It should be noted that the calculation results of polynomial multiplication, addition, etc. in the embodiments of the present application are also ∈F2[x], such as h(x)+f(x)g(x), H(x)+(1+x k )F(x)G(x)∈F2[x].
[0052] The quantum circuit construction method refers to the process of combining various quantum gates and operations in a certain order according to a specific algorithm or problem during quantum computing. For example, a Hadamard gate (H gate) can be applied to |0> to construct a superposition state of |0>+|1>. Quantum circuit construction is the most basic content in quantum computing, just like the logic gate circuit in classical computing, which is the basis for implementing various quantum algorithms. Appropriate quantum circuit design can efficiently solve many traditionally difficult problems with low error rate and high speed.
[0053] Constructed to realize H(x)+(1+x k The target quantum circuit for the calculation of )F(x)G(x) refers to a specific quantum circuit design whose purpose is to calculate the polynomial H(x) plus (1+x k ) and F(x)G(x). In a finite field, multiplication and addition of polynomials are important operations in cryptography and coding theory. By utilizing the linear superposition and entanglement characteristics of quantum computing, such complex polynomial operations can be implemented more efficiently, and compared with classical computing methods, it has higher parallelism and efficiency, especially for large-scale polynomial operations, which can significantly improve the speed of polynomial calculations and make it easier to expand and adapt to more complex polynomial structures.
[0054] A field with a finite number of elements is a finite field. In cryptographic applications, finite fields can be divided into prime fields F y (y is a very large prime number) and the binary extension domain The binary field F2 is a finite field containing two elements (for example, 0 and 1). By expanding the binary field n times, we can get the binary extended field The following is a brief introduction to the binary extension domain A way to express :
[0055] Let F2[x] be a polynomial ring defined over the binary field F2, whose elements are polynomials f(x)=a n x n +a n-1 x n-1+…+a1x+a0. Further, the binary extension domain is realized by the polynomial ring Where m(x) is an irreducible polynomial on F2[x], the degree of m(x) is n (i.e., deg(m(x)=n), and ideal<m(x)> It can be regarded as the great ideal of F2[x]. Since m(x) is an irreducible polynomial, c0=c n =1. The default modulus polynomial m(x) is represented by an n-dimensional array, and the default highest bit is 1, which is convenient for unified processing and representation on quantum circuits and saves one bit. The binary expansion domain is generally represented as:
[0056]
[0057] Here you can As an n-dimensional vector space defined on F2, choose {1,x,x 2 ,…,x n-1 As A basis on , which is also called a polynomial basis. Thus, The elements f(x) on can be represented by vectors, namely:
[0058]
[0059] Therefore, a polynomial f(x)∈F2[x] means that each coefficient of the polynomial f(x) is either 0 or 1. Polynomial operations in F2[x] are widely used in cryptography, communications and other fields. Their operation rules are simple, convenient for practical applications, and compatible with the binary representation of computers.
[0060] The quantum operations in the target quantum circuit include the CNOT operation, which is also called the controlled NOT gate and is a two-bit quantum logic gate in quantum computing. In the quantum circuit, the CNOT gate can realize entanglement and logic operations between quantum bits.
[0061] The quantum circuit construction method provided in this application is based on the Karatsuba algorithm. The polynomials F(x) and G(x) are multiplied in segments using the segmentation idea of the algorithm. Then (1+x k)F(x)G(x) and H(x) are added piecewise. In this process, the quantum operations used include CNOT operations, which can realize conditional flipping between quantum states. The quantum circuit construction method of the present application not only makes the implementation of polynomial multiplication and addition efficient and concise, but also greatly reduces the required quantum gate depth and operation complexity. The use of CNOT gates in quantum circuits simplifies the construction of quantum circuits, thereby achieving higher execution efficiency and stability on actual quantum computers, and reduces the error rate and increases the accuracy of operations. Compared with traditional polynomial multiplication quantum circuits, this method reduces the use of TOFFOLI gates, thereby reducing the physical implementation requirements of quantum computers. This method provides an efficient and feasible quantum solution for complex polynomial operations. The quantum circuit construction method based on the Karatsuba algorithm provides new computing tools for cryptography and coding theory in finite fields, which can more efficiently process operations in these fields. In addition, the scope of application of this method is wide. In addition to cryptographic applications, it can also be extended to other technical fields, such as digital signal processing, computer graphics, etc.
[0062] For example, suppose there is a polynomial F(x)=x 2 +1, G(x)=x 3 +1, H(x) = x 5 +1, where all polynomial coefficients are on the binary field F2, and k = 2. Through the target quantum circuit, calculate H(x)+(1+x k )F(x)G(x), the result is: H(x)+(1+x k )F(x)G(x)=x 7 +x 5 +x 4 +x 3 .
[0063] See also Figure 2 , Figure 2 It is a schematic diagram of a process for constructing the target quantum circuit provided in an embodiment of the present application.
[0064] In some embodiments, the process of constructing the target quantum circuit includes steps S201 to S202.
[0065] Step S201: Store the coefficient arrays of F(x), G(x) and H(x) in quantum registers A to C respectively; wherein the degrees of F(x) and G(x) are both less than m, and the degree of H(x) is less than k+2m-1, and the polynomial coefficients in the coefficient arrays are arranged in descending order of degree, m and k are positive integers, and k≥m; the number of bits of quantum registers A to C are m, m and k+2m-1 respectively.
[0066] Step S202: construct the target quantum circuit using the input and output of the target quantum circuit and the CNOT operation; wherein the input of the target quantum circuit includes the coefficient array stored in quantum registers A to C, and the output of the target quantum circuit includes H(x)+(1+x stored in quantum register C k )The calculation result of F(x)G(x).
[0067] Storing the coefficient arrays of F(x), G(x) and H(x) in quantum registers A to C respectively means that the coefficient arrays of polynomials F(x), G(x) and H(x) are stored in a specific quantum storage structure, namely, quantum registers. The coefficient array of a polynomial is an array representing the coefficients of each polynomial, arranged from high to low according to the degree of the polynomial. For example, for f(x) = x 3 +x 2 +1, and its coefficient array is [1,1,0,1]. The coefficient array provides a compact representation that makes the storage and processing of polynomials more efficient. A quantum register is a group of quantum bits, similar to registers in classical computers, but used to store and manipulate quantum information. For example, a 2-bit quantum register can store 4 results: |00>, |01>, |10>, or |11>. This storage method provides quantum representation of polynomials for quantum computing, laying the foundation for subsequent quantum operations. Converting the coefficients of polynomials into quantum form can use quantum machines to efficiently perform complex computing operations. When storing and processing quantum information in quantum computing, additional data conversion steps are avoided, and quantum superposition and entanglement can be used to efficiently perform parallel operations.
[0068] The input of the target quantum circuit includes the coefficient array stored in quantum registers A to C, which means that the input of the target quantum circuit is determined by k and the polynomial coefficients stored in quantum registers A, B and C, and the quantum state at the beginning of the target quantum circuit is determined, providing a clear starting state for the target quantum circuit and ensuring the accuracy of the calculation.
[0069] The output of the target quantum circuit includes H(x)+(1+x k The calculation result of )F(x)G(x) refers to the result stored in quantum register C after the calculation of the target quantum circuit, which facilitates subsequent calculations or measurements. For example, the result stored in quantum register C is 11000.
[0070] In some embodiments, the target quantum circuit calculates H(x)+(1+x k The process of )F(x)G(x) includes:
[0071] R1: Take k, A[0,…,m-1], B[0,…,m-1], C[0,…,k+2m-2] as the input of the target quantum circuit; when m>1, split to obtain (FG)(x)=F(x)G(x)=(FG)0(x)+(FG)1(x)x k , H(x)=H0(x)+H1(x)x k +H2(x)x 2k , execute R2; when m=1, execute R5;
[0072] R2: Perform CNOT operation so that C[k,…,k+p-1] stores H1(x)+H2(x) and C[0,…,k-1] stores H0(x)+H1(x)+H2(x);
[0073] R3: Call the recursive quantum circuit so that C[k,…,2k-1] stores H1(x)+H2(x)+(FG)0(x), and C[2k,…,2k+p-1] stores H2(x)+(FG)1(x); wherein A[0,…,m-1], B[0,…,m-1], and C[k,…,2k+p-1] are used as inputs of the recursive quantum circuit, and C[k,…,2k+p-1] is used as output of the recursive quantum circuit;
[0074] R4: Perform CNOT operation so that C[0,…,k-1] stores H0(x)+(FG)0(x) and C[k,…,k+p-1] stores H1(x)+(FG)0(x)+(FG)1(x);
[0075] R5: Perform CNOT operation and TOFFOLI operation, and use C[0,…,k+2m-2] as the output of the target quantum circuit.
[0076] In some embodiments, in step R2, the process of performing the CNOT operation includes:
[0077] Perform a CNOT operation so that C[k,…,k+p-1] stores H1(x)+H2(x); wherein C[2k,…,2k+p-1] is used as a control bit and C[k,…,k+p-1] is used as a target bit; p=max{0,2m-1-k};
[0078] A CNOT operation is performed so that C[0,…,k-1] stores H0(x)+H1(x)+H2(x); wherein C[k,…,2k-1] is used as a control bit and C[0,…,k-1] is used as a target bit.
[0079] In some embodiments, in step R4, the process of performing the CNOT operation includes:
[0080] Perform a CNOT operation so that C[0,…,k-1] stores H0(x)+(FG)0(x); wherein C[k,…,2k-1] is used as a control bit and C[0,…,k-1] is used as a target bit;
[0081] A CNOT operation is performed so that C[k,…,k+p-1] stores H1(x)+(FG)0(x)+(FG)1(x); wherein C[2k,…,2k+p-1] is used as a control bit, C[k,…,k+p-1] is used as a target bit, and C[0,…,k+2m-2] is used as an output of the target quantum circuit.
[0082] In some embodiments, in step R5, the process of performing the CNOT operation and the TOFFOLI operation includes:
[0083] Perform a CNOT operation, wherein C[k] is used as a control bit and C[0] is used as a target bit;
[0084] Perform a TOFFOLI operation, wherein A[0] and B[0] are used as control bits, and C[k] is used as the target bit;
[0085] A CNOT operation is performed, wherein C[k] is used as a control bit, C[0] is used as a target bit, and C[0, ..., k+2m-2] is used as an output of the target quantum circuit.
[0086] In a specific application scenario, the target quantum circuit calculates H(x)+(1+x k )F(x)G(x) process includes steps W1 to W9.
[0087] W1: Take k, A[0,…,m-1], B[0,…,m-1], C[0,…,k+2m-2] as the input of the target quantum circuit; when m>1, split to obtain (FG)(x)=F(x)G(x)=(FG)0(x)+(FG)1(x)x k , H(x)=H0(x)+H1(x)x k +H2(x)x 2k , execute W2; when m=1, execute W7;
[0088] W2: Perform CNOT operation so that C[k,…,k+p-1] stores H1(x)+H2(x); wherein C[2k,…,2k+p-1] is used as the control bit and C[k,…,k+p-1] is used as the target bit; p=max{0,2m-1-k};
[0089] W3: Perform CNOT operation so that C[0,…,k-1] stores H0(x)+H1(x)+H2(x); wherein C[k,…,2k-1] is used as the control bit and C[0,…,k-1] is used as the target bit;
[0090] W4: Call the recursive quantum circuit so that C[k,…,2k-1] stores H1(x)+H2(x)+(FG)0(x), and C[2k,…,2k+p-1] stores H2(x)+(FG)1(x); wherein A[0,…,m-1], B[0,…,m-1], and C[k,…,2k+p-1] are used as inputs of the recursive quantum circuit, and C[k,…,2k+p-1] is used as output of the recursive quantum circuit;
[0091] W5: Perform CNOT operation to make C[0,…,k-1] store H0(x)+(FG)0(x); wherein C[k,…,2k-1] is used as the control bit and C[0,…,k-1] is used as the target bit;
[0092] W6: Perform a CNOT operation so that C[k,…,k+p-1] stores H1(x)+(FG)0(x)+(FG)1(x); wherein C[2k,…,2k+p-1] is used as a control bit, C[k,…,k+p-1] is used as a target bit, and C[0,…,k+2m-2] is used as the output of the target quantum circuit;
[0093] W7: Perform CNOT operation, wherein C[k] is used as the control bit and C[0] is used as the target bit;
[0094] W8: Perform TOFFOLI operation, wherein A[0] and B[0] are used as control bits, and C[k] is used as the target bit;
[0095] W9: Perform a CNOT operation, wherein C[k] is used as a control bit, C[0] is used as a target bit, and C[0,…,k+2m-2] is used as the output of the target quantum circuit.
[0096] In this embodiment, quantum registers A, B, and C are used to store the coefficient arrays of polynomials F(x), G(x), and H(x). The target quantum circuit is designed to accept specific inputs and complete the calculation through a series of CNOT and TOFFOLI operations. The target quantum circuit uses the parallelism of quantum computing to process multiple parts of the polynomial at the same time, and decomposes the complex polynomial calculation problem into smaller and more easily handled subtasks through a hierarchical and modular approach. The target quantum circuit can be recorded as Multxk, for example.
[0097] The benefits of doing this are that, first, this method uses the powerful parallel capability of quantum computing, allowing multiple polynomial coefficients to be calculated simultaneously, greatly improving the speed of calculation. Secondly, this decomposition strategy makes the problem more modular, which not only improves the reusability of the algorithm, but also provides space for future optimization and expansion. For example, from a cryptographic perspective, it provides higher computational efficiency for polynomial-based cryptographic algorithms, thereby increasing the speed of encryption, decryption, and key exchange. In addition, by splitting multiple tasks into smaller subtasks, this method provides a better platform for algorithm error correction, because errors on any subtask may be corrected in subsequent steps. Finally, the modular nature of this method makes it easy to combine with other quantum computing or cryptographic methods, providing flexibility and adaptability for applications in multiple fields.
[0098] For example, assuming k = 2, m = 2, p = 1, F(x) = x, G(x) = 1 + x, H(x) = x 4 , the degrees of F(x) and G(x) are both less than 2, and the degree of H(x) is less than 5. The number of bits of quantum registers A to C are 2, 2, and 5, respectively. The F(x) coefficient array [0,1] is stored in quantum register A, A[0,1]=01; the G(x) coefficient array [1,1] is stored in quantum register B, B[0,1]=11; the H(x) coefficient array [1,0,0,0,0] is stored in quantum register C, C[0,1,2,3,4]=00001.
[0099] Since m=2>1, the decomposition is: (FG)(x)=x+x 2 , (FG)0(x)=x, (FG)1(x)=1; H0(x)=0, H1(x)=0, H2(x)=1.
[0100] Perform a CNOT operation so that C[2] stores 1, wherein C[4] is used as a control bit and C[2] is used as a target bit;
[0101] Perform a CNOT operation so that C[0,1] stores 10; wherein C[2,3] is used as the control bit and C[0,1] is used as the target bit;
[0102] Calling the recursive quantum circuit so that C[2,3] stores 11 and C[4] stores 0; wherein A[0,1], B[0,1], and C[2,3,4] are used as inputs of the recursive quantum circuit, and C[2,3,4] is used as output of the recursive quantum circuit;
[0103] Perform a CNOT operation so that C[0,1] stores 01; wherein C[2,3] is used as a control bit and C[0,1] is used as a target bit;
[0104] A CNOT operation is performed to make C[2] store 1; wherein C[4] is used as a control bit, C[2] is used as a target bit, and C[0, ..., 4] is used as an output of the target quantum circuit.
[0105] After completing the above calculation, C[0,1,2,3,4] stores 01110, and the result stored in quantum register C corresponds to H(x)+(1+x k )The calculation result of F(x)G(x)x 3 +x 2 +x.
[0106] In some embodiments, the process of constructing the recursive quantum circuit includes: storing the coefficient arrays of f(x), g(x) and h(x) in quantum registers A to C, respectively; wherein the degrees of f(x) and g(x) are both less than n, the degree of h(x) is less than 2n-1, the polynomial coefficients in the coefficient arrays are arranged in descending order of degree, and n is a positive integer; the number of bits of quantum registers A to C are n, n and 2n-1, respectively; constructing the first quantum circuit using the input and output of the first quantum circuit and the CNOT operation; wherein the input of the first quantum circuit includes the coefficient array stored in quantum registers A to C, and the output of the first quantum circuit includes the calculation result of h(x)+f(x)g(x) stored in quantum register C.
[0107] In this embodiment, the coefficient arrays of the polynomials f(x), g(x) and h(x) are first stored in quantum registers A, B and C respectively. Next, the polynomial operation is implemented through a specific quantum operation, such as the CNOT operation. After the processing of the recursive quantum circuit, the calculation result of h(x)+f(x)g(x) is stored in quantum register C. This method combines the idea of the Karatsuba algorithm with quantum computing and efficiently implements the multiplication of polynomials.
[0108] Using the above-mentioned quantum circuit construction method, a recursive quantum circuit can be constructed to quickly and efficiently complete the calculation of polynomials in a quantum environment. Especially when the degree of the polynomial is very large, the efficiency of this method far exceeds that of classical computing methods. By storing the coefficient information of the polynomial in a quantum register, the parallelism and entanglement of quantum computing can be directly used to complete the calculation, thereby greatly shortening the calculation time. At the same time, this method has strong scalability. For polynomials of different degrees and complexities, they can be adapted by adjusting the quantum circuit, and it has important application potential in complex computing scenarios such as cryptography.
[0109] In some embodiments, the recursive quantum circuit is used to realize the calculation of h(x)+f(x)g(x); the coefficient arrays of f(x), g(x) and h(x) are stored in quantum registers A to C respectively; wherein the degrees of f(x) and g(x) are both less than n, the degree of h(x) is less than 2n-1, and n is a positive integer; the number of bits of quantum registers A to C are n, n and 2n-1 respectively.
[0110] In some embodiments, the process of calculating h(x)+f(x)g(x) by the recursive quantum circuit includes:
[0111] S1: Take n, A[0,…,n-1], B[0,…,n-1], C[0,…,2n-2] as the input of the recursive quantum circuit; when n>1, let Split to get f(x) = f0(x) + f1(x)x d , g(x)=g0(x)+g1(x)x d ,α(x)=f0(x)g0(x)=α0(x)+α1(x)x d , β(x)=f1(x)g1(x)=β0(x)+β1(x)x d , γ(x)=(f0(x)+f1(x))(g0(x)+g1(x))=γ0(x)+γ1(x)x d ,h(x)=h0(x)+h1(x)x d +h2(x)x 2d +h3(x)x 3d , execute S2; when n=1, set d=0 and execute S6;
[0112] S2: Call the target quantum circuit so that C[0,…,d-1] stores h0(x)+α0(x), C[d,…,2d-1] stores h1(x)+α0(x)+α1(x)+β0(x), C[2d,…,3d-1] stores h2(x)+α1(x)+β0(x)+β1(x), and C[3d,…,2n-2] stores h3(x)+β1(x);
[0113] S3: Perform CNOT operation so that A[0,…,nd-1] stores f0(x)+f1(x) and B[0,…,nd-1] stores g0(x)+g1(x);
[0114] S4: Call the recursive quantum circuit so that C[d,…,2d-1] stores h1(x)+α0(x)+α1(x)+β0(x)+γ0(x), and C[2d,…,3d-1] stores h2(x)+α1(x)+β0(x)+β1(x)+γ1(x); where A[0,…,d-1], B[0,…,d-1], C[d,…,3d-1] are used as inputs of the recursive quantum circuit, and C[d,…,3d-1] is used as output of the recursive quantum circuit;
[0115] S5: Perform CNOT operation so that B[0,…,nd-1] stores g0(x)+g1(x) and A[0,…,nd-1] stores f0(x)+f1(x);
[0116] S6: Perform TOFFOLI operation and use C[0,…,2n-2] as the output of the recursive quantum circuit.
[0117] In some embodiments, in step S2, the process of calling the target quantum circuit includes:
[0118] Calling the target quantum circuit so that C[0,…,d-1] stores h0(x)+α0(x), C[d,…,2d-1] stores h1(x)+α0(x)+α1(x), and C[2d,…,3d-1] stores h2(x)+α1(x); wherein d, A[0,…,d-1], B[0,…,d-1], and C[0,…,3d-1] are used as inputs of the target quantum circuit, and C[0,…,3d-1] is used as output of the target quantum circuit;
[0119] The target quantum circuit is called so that C[d,…,2d-1] stores h1(x)+α0(x)+α1(x)+β0(x), C[2d,…,3d-1] stores h2(x)+α1(x)+β0(x)+β1(x), and C[3d,…,2n-2] stores h3(x)+β1(x); wherein nd, A[d,…,n-1], B[d,…,n-1], and C[d,…,2n-2] are used as inputs of the target quantum circuit, and C[d,…,2n-2] is used as output of the target quantum circuit.
[0120] In some embodiments, in step S3, the process of performing the CNOT operation includes:
[0121] Perform a CNOT operation so that A[0,…,nd-1] stores f0(x)+f1(x); wherein A[d,…,n-1] is used as a control bit and A[0,…,nd-1] is used as a target bit;
[0122] A CNOT operation is performed so that B[0,…,nd-1] stores g0(x)+g1(x), wherein B[d,…,n-1] is used as a control bit and B[0,…,nd-1] is used as a target bit.
[0123] In some embodiments, in step S5, the process of performing the CNOT operation includes:
[0124] S7: Perform a CNOT operation so that B[0,…,nd-1] stores g0(x)+g1(x); wherein B[d,…,n-1] is used as a control bit and B[0,…,nd-1] is used as a target bit;
[0125] S8: Perform a CNOT operation so that A[0,…,nd-1] stores f0(x)+f1(x); wherein A[d,…,n-1] is used as a control bit and A[0,…,nd-1] is used as a target bit.
[0126] In a specific application scenario, the process of calculating h(x)+f(x)g(x) by the recursive quantum circuit includes steps U1 to U9.
[0127] U1: Take n, A[0,…,n-1], B[0,…,n-1], C[0,…,2n-2] as the input of the recursive quantum circuit; when n>1, let Split to get f(x) = f0(x) + f1(x)x d , g(x)=g0(x)+g1(x)x d ,α(x)=f0(x)g0(x)=α0(x)+α1(x)x d , β(x)=f1(x)g1(x)=β0(x)+β1(x)x d , γ(x)=(f0(x)+f1(x))(g0(x)+g1(x))=γ0(x)+γ1(x)x d ,h(x)=h0(x)+h1(x)x d +h2(x)x 2d +h3(x)x 3d , execute U2; when n=1, set d=0 and execute U9;
[0128] U2: Call the target quantum circuit so that C[0,…,d-1] stores h0(x)+α0(x), C[d,…,2d-1] stores h1(x)+α0(x)+α1(x), and C[2d,…,3d-1] stores h2(x)+α1(x); wherein d, A[0,…,d-1], B[0,…,d-1], and C[0,…,3d-1] are used as inputs of the target quantum circuit, and C[0,…,3d-1] is used as output of the target quantum circuit;
[0129] U3: Call the target quantum circuit so that C[d,…,2d-1] stores h1(x)+α0(x)+α1(x)+β0(x), C[2d,…,3d-1] stores h2(x)+α1(x)+β0(x)+β1(x), and C[3d,…,2n-2] stores h3(x)+β1(x); wherein nd, A[d,…,n-1], B[d,…,n-1], and C[d,…,2n-2] are used as the input of the target quantum circuit, and C[d,…,2n-2] is used as the output of the target quantum circuit; (It should be noted that when 3d>2n-2, the interval [3d,…,2n-2] does not exist.)
[0130] U4: Perform CNOT operation to make A[0,…,nd-1] store f0(x)+f1(x); wherein A[d,…,n-1] is used as the control bit and A[0,…,nd-1] is used as the target bit;
[0131] U5: Perform CNOT operation to make B[0,…,nd-1] store g0(x)+g1(x); wherein B[d,…,n-1] is used as the control bit and B[0,…,nd-1] is used as the target bit;
[0132] U6: Call the recursive quantum circuit so that C[d,…,2d-1] stores h1(x)+α0(x)+α1(x)+β0(x)+γ0(x), and C[2d,…,3d-1] stores h2(x)+α1(x)+β0(x)+β1(x)+γ1(x); where A[0,…,d-1], B[0,…,d-1], C[d,…,3d-1] are used as inputs of the recursive quantum circuit, and C[d,…,3d-1] is used as output of the recursive quantum circuit;
[0133] U7: Perform CNOT operation to make B[0,…,nd-1] store g0(x)+g1(x); wherein B[d,…,n-1] is used as the control bit and B[0,…,nd-1] is used as the target bit;
[0134] U8: Perform CNOT operation to make A[0,…,nd-1] store f0(x)+f1(x); wherein A[d,…,n-1] is used as the control bit and A[0,…,nd-1] is used as the target bit;
[0135] U9: Perform TOFFOLI operation, wherein A[0] and B[0] are used as control bits, C[0] is used as the target bit, and C[0, ..., 2n-2] is used as the output of the recursive quantum circuit.
[0136] The recursive quantum circuit is used to calculate the sum of the products of the polynomials h(x) and f(x) and g(x). The products and sums of the polynomials are calculated through quantum parallelism. The recursive quantum circuit can be denoted as KMult, for example.
[0137] Calling the target quantum circuit means that in the specific steps (U2, U3) of the recursive quantum circuit, the target quantum circuit needs to be used to complete specific subtasks, providing a modular solution for complex quantum computing tasks. The benefit is that it improves the efficiency and reusability of the calculation and simplifies the structure of the problem.
[0138] Calling a recursive quantum circuit means that in a specific step (U6) of the recursive quantum circuit, a recursive quantum circuit is needed to complete a specific subtask, providing a recursive solution for a larger computing task. The benefit is that complex problems can be solved effectively, and the reusability of the quantum circuit is improved through recursion.
[0139] The TOFFOLI operation is a three-bit quantum logic gate that flips the third target bit when the first two control bits are in the |1> state. For example, for the input |110>, the output after the TOFFOLI operation is |111>.
[0140] The quantum circuit in this embodiment utilizes the parallelism of quantum computing to effectively complete the multiplication and summation of polynomials. The coefficient array of the polynomial is stored in a quantum register, and then the multiplication and addition operations are realized through specific quantum operations (such as CNOT and TOFFOLI operations). The recursive quantum circuit needs to call the target quantum circuit and recursively call itself, processing a part of the polynomial calculation each time until the complex calculation task is completed.
[0141] This design achieves efficient and accurate polynomial calculations. First, using this quantum circuit, the product and sum of polynomials can be calculated in parallel in a short time, making full use of the characteristics of quantum computing, such as superposition and entanglement, thereby greatly improving the speed and efficiency of calculations. In cryptography, fast calculation of polynomials is very important for some algorithms, such as encryption algorithms based on elliptic curves. Secondly, this method provides a modular way of calculation, making the algorithm clearer and easier to understand. The modular and recursive design of this method makes it highly reusable and can be applied to various complex computing tasks. In addition, since only CNOT operations, TOFFOLI operations and basic quantum circuit calls are used in the whole process, the possibility of errors is reduced and the stability of calculations is improved. Applying it to cryptography can process and analyze data more quickly and accurately, meeting the high standards of complex computing scenarios such as modern cryptography.
[0142] As an example, assuming n=4, f(x)=x+x 2 , g(x)=x+x 3 , h(x)=1+x 6 , the degrees of f(x) and g(x) are both less than 4, and the degree of h(x) is less than 7. The number of bits of quantum registers A to C are 4, 4, and 7, respectively. The f(x) coefficient array [0,1,1,0] is stored in quantum register A, A[3]=0, A[2]=1, A[1]=1, A[0]=0, A[0,…,3]=0110; the g(x) coefficient array [1,0,1,0] is stored in quantum register B, B[3]=1, B[2]=0, B[1]=1, B[0]=0, B[0,…,3]=0101; the h(x) coefficient array [1,0,0,0,0,0,1] is stored in quantum register C, C[6]=1, C[5]=0, C[4]=0, C[3]=0, C[2]=0, C[1]=0, C[0]=1, C[0,…,6]=1000001.
[0143] Since n=4>1, let The decomposition results in: f0(x) = x, f1(x) = 1; g0(x) = x, g1(x) = x; α(x) = x 2 , α0(x)=0, α1(x)=1; β(x)=x, β0(x)=x, β1(x)=0; γ(x)=0, γ0(x)=0, γ1(x)=0; h0(x)=1, h1(x)=0, h2(x)=0, h3(x)=1.
[0144] The target quantum circuit is called so that C[0,1] stores 01, C[2,3] stores 01, and C[4,5] stores 01; wherein d=2, A[0,1], B[0,1], C[0,…,5] are used as inputs of the target quantum circuit, and C[0,…,5] is used as outputs of the target quantum circuit;
[0145] Call the target quantum circuit so that C[2,3] stores 11, C[4,5] stores 11, and C[6] stores 1; wherein nd=2, A[2,3], B[2,3], C[2,…,6] are used as inputs of the target quantum circuit, and C[2,…,6] is used as outputs of the target quantum circuit;
[0146] Perform a CNOT operation so that A[0,1] stores 11, wherein A[2,3] is used as a control bit and A[0,1] is used as a target bit;
[0147] Perform a CNOT operation so that B[0,1] stores 00; wherein B[2,3] is used as a control bit and B[0,1] is used as a target bit;
[0148] Call the recursive quantum circuit so that C[2,3] stores 11 and C[4,5] stores 11; A[0,1], B[0,1], C[2,…,5] are used as the input of the recursive quantum circuit, and C[2,…,5] is used as the output of the recursive quantum circuit; in the process of continuously calling the recursive quantum circuit, when n>1, the change of n is continuously reduced from n to Finally, when n=1, d=0 is set and TOFFOLI operation is performed, where A[0] and B[0] are used as control bits and C[0] is used as the target bit;
[0149] Perform a CNOT operation so that B[0,1] stores 01; wherein B[2,3] is used as a control bit and B[0,1] is used as a target bit;
[0150] A CNOT operation is performed to make A[0,1] store 01, wherein A[2,3] is used as the control bit and A[0,1] is used as the target bit.
[0151] After completing the above calculation, C[0,…,6] stores 1011111, and the result stored in quantum register C corresponds to the calculation result of h(x)+f(x)g(x) 1+x 2 +x 3 +x 4 +x 5 +x 6 .
[0152] As another example, assume n=2, f(x)=x, g(x)=1+x, h(x)=x 2 , the degrees of f(x) and g(x) are both less than 2, and the degree of h(x) is less than 3. The number of bits of quantum registers A to C are 2, 2, and 3, respectively. The f(x) coefficient array [0,1] is stored in quantum register A, A[0,1]=01; the g(x) coefficient array [1,1] is stored in quantum register B, B[0,1]=11; the h(x) coefficient array [0,0,1] is stored in quantum register C, C[0,1,2]=001.
[0153] Since n=2>1, let Split into: f0(x)=0, f1(x)=1; g0(x)=1, g1(x)=1; α(x)=0, α0(x)=0, α1(x)=0; β(x)=1, β0 (x)=1, β1(x)=0; γ(x)=0, γ0(x)=0, γ1(x)=0; h0(x)=0, h1(x)=0, h2(x)=1, h3(x)=0.
[0154] Calling the target quantum circuit so that C[0] stores 0, C[1] stores 0, and C[2] stores 1; wherein d=1, A[0], B[0], C[0,1,2] are used as inputs of the target quantum circuit, and C[0,1,2] is used as output of the target quantum circuit;
[0155] Calling the target quantum circuit so that C[1] stores 1 and C[2] stores 0; wherein nd=1, A[1], B[1], C[1,2] are used as inputs of the target quantum circuit, and C[1,2] is used as output of the target quantum circuit;
[0156] Perform a CNOT operation so that A[0] stores 1, wherein A[1] is used as a control bit and A[0] is used as a target bit;
[0157] Perform a CNOT operation so that B[0] stores 0; wherein B[1] is used as a control bit and B[0] is used as a target bit;
[0158] Call the recursive quantum circuit, where A[0], B[0], C[1,2] are used as inputs of the recursive quantum circuit, and C[1,2] is used as output of the recursive quantum circuit; since n=1, let d=0, and perform TOFFOLI operation to make C[0] store 0, wherein A[0] and B[0] are used as control bits, and C[0] is used as the target bit;
[0159] Perform a CNOT operation so that B[0] stores 1, wherein B[1] is used as a control bit and B[0] is used as a target bit;
[0160] A CNOT operation is performed to make A[0] store 0, wherein A[1] is used as a control bit and A[0] is used as a target bit.
[0161] After completing the above calculation, C[0,1,2] stores 010, and the result saved in quantum register C corresponds to the calculation result x of h(x)+f(x)g(x).
[0162] In some embodiments, the quantum operations in the recursive quantum circuit and the target quantum circuit only include a CNOT operation and a TOFFOLI operation.
[0163] Constructing the recursive quantum circuit and the target quantum circuit using only CNOT operations and one TOFFOLI operation can simplify the circuit complexity, improve the stability of quantum computing, reduce errors, and provide a basis for the optimization and improvement of subsequent quantum algorithms.
[0164] In a given quantum circuit, the CNOT gate is used to operate on the states of the corresponding qubits, thereby splitting, multiplying, and combining polynomials according to the idea of the Karatsuba algorithm. No other types of quantum gates are introduced in the entire circuit, ensuring the simplicity and efficiency of the calculation. In addition, due to the characteristics of the CNOT gate itself, this design makes full use of the superposition and entanglement characteristics of quantum mechanics, enabling the direct implementation of the required calculations on quantum states and avoiding the intermediate conversion steps involved in classical computing. Using only CNOT operations and one TOFFOLI operation simplifies the structure of the entire quantum circuit and reduces the complexity of implementation and maintenance. Since there are fewer other types of quantum gates, the error rate of the system is also relatively reduced, thereby increasing the stability and accuracy of the calculation.
[0165] The quantum circuit construction method provided in this application uses two quantum circuits to achieve efficient calculation of specific polynomial operations and maintains the operations in the binary field F2 throughout the calculation process.
[0166] As an example, let F(x), G(x), H(x) ∈ F2[x], where the degrees of F(x) and G(x) are both less than m, and the degree of H(x) is less than k + 2m - 1. Using an array to represent polynomials, the array stores the coefficients of the polynomials. It is agreed that the array stores the coefficients of the polynomial from the high-order to the low-order from left to right, which is convenient for implementation on the quantum circuit. To solve H(x) + (1 + x k )F(x)G(x), the Karatsuba algorithm can be used, and the specific implementation idea is as follows:
[0167] The code flow of the target quantum circuit for calculating H(x) + (1 + x k )F(x)G(x): (labeled as Multxk)
[0168] Given k, F(x), G(x), H(x), where deg(F), deg(G) < m, and k ≥ m. Let p = max{0, 2m - 1 - k}, and store the coefficient arrays of F(x) and G(x) in the m-bit quantum registers A and B respectively. The coefficient array of H(x) is stored in the quantum register C with k + 2m - 2 bits. Note that k + 2m - 2 = 2k + p - 1.
[0169] Algorithm 1. Implementing H(x) + (1 + x k)Pseudocode for Multxk of F(x)G(x).
[0170]
[0171] The results obtained in each step of Algorithm 1 are shown in detail in the following table.
[0172]
[0173] Table 1. Changes in C in each step of Algorithm 1
[0174] In Algorithm 1, C is divided into three parts with corresponding bit sizes of k, k, and p, and the corresponding H(x) = h0 + h1x k + h2x 2k . According to Table 1, the final result obtained is: h0 + (fg)0 + (h1 + (fg)0 + (fg)1)x k + (h2 + (fg)1)x 2k = h0 + h1x k + h2x 2k + fg + fgx k = h + (1 + x k )fg.
[0175] When m = 1, only 2 CNOT gates and 1 TOFFOLI gate are required. Algorithm 2 needs to be called once in Algorithm 1. Algorithm 2 is introduced below.
[0176] Code flow for recursively calculating h(x) + f(x)g(x) on a quantum circuit: (labeled KMult)
[0177] Given deg(f), deg(g) < n, the coefficient arrays of f(x) and g(x) are stored in n-bit quantum registers A and B respectively. The degree of h(x) is less than 2n - 1, and the coefficient array of h(x) is stored in a (2n - 1)-bit quantum register C. If n > 1, let If n = 1, d = 0.
[0178] Algorithm 2. Pseudocode KMult for implementing h(x) + f(x)g(x).
[0179]
[0180]
[0181] The results obtained in each step of Algorithm 2 are shown in detail in the following table:
[0182]
[0183] Table 2. Changes in C in each step of Algorithm 2
[0184] According to the change of C in Table 2 and the splitting formula of h(x), by continuously calling Algorithm 2 and Algorithm 1, h(x)+f(x)g(x) can be calculated.
[0185] The basic principle of Algorithm 2 is that when the algorithm KMult is continuously called, the change of n is continuously reduced from n to Finally, we reach n = 1. When n = 1, d = 0, and the Toffoli gate can be used to implement h(x) + f(x)g(x).
[0186] (Target quantum circuit)
[0187] The present application also provides a target quantum circuit for realizing H(x)+(1+x k )F(x)G(x); wherein the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, k is a positive integer, and the quantum operation in the target quantum circuit includes a CNOT operation.
[0188] In some embodiments, the process of constructing the target quantum circuit includes: storing coefficient arrays of F(x), G(x) and H(x) in quantum registers A to C respectively; wherein the degrees of F(x) and G(x) are both less than m, the degree of H(x) is less than k+2m-1, the polynomial coefficients in the coefficient array are arranged in descending order of degree, m and k are positive integers, and k≥m; the number of bits of quantum registers A to C are m, m and k+2m-1 respectively; constructing the target quantum circuit using the input and output of the target quantum circuit and the CNOT operation; wherein the input of the target quantum circuit includes the coefficient array stored in quantum registers A to C, and the output of the target quantum circuit includes H(x)+(1+x stored in quantum register C). k )The calculation result of F(x)G(x).
[0189] (Quantum chip system)
[0190] See also Figure 3 , Figure 3 It is a schematic diagram of the structure of a quantum chip system provided in an embodiment of the present application.
[0191] The embodiment of the present application also provides a quantum chip system, the specific implementation of which is consistent with the implementation and technical effects recorded in the above-mentioned quantum circuit construction method embodiment, and some contents will not be repeated here.
[0192] The quantum chip system includes at least one quantum processor, and the at least one quantum processor is used to execute quantum operations corresponding to the quantum program to implement the following steps: through the target quantum circuit, k )F(x)G(x) is calculated; wherein the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, k is a positive integer, and the quantum operation in the target quantum circuit includes a CNOT operation.
[0193] A quantum chip system is a micro device for processing quantum information, which can perform quantum operations corresponding to quantum programs. In this embodiment, the quantum chip system is used as a core computing component for performing polynomial calculations, and its parallel processing capabilities are used to achieve efficient computing. As an example, the quantum chip system can be a superconducting quantum chip system, an ion trap quantum chip system, an optical quantum chip system, etc., including a quantum processor and peripheral devices that provide quantum chip packaging, etc.
[0194] A quantum processor is a specific hardware device that uses the principles of quantum mechanics to perform calculations. Unlike traditional classical computer processors, quantum processors process quantum bits instead of classical bits. For example, a quantum processor is a quantum processor with 72 quantum bits. The super localization ability and quantum entanglement characteristics of quantum processors make them more efficient than classical computers in certain tasks, such as factorization and search problems.
[0195] A quantum program is a series of instructions written for a quantum computer that instructs a quantum processor to perform specific quantum operations. Quantum programs allow researchers and engineers to operate and control quantum computers in detail, providing efficient solutions to complex problems.
[0196] Quantum operations are the basic operations performed on qubits, including various quantum gates and measurements. For example, applying a Pauli-X gate to a qubit flips it from the |0> state to the |1> state. Quantum operations form the basis of quantum computing, allowing users to manipulate and read quantum information, thereby implementing quantum algorithms.
[0197] (Quantum Computer)
[0198] See also Figure 4 , Figure 4 It is a schematic diagram of the structure of a quantum computer provided in an embodiment of the present application.
[0199] The embodiment of the present application also provides a quantum computer, and its specific implementation method is consistent with the implementation method and technical effects recorded in the above-mentioned quantum core method embodiment, and some contents are not repeated here.
[0200] The quantum computer includes any of the above-mentioned quantum chip systems 1, measurement and control system 2, support system 3 and operating system 4. For example, a superconducting quantum computer includes a 24-bit superconducting quantum chip system 1, a quantum computing measurement and control system 2, a quantum computer operating system 3 and a quantum computing environment support system 4.
[0201] The quantum chip system 1 includes at least one quantum processor, which is used to execute quantum operations corresponding to the quantum program to process quantum bits, thereby processing H(x)+(1+x k )F(x)G(x) is calculated; wherein the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, k is a positive integer, and the quantum operation in the target quantum circuit includes a CNOT operation. For example, in a superconducting quantum computer, a superconducting quantum chip system 1 based on a superconducting quantum processor is the computing core of the quantum computer and can realize the execution of quantum programs. The embodiment of the present application does not limit the number of quantum processors in the quantum chip system 1, which can be, for example, one or more.
[0202] The measurement and control system 2 includes a control device and a measuring device. The control device is used to convert the quantum program corresponding to the target quantum circuit into a corresponding control signal and send it to the quantum processor. The measuring device is used to measure the quantum bit. The quantum computing measurement and control system 2 is the control system of the quantum computer, which is used to control the operation of the quantum chip system 1. The quantum chip system 1 receives the control signal from the measurement and control system 2, executes the quantum operation corresponding to the quantum program to process the quantum bit, thereby realizing the execution of the quantum program.
[0203] The present application does not limit the measuring device, which may be, for example, any one or a combination of the following devices.
[0204] Superconducting measurement device: Utilizes the characteristics of superconducting materials under low temperature conditions to measure the state of quantum bits. This device can accurately detect changes in quantum states in a very short time.
[0205] Optical interferometer: Measurement of quantum states through interference of light, especially suitable for photon qubits.
[0206] Ion trap detector: For ion trapped qubit systems, this device can detect the quantum state of the ions by measuring their electromagnetic frequencies.
[0207] Magnetic resonance measurement device: Using magnetic resonance technology, the state of specific quantum bits, such as spin-based quantum bits, can be measured.
[0208] Charge measurement devices: These devices can detect the charge state in a quantum dot or other tiny structure, thereby understanding its quantum state.
[0209] Quantum dot measurement device: For quantum dot-based quantum computing systems, this device is able to measure the electronic states in the quantum dots.
[0210] Quantum state identifier: Able to identify and classify a given quantum state to determine the specific state.
[0211] Environmental monitor: Since quantum computing needs to be carried out under specific environmental conditions (such as low temperature and low noise), this device can monitor and control the computing environment in real time to ensure the accuracy of the measurement.
[0212] Error correction module: Since errors may occur in quantum computing, the error correction module can correct and optimize the measurement results.
[0213] Each of the measurement devices listed above can be used independently or in combination with other devices to meet specific quantum computing needs.
[0214] The support system 3 is used to provide working environment conditions to ensure the operation of the quantum chip system 1. The support system 3 may include an ultra-low temperature refrigeration system and a host active vibration reduction system to provide working environment guarantee for the stable operation of the quantum computer.
[0215] The operating system 4 is used to provide a software system to enable interaction between the user and the quantum chip system 1 and the measurement and control system 2. The quantum computer operating system 4 can adopt the Sinan system, for example, to provide a quantum computing software system framework for the quantum computer, with functions such as parallel execution of multiple quantum computing tasks, automatic calibration of quantum chips, and efficient management of quantum resources.
[0216] (Quantum Memory)
[0217] The embodiment of the present application also provides a quantum memory, and its specific implementation method is consistent with the implementation method and technical effects recorded in the above method embodiment, and some contents are not repeated here.
[0218] The quantum memory stores a quantum program, and when the quantum program is executed by at least one quantum processor, the function of any of the above-mentioned quantum chip systems or the steps of any of the above-mentioned methods are realized.
[0219] By introducing quantum memory, quantum computers can store complex numbers of quantum programs and execute them by quantum processors, which greatly expands the functionality and application scope of quantum computing. Compared with classical memory, quantum memory can store and process a large amount of quantum state information, which means that quantum computers can perform more complex and advanced quantum algorithms and tasks; due to the characteristics of quantum programs, quantum processors can process multiple computing tasks at the same time, greatly accelerating the computing speed compared with classical computing; quantum memory can store quantum keys and other information related to quantum communication and quantum cryptography, thereby providing a higher level of security than classical technology; the design of quantum memory allows dynamic expansion of memory capacity to adapt to the growing computing needs; quantum memory can work with traditional classical memory and other computing resources, making it possible for quantum computers and classical computers to work together; since quantum memory can store multiple quantum states in super positions, data redundancy can be effectively reduced and storage efficiency can be improved; by storing quantum programs designed for quantum processors, the potential of quantum computing can be better utilized, such as quantum machine learning, quantum simulation, etc.; users can load and execute different quantum programs according to their needs, so that quantum computers can perform a variety of tasks; by effectively managing and allocating quantum storage resources, the efficient operation of quantum computers can be ensured; the introduction of quantum memory creates conditions for further research and application of quantum computing, quantum communication and other quantum technologies, thereby promoting technological progress in the entire field of quantum information science.
[0220] (Quantum Program Product)
[0221] The embodiment of the present application also provides a quantum program product, the specific implementation of which is consistent with the implementation and technical effects recorded in the above method embodiment, and some contents will not be repeated here.
[0222] The quantum program product includes a quantum program, which, when executed by at least one quantum processor, implements the functions of any of the above-mentioned quantum chip systems or the steps of any of the above-mentioned methods.
[0223] Quantum program products provide specific operation and functional guidelines for quantum computers, allowing quantum processors to efficiently perform complex tasks, so that a variety of different quantum computing tasks can be carried out in a modular and repeatable manner; similar to classical software applications, quantum programs can be shared and deployed by multiple users or devices, thereby expanding their scope of application; optimized quantum programs can improve the computing efficiency of quantum processors, reduce error rates, and ensure accurate computing results; quantum program products can include complex algorithms and processes to support a variety of advanced quantum computing tasks, such as optimization, simulation, encryption, and machine learning; users can customize or adjust quantum programs according to their needs to meet specific computing tasks or business needs; quantum programs Quantum program products can work with classical computing programs, allowing seamless integration between quantum computers and classical computers; for non-professional users, quantum program products provide a simple and easy-to-use interface, allowing users to easily utilize the powerful functions of quantum computing without having to deeply understand the complex principles behind it; quantum program products can include various testing and verification tools to help users ensure the accuracy and reliability of quantum computing; with the development of quantum computing technology, more and more quantum program products are entering the market, providing users with various functions and services, thereby promoting the commercialization process of the entire quantum computing field; quantum program products can also be used as education and training tools to help students and researchers better understand and master the principles and applications of quantum computing.
[0224] The embodiments of the present application do not limit the users. Taking the field of cryptography as an example, users may be, for example, national security departments, intelligence agencies, military research departments, network security companies, information security departments of large enterprises, technical security teams of financial institutions, telecommunications companies, network service providers, hardware and software development companies, digital currency and blockchain organizations, independent cryptographic researchers, university computer science and cryptography departments, technical research institutes, digital rights management organizations, regulatory agencies related to digital communications, standard setting agencies, security certification agencies, etc. These users can use the above-mentioned quantum computing technology solutions to conduct various cryptographic research and practices, such as quantum-safe key exchange, research and development of post-quantum cryptographic algorithms, simulation of quantum attacks on traditional cryptographic systems, efficient digital signature schemes, secure data encryption and transmission, deep cryptographic analysis, privacy enhancement technology, anonymous communication, digital identity authentication, two-way authentication, multi-party secure computing, etc. For example, network security companies can use the power of quantum computing to develop more secure encryption algorithms to cope with potential quantum attack threats. Telecommunications companies and network service providers can use this technology to protect their communication networks and ensure the security and privacy of data transmission. Digital currency and blockchain organizations can use quantum cryptography to enhance the security of their systems and prevent future security threats. In short, all types of users can take advantage of the powerful capabilities of quantum computing in the field of cryptography to improve their information security and defense capabilities.
[0225] (Classical Computer)
[0226] An embodiment of the present application also provides a classical computer, comprising a memory and at least one processor.
[0227] The memory is used to store computer programs; the at least one processor is used to execute the computer program to implement the following steps: obtaining coefficient arrays of F(x), G(x) and H(x); wherein the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, and the polynomial coefficients in the coefficient array are arranged in descending order of degree.
[0228] The classical computer in the embodiment of the present application includes a memory and a processor. The memory is used to store a computer program, which is designed to obtain the coefficient array of polynomials F(x), G(x) and H(x). When executing this program, the processor first reads the coefficients of each polynomial, and then organizes these coefficients into an array in the order of the degree of the polynomial from high to low. In this way, the coefficient array of the polynomial is obtained, and all coefficients are 0 or 1. The classical computer provides a method for quickly and accurately obtaining the coefficient array of the polynomial, which provides a basis for further processing and operation in quantum computing. By accurately representing the polynomial, the accuracy and efficiency of the quantum algorithm can be ensured. In addition, the introduction of this method also improves the automation of the entire calculation process and reduces manual operations and potential errors.
[0229] There are many ways to obtain the coefficient arrays of the polynomials F(x), G(x), and H(x), and the specific method depends on the source of the polynomial and its representation in the computer. The following are some possible ways to obtain it.
[0230] Direct parsing: If the polynomial is given in text form, the coefficients of each term can be obtained directly by parsing the text.
[0231] Algebraic packages: Use an algebraic package such as Mathematica, MATLAB, or SageMath, which can automatically read and parse polynomials and output arrays of their coefficients.
[0232] Programming language libraries: For example, in Python, you can use the poly function of the numpy library to return the coefficients of a polynomial from its roots.
[0233] Database lookup: If you have a database storing precomputed polynomial coefficients, you can directly retrieve the coefficients of the required polynomial from the database.
[0234] Polynomial interpolation: If the values of a polynomial at different points are given, polynomial interpolation can be used to recover the coefficients of the polynomial.
[0235] Using FFT: For large-scale polynomial multiplications, you can use the Fast Fourier Transform (FFT) to obtain the coefficients.
[0236] Polynomial decomposition: For certain polynomial forms, such as piecewise polynomials or recursively defined polynomials, their coefficients can be obtained by polynomial decomposition.
[0237] Obtaining the coefficient array of a polynomial is an important step in polynomial processing, polynomial arithmetic, and other applications, providing a structured way to manipulate and store polynomials, making computations more efficient and manageable.
[0238] It should be understood that the specific examples in this article are only intended to help those skilled in the art better understand the implementation methods of the present application, rather than to limit the scope of the present application.
[0239] It can be understood that in the various implementations of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation methods of the present application.
[0240] It can be understood that the various embodiments described in this application can be implemented individually or in combination, and the embodiments of this application are not limited to this.
[0241] Unless otherwise stated, all technical and scientific terms used in the embodiments of the present application have the same meaning as those generally understood by those skilled in the art of the technical field of the present application. The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the scope of the present application. The term "and / or" used in the present application includes any and all combinations of one or more related listed items. The singular forms of "a kind of", "above" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0242] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0243] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the quantum computer, performance improvement method, quantum memory, and quantum program product described above can refer to the corresponding processes in the aforementioned quantum chip system implementation method and will not be repeated here.
[0244] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0245] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0246] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0247] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer (for example, a classical computer or a quantum computer) readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0248] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for constructing a quantum circuit, characterized in that: The method comprises: Constructed to realize H(x)+(1+x k )The target quantum circuit for the calculation of F(x)G(x); Wherein, the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, k is a positive integer, and the quantum operation in the target quantum circuit includes a CNOT operation.
2. The method for constructing a quantum circuit according to claim 1, characterized in that: The process of constructing the target quantum circuit includes: The coefficient arrays of F(x), G(x) and H(x) are stored in quantum registers A to C respectively; wherein the degrees of F(x) and G(x) are both less than m, the degree of H(x) is less than k+2m-1, the polynomial coefficients in the coefficient arrays are arranged in descending order of degree, m and k are positive integers, and k≥m; the number of bits of quantum registers A to C are m, m and k+2m-1 respectively; The target quantum circuit is constructed by using the input and output of the target quantum circuit and the CNOT operation; wherein the input of the target quantum circuit includes the coefficient array stored in quantum registers A to C, and the output of the target quantum circuit includes H(x)+(1+x stored in quantum register C k )The calculation result of F(x)G(x).
3. The method for constructing a quantum circuit according to claim 2, characterized in that: The target quantum circuit calculates H(x)+(1+x k The process of )F(x)G(x) includes: R1: Take k, A[0,…,m-1], B[0,…,m-1], C[0,…,k+2m-2] as the input of the target quantum circuit; when m>1, split to obtain (FG)(x)=F(x)G(x)=(FG)0(x)+(FG)1(x)x k , H(x)=H0(x)+H1(x)x k +H2(x)x 2k , execute R2; when m=1, execute R5; R2: Perform CNOT operation so that C[k,…,k+p-1] stores H1(x)+H2(x) and C[0,…,k-1] stores H0(x)+H1(x)+H2(x); R3: Call the recursive quantum circuit so that C[k,…,2k-1] stores H1(x)+H2(x)+(FG)0(x), and C[2k,…,2k+p-1] stores H2(x)+(FG)1(x); wherein A[0,…,m-1], B[0,…,m-1], and C[k,…,2k+p-1] are used as inputs of the recursive quantum circuit, and C[k,…,2k+p-1] is used as output of the recursive quantum circuit; R4: Perform CNOT operation so that C[0,…,k-1] stores H0(x)+(FG)0(x) and C[k,…,k+p-1] stores H1(x)+(FG)0(x)+(FG)1(x); R5: Perform CNOT operation and TOFFOLI operation, and use C[0,…,k+2m-2] as the output of the target quantum circuit.
4. The method for constructing a quantum circuit according to claim 3, characterized in that: In step R2, the process of performing the CNOT operation includes: Perform a CNOT operation so that C[k,…,k+p-1] stores H1(x)+H2(x); wherein C[2k,…,2k+p-1] is used as a control bit and C[k,…,k+p-1] is used as a target bit; p=max{0,2m-1-k}; A CNOT operation is performed so that C[0,…,k-1] stores H0(x)+H1(x)+H2(x); wherein C[k,…,2k-1] is used as a control bit and C[0,…,k-1] is used as a target bit.
5. The method for constructing a quantum circuit according to claim 3, characterized in that: In step R4, the process of performing the CNOT operation includes: Perform a CNOT operation so that C[0,…,k-1] stores H0(x)+(FG)0(x); wherein C[k,…,2k-1] is used as a control bit and C[0,…,k-1] is used as a target bit; A CNOT operation is performed so that C[k,…,k+p-1] stores H1(x)+(FG)0(x)+(FG)1(x); wherein C[2k,…,2k+p-1] is used as a control bit, C[k,…,k+p-1] is used as a target bit, and C[0,…,k+2m-2] is used as an output of the target quantum circuit.
6. The method for constructing a quantum circuit according to claim 3, characterized in that: In step R5, the process of performing the CNOT operation and the TOFFOLI operation includes: Perform a CNOT operation, wherein C[k] is used as a control bit and C[0] is used as a target bit; Perform a TOFFOLI operation, wherein A[0] and B[0] are used as control bits, and C[k] is used as the target bit; A CNOT operation is performed, wherein C[k] is used as a control bit, C[0] is used as a target bit, and C[0, ..., k+2m-2] is used as an output of the target quantum circuit.
7. The method for constructing a quantum circuit according to claim 3, characterized in that: The recursive quantum circuit is used to realize the calculation of h(x)+f(x)g(x); the coefficient arrays of f(x), g(x) and h(x) are stored in quantum registers A to C respectively; wherein the order of f(x) and g(x) is less than n, the order of h(x) is less than 2n-1, and n is a positive integer; the number of bits of quantum registers A to C are n, n and 2n-1 respectively; The process of calculating h(x)+f(x)g(x) by the recursive quantum circuit includes: S1: Take n, A[0,…,n-1], B[0,…,n-1], C[0,…,2n-2] as the input of the recursive quantum circuit; when n>1, let Split to get f(x) = f0(x) + f1(x)x d , g(x)=g0(x)+g1(x)x d ,α(x)=f0(x)g0(x)=α0(x)+α1(x)x d , β(x)=f1(x)g1(x)=β0(x)+β1(x)x d , γ(x)=(f0(x)+f1(x))(g0(x)+g1(x))=γ0(x)+γ1(x)x d ,h(x)=h0(x)+h1(x)x d +h2(x)x 2d +h3(x)x 3d , execute S2; when n=1, set d=0 and execute S6; S2: Call the target quantum circuit so that C[0,…,d-1] stores h0(x)+α0(x), C[d,…,2d-1] stores h1(x)+α0(x)+α1(x)+β0(x), C[2d,…,3d-1] stores h2(x)+α1(x)+β0(x)+β1(x), and C[3d,…,2n-2] stores h3(x)+β1(x); S3: Perform CNOT operation so that A[0,…,nd-1] stores f0(x)+f1(x) and B[0,…,nd-1] stores g0(x)+g1(x); S4: Call the recursive quantum circuit so that C[d,…,2d-1] stores h1(x)+α0(x)+α1(x)+β0(x)+γ0(x), and C[2d,…,3d-1] stores h2(x)+α1(x)+β0(x)+β1(x)+γ1(x); where A[0,…,d-1], B[0,…,d-1], C[d,…,3d-1] are used as inputs of the recursive quantum circuit, and C[d,…,3d-1] is used as output of the recursive quantum circuit; S5: Perform CNOT operation so that B[0,…,nd-1] stores g0(x)+g1(x) and A[0,…,nd-1] stores f0(x)+f1(x); S6: Perform TOFFOLI operation and use C[0,…,2n-2] as the output of the recursive quantum circuit.
8. The method for constructing a quantum circuit according to claim 7, characterized in that: In step S2, the process of calling the target quantum circuit includes: Calling the target quantum circuit so that C[0,…,d-1] stores h0(x)+α0(x), C[d,…,2d-1] stores h1(x)+α0(x)+α1(x), and C[2d,…,3d-1] stores h2(x)+α1(x); wherein d, A[0,…,d-1], B[0,…,d-1], and C[0,…,3d-1] are used as inputs of the target quantum circuit, and C[0,…,3d-1] is used as output of the target quantum circuit; The target quantum circuit is called so that C[d,…,2d-1] stores h1(x)+α0(x)+α1(x)+β0(x), C[2d,…,3d-1] stores h2(x)+α1(x)+β0(x)+β1(x), and C[3d,…,2n-2] stores h3(x)+β1(x); wherein nd, A[d,…,n-1], B[d,…,n-1], and C[d,…,2n-2] are used as inputs of the target quantum circuit, and C[d,…,2n-2] is used as output of the target quantum circuit.
9. The method for constructing a quantum circuit according to claim 7, characterized in that: In step S3, the process of performing the CNOT operation includes: Perform a CNOT operation so that A[0,…,nd-1] stores f0(x)+f1(x); wherein A[d,…,n-1] is used as a control bit and A[0,…,nd-1] is used as a target bit; A CNOT operation is performed so that B[0,…,nd-1] stores g0(x)+g1(x), wherein B[d,…,n-1] is used as a control bit and B[0,…,nd-1] is used as a target bit.
10. The method for constructing a quantum circuit according to claim 7, characterized in that: In step S5, the process of performing the CNOT operation includes: S7: Perform a CNOT operation so that B[0,…,nd-1] stores g0(x)+g1(x); wherein B[d,…,n-1] is used as a control bit and B[0,…,nd-1] is used as a target bit; S8: Perform a CNOT operation so that A[0,…,nd-1] stores f0(x)+f1(x); wherein A[d,…,n-1] is used as a control bit and A[0,…,nd-1] is used as a target bit.
11. A target quantum circuit, characterized in that: To realize H(x)+(1+x k )Calculation of F(x)G(x); Wherein, the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, k is a positive integer, and the quantum operation in the target quantum circuit includes a CNOT operation.
12. A quantum chip system, characterized in that: The quantum chip system includes at least one quantum processor, and the at least one quantum processor is used to execute quantum operations corresponding to the quantum program to implement the following steps: Through the target quantum circuit, H(x)+(1+x k )F(x)G(x) is calculated; Wherein, the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, k is a positive integer, and the quantum operation in the target quantum circuit includes a CNOT operation.
13. A quantum computer, characterized in that: The quantum computer comprises: A quantum chip system, the quantum chip system comprising at least one quantum processor, the at least one quantum processor being used to execute quantum operations corresponding to a quantum program to process quantum bits, thereby performing a quantum operation on H(x)+(1+x) through a target quantum circuit. k )F(x)G(x) is calculated; wherein the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, k is a positive integer, and the quantum operation in the target quantum circuit includes a CNOT operation; A measurement and control system, the measurement and control system comprising a control device and a measuring device, the control device is used to convert the quantum program corresponding to the target quantum circuit into a corresponding control signal and send it to the quantum processor, and the measuring device is used to measure the quantum bit; A support system for providing working environment conditions to ensure the operation of the quantum chip system; An operating system is used to provide a software system to enable interaction between a user and the quantum chip system and the measurement and control system.
14. A classical computer, characterized in that The classical computer comprises: Memory for storing computer programs; At least one processor is configured to execute the computer program to implement the following steps: Get the coefficient arrays of F(x), G(x) and H(x); wherein the polynomials F(x), G(x) and H(x) are all ∈F2[x], F2[x] is a polynomial ring defined on the binary field F2, and the polynomial coefficients in the coefficient arrays are arranged in descending order of degree.