Data generation method and device, quantum computing system, medium and electronic device
By using Toffoli gates and preset depositioners to construct quantum circuits in quantum computing systems to excite and drive qubits, the problem of difficulty in efficiently generating GF (2k) target data in the existing technology has been solved, and the speed of cracking classic encryption algorithms has been achieved. Effect.
Patent Information
- Application Number
- CN202310324600.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2043-03-29
AI Technical Summary
It is difficult for existing technology to efficiently generate target data in finite field GF(2k), thereby accelerating the cracking of classic encryption algorithms.
By receiving the data generation task, a quantum circuit is constructed based on the Toffoli gate and the preset depositioner, the input data and the quantum circuit are sent to the quantum computing unit, the qubit is excited to the initial quantum state, and the qubit is driven from the initial quantum state based on the quantum circuit. Evolve and obtain the measurement results of the qubit to determine the target data corresponding to the input data.
Efficient generation of target data in GF(2k) is achieved, which is conducive to accelerating the cracking of classic encryption algorithms.
Smart Images

Figure CN118780376A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of quantum computing technology, and in particular to a data generation method, device, quantum computing system, medium and electronic 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 ), thereby accelerating the cracking of classic encryption algorithms. Summary of the invention
[0004] The purpose of the present invention is to provide a data generation method, device, quantum computing system, medium and electronic device, aiming to efficiently generate GF(2 k ), thereby accelerating the cracking of classic encryption algorithms.
[0005] An embodiment of the present invention provides a data generation method, which is applied to a classical computing unit, and the method includes:
[0006] Receive a data generation task, where the data generation task is used to generate target data corresponding to input data;
[0007] Constructing a quantum circuit corresponding to the data generation task based on a Toffoli gate and a preset debouncer;
[0008] Sending the input data and the quantum circuit to a quantum computing unit, instructing the quantum computing unit to excite a quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data;
[0009] The measurement result sent by the quantum computing unit is received, and target data corresponding to the input data is determined based on the measurement result.
[0010] Optionally, the input data includes two polynomials to be multiplied, and the highest degree of the polynomials is k-1; the two polynomials are respectively encoded with k data bits, and the quantum bits include 2k data bits.
[0011] Optionally, the quantum bit further includes 2k-1 result bits; and the step of constructing a quantum circuit corresponding to the data generation task based on a Toffoli gate and a preset debouncer includes:
[0012] Applying a Toffoli gate to the 2k data bits and the 2k-1 result bits to obtain a general multiplication circuit corresponding to the data generation task, wherein the data bits are control bits; and the general multiplication result of the two polynomials is mapped to the 2k-1 result bits;
[0013] The preset de-biter is applied to 2k-1 of the result bits to obtain a de-bit line corresponding to the data generation task, and the target data corresponding to the two polynomials are mapped to k of the result bits.
[0014] Optionally, the method further includes:
[0015] An irreducible polynomial is obtained, and the preset deregister is constructed based on the irreducible polynomial and a CONT gate.
[0016] Optionally, constructing the preset backoff device based on the irreducible polynomial and the CONT gate includes:
[0017] The preset deregistrator is obtained by using the quantum bit corresponding to the non-highest term in the irreducible polynomial as the controlled bit of the CNOT gate, and using the quantum bit corresponding to the highest term in the irreducible polynomial as the control bit of the CNOT gate.
[0018] Yet another embodiment of the present invention provides a data generation method, which is applied to a quantum computing unit, and the method includes:
[0019] Receiving input data sent by a classical computing unit and a quantum circuit corresponding to a data generation task, wherein the data generation task is used to generate target data corresponding to the input data, and the quantum circuit is constructed by the classical computing unit based on a Toffoli gate and a preset debouncer;
[0020] Exciting a quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data;
[0021] The measurement result is sent to the classical computing unit, so that the classical computing unit determines the target data corresponding to the input data based on the measurement result.
[0022] Optionally, the input data includes two polynomials to be multiplied, and the highest degree of the polynomials is k-1; the quantum bits include 2k data bits and 2k-1 result bits; and exciting the quantum bits to an initial quantum state includes:
[0023] Excite k of the data bits to a first quantum state corresponding to one of the polynomials, excite another k of the data bits to a second quantum state corresponding to another of the polynomials, and excite 2k-1 of the result bits to a ground state.
[0024] 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;
[0025] The classical computing unit is used to perform the following steps:
[0026] Receive a data generation task, where the data generation task is used to generate target data corresponding to input data;
[0027] Constructing a quantum circuit corresponding to the data generation task based on a Toffoli gate and a preset debouncer;
[0028] Sending the input data and the quantum circuit to a quantum computing unit, instructing the quantum computing unit to excite a quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data;
[0029] The measurement result sent by the quantum computing unit is received, and target data corresponding to the input data is determined based on the measurement result.
[0030] The quantum computing unit is used to perform the following steps:
[0031] Receiving input data sent by a classical computing unit and a quantum circuit corresponding to a data generation task, wherein the data generation task is used to generate target data corresponding to the input data, and the quantum circuit is constructed by the classical computing unit based on a Toffoli gate and a preset debouncer;
[0032] Exciting the quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state corresponding to the input data;
[0033] The measurement result is sent to the classical computing unit, so that the classical computing unit determines the target data corresponding to the input data based on the measurement result.
[0034] Another embodiment of the present invention provides a data generation device, which is applied to a classical computing unit, and the device includes:
[0035] A receiving module, used for receiving a data generation task, wherein the data generation task is used for generating target data corresponding to the input data;
[0036] A construction module, used to construct a quantum circuit corresponding to the data generation task based on a Toffoli gate and a preset decoupling device;
[0037] A sending module, used to send the input data and the quantum circuit to a quantum computing unit, instruct the quantum computing unit to excite the quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data;
[0038] The receiving module is further used to receive the measurement result sent by the quantum computing unit, and determine the target data corresponding to the input data based on the measurement result.
[0039] Another embodiment of the present invention provides a data generating device, which is applied to a quantum computing unit, and the device includes:
[0040] A receiving module, used for receiving input data sent by a classical computing unit and a quantum circuit corresponding to a data generation task, wherein the data generation task is used to generate target data corresponding to the input data, and the quantum circuit is constructed by the classical computing unit based on a Toffoli gate and a preset debouncer;
[0041] A computing module, configured to excite a quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state corresponding to the input data;
[0042] A sending module is used to send the measurement result to the classical computing unit, so that the classical computing unit determines the target data corresponding to the input data based on the measurement result.
[0043] 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.
[0044] 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.
[0045] Compared with the prior art, the present invention provides a data generation method, device, quantum computing system, medium and electronic device, which receive a data generation task for generating target data corresponding to input data; then construct a quantum circuit corresponding to the data generation task based on a Toffoli gate and a preset decoy; send the input data and the quantum circuit to a quantum computing unit, instruct the quantum computing unit to excite a quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data; finally, receive the measurement result sent by the quantum computing unit, and determine the target data corresponding to the input data based on the measurement result.
[0046] The present invention processes GF(2 k ), the classical computing unit focuses on the design of quantum circuits, and the quantum computing unit efficiently executes the quantum circuits, thus achieving GF(2 k ), which helps to accelerate the cracking of classic encryption algorithms. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A network block diagram of a data generation system provided by an embodiment of the present invention;
[0048] Figure 2 A schematic diagram of a flow chart of a data generation method provided by an embodiment of the present invention;
[0049] Figure 3 A schematic diagram of the structure of a detent provided by an embodiment of the present invention;
[0050] Figure 4 A GF(2 k )The quantum circuit diagram corresponding to the multiplication operation;
[0051] Figure 5 A schematic diagram of a flow chart of another data generation method provided by an embodiment of the present invention;
[0052] Figure 6 A schematic diagram of the structure of a data generating device provided by an embodiment of the present invention;
[0053] Figure 7A schematic diagram of the structure of another data generating device provided by an embodiment of the present invention;
[0054] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] 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.
[0056] Figure 1 A network block diagram of a data generation system provided in an embodiment of the present invention. The data generation system 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.
[0057] The network 110 is a medium for providing communication links between various devices and computers connected together in the data generation system, 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.
[0058] 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.
[0059] 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 by a data generation method provided in an embodiment of the present invention.
[0060] 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.
[0061] 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.
[0062] 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.
[0063] 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.
[0064] 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.
[0065] 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.
[0066] 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.
[0067] Exemplary:
[0068] Quantum algorithm 1: H1, H2, CNOT(1,3), H3, CNOT(2,3);
[0069] Quantum Algorithm 2: H1, H2, CNOT(1,2), H3, CNOT(2,3);
[0070] Among them, 1 / 2 / 3 represent three sequentially connected quantum bits Q1, Q2, Q3 or mutually connected quantum bits Q1, Q2, Q3 respectively;
[0071] An exemplary explanation of how quantum algorithms are affected by the coherence time of qubits is as follows:
[0072] 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:
[0073] 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);
[0074] 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);
[0075] When Q1, Q2, and Q3 are connected in sequence, the quantum algorithm 1 needs to be equivalent to: H 1, 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).
[0076] Therefore, the design of quantum logic functions acting on quantum bits (including the design of whether quantum bits are used or not 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. Based on this, the present invention proposes a data generation method, device, quantum computing system, medium and electronic device, which aims to efficiently generate GF(2 k ), thereby accelerating the cracking of classic encryption algorithms.
[0077] See also Figure 2 , Figure 2 A flow chart of a data generation method provided by an embodiment of the present invention is applied to a classical computing unit, and the method includes:
[0078] Step 201: receiving a data generation task, wherein the data generation task is used to generate target data corresponding to input data;
[0079] 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.
[0080] 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=7x 7 +a6x 6 +5x 5 +4x 4 +3x 3 +2x 2 +1x 1 +0.
[0081] The target data may be, for example, GF(2 k ) multiplication result, the input data may, for example, include two polynomials to be multiplied, the highest degree of the polynomials being k-1; the two polynomials are respectively encoded with k data bits, and the quantum bits include 2k data bits.
[0082] Wherein, k is an integer greater than or equal to 1; for a polynomial, since its coefficients can only be 0 or 1, the coefficients of the polynomial can be encoded onto data bits through a NOT gate.
[0083] Step 202: constructing a quantum circuit corresponding to the data generation task based on a Toffoli gate and a preset backstage;
[0084] Specifically, the quantum bit also includes 2k-1 result bits; the quantum circuit corresponding to the data generation task is constructed based on the Toffoli gate and the preset debouncer, including:
[0085] Applying a Toffoli gate to the 2k data bits and the 2k-1 result bits to obtain a general multiplication circuit corresponding to the data generation task, wherein the data bits are control bits; and the general multiplication result of the two polynomials is mapped to the 2k-1 result bits;
[0086] The preset de-biter is applied to 2k-1 of the result bits to obtain a de-bit line corresponding to the data generation task, and the target data corresponding to the two polynomials are mapped to k of the result bits.
[0087] Since the highest degree of the polynomial is k-1, the highest degree of its multiplication result is 2(k-1) and the lowest degree is 0. Therefore, 2k-1 result bits are needed to store the multiplication result, and the total number of quantum bits required is 4k-1.
[0088] It should be noted that the highest degrees of the two polynomials can be different. For example, if one is k1-1 and the other is k2-1, the number of data bits required is k1+k2. Similarly, the number of result bits required later is k1+k2-1. The total number of quantum bits required is 2k1+2k2-1.
[0089] When a term in one polynomial is multiplied by a term in the other polynomial, the two terms can only be multiplied if their coefficients are both 1, so this can be achieved through a Toffoli gate. The Toffoli gate is composed of C-CNOT gates, i.e., control-control-not gates. The data bits encoding these two terms can be used as control bits in the Toffoli gate.
[0090] The preset decimal point reducer is used to reduce the order of the general multiplication result of the polynomial. The operation may reduce each term in the general multiplication result (also a polynomial) by one, two, or multiple times, which is not limited here. The general multiplication operation refers to the multiplication operation in the ordinary four arithmetic operations, which is different from the GF(2 k )Multiplication operation.
[0091] Step 203: sending the input data and the quantum circuit to a quantum computing unit, instructing the quantum computing unit to excite a quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data;
[0092] Specifically, the quantum bit is driven to evolve from an initial quantum state based on the quantum circuit to obtain a measurement result of the quantum bit, including applying a corresponding control waveform to a corresponding quantum bit according to information such as a quantum logic gate in the quantum circuit, a quantum bit acted on by the quantum logic gate, and an action timing, so as to drive the quantum bit to evolve from the initial quantum state. After the evolution is completed, a measurement waveform is applied to the corresponding quantum bit to obtain a feedback measurement result.
[0093] Step 204: Receive the measurement result sent by the quantum computing unit, and determine the target data corresponding to the input data based on the measurement result.
[0094] Specifically, determining the target data corresponding to the input data based on the measurement result includes parsing the measurement result to obtain the target data represented by the measurement result.
[0095] Compared with the prior art, the present invention receives a data generation task for generating target data corresponding to input data; then constructs a quantum circuit corresponding to the data generation task based on a Toffoli gate and a preset decoupling device; sends the input data and the quantum circuit to a quantum computing unit, instructs the quantum computing unit to excite a quantum bit to an initial quantum state, and drives the quantum bit to evolve from the initial quantum state based on the quantum circuit, thereby obtaining a measurement result of the quantum bit, wherein the initial quantum state includes a quantum state obtained by encoding the input data; finally, receives the measurement result sent by the quantum computing unit, and determines the target data corresponding to the input data based on the measurement result.
[0096] The present invention processes GF(2 k ), the classical computing unit focuses on the design of quantum circuits, and the quantum computing unit efficiently executes the quantum circuits, thus achieving GF(2 k ), which helps to accelerate the cracking of classic encryption algorithms.
[0097] Specifically, applying the Toffoli gate to the 2k data bits and 2k-1 result bits includes:
[0098] Iterative execution applies the Toffoli gate to a data bit a corresponding to one of the polynomials i , another data bit b corresponding to the polynomial j and the result bit c i+j , until i, j=k-1, the initial values of i, j are 0.
[0099] Wherein, i and j are integers greater than or equal to 0 and less than or equal to k-1. In the specific implementation program, it can be implemented through a double loop, which can be firstly set i=i+1, j unchanged, and execute the above steps to implement the first loop, and then when i=k-1, set j=j+1, execute the above steps to implement the second loop; or firstly set j=j+1, i unchanged, execute the above steps to implement the first loop, and then when j=k-1, set i=i+1, execute the above steps to implement the second loop; it is not limited here.
[0100] For example, for the polynomial x 5 With the polynomial x 8 To perform multiplication, we only need to apply the Toffoli gate to the code x 5Data bit a5, code x 8 Data bit b8 and result bit c 13 The measurement result bit c 13 You can get the multiplication result x 13 .
[0101] Furthermore, the method further comprises:
[0102] An irreducible polynomial is obtained, and the preset deregister is constructed based on the irreducible polynomial and a CONT gate.
[0103] In the implementation of GF(2 k ) in the modular removal operation, the irreducible polynomial to be removed is preset. k ), since the coefficients of the polynomial come from the binary field (1=-1), a preset de-biter can be constructed using a CNOT gate, in which the control bit and the controlled bit of the CNOT gate are determined based on the irreducible polynomial.
[0104] For example, the two polynomials to be multiplied are 1+x 2 and x 2 , using the Toffoli gate calculation in the above embodiment, the general product x can be obtained. 2 +x 4 . If the irreducible polynomial is 1+x 2 +x 3 =0, then the irreducible polynomial is equivalent to 1+x 2 =x 3 , execute the deregistration once, and get x 2 +x·(1+x 2 )=x+x 2 +x 3 ; Execute the backbiter again and get x+x 2 +1+x 2 =1+x, which achieves the reduction of order and obtains 1+x 2 and x 2 GF(2 k )The multiplication result is 1+x.
[0105] Specifically, constructing the preset deregister based on the irreducible polynomial and the CONT gate includes:
[0106] The preset deregistrator is obtained by using the quantum bit corresponding to the non-highest term in the irreducible polynomial as the controlled bit of the CNOT gate, and using the quantum bit corresponding to the highest term in the irreducible polynomial as the control bit of the CNOT gate.
[0107] Furthermore, the highest degree of the irreducible polynomial is k; the method of using the qubit corresponding to the non-highest term in the irreducible polynomial as the controlled bit of the CNOT gate, and using the qubit corresponding to the highest term in the irreducible polynomial as the control bit of the CNOT gate, comprises:
[0108] Iterative execution applies the CNOT gate to qubit m h and m k , until h = 0, the initial value of h is k-1, the m h is the controlled bit corresponding to the non-highest term in the irreducible polynomial, and the m k is the control bit corresponding to the highest term in the irreducible polynomial.
[0109] Among them, the control bits of multiple CNOT gates are all quantum bits corresponding to the highest term, and the controlled bits are quantum bits corresponding to the non-highest terms as the control bits of the CNOT gates. Therefore, the action timing of multiple CNOT gates does not affect the overall abdication operation. The above embodiment is one of the implementation methods provided by the present invention.
[0110] like Figure 3 As shown, Figure 3 A schematic diagram of the structure of a detent provided by an embodiment of the present invention. Figure 3 In the equation, the irreducible polynomial is 1+x 2 +x 3 =0, the irreducible polynomial is equivalent to 1+x 2 =x 3 Therefore, a CNOT gate can be applied to qubits m3 and m2, and a CNOT gate can be applied to qubits m3 and m0 to obtain a demutator, where qubit m3 is a control bit and qubits m2 and m0 are controlled bits. The timing relationship between the CNOT gate applied to qubits m3 and m2 and the CNOT gate applied to qubits m3 and m0 is not limited.
[0111] Specifically, the step of applying a preset backoff device to 2k-1 result bits to obtain a backoff line corresponding to the data generation task includes:
[0112] The k-1 preset delinquents are applied to the 2k-1 result bits to obtain the delinquent circuit corresponding to the data generation task.
[0113] More specifically, the step of applying k-1 preset backbiters to 2k-1 result bits includes:
[0114] The iterative execution acts on the preset de-biter on the 2k-1th to k-2-qth result bits until q=k-1, and the initial value of q is 0.
[0115] The preset de-biter is applied to the 2k-1th to k-2-qth result bits until q=k-1, i.e., the order is reduced from high to low layer by layer.
[0116] like Figure 4 As shown, Figure 4 A GF(2 k ) quantum circuit diagram corresponding to the multiplication operation. k = 3, the quantum circuit includes 3 data bits a2, a1, a0, which are used to encode one of the polynomials; it also includes 3 data bits b2, b1, b0, which are used to encode the other polynomial; it also includes 2×3-1=5 result bits c4, c3, c2, c1, c0, which are used to store the multiplication result of the two polynomials or GF(2 k )The result of the multiplication operation.
[0117] The two polynomials in the figure each include 3 terms, so 3 2 Toffoli gates, each acting on a data bit a i , a data bit b j and a result bit c i+j , the timing of action is not limited.
[0118] The highest order of the irreducible polynomial for constructing the backbiter is 3, so two backbiters are needed, each of which acts on 4 qubits. The backbiter is first applied to the result bits c4, c3, c2, c1, and then to the result bits c3, c2, c1, c0, so that the GF(2 k )The multiplication result is mapped to three result bits c2, c1, and c0.
[0119] See also Figure 5 , Figure 5 A flow chart of another data generation method provided by an embodiment of the present invention, which is applied to a quantum computing unit, includes:
[0120] Step 501: receiving input data sent by a classical computing unit and a quantum circuit corresponding to a data generation task, wherein the data generation task is used to generate target data corresponding to the input data, and the quantum circuit is constructed by the classical computing unit based on a Toffoli gate and a preset debouncer;
[0121] Step 502: Exciting the quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data;
[0122] Step 503: Send the measurement result to the classical computing unit, so that the classical computing unit determines the target data corresponding to the input data based on the measurement result.
[0123] Specifically, the input data includes two polynomials to be multiplied, and the highest degree of the polynomials is k-1; the quantum bits include 2k data bits and 2k-1 result bits; and exciting the quantum bits to an initial quantum state includes:
[0124] Excite k of the data bits to a first quantum state corresponding to one of the polynomials, excite another k of the data bits to a second quantum state corresponding to another of the polynomials, and excite 2k-1 of the result bits to a ground state.
[0125] For example, the two polynomials to be multiplied are 1+x 2 and x 2 , then the first quantum state is |101>, the second quantum state is |100>, the resulting quantum state of the bit is |00000>, and the initial quantum state is |00000100101>. Exciting a quantum bit to a certain quantum state can be achieved through an X-gate, for example, initializing all quantum bits to the ground state |0>, then determining the quantum bit that needs to be excited to the excited state |1>, and applying the control waveform corresponding to the X-gate to the quantum bit.
[0126] 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.
[0127] 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;
[0128] The classical computing unit is used to perform the following steps:
[0129] Receive a data generation task, where the data generation task is used to generate target data corresponding to input data;
[0130] Constructing a quantum circuit corresponding to the data generation task based on a Toffoli gate and a preset debouncer;
[0131] Sending the input data and the quantum circuit to a quantum computing unit, instructing the quantum computing unit to excite a quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data;
[0132] The measurement result sent by the quantum computing unit is received, and target data corresponding to the input data is determined based on the measurement result.
[0133] The quantum computing unit is used to perform the following steps:
[0134] Receiving input data sent by a classical computing unit and a quantum circuit corresponding to a data generation task, wherein the data generation task is used to generate target data corresponding to the input data, and the quantum circuit is constructed by the classical computing unit based on a Toffoli gate and a preset debouncer;
[0135] Exciting the quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state corresponding to the input data;
[0136] The measurement result is sent to the classical computing unit, so that the classical computing unit determines the target data corresponding to the input data based on the measurement result.
[0137] See also Figure 6 , Figure 6 A schematic diagram of the structure of a data generation device provided by an embodiment of the present invention, which is applied to a classical computing unit, includes:
[0138] A receiving module 601 is used to receive a data generation task, where the data generation task is used to generate target data corresponding to input data;
[0139] A construction module 602 is used to construct a quantum circuit corresponding to the data generation task based on a Toffoli gate and a preset backstage;
[0140] A sending module 603 is used to send the input data and the quantum circuit to a quantum computing unit, instruct the quantum computing unit to excite the quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data;
[0141] The receiving module 601 is further used to receive the measurement result sent by the quantum computing unit, and determine the target data corresponding to the input data based on the measurement result.
[0142] See also Figure 7 , Figure 7 A schematic diagram of the structure of another data generating device provided by an embodiment of the present invention, which is applied to a quantum computing unit, includes:
[0143] A receiving module 701 is used to receive input data sent by a classical computing unit and a quantum circuit corresponding to a data generation task, wherein the data generation task is used to generate target data corresponding to the input data, and the quantum circuit is constructed by the classical computing unit based on a Toffoli gate and a preset debouncer;
[0144] A computing module 702 is used to excite the quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state corresponding to the input data;
[0145] The sending module 703 is used to send the measurement result to the classical computing unit, so that the classical computing unit determines the target data corresponding to the input data based on the measurement result.
[0146] Regarding the specific functions and effects achieved by the data generation device, reference can be made to other embodiments of this specification for comparative explanation, and no further description is given here. Each module in the data generation device can be implemented in whole or in part by software, hardware, and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0147] See also Figure 8 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 data generation method in any of the above embodiments when executing the computer program. Figure 8 , the computer device may be a classical computer. The computer device may also be a quantum computer.
[0148] The embodiments of the present 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 data generating method in any of the above embodiments.
[0149] The embodiments of the present specification also provide a computer program product including instructions, which, when executed by a computer, enables the computer to execute the data generation method in any of the above embodiments.
[0150] 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.
[0151] 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.
[0152] 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.
[0153] 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.
[0154] 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 disclosed methods, steps and logic block diagrams 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, etc. 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.
[0155] 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.
[0156] 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.
[0157] 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.
[0158] 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.
[0159] 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.
[0160] 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.
[0161] 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.
[0162] 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 data generation method, characterized in that: Applied to a classical computing unit, the method comprises: Receive a data generation task, where the data generation task is used to generate target data corresponding to input data; Constructing a quantum circuit corresponding to the data generation task based on a Toffoli gate and a preset debouncer; Sending the input data and the quantum circuit to a quantum computing unit, instructing the quantum computing unit to excite a quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data; The measurement result sent by the quantum computing unit is received, and target data corresponding to the input data is determined based on the measurement result.
2. The method according to claim 1, characterized in that The input data includes two polynomials to be multiplied, and the highest degree of the polynomials is k-1; the two polynomials are respectively encoded with k data bits, and the quantum bits include 2k data bits.
3. The method according to claim 2, characterized in that The quantum bit also includes 2k-1 result bits; the quantum circuit corresponding to the data generation task is constructed based on the Toffoli gate and the preset debouncer, including: Applying a Toffoli gate to the 2k data bits and the 2k-1 result bits to obtain a general multiplication circuit corresponding to the data generation task, wherein the data bits are control bits; and the general multiplication result of the two polynomials is mapped to the 2k-1 result bits; The preset de-biter is applied to 2k-1 of the result bits to obtain a de-bit line corresponding to the data generation task, and the target data corresponding to the two polynomials are mapped to k of the result bits.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: An irreducible polynomial is obtained, and the preset deregister is constructed based on the irreducible polynomial and a CONT gate.
5. The method according to claim 4, characterized in that The step of constructing the preset backbiter based on the irreducible polynomial and the CONT gate comprises: The preset deregistrator is obtained by using the quantum bit corresponding to the non-highest term in the irreducible polynomial as the controlled bit of the CNOT gate, and using the quantum bit corresponding to the highest term in the irreducible polynomial as the control bit of the CNOT gate.
6. A data generation method, characterized in that: Applied to a quantum computing unit, the method comprises: Receiving input data sent by a classical computing unit and a quantum circuit corresponding to a data generation task, wherein the data generation task is used to generate target data corresponding to the input data, and the quantum circuit is constructed by the classical computing unit based on a Toffoli gate and a preset debouncer; Exciting a quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data; The measurement result is sent to the classical computing unit, so that the classical computing unit determines the target data corresponding to the input data based on the measurement result.
7. The method according to claim 6, characterized in that The input data includes two polynomials to be multiplied, and the highest degree of the polynomials is k-1; the quantum bits include 2k data bits and 2k-1 result bits; and exciting the quantum bits to an initial quantum state includes: Excite k of the data bits to a first quantum state corresponding to one of the polynomials, excite another k of the data bits to a second quantum state corresponding to another of the polynomials, and excite 2k-1 of the result bits to a ground state.
8. 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: Receive a data generation task, where the data generation task is used to generate target data corresponding to input data; Constructing a quantum circuit corresponding to the data generation task based on a Toffoli gate and a preset debouncer; Sending the input data and the quantum circuit to a quantum computing unit, instructing the quantum computing unit to excite a quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data; The measurement result sent by the quantum computing unit is received, and target data corresponding to the input data is determined based on the measurement result. The quantum computing unit is used to perform the following steps: Receiving input data sent by a classical computing unit and a quantum circuit corresponding to a data generation task, wherein the data generation task is used to generate target data corresponding to the input data, and the quantum circuit is constructed by the classical computing unit based on a Toffoli gate and a preset debouncer; Exciting the quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state corresponding to the input data; The measurement result is sent to the classical computing unit, so that the classical computing unit determines the target data corresponding to the input data based on the measurement result.
9. A data generating device, characterized in that: Applied to a classical computing unit, the device comprises: A receiving module, used for receiving a data generation task, wherein the data generation task is used for generating target data corresponding to the input data; A construction module, used to construct a quantum circuit corresponding to the data generation task based on a Toffoli gate and a preset decoupling device; A sending module, used to send the input data and the quantum circuit to a quantum computing unit, instruct the quantum computing unit to excite the quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state obtained by encoding the input data; The receiving module is further used to receive the measurement result sent by the quantum computing unit, and determine the target data corresponding to the input data based on the measurement result.
10. A data generating device, characterized in that: Applied to a quantum computing unit, the device comprises: A receiving module, used for receiving input data sent by a classical computing unit and a quantum circuit corresponding to a data generation task, wherein the data generation task is used to generate target data corresponding to the input data, and the quantum circuit is constructed by the classical computing unit based on a Toffoli gate and a preset debouncer; A computing module, configured to excite a quantum bit to an initial quantum state, 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, wherein the initial quantum state includes a quantum state corresponding to the input data; A sending module is used to send the measurement result to the classical computing unit, so that the classical computing unit determines the target data corresponding to the input data based on the measurement result.
11. 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 7 when executed.
12. 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 7.
Citation Information
Patent Citations
Realization method of AES encryption system hardware module based on quantum reversible logic
CN108650076A
AES hardware encryption system implementation method based on quantum reversible circuit
CN110120867A
Finite field discrete logarithm quantum solving line optimization construction method
CN110417545A
Quantum multiplication operation method and device, electronic device and storage medium
CN112114776A
Method for realizing AES S-box quantum circuit
CN114239839A
