Module index data generation task processing method and related device

By using irreducible polynomials and LUP decomposition methods in quantum computing units to build quantum circuits and decompose the modulo index operation, the problem of low generation efficiency of GF(2k) modulo index data is solved, and the effect of accelerating the cracking of classical encryption algorithms is achieved.

CN119026696AActive Publication Date: 2024-11-26ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310618871.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-25
Publication Date
2024-11-26
Estimated Expiration
2043-05-25

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently generate modulo index data in finite domain GF(2k), resulting in inefficient cracking of classical encryption algorithms.

Method used

The quantum circuit is constructed by preset irreducible polynomials and LUP decomposition methods, and the modular index operation is decomposed as a modular multiplication operation of polynomials, and the sub-quantum circuit is constructed using CNOT gate and SWAP gate to realize the modular index operation in the quantum computing unit, and generate Modal index data in GF(2k).

Benefits of technology

It realizes efficient generation of modular index data in GF(2k), significantly accelerating the process of cracking classic encryption algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026696A_ABST
    Figure CN119026696A_ABST
Patent Text Reader

Abstract

The invention discloses a processing method for a modular index data generation task and a related device. A classical calculation unit constructs a quantum circuit for calculating a modular index operation result of a base number and an index input in GF (2k) based on a preset irreducible polynomial, the base number and an LUP decomposition method; and sending the index and the quantum circuit to a quantum computing unit; the quantum calculation unit excites the quantum bit to an initial quantum state based on the index, and drives the quantum bit to start to evolve from the initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit; and sending the measurement result to the classic calculation unit; the classical calculation unit determines and outputs the modular exponent operation result based on the measurement result; the quantum circuit is constructed through the irreducible polynomial, the base number and the LUP decomposition method, the index is used as the input of the quantum circuit, the modular index data in the GF (2k) is efficiently generated, and then the classical encryption algorithm is cracked in an accelerated mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of quantum computing technology, and in particular to a method for processing modular exponential data generation tasks and a related device. 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] Finite field, also known as Galois Field (GF), is a very important concept in many disciplines such as abstract algebra and cryptography. Taking cryptography as an example, the discrete logarithm problem over finite fields is one of the two core difficult problems in the classical public key cryptography system. GF(2 k ) occupies a special position among many finite fields. How to efficiently generate GF(2 k ) to accelerate the cracking of classic encryption algorithms. Summary of the invention

[0004] The purpose of the present invention is to provide a method and a related device for processing modular exponential data generation tasks, aiming to efficiently generate GF(2 k ) to accelerate the cracking of classic encryption algorithms.

[0005] An embodiment of the present invention provides a method for processing a modular exponential data generation task, which is applied to a classical computing unit. The modular exponential data generation task is used to calculate a finite field GF(2 k ), the method comprising:

[0006] Based on the preset irreducible polynomial, the base number and the LUP decomposition method, a method for calculating GF(2 k ) is a quantum circuit that generates a modular exponential operation result of the base and exponent input in ;

[0007] sending the index and the quantum circuit to a quantum computing unit;

[0008] Receive the measurement result fed back by the quantum computing unit, and determine and output the modular exponential operation result based on the measurement result.

[0009] Optionally, the method for calculating GF(2 k) is a quantum circuit for the modular exponential operation result of the base and exponent input in , including:

[0010] Decomposing the modular exponential operation into k polynomial modular multiplication operations;

[0011] Based on a preset irreducible polynomial, the base number and the LUP decomposition method, a sub-quantum circuit corresponding to each polynomial in the modular multiplication operation is constructed to obtain k sub-quantum circuits;

[0012] The k sub-quantum circuits are cascaded to obtain the k ) is a quantum circuit that generates the result of the modular exponential operation of the base and exponent entered in .

[0013] Optionally, constructing a sub-quantum circuit corresponding to each polynomial in the modular multiplication operation based on a preset irreducible polynomial, the base and the LUP decomposition method includes:

[0014] Determine a first square matrix based on a preset irreducible polynomial and the base;

[0015] Iteratively calculate the square of the first matrix until k-1 second matrices are obtained, where the second matrix is ​​2 of the first matrix. m power, where m is an integer in [1, k-1];

[0016] Perform LUP decomposition on the first square matrix and k-1 second square matrices to obtain k L-type, k U-type and k P-type matrices respectively;

[0017] Constructing quantum circuits corresponding to the L-type and U-type matrices based on CNOT gates, and constructing quantum circuits corresponding to the P-type matrix based on SWAP gates;

[0018] The quantum circuits corresponding to each of the P-type matrices and the U-type and L-type matrices corresponding to the P-type matrices are spliced ​​to obtain a sub-quantum circuit corresponding to each polynomial in the modular multiplication operation.

[0019] Optionally, determining the first square matrix based on a preset irreducible polynomial and the base includes:

[0020] Determine the degree corresponding to the highest term in the preset irreducible polynomial;

[0021] Determine a modular multiplication result of the base and each term of a lower degree than the highest term;

[0022] A first square matrix is ​​determined based on the modular multiplication result.

[0023] Another embodiment of the present invention provides a method for processing a modular exponential data generation task, which is applied to a quantum computing unit. The modular exponential data generation task is used to calculate a finite field GF(2 k ), the method comprising:

[0024] Receive the index and quantum circuit sent by the classical computing unit, the quantum circuit is used to calculate GF(2 k ), wherein the quantum circuit is constructed based on a preset irreducible polynomial, the base and the LUP decomposition method;

[0025] Exciting the quantum bit to an initial quantum state based on the index, and driving the quantum bit to evolve from the initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit;

[0026] The measurement result is sent to the classical computing unit, so that the classical computing unit determines the modular exponential operation result based on the measurement result.

[0027] Yet another embodiment of the present invention provides a quantum computing system, the quantum computing system comprising a classical computing unit and a quantum computing unit;

[0028] The classical computing unit is used to perform the following steps:

[0029] Based on the preset irreducible polynomial, the base number and the LUP decomposition method, a method for calculating GF(2 k ) is a quantum circuit that generates a modular exponential operation result of the base and exponent input in ;

[0030] sending the index and the quantum circuit to a quantum computing unit;

[0031] Receive the measurement result fed back by the quantum computing unit, and determine and output the modular exponential operation result based on the measurement result.

[0032] The quantum computing unit is used to perform the following steps:

[0033] Receive the index and quantum circuit sent by the classical computing unit, the quantum circuit is used to calculate GF(2 k ), wherein the quantum circuit is constructed based on a preset irreducible polynomial, the base and the LUP decomposition method;

[0034] Exciting the quantum bit to an initial quantum state based on the index, and driving the quantum bit to evolve from the initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit;

[0035] The measurement result is sent to the classical computing unit, so that the classical computing unit determines the modular exponential operation result based on the measurement result.

[0036] Another embodiment of the present invention provides a processing device for a modular exponential data generation task, which is applied to a classical computing unit. The modular exponential data generation task is used to calculate a modular exponential operation result of a base and an exponent input in a finite field. The device includes:

[0037] A processing unit, for constructing a quantum circuit for calculating a result of a modular exponential operation of a base and an exponent input in the calculation based on a preset irreducible polynomial, the base and the LUP decomposition method;

[0038] A sending unit, used for sending the index and the quantum circuit to a quantum computing unit;

[0039] A receiving unit is used to receive the measurement result fed back by the quantum computing unit, and determine and output the modular exponential operation result based on the measurement result.

[0040] Another embodiment of the present invention provides another processing device for modular exponential data generation task, which is applied to a quantum computing unit. The modular exponential data generation task is used to calculate the finite field GF(2 k ), the device comprising:

[0041] A receiving unit is used to receive the index and quantum circuit sent by the classical computing unit, wherein the quantum circuit is used to calculate GF(2 k ), wherein the quantum circuit is constructed based on a preset irreducible polynomial, the base and the LUP decomposition method;

[0042] A computing unit, configured to excite the quantum bit to an initial quantum state based on the index, and drive the quantum bit to evolve from the initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit;

[0043] A sending unit is used to send the measurement result to the classical computing unit, so that the classical computing unit determines the modular exponential operation result based on the measurement result.

[0044] Yet another embodiment of the present invention provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to execute any of the above methods when running.

[0045] Yet another embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any of the above methods.

[0046] Compared with the prior art, the present invention provides a method and a related device for processing modular exponential data generation tasks. The classical computing unit is constructed based on a preset irreducible polynomial, a base number and a LUP decomposition method to calculate GF(2 k ) in the quantum circuit of the modular exponential operation result of the base and the exponent input in the quantum circuit; and sending the exponent and the quantum circuit to the quantum computing unit;

[0047] The quantum computing unit excites the quantum bit to an initial quantum state based on the index, and drives the quantum bit to evolve from the initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit; and sends the measurement result to the classical computing unit;

[0048] The classical computing unit determines and outputs the modular exponential operation result based on the measurement result; a quantum circuit is constructed by using irreducible polynomials, bases and LUP decomposition method, and the exponent is used as the input of the quantum circuit to achieve efficient generation of GF(2 k ) to accelerate the cracking of classic encryption algorithms. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A network block diagram of a processing system for a modular exponential data generation task provided by an embodiment of the present invention;

[0050] Figure 2 A schematic flow chart of a method for processing a modular exponential data generation task provided by an embodiment of the present invention;

[0051] Figure 3 A schematic diagram of the structure of a quantum circuit corresponding to an L-type matrix provided in an embodiment of the present invention;

[0052] Figure 4 A schematic diagram of the structure of a quantum circuit corresponding to a P-type matrix provided in an embodiment of the present invention;

[0053] Figure 5 A structural diagram of a sub-quantum circuit corresponding to one of the polynomials in a modular multiplication operation provided by an embodiment of the present invention;

[0054] Figure 6 A method for calculating a finite field GF(2 k ) is a quantum circuit that generates a modular exponential operation result of the base and exponent input in ;

[0055] Figure 7 A flowchart of another method for processing a modular exponential data generation task provided by an embodiment of the present invention;

[0056] Figure 8 A schematic diagram of the structure of a processing device for a modular exponential data generation task provided by an embodiment of the present invention;

[0057] Fig. 9 A schematic diagram of the structure of another processing device for modular exponential data generation task provided by an embodiment of the present invention;

[0058] Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but should not be construed as limiting the present invention.

[0060] Figure 1 1 is a network block diagram of a processing system for modular exponential data generation tasks provided by an embodiment of the present invention. The processing system for modular exponential data generation tasks may include a network 110, a server 120, a wireless device 130, a client 140, a storage 150, a classical computing unit 160, a quantum computing unit 170, and may also include additional memories, classical processors, quantum processors, and other devices not shown.

[0061] The network 110 is a medium for providing communication links between various devices and computers connected together within the processing system for the modular exponential data generation task, including but not limited to the Internet, corporate intranets, local area networks, mobile communication networks and combinations thereof. The connection method may be wired, wireless communication links or optical fiber cables, etc.

[0062] The server 120, the wireless device 130 and the client 140 are conventional data processing systems, which may contain data and applications or software tools for performing conventional computing processes. The client 140 may be a personal computer or a network computer, so the data may also be provided by the server 120. The wireless device 130 may be a smart phone, a tablet, a laptop, a smart wearable device, etc. The storage unit 150 may include a database 151, which may be configured to store data such as quantum bit parameters, quantum logic gate parameters, quantum circuits, quantum programs, etc.

[0063] The classical computing unit 160 (quantum computing unit 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 162 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application 163 (application 173). The application 163 (application 173) may be used to implement a quantum algorithm compiled according to a processing method for a modular exponential data generation task provided in an embodiment of the present invention.

[0064] Any data or information stored or generated in the classical computing unit 160 (quantum computing unit 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and any application program executed by it can also be configured to be executed in another classical (quantum) processing system in a similar manner.

[0065] It should be noted that a true quantum computer is a hybrid structure, which includes at least Figure 1 There are two major parts in it: the classical computing unit 160, which is responsible for performing classical computing and control; the quantum computing unit 170, which is responsible for running quantum programs and thus realizing quantum computing.

[0066] The classical computing unit 160 and the quantum computing unit 170 may be integrated into one device or distributed in two different devices. For example, the first device including the classical computing unit 160 runs a classical computer operating system, on which quantum application development tools and services are provided, as well as storage and network services required for quantum applications. Users develop quantum programs through the quantum application development tools and services thereon, and send quantum programs to the second device including the quantum computing unit 170 through the network services thereon. The second device runs a quantum computer operating system, and the code of the quantum program is parsed and compiled into instructions that can be recognized and executed by the quantum processor 170 through the quantum computer operating system. The quantum processor 170 implements the quantum algorithm corresponding to the quantum program according to the instructions.

[0067] The computing unit of the classic processor 161 in the classic computing unit 160 is a CMOS tube based on a silicon chip. This computing unit is not limited by time and coherence, that is, this computing unit is not limited by the length of use and can be used at any time. In addition, in the silicon chip, the number of such computing units is also sufficient. At present, the number of computing units in a classic processor 161 is tens of thousands. The number of computing units is sufficient and the computing logic that can be selected by the CMOS tube is fixed, such as: AND logic. When calculating with the help of CMOS tubes, a large number of CMOS tubes are combined with limited logic functions to achieve the calculation effect.

[0068] The basic computing unit of the quantum processor 171 in the quantum computing unit 170 is a quantum bit, and the input of the quantum bit is limited by coherence and coherence time, that is, the quantum bit is limited by the use time and is not available at any time. Making full use of the quantum bit within the available use time of the quantum bit is a key problem in quantum computing. In addition, the number of quantum bits in a quantum computer is one of the representative indicators of the performance of a quantum computer. Each quantum bit realizes the computing function through the logical function configured on demand. In view of the limited number of quantum bits, the logical functions in the field of quantum computing are diverse, such as: Hadamard gate (Hadamard gate, H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate) Pauli-Z gate (Z gate), X gate, RY gate, RZ gate, CNOT gate, CR gate, iSWAP gate, Toffoli gate, etc. During quantum computing, it is necessary to use limited quantum bits combined with a variety of logical functions to achieve the computing effect.

[0069] Based on these differences, the design of CMOS tubes by classical logic functions and the design of quantum bits by quantum logic functions are significantly and essentially different. The design of CMOS tubes by classical logic functions does not need to consider the individuality of CMOS tubes. For example, the representation of CMOS tubes in silicon chips is the individual identification, position, and usable life of each CMOS tube. Therefore, the classical algorithm composed of classical logic functions only expresses the operational relationship of the algorithm, but does not express the algorithm's dependence on individual CMOS tubes.

[0070] When quantum logic functions act on qubits, the individuality of qubits needs to be considered, such as the individual identification of the qubit in the quantum chip, its position, its relationship with surrounding qubits, and the usable time of each qubit. Therefore, the quantum algorithm composed of quantum logic functions not only expresses the computational relationship of the algorithm, but also expresses the algorithm's dependence on individual qubits.

[0071] Exemplary:

[0072] Quantum algorithm 1: H1, H2, CNOT(1,3), H3, CNOT(2,3);

[0073] Quantum Algorithm 2: H1, H2, CNOT(1,2), H3, CNOT(2,3);

[0074] Among them, 1 / 2 / 3 represent three sequentially connected quantum bits Q1, Q2, Q3 or mutually connected quantum bits Q1, Q2, Q3 respectively;

[0075] An exemplary explanation of how quantum algorithms are affected by the coherence time of qubits is as follows:

[0076] Define the execution time of a single-qubit logic gate as t, and the execution time of a two-qubit logic gate acting on adjacent bits as 2t; then:

[0077] When Q1, Q2, and Q3 are interconnected, the calculation of quantum algorithm 1 takes 6t, which is divided into 4 time periods. The duration of each time period is t, 2t, t, and 2t respectively. The operations performed in each time period are: H1, H2; CNOT(1, 3); H3; CNOT(2, 3);

[0078] The calculation of quantum algorithm 1 takes 5t, which is divided into 3 time periods. The duration of each time period is t, 2t, and 2t respectively. The operations performed in each time period are: H1, H2, H3; CNOT(1, 2); CNOT(2, 3);

[0079] When Q1, Q2, and Q3 are connected in sequence, the quantum algorithm 1 needs to be equivalent to: H1, H2; swap(1, 2), CNOT(2, 3), swap(1, 2); H3; CNOT(2, 3); the calculation of the equivalent quantum algorithm 1 requires 10t, which is divided into 4 time periods, and the duration of each time period is t, 6t, t, and 2t respectively. The operations performed in each time period are: H1, H2; swap(1, 2), CNOT(2, 3), swap(1, 2); H3; CNOT(2, 3).

[0080] A quantum chip only includes quantum bits and channels for regulating quantum bits. Quantum logic gates are implemented through analog signals. Different combinations of analog signals are applied to quantum bits through channels for regulating quantum bits, thereby realizing quantum circuits with different functions and completing data processing. Therefore, the design of quantum logic functions acting on quantum bits (including the design of whether quantum bits are used and the design of the efficiency of each quantum bit) is the key to improving the computing performance of quantum computers, and requires special design. This is also the uniqueness of quantum algorithms based on quantum logic functions, which is essentially and significantly different from classical algorithms based on classical logic functions. The above-mentioned design for quantum bits is a technical problem that ordinary computing devices do not need to consider or face. The present invention proposes a processing method and related device for modular exponential data generation tasks, aiming to efficiently generate GF(2 k ) in order to accelerate the cracking of the classic encryption algorithm.

[0081] See also Figure 2 , Figure 2 A schematic flow chart of a method for processing a modular exponential data generation task provided by an embodiment of the present invention, which is applied to a classical computing unit, wherein the modular exponential data generation task is used to calculate a finite field GF(2 k), the method comprising:

[0082] Step 201: construct a method for calculating GF(2 k ) is a quantum circuit that generates a modular exponential operation result of the base and exponent input in ;

[0083] Among them, GF(2 k ) are polynomials with coefficients of 0 and 1, or more precisely, the remainder class of polynomials, where the equivalence relation is characterized by modulo division (modulo division means dividing a polynomial and taking the remainder) an irreducible polynomial of degree k. An irreducible polynomial is one that has no other polynomials as factors except 1 and the polynomial itself in the current number field.

[0084] For current binary system computers, GF(2 k ) is particularly important. Many encryption standard algorithms use bytes as processing units. For example, each byte can be regarded as GF(2 8 )(k=8), each corresponding to a polynomial of degree not exceeding 7, a7a6a5a4a3a2a1a0=a7x 7 +a6x 6 +a5x 5 +a4x 4 +a3x 3 +a2x 2 +a1x 1 +a0.

[0085] If the input base is x, the exponent is n, and the irreducible polynomial is f, then the modular exponentiation operation is x n mod f.

[0086] Among them, decomposing a square matrix A into the product of the lower triangular matrix L and the upper triangular matrix U is called LU decomposition. LUP decomposition is to add a permutation matrix P on the basis of LU decomposition. The square matrix A is first subjected to the permutation matrix to obtain AP, and then the new matrix is ​​decomposed by LU, that is, AP = LU.

[0087] Step 202: Sending the index and the quantum circuit to a quantum computing unit;

[0088] Step 203: Receive the measurement result fed back by the quantum computing unit, and determine and output the modular exponential operation result based on the measurement result.

[0089] The quantum computing unit can be based on the exponential to excite the quantum state of the quantum bit to the initial state to achieve exponential loading. For example, if the exponent is 5, its binary representation is 101, then the 0th and 2nd quantum bits can be excited from the ground state |0> to the excited state |1>; then based on the quantum circuit, the quantum bit is driven to evolve from the initial quantum state to obtain the measurement result of the quantum bit. The quantum computing unit executes the quantum circuit for a specified number of times.

[0090] Among them, the measurement results can be in the form of an array. For example, for two quantum bits and 1024 execution times, the measurement results can be "00":251, "01":213, "10":260, "11":300, where "00", "01", "10", "11" are the measured quantum states, and "251, 213, 260, 300" are the times corresponding to the measured quantum states.

[0091] Specifically, the quantum computing unit generates a first pulse modulation signal based on an exponential, and the first pulse modulation signal is used to drive the quantum bit to be excited to an initial quantum state; and generates a second pulse modulation signal based on the quantum circuit, and the first pulse modulation signal is used to drive the quantum bit to evolve from the initial quantum state to a target state; the quantum computing unit generates a third pulse modulation signal, and the third pulse modulation signal is used to measure the quantum bit to obtain a measurement result corresponding to the target state.

[0092] Compared with the prior art, the present invention provides a method and a related device for processing modular exponential data generation tasks. The classical computing unit is constructed based on a preset irreducible polynomial, a base number and a LUP decomposition method to calculate GF(2 k ) in the quantum circuit of the modular exponential operation result of the base and the exponent input in the quantum circuit; and sending the exponent and the quantum circuit to the quantum computing unit;

[0093] The quantum computing unit excites the quantum bit to an initial quantum state based on the index, and drives the quantum bit to evolve from the initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit; and sends the measurement result to the classical computing unit;

[0094] The classical computing unit determines and outputs the modular exponential operation result based on the measurement result; a quantum circuit is constructed by using irreducible polynomials, bases and LUP decomposition method, and the exponent is used as the input of the quantum circuit to achieve efficient generation of GF(2 k ) to accelerate the cracking of classic encryption algorithms.

[0095] Optionally, the method for calculating GF(2k ) is a quantum circuit for the modular exponential operation result of the base and exponent input in , including:

[0096] Decomposing the modular exponential operation into k polynomial modular multiplication operations;

[0097] Based on a preset irreducible polynomial, the base number and the LUP decomposition method, a sub-quantum circuit corresponding to each polynomial in the modular multiplication operation is constructed to obtain k sub-quantum circuits;

[0098] The k sub-quantum circuits are cascaded to obtain the k ) is a quantum circuit that generates the result of the modular exponential operation of the base and exponent entered in .

[0099] If the binary number of n is n k n k-1 …n1, then For example Therefore, the modular exponential operation can be decomposed into modular multiplication operations of k polynomials.

[0100] The input of the quantum circuit is the quantum state of the quantum bit. Due to the finite field GF(2 k ) is decomposed into the multiplication operation of k polynomials. Therefore, except for the sub-quantum circuits corresponding to the first and last polynomials, the output of the sub-quantum circuit corresponding to the previous polynomial is the input of the sub-quantum circuit corresponding to the next polynomial; the input of the sub-quantum circuit corresponding to the first polynomial is the quantum state of the quantum bit encoding the input data.

[0101] Furthermore, the sub-quantum circuit corresponding to each polynomial in the modular multiplication operation is constructed based on the preset irreducible polynomial, the base number and the LUP decomposition method, including:

[0102] Determine a first square matrix based on a preset irreducible polynomial and the base;

[0103] Iteratively calculate the square of the first matrix until k-1 second matrices are obtained, where the second matrix is ​​2 of the first matrix. m power, where m is an integer in [1, k-1];

[0104] Perform LUP decomposition on the first square matrix and k-1 second square matrices to obtain k L-type, k U-type and k P-type matrices respectively;

[0105] Constructing quantum circuits corresponding to the L-type and U-type matrices based on CNOT gates, and constructing quantum circuits corresponding to the P-type matrix based on SWAP gates;

[0106] The quantum circuits corresponding to each of the P-type matrices and the U-type and L-type matrices corresponding to the P-type matrices are spliced ​​to obtain a sub-quantum circuit corresponding to each polynomial in the modular multiplication operation.

[0107] Specifically, determining the first square matrix based on the preset irreducible polynomial and the base number includes:

[0108] Determine the degree corresponding to the highest term in the preset irreducible polynomial;

[0109] Determine a modular multiplication result of the base and each term of a lower degree than the highest term;

[0110] A first square matrix is ​​determined based on the modular multiplication result.

[0111] For example, the preset irreducible polynomial is f=1+x+x 4 , the base is the polynomial 1+x, and the modular multiplication results of the base and each term with a lower degree than the highest term are:

[0112] (1+x)×1modf=1+x

[0113] (1+x)×xmodf=x+x 2

[0114] (1+x)×x 2 modf=x 2 +x 3

[0115] (1+x)×x 3 modf=x 3 +x 4 modf=1+x+x 3

[0116] Translating the above expression into the language of linear algebra:

[0117] (1,1,0,0)×(1,0,0,0)=(1,1,0,0)

[0118] (1, 1, 0, 0) × (0, 1, 0, 0) = (0, 1, 1, 0)

[0119] (1,1,0,0)×(0,0,1,0)=(0,0,1,1)

[0120] (1,1,0,0)×(0,0,0,1)=(1,1,0,1)

[0121] Putting the above four equations together we get:

[0122]

[0123] Thus, the first matrix to be determined can be obtained as:

[0124]

[0125] First, left-multiplying the matrix by a vector in the domain is equivalent to multiplying (1+x) by its elements, which is obvious because polynomial operations obey the distributive ratio of multiplication to addition.

[0126] Specifically, the square of the first matrix is ​​iteratively calculated until k-1 second matrices are obtained, where the second matrix is ​​2 of the first matrix. m For example, when m=1, then (1+x) 2 The corresponding second matrix is ​​the square of the first matrix:

[0127]

[0128] According to the above method, iterative calculation can be obtained The corresponding second matrix.

[0129] Among them, the elements of the P-type, U-type, and L-type matrices are all taken from {0, 1}, so the quantum circuit corresponding to the P-type matrix can be realized through the SWAP gate, and the quantum circuits corresponding to the U-type and L-type matrices can be realized through the CNOT gate.

[0130] Specifically, the quantum circuit corresponding to the L-type matrix is ​​constructed based on the CNOT gate, including:

[0131] Determine the non-zero elements a in the L-type matrix except the diagonal ij , apply the CNOT gate to the i-th and j-th quantum bits to obtain the quantum circuit corresponding to the L-type matrix, the i-th quantum bit is the controlled bit, the j-th quantum bit is the control bit, and i and j are the number of rows and columns of the L-type matrix respectively.

[0132] like Figure 3 As shown, Figure 3 A schematic diagram of the structure of a quantum circuit corresponding to an L-type matrix provided in an embodiment of the present invention. For example, the L-type matrix is:

[0133]

[0134] The non-zero elements of the L-type matrix other than the diagonal are a 20 、a 21 、a 30, then according to the order of the non-zero elements first from small to large and then from small to large, the CNOT gate is applied to the second and zeroth quantum bits (q2 and q0), the second quantum bit q2 is the controlled bit, and the zeroth quantum bit q0 is the control bit; the CNOT gate is applied to the second and first quantum bits (q2 and q1), the second quantum bit q2 is the controlled bit, and the first quantum bit q1 is the control bit; the CNOT gate is applied to the third and zeroth quantum bits (q3 and q0), the third quantum bit q3 is the controlled bit, and the zeroth quantum bit q0 is the control bit.

[0135] Specifically, the quantum circuit corresponding to the U-shaped matrix is ​​constructed based on the CNOT gate, including:

[0136] Determine the non-zero elements a in the U-shaped matrix except the diagonal ij , apply the CNOT gate to the i-th and j-th quantum bits to obtain the quantum circuit corresponding to the U-type matrix, the j-th quantum bit is the controlled bit, the i-th quantum bit is the control bit, and i and j are the number of rows and columns of the U-type matrix respectively.

[0137] The specific implementation process of the quantum circuit corresponding to the U-type matrix is ​​similar to the specific implementation process of the quantum circuit corresponding to the L-type matrix. Please refer to the specific implementation process of the quantum circuit corresponding to the above L-type matrix, which will not be repeated here.

[0138] Specifically, the quantum circuit corresponding to the P-type matrix is ​​constructed based on the SWAP gate, and the dimension of the P-type matrix is ​​k×k, including:

[0139] The quantum state of the k qubits corresponding to the number of rows is transferred to the quantum state of the k qubits corresponding to the number of columns, and the non-zero elements a except the diagonal in the P-type matrix are determined. mn , m and n are the number of rows and columns of the P-type matrix respectively;

[0140] The SWAP gate is applied to the mth qubit among the k qubits corresponding to the number of rows and the nth qubit among the k qubits corresponding to the number of columns to obtain a quantum circuit corresponding to the P-type matrix.

[0141] Furthermore, the step of transferring the quantum state of the k qubits corresponding to the number of rows to the quantum state of the k qubits corresponding to the number of columns includes:

[0142] The SWAP gate is applied to the qubits corresponding to the row number and the qubits corresponding to the column number with the same serial number, that is, k qubits corresponding to both the row number and the column number.

[0143] For example, Figure 4 As shown, Figure 4A schematic diagram of a quantum circuit structure corresponding to a P-type matrix provided in an embodiment of the present invention. If k = 4, the quantum circuit includes four quantum bits corresponding to the number of rows: q Line0 ,q Line1 ,q Line2 ,q Line3 , the number of columns corresponds to the four quantum bits: q Row0 ,q Row1 ,q Row2 ,q Row3 . You can first use SWAP(q Line0 ,q Row0 )、SWAP(q Line1 ,q Row1 )、SWAP(q Line2 ,q Row2 )、SWAP(q Line3 ,q Row3 ) transfers the quantum state of the qubit corresponding to the row number to the quantum state of the qubit corresponding to the column number. Here, the four SWAP gates act on different qubits, so their action sequence is not affected. Figure 4 Just one example.

[0144] If the P-type matrix is:

[0145]

[0146] Then the non-zero elements have a 01 、a 12 、a 23 、a 30 , so there exists SWAP(q Line0 ,q Row1 )、SWAP(q Line1 ,q Row2 )、SWAP(q Line2 ,q Row3 )、SWAP(q Line3 ,q Row0 ). Similarly, the four SWAP gates act on different quantum bits, so it does not affect their timing. Figure 4 Just one example.

[0147] Specifically, the quantum circuits corresponding to the P-type, U-type and L-type matrices are spliced ​​to obtain the quantum circuits for calculating GF(2 k ) is a quantum circuit that inputs the modular square operation result of the polynomial, and the dimensions of the L-type and U-type matrices are also k×k. The k quantum bits corresponding to the number of rows of the P-type matrix can be cascaded with the k quantum bits included in the quantum circuits corresponding to the U-type and L-type to achieve splicing.

[0148] See also Figure 5 , Figure 5 A structural diagram of a sub-quantum circuit corresponding to one of the polynomials in a modular multiplication operation provided by an embodiment of the present invention. By the matrix P k The corresponding quantum circuit MatP k , matrix U k The corresponding quantum circuit MatU k , matrix L k The corresponding quantum circuit MatL k Stitched together.

[0149] See also Figure 6 , Figure 6 A method for calculating a finite field GF(2 k ) is a quantum circuit for the result of the modular exponential operation of the base and the exponent input in the quantum circuit. The quantum circuit includes k data bits and k auxiliary bits. The k data bits are used to encode the binary value n of the exponent n. k n k-1 …n1, the initial quantum state of one of the k auxiliary bits is an excited state |1>, for example, the initial state of the auxiliary bit used to represent the lowest bit is |1>. Figure 6 The quantum logic gate in the sub-quantum circuit shown in the embodiment acts on k auxiliary bits, and the quantum logic gate is controlled by the data bit corresponding to the binary bit. Finally, the quantum state corresponding to the result of the modular exponential operation of the base and the exponent can be obtained by measuring the k auxiliary bits.

[0150] See also Figure 7 , Figure 7 A flowchart of another method for processing a modular exponential data generation task provided by an embodiment of the present invention is applied to a quantum computing unit, wherein the modular exponential data generation task is used to calculate a finite field GF(2 k ), the method comprising:

[0151] Step 701: Receive the index and quantum circuit sent by the classical computing unit, the quantum circuit is used to calculate GF(2 k ), wherein the quantum circuit is constructed based on a preset irreducible polynomial, the base and the LUP decomposition method;

[0152] Step 702: exciting the quantum bit to an initial quantum state based on the index, and driving the quantum bit to evolve from the initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit;

[0153] Step 703: Send the measurement result to the classical computing unit, so that the classical computing unit determines the modular exponential operation result based on the measurement result.

[0154] The specific implementation of this embodiment can refer to the application to the classic computing unit side. Figure 2 The illustrated embodiments are not described in detail here.

[0155] Yet another embodiment of the present invention provides a quantum computing system, the quantum computing system comprising a classical computing unit and a quantum computing unit;

[0156] The classical computing unit is used to perform the following steps:

[0157] Based on the preset irreducible polynomial, the base number and the LUP decomposition method, a method for calculating GF(2 k ) is a quantum circuit that generates a modular exponential operation result of the base and exponent input in ;

[0158] sending the index and the quantum circuit to a quantum computing unit;

[0159] Receive the measurement result fed back by the quantum computing unit, and determine and output the modular exponential operation result based on the measurement result.

[0160] The quantum computing unit is used to perform the following steps:

[0161] Receive the index and quantum circuit sent by the classical computing unit, the quantum circuit is used to calculate GF(2 k ), wherein the quantum circuit is constructed based on a preset irreducible polynomial, the base and the LUP decomposition method;

[0162] Exciting the quantum bit to an initial quantum state based on the index, and driving the quantum bit to evolve from the initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit;

[0163] The measurement result is sent to the classical computing unit, so that the classical computing unit determines the modular exponential operation result based on the measurement result.

[0164] Furthermore, the method further comprises:

[0165] The obtained ciphertext is decrypted based on the modular exponentiation result.

[0166] See also Figure 8 , Figure 8A schematic diagram of the structure of a processing device for a modular exponential data generation task provided by an embodiment of the present invention, which is applied to a classical computing unit, wherein the modular exponential data generation task is used to calculate a modular exponential operation result of a base and an exponent input in a finite field, and the device includes:

[0167] A processing unit 801 is used to construct a quantum circuit for calculating the result of modular exponential operation of the input base and exponent in the calculation based on a preset irreducible polynomial, the base and the LUP decomposition method;

[0168] A sending unit 802, configured to send the index and the quantum circuit to a quantum computing unit;

[0169] The receiving unit 803 is used to receive the measurement result fed back by the quantum computing unit, and determine and output the modular exponential operation result based on the measurement result.

[0170] See also Fig. 9 , Fig. 9 A schematic diagram of a processing device for another modular exponential data generation task provided by an embodiment of the present invention, which is applied to a quantum computing unit, wherein the modular exponential data generation task is used to calculate a finite field GF(2 k ), the method comprising:

[0171] The receiving unit 901 is used to receive the index and quantum circuit sent by the classical computing unit, and the quantum circuit is used to calculate GF(2 k ), wherein the quantum circuit is constructed based on a preset irreducible polynomial, the base and the LUP decomposition method;

[0172] A calculation unit 902 is used to excite the quantum bit to an initial quantum state based on the index, and drive the quantum bit to evolve from the initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit;

[0173] The sending unit 903 is used to send the measurement result to the classical computing unit, so that the classical computing unit determines the modular exponential operation result based on the measurement result.

[0174] The specific functions and effects achieved by the processing device for the modular exponential data generation task can be explained in reference to other embodiments of this specification, and will not be repeated here. The various modules in the processing device for the modular square data generation task can be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0175] See also Fig.10 The present specification also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the processing method of the modular exponential data generation task in any of the above embodiments when executing the computer program. Fig.10 , the computer device may be a classical computer. The computer device may also be a quantum computer.

[0176] The embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a computer, the computer executes the processing method for the modular exponential data generation task in any of the above embodiments.

[0177] The embodiments of this specification also provide a computer program product including instructions, which, when executed by a computer, enables the computer to execute the processing method for the modular exponential data generation task in any of the above embodiments.

[0178] It should be understood that the specific examples in this specification are only intended to help those skilled in the art to better understand the implementation methods of this specification, rather than to limit the scope of the present invention.

[0179] It can be understood that in the various implementations of this specification, 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 this specification.

[0180] It can be understood that the various embodiments described in this specification can be implemented individually or in combination, and the embodiments of this specification are not limited to this.

[0181] Unless otherwise specified, all technical and scientific terms used in the embodiments of this specification have the same meaning as those generally understood by those skilled in the art of the technical field of this specification. The terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the scope of this specification. The term "and / or" used in this specification includes any and all combinations of one or more related listed items. The singular forms of "a", "above", and "the" used in the embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0182] It can be understood that the processor of the embodiment of this specification can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method implementation can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiment of this specification can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of this specification can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0183] It is understood that the memory in the embodiments of this specification may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (programmable ROM, PROM), an erasable programmable read-only memory (erasablePROM, EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0184] Those skilled 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 specification.

[0185] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method implementation methods and will not be repeated here.

[0186] In the several embodiments provided in this specification, 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.

[0187] 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.

[0188] In addition, each functional unit in each embodiment of the present specification 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.

[0189] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this specification, 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. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0190] The above is only a specific implementation of this specification, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in this specification, which should be included in the protection scope of this specification. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for processing a modular exponential data generation task, characterized in that: Applied to the classical computing unit, the modular exponential data generation task is used to calculate the finite field GF(2 k ), the method comprising: Based on the preset irreducible polynomial, the base number and the LUP decomposition method, a method for calculating GF(2 k ) is a quantum circuit that generates a modular exponential operation result of the base and exponent input in ; sending the index and the quantum circuit to a quantum computing unit; Receive the measurement result fed back by the quantum computing unit, and determine and output the modular exponential operation result based on the measurement result.

2. The method according to claim 1, characterized in that The method for calculating GF(2 k ) is a quantum circuit for the modular exponential operation result of the base and exponent input in , including: Decomposing the modular exponential operation into k polynomial modular multiplication operations; Constructing a sub-quantum circuit corresponding to each polynomial in the modular multiplication operation based on a preset irreducible polynomial, the base number and the LUP decomposition method to obtain k sub-quantum circuits; The k sub-quantum circuits are cascaded to obtain the k ) is a quantum circuit that generates the result of the modular exponential operation of the base and exponent entered in .

3. The method according to claim 2, characterized in that The method of constructing a sub-quantum circuit corresponding to each polynomial in the modular multiplication operation based on a preset irreducible polynomial, the base number and the LUP decomposition method includes: Determine a first square matrix based on a preset irreducible polynomial and the base; Iteratively calculate the square of the first matrix until k-1 second matrices are obtained, where the second matrix is ​​2 of the first matrix. m power, where m is an integer in [1, k-1]; Perform LUP decomposition on the first square matrix and k-1 second square matrices to obtain k L-type, k U-type and k P-type matrices respectively; Constructing quantum circuits corresponding to the L-type and U-type matrices based on CNOT gates, and constructing quantum circuits corresponding to the P-type matrix based on SWAP gates; The quantum circuits corresponding to each of the P-type matrices and the U-type and L-type matrices corresponding to the P-type matrices are spliced ​​to obtain a sub-quantum circuit corresponding to each polynomial in the modular multiplication operation.

4. The method according to claim 3, characterized in that The determining of the first square matrix based on the preset irreducible polynomial and the base number comprises: Determine the degree corresponding to the highest term in the preset irreducible polynomial; Determine a modular multiplication result of the base and each term of a lower degree than the highest term; A first square matrix is ​​determined based on the modular multiplication result.

5. A method for processing a modular exponential data generation task, characterized in that: Applied to quantum computing unit, the modular exponential data generation task is used to calculate the finite field GF(2 k ), the method comprising: Receive the index and quantum circuit sent by the classical computing unit, the quantum circuit is used to calculate GF(2 k ), wherein the quantum circuit is constructed based on a preset irreducible polynomial, the base and the LUP decomposition method; Exciting the quantum bit to an initial quantum state based on the index, and driving the quantum bit to evolve from the initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit; The measurement result is sent to the classical computing unit, so that the classical computing unit determines the modular exponential operation result based on the measurement result.

6. A quantum computing system, characterized in that: The quantum computing system includes a classical computing unit and a quantum computing unit; The classical computing unit is used to perform the following steps: Based on the preset irreducible polynomial, the base number and the LUP decomposition method, a method for calculating GF(2 k ) is a quantum circuit that generates a modular exponential operation result of the base and exponent input in ; sending the index and the quantum circuit to a quantum computing unit; Receive the measurement result fed back by the quantum computing unit, and determine and output the modular exponential operation result based on the measurement result. The quantum computing unit is used to perform the following steps: Receive the index and quantum circuit sent by the classical computing unit, the quantum circuit is used to calculate GF(2 k ), wherein the quantum circuit is constructed based on a preset irreducible polynomial, the base and the LUP decomposition method; Exciting the quantum bit to an initial quantum state based on the index, and driving the quantum bit to evolve from the initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit; The measurement result is sent to the classical computing unit, so that the classical computing unit determines the modular exponential operation result based on the measurement result.

7. A processing device for modular exponential data generation task, characterized in that: Applied to a classical computing unit, the modular exponential data generation task is used to calculate the modular exponential operation result of the base and exponent input in a finite field, and the device includes: A processing unit, for constructing a quantum circuit for calculating a result of a modular exponential operation of a base and an exponent input in the calculation based on a preset irreducible polynomial, the base and the LUP decomposition method; A sending unit, used for sending the index and the quantum circuit to a quantum computing unit; A receiving unit is used to receive the measurement result fed back by the quantum computing unit, and determine and output the modular exponential operation result based on the measurement result.

8. A processing device for modular exponential data generation task, characterized in that: Applied to quantum computing unit, the modular exponential data generation task is used to calculate the finite field GF(2 k ), the device comprising: A receiving unit is used to receive the index and quantum circuit sent by the classical computing unit, wherein the quantum circuit is used to calculate GF(2 k ), wherein the quantum circuit is constructed based on a preset irreducible polynomial, the base and the LUP decomposition method; A computing unit, configured to excite the quantum bit to an initial quantum state based on the index, and drive the quantum bit to evolve from the initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit; A sending unit is used to send the measurement result to the classical computing unit, so that the classical computing unit determines the modular exponential operation result based on the measurement result.

9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 5 when executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Quantum additive operation method and device, electronic device and storage medium

    CN112162723A

  • AES algorithm implementation method in quantum storage limited environment

    CN115348003A

  • Quantum computing task processing method and device and quantum computer operating system

    CN115511089A

  • Classically-boosted variational quantum eigensolver

    US20220284337A1

  • Group algebra techniques for operating on matrices

    US7792894B1