A quantum simulation method and device for an operation to be executed
The quantum simulation method simplifies quantum circuit design by using operation identifiers and bit pairs to perform and invert operations, addressing the lack of basic functions in quantum computers and enhancing their computational capabilities.
Patent Information
- Application Number
- CN202310771107.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-21
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2040-01-21
AI Technical Summary
Due to the limitations of the development of quantum chip hardware, existing quantum computers are unable to effectively implement basic arithmetic operations and elementary function operations, resulting in limited quantum computing research and application.
By obtaining operation identifiers and auxiliary identifiers, using the quantum state space of the qubits, perform specific operations or inverse operations according to the transposed conjugate state, establish the relationship between the operation object and the qubits, and realize basic arithmetic operations such as addition, subtraction, multiplication, and division, and simulation of primary functions such as power functions and exponential functions.
It realizes the simulation of basic arithmetic operations and elementary function operations in quantum circuits, fills the gap in the existing technology, and improves the efficiency and application potential of quantum computing.
Smart Images

Figure CN116796848B_ABST
Abstract
Description
[0001] This application is a divisional application of an application with an application date of January 21, 2020, an application number of 202010072072.2, and a patent title of "A Quantum Simulation Method and Device for Operations to be Executed". Technical Field
[0002] The present invention belongs to the field of quantum computing, and particularly relates to a quantum simulation method and device for operations to be executed, an electronic device, and a storage medium. Background Art
[0003] Quantum computers utilize the superposition property of quantum bits and theoretically have the ability of exponential acceleration in certain cases. For example, it takes hundreds of years to crack RSA keys on classical computers, while it only takes a few hours to execute quantum algorithms on quantum computers. However, currently, the number of qubits that can be manipulated by quantum computers is limited due to the development of quantum chip hardware, so the computing power is limited and quantum algorithms cannot be generally run. Generally running quantum algorithms usually requires the help of quantum computing simulation methods.
[0004] In the process of simulating and implementing quantum algorithms, various quantum logic gates are usually used to construct quantum algorithms. However, when constructing quantum algorithms only relying on various quantum logic gates, there are no quantum logic gate operations corresponding to numerical values such as basic arithmetic operations like addition, subtraction, multiplication, and division and their corresponding inverse operations, nor are there quantum logic gate operations that can implement numerical basic elementary function operations such as power functions, exponential functions, logarithmic functions, trigonometric functions, and inverse trigonometric functions and their corresponding inverse operations. And when relying on various quantum logic gates to construct equivalent quantum logic gates to achieve the above-described corresponding functions, the number of various quantum logic gates required is huge, and the quantum circuit corresponding to the constructed quantum algorithm is too complex, seriously hindering the research of quantum computing.
[0005] Therefore, there is an urgent need to provide a quantum simulation method for simulating the above functional operation operations in a quantum circuit to fill the related technical gaps. Summary of the Invention
[0006] The purpose of the present invention is to provide a quantum simulation method and device for operations to be executed, an electronic device, and a storage medium to solve the deficiencies in the prior art. It can fill the related technical gaps and be used to simulate operations to be executed in a quantum circuit.
[0007] The technical solution adopted by the present invention is as follows:
[0008] A quantum simulation method for operations to be executed, the method comprising:
[0009] Obtaining an operation identifier, where the operation identifier is used to represent the specific operation corresponding to the operation to be executed;
[0010] Obtain an auxiliary identifier, which is used to indicate whether the operation to be executed is in the transpose conjugate state;
[0011] Obtain a set of qubits and the quantum state space they represent; the set of qubits includes a first qubit and a second qubit; the first qubit is used to represent the operation object of the specific operation, and the second qubit is used to represent the operation object of the specific operation and / or represent the operation result of the specific operation;
[0012] According to whether the operation to be executed is in the transpose conjugate state, perform the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit and / or the value corresponding to the sub-quantum state representing the second qubit in each eigenstate of the quantum state space.
[0013] The quantum simulation method for the operation to be executed as described above, wherein, preferably, the specific operation is for the operation of two operation objects;
[0014] The first qubit is used to represent an operation object of the specific operation, and the second qubit is used to represent another operation object of the specific operation and represent the operation result of the specific operation.
[0015] The quantum simulation method for the operation to be executed as described above, wherein, preferably, the specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
[0016] The quantum simulation method for the operation to be executed as described above, wherein, preferably, the performing the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit and / or the value corresponding to the sub-quantum state representing the second qubit in each eigenstate of the quantum state space according to whether the operation to be executed is in the transpose conjugate state specifically includes:
[0017] Judge whether the operation to be executed is in the transpose conjugate state according to the auxiliary identifier;
[0018] When the operation to be executed is not in the transpose conjugate state, perform the specific operation on the value corresponding to the sub-quantum state representing the first qubit and the value corresponding to the sub-quantum state representing the second qubit in each eigenstate of the quantum state space, and code the operation result to the second qubit.
[0019] The quantum simulation method of the operation to be executed as described above, wherein, preferably, when the operation to be executed is in the transpose conjugate state, the inverse operation of the specific operation is performed on the value corresponding to the sub-quantum state representing the first qubit and the value corresponding to the sub-quantum state representing the second qubit in each eigenstate of the quantum state space, and the operation result is encoded into the second qubit.
[0020] The quantum simulation method of the operation to be executed as described above, wherein, preferably, the specific operation is used for the operation of two operation objects;
[0021] The first qubit is used to represent the two operation objects of the specific operation, and the second qubit is used to represent the operation result of the specific operation.
[0022] The quantum simulation method of the operation to be executed as described above, wherein, preferably, the specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
[0023] The quantum simulation method of the operation to be executed as described above, wherein, preferably, according to whether the operation to be executed is in the transpose conjugate state, performing the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit and / or the value corresponding to the sub-quantum state representing the second qubit in each eigenstate of the quantum state space specifically includes:
[0024] Judging whether the operation to be executed is in the transpose conjugate state according to the auxiliary identifier;
[0025] When the operation to be executed is not in the transpose conjugate state, performing the specific operation on the value corresponding to the sub-quantum state representing the first qubit in each eigenstate of the quantum state space, and encoding the operation result into the second qubit.
[0026] The quantum simulation method of the operation to be executed as described above, wherein, preferably, when the operation to be executed is in the transpose conjugate state, the sub-quantum state representing the second qubit in each eigenstate of the quantum state space is restored to the initial sub-quantum state.
[0027] The quantum simulation method of the operation to be executed as described above, wherein, preferably, the specific operation is used for the operation of one operation object;
[0028] The first qubit is used to represent one operation object of the specific operation, and the second qubit is used to represent the operation result of the specific operation.
[0029] The quantum simulation method for the operation to be executed as described above, wherein, preferably, the specific operation is one of power function operation, exponential function operation, logarithmic function operation, trigonometric function operation, and inverse trigonometric function operation.
[0030] The quantum simulation method for the operation to be executed as described above, wherein, preferably, according to whether the operation to be executed is in the conjugate transpose state, performing the specific operation or the inverse operation of the specific operation on the value corresponding to the sub - quantum state representing the first qubit in each eigenstate of the quantum state space and / or the value corresponding to the sub - quantum state representing the second qubit, specifically including:
[0031] Judging whether the operation to be executed is in the conjugate transpose state according to the auxiliary identifier;
[0032] When the operation to be executed is not in the conjugate transpose state, performing the specific operation on the value corresponding to the sub - quantum state representing the first qubit in each eigenstate of the quantum state space, and encoding the operation result to the second qubit.
[0033] The quantum simulation method for the operation to be executed as described above, wherein, preferably, when the operation to be executed is in the conjugate transpose state, restoring the sub - quantum state representing the second qubit in each eigenstate of the quantum state space to the initial sub - quantum state.
[0034] A quantum simulation device for the operation to be executed, the device includes:
[0035] An operation identifier acquisition module, configured to acquire an operation identifier, where the operation identifier is used to represent the specific operation corresponding to the operation to be executed;
[0036] An auxiliary identifier acquisition module, configured to acquire an auxiliary identifier, where the auxiliary identifier is used to represent whether the operation to be executed is in the conjugate transpose state;
[0037] A first acquisition module, connected to the operation identifier acquisition module, configured to acquire a set of qubits and the quantum state space they represent; the set of qubits includes a first qubit and a second qubit; the first qubit is used to represent the operation object of the specific operation, and the second qubit is used to represent the operation object of the specific operation and / or represent the operation result of the specific operation;
[0038] An operation module, connected to the auxiliary identifier acquisition module and the first acquisition module, configured to perform the specific operation or the inverse operation of the specific operation on the value corresponding to the sub - quantum state representing the first qubit in each eigenstate of the quantum state space and / or the value corresponding to the sub - quantum state representing the second qubit according to whether the operation to be executed is in the conjugate transpose state.
[0039] The specific operation is for the operation of two operands;
[0040] The first qubit is used to represent one operand of the specific operation, and the second qubit is used to represent the other operand of the specific operation and the operation result of the specific operation.
[0041] The specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
[0042] Specifically, the operation module is specifically used for:
[0043] Judging whether the operation to be executed is in the transpose conjugate state according to the auxiliary identifier;
[0044] When the operation to be executed is not in the transpose conjugate state, perform the specific operation on the value corresponding to the sub-quantum state representing the first qubit and the value corresponding to the sub-quantum state of the second qubit in each eigenstate of the quantum state space, and code the operation result to the second qubit.
[0045] When the operation to be executed is in the transpose conjugate state, perform the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit and the value corresponding to the sub-quantum state of the second qubit in each eigenstate of the quantum state space, and code the operation result to the second qubit.
[0046] The specific operation is for the operation of two operands;
[0047] The first qubit is used to represent the two operands of the specific operation, and the second qubit is used to represent the operation result of the specific operation.
[0048] The specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
[0049] Judging whether the operation to be executed is in the transpose conjugate state according to the auxiliary identifier;
[0050] When the operation to be executed is not in the transpose conjugate state, perform the specific operation on the value corresponding to the sub-quantum state representing the first qubit in each eigenstate of the quantum state space, and code the operation result to the second qubit.
[0051] When the operation to be executed is in the transpose conjugate state, restore the sub-quantum state representing the second qubit in each eigenstate of the quantum state space to the initial sub-quantum state.
[0052] The specific operation is used for the operation of one operand;
[0053] The first qubit is used to represent one operand of the specific operation, and the second qubit is used to represent the operation result of the specific operation.
[0054] The specific operation is one of power function operation, exponential function operation, logarithmic function operation, trigonometric function operation and inverse trigonometric function operation.
[0055] Performing the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit and / or the value corresponding to the sub-quantum state representing the second qubit in each eigenstate of the quantum state space according to whether the to-be-executed operation is in the conjugate transpose state specifically includes:
[0056] Judging whether the to-be-executed operation is in the conjugate transpose state according to the auxiliary identifier;
[0057] When the to-be-executed operation is not in the conjugate transpose state, performing the specific operation on the value corresponding to the sub-quantum state representing the first qubit in each eigenstate of the quantum state space, and encoding the operation result to the second qubit.
[0058] When the to-be-executed operation is in the conjugate transpose state, restoring the sub-quantum state representing the second qubit in each eigenstate of the quantum state space to the initial sub-quantum state.
[0059] An electronic device includes a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the method described in any one of the above.
[0060] A storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of the above when running.
[0061] Compared with the prior art, the quantum simulation method for the operation to be executed provided by the present invention establishes the relationship between the operation object of the specific operation to be executed and the quantum bit positions, specifically: the group of quantum bit positions includes a first quantum bit position and a second quantum bit position; the first quantum bit position is used to represent the operation object of the specific operation, and the second quantum bit position is used to represent the operation object of the specific operation and / or represent the operation result of the specific operation; and according to the transpose conjugate state of the operation to be executed, the specific operation or the inverse operation of the specific operation is performed on the numerical value corresponding to the sub-quantum state representing the first quantum bit position and / or the numerical value corresponding to the sub-quantum state of the second quantum bit position in each eigenstate of the quantum state space of a quantum bit position. Furthermore, through the operation on the numerical value corresponding to the quantum state, the simulation of the operation to be executed that supports the specific operation or the inverse operation of the specific operation is realized, so that the operation to be executed has the characteristic of supporting unitary transformation similar to a quantum logic gate, and further the simulation of the operation to be executed corresponding to the specific operation in the quantum circuit is realized, filling the gap in the related art. Description of the Drawings
[0062] Figure 1 is a hardware structure block diagram of a computer terminal for the quantum simulation method of an operation to be executed provided by an embodiment of the present application;
[0063] Figure 2 is a schematic flowchart of the quantum simulation method of the operation to be executed provided by an embodiment of the present invention;
[0064] Figure 3 is a schematic structural diagram of a quantum simulation device for an operation to be executed provided by an embodiment of the present invention;
[0065] Figure 4 is a schematic structural diagram of another quantum simulation device for an operation to be executed provided by an embodiment of the present invention;
[0066] Figure 5 is a schematic structural diagram of another quantum simulation device for an operation to be executed provided by an embodiment of the present invention;
[0067] Figure 6 is a schematic structural diagram of yet another quantum simulation device for an operation to be executed provided by an embodiment of the present invention. Detailed Embodiments
[0068] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention and should not be construed as limiting the present invention.
[0069] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence.
[0070] Embodiments of the present invention provide a method for realizing quantum simulation of an operation to be executed, which is used to simulate the operation to be executed in a quantum circuit. Among them, the operation to be executed corresponds to a specific operation. This method can be applied to electronic devices, such as mobile terminals, specifically mobile phones, tablet computers; such as computer terminals, specifically ordinary computers, quantum computers, etc.
[0071] The following takes running on a computer terminal as an example to illustrate it in detail. Figure 1 It is a block diagram of the hardware structure for quantum computing simulation according to an embodiment of the present application. As Figure 1 shown, the computer terminal 10 may include one or more ( Figure 1 only one is shown in Figure 1 figures) processors 102 (the processor 102 may include, but is not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the above computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown in Figure 1 figures is only schematic and does not limit the structure of the above computer terminal. For example, the computer terminal 10 may further include more or fewer components than
[0072] shown in
[0073] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0074] It should be noted that a real quantum computer has a hybrid structure, which includes two major parts: one is a classical computer, responsible for performing classical calculations and controls; the other is a quantum device, responsible for running quantum programs to achieve quantum computing. A quantum program is a series of instructions that can run on a quantum computer and is written in a quantum language such as the QRunes language, which supports operations on quantum logic gates and ultimately realizes quantum computing. Specifically, a quantum program is a series of instruction sequences that operate on quantum logic gates in a certain time sequence.
[0075] In practical applications, due to the limitation of the development of quantum device hardware, quantum computing simulation is usually required to verify quantum algorithms, quantum applications, etc. Quantum computing simulation is a process of simulating the operation of a quantum program corresponding to a specific problem by means of a virtual architecture (i.e., a quantum virtual machine) built with the resources of a general-purpose computer. Usually, a quantum program corresponding to a specific problem needs to be constructed. The quantum program referred to in the embodiments of the present invention is a program written in a classical language that represents qubits and their evolution, where qubits, quantum logic gates, etc. related to quantum computing are all represented by corresponding classical codes.
[0076] As a manifestation of a quantum program, a quantum circuit, also known as a quantum logic circuit, is the most commonly used general quantum computing model, which represents a circuit for operating on qubits under an abstract concept. Its composition includes qubits, a circuit (timeline), and various quantum logic gates. Finally, the result often needs to be read out through a quantum measurement operation.
[0077] Different from traditional circuits that are connected by metal wires to transmit voltage signals or current signals, in a quantum circuit, the circuit can be regarded as being connected by time, that is, the state of the qubit evolves naturally over time, and during this process, it is operated according to the instructions of the Hamiltonian operator until it encounters a logic gate.
[0078] Overall, a quantum program corresponds to a total quantum circuit. The quantum program in the present invention refers to this total quantum circuit. Among them, the total number of qubits in the total quantum circuit is the same as the total number of qubits in the quantum program. It can be understood that a quantum program can be composed of a quantum circuit, measurement operations for qubits in the quantum circuit, registers for storing measurement results, and control flow nodes (jump instructions). A quantum circuit can include dozens, hundreds, or even thousands of quantum logic gate operations. The execution process of a quantum program is a process of executing all quantum logic gates in a certain time sequence. It should be noted that the time sequence is the time order in which a single quantum logic gate is executed.
[0079] It should be noted that in classical computing, the most basic unit is a bit, and the most basic control mode is a logic gate. The purpose of controlling a circuit can be achieved through the combination of logic gates. Similarly, the way to process qubits is a quantum logic gate. Using a quantum logic gate can cause the evolution of a quantum state. A quantum logic gate is the basis for constructing a quantum circuit. Quantum logic gates include single-qubit quantum logic gates, such as the Hadamard gate (H gate), Pauli-X gate, Pauli-Y gate, Pauli-Z gate, RX gate, RY gate, RZ gate; multi-qubit quantum logic gates, such as the CNOT gate, CR gate, iSWAP gate, Toffoli gate. Quantum logic gates are generally represented by unitary matrices, and a unitary matrix is not only in matrix form but also an operation and transformation.
[0080] Currently, there is no combination of quantum logic gates that can implement some classical operations, such as the four arithmetic operations, exemplary: addition, subtraction, multiplication, and division operations, or basic elementary function operations, exemplary: power function, exponential function, logarithmic function, trigonometric function, and inverse trigonometric function, etc. To implement the above functions in a quantum program, a large number of the above common logic gates are usually used to construct a complex quantum circuit to achieve the target function operation, which seriously affects the development of quantum computing and the expansion and implementation of the quantum application field. The quantum implementation of the above functions can play a role in verifying the construction of quantum programs and the solution of complex quantum computing problems.
[0081] As Figure 2 shown, the embodiment of the present invention provides a schematic flowchart of a quantum simulation method for an operation to be executed. The method includes:
[0082] S201: Obtain an operation identifier, where the operation identifier is used to represent the specific operation corresponding to the operation to be executed.
[0083] An operation identifier refers to a symbol used to identify a specific operation, and different symbols represent different operations. In quantum simulation operations, the corresponding operation identifier can be set according to the meaning of the specific operation of the classical arithmetic operation to be simulated (i.e., the operation to be performed). Among them, the classical arithmetic operation can be a basic arithmetic operation, a basic elementary function operation, etc.
[0084] Specifically, when the classical arithmetic operation to be simulated is a basic arithmetic operation including addition, subtraction, multiplication, and division, or a basic elementary function including power function, exponential function, logarithmic function, trigonometric function, and inverse trigonometric function, the operation identifier can be set according to the classical arithmetic operation to be performed.
[0085] Exemplarily, when the classical arithmetic operation to be simulated is a basic arithmetic operation setting, the operation identifier can be set to "O M ", where "O" is a representation of this type of operation to be performed for basic arithmetic operations, without a specific meaning itself, and can also be represented by other letters; "M" represents the specific type of basic arithmetic operation, and the two together form an operation identifier.
[0086] Exemplarily, when the operation to be performed is an addition operation, the operation identifier is set to "O add ", which represents that the specific operation to be performed is an addition operation; when the operation to be performed is a subtraction operation, the operation identifier "O sub " is set, which represents that the specific operation to be performed is a subtraction operation; when the operation to be performed is a multiplication operation, the operation identifier "O multi " is set, which represents that the specific operation to be performed is a multiplication operation; when the operation to be performed is a division operation, the operation identifier "O div " is set, which represents that the specific operation to be performed is a division operation.
[0087] Another exemplarily, when the specific operation to be performed is a basic elementary function operation, the operation identifier "A y " can be set to represent it. Among them, "A" is a representation of this type of operation to be performed for basic elementary functions, without a specific meaning itself, and can also be represented by other letters; "y" represents the specific basic function, and the two together form an operation identifier.
[0088] Exemplarily, when y = sinx, the operation identifier "Asinx" represents the sine trigonometric function operation.
[0089] The representation forms of the operation identifiers for the remaining elementary function operations are similar to those of the trigonometric function operation identifiers, and will not be elaborated here.
[0090] S202: Obtain an auxiliary identifier, and the auxiliary identifier is used to indicate whether the operation to be performed is in a transpose conjugate state.
[0091] Specifically, the auxiliary identifier can be obtained as the information carried by the operation identifier. Exemplarily, the auxiliary identifier can be a symbol in the upper right corner of the operation identifier.
[0092] Meanwhile, the auxiliary identifier has two states, which are respectively used to indicate that the operation to be executed is not in the transpose conjugate state and that the operation to be executed is in the transpose conjugate state.
[0093] Optionally, the symbol has two states: non - existent state and existent state. The former is used to indicate that the operation to be executed is not in the transpose conjugate state, and the latter is used to indicate that the operation to be executed is in the transpose conjugate state.
[0094] Optionally, the former state of non - existence can be represented by 0 or by omitting to display any information; the latter state of existence can be represented by 1 or a specified symbol label; where the specified symbol can be identical to the identifier of the transpose conjugate state of the quantum logic gate (read as Dagger).
[0095] When the auxiliary identifier is a symbol in the upper right corner of the operation identifier, and when the non - transpose - conjugate state of the operation to be executed is represented by omitting to display any information, and the transpose - conjugate state of the operation to be executed is represented by, obtaining the auxiliary identifier can be understood as judging whether there is a symbol in the upper right corner of the operation identifier, and judging whether the operation to be executed is in the transpose conjugate state according to the existence or non - existence of the symbol.
[0096] S203: Obtain a set of quantum bit positions and the quantum state space they represent; the set of quantum bit positions includes a first quantum bit position and a second quantum bit position; the first quantum bit position is used to represent the operation object of the specific operation, and the second quantum bit position is used to represent the operation object of the specific operation and / or represent the operation result of the specific operation.
[0097] Specifically, the quantum state space represented by a quantum bit position refers to the quantum state information carried by the quantum bit position and characterized by all the eigenstates of the quantum bit position. Among them, the number of all eigenstates corresponding to the quantum bit position is 2 to the power of the number of quantum bit positions, and the quantum state information characterized by all eigenstates is the linear superposition of all eigenstates.
[0098] For example, a set of qubits is q0, q1, q2, representing the 0th, 1st, and 2nd qubits. Sorted from the highest bit to the lowest bit as q2q1q0, there are a total of 8 eigenstates corresponding to this set of qubit positions, which are: |000>, |001>, |010>, |011>, |100>, |101>, |110>, |111>. The superposition states between these 8 eigenstates together form the quantum state space ψ:
[0099] ψ = 0|000> + a1|001> + a2|010> + a3|011> + a4|100> + a5|101> + 6|110> + a7|111>, where a0, a1, a2, a3, a4, a5, a6, a7 are all complex numbers, and
[0100] Obtaining a set of qubit positions is implemented through user input, and the number of qubits in this set can be set according to the basic operations to be performed. In a quantum circuit, this set of qubit positions is a qubit with an initial state or a qubit carrying the information of the evolved quantum state.
[0101] As the connection bridge between the specific operations corresponding to the operations to be simulated and the qubit positions, this set of qubit positions includes a first qubit and a second qubit. The first qubit is used to represent the operation object of the specific operation, and the second qubit is used to represent the operation object of the specific operation and / or represent the operation result of the specific operation.
[0102] Among them, it can be understood that the operation object obtains the operation result through a specific operation. Therefore, when the second qubit is used to represent the operation object of the specific operation and represent the operation result of the specific operation, it means that the bit storing the operation result is the bit representing an operation object of the basic arithmetic operation. That is, the second qubit has the dual role of storing the operation object and the operation result before and after the specific operation.
[0103] When the second qubit has the dual role of storing the operation object and the operation result before and after the specific operation, on the one hand, it reduces the number of qubits required to simulate the basic arithmetic operation; on the other hand, it facilitates the simulation of the inverse operation of the basic arithmetic operation.
[0104] S204: According to whether the operation to be performed is in the conjugate transpose state, perform the specific operation or the inverse operation of the specific operation on the value corresponding to the sub - quantum state representing the first qubit and / or the value corresponding to the sub - quantum state representing the second qubit in each eigenstate of the quantum state space.
[0105] As described above, the auxiliary identifier is used to indicate whether the operation to be performed is in the conjugate transpose state; during the specific operation, it is possible to determine whether the operation to be performed is in the conjugate transpose state according to the auxiliary identifier; then, according to the determination result, perform the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit in each eigenstate of the quantum state space and / or the value corresponding to the sub-quantum state representing the second qubit.
[0106] Through steps S201 to S204, the relationship between the operation object of the specific operation to be performed and the qubits is established. Specifically: the set of qubits includes a first qubit and a second qubit; the first qubit is used to represent the operation object of the specific operation, and the second qubit is used to represent the operation object of the specific operation and / or represent the operation result of the specific operation; and according to the conjugate transpose state of the operation to be performed, perform the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit in each eigenstate of the quantum state space of a qubit and / or the value corresponding to the sub-quantum state representing the second qubit. Furthermore, through the operation of the values corresponding to the quantum states, the simulation of the operation to be performed that supports the specific operation or the inverse operation of the specific operation is realized, so that the operation to be performed has the characteristic of supporting unitary transformation analogous to a quantum logic gate, and further the simulation of the operation to be performed corresponding to the specific operation in the quantum circuit is realized, filling the gap in the related technology.
[0107] As a specific implementation of the above quantum simulation method of the operation to be performed, the specific operation is for the operation of two operation objects, the first qubit is used to represent one operation object of the specific operation, and the second qubit is used to represent the other operation object of the specific operation and represent the operation result of the specific operation. Among them, the specific operation is one of addition operation, subtraction operation, multiplication operation, and division operation.
[0108] Then, the step S204 of performing the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit in each eigenstate of the quantum state space and / or the value corresponding to the sub-quantum state representing the second qubit according to whether the operation to be performed is in the conjugate transpose state specifically includes:
[0109] S2041: Determine whether the operation to be performed is in the conjugate transpose state according to the auxiliary identifier.
[0110] Specifically, the auxiliary identifier can be obtained as the information carried by the operation identifier. Exemplarily, the auxiliary identifier can be a symbol in the upper right corner of the operation identifier.
[0111] Meanwhile, the auxiliary identifier has two states, which are used to represent that the operation to be executed is not in the conjugate transpose state and that the operation to be executed is in the conjugate transpose state, respectively.
[0112] Optionally, the symbol has two states: the non-existence state and the existence state. The former is used to represent that the operation to be executed is not in the conjugate transpose state, and the latter is used to represent that the operation to be executed is in the conjugate transpose state.
[0113] Optionally, the former representing the non-existence state can be represented by 0 or by omitting to display any information; the latter representing the existence state can be represented by 1 or a specified symbol label; where the specified symbol can be consistent with the identifier of the conjugate transpose state of the quantum logic gate (read as Dagger).
[0114] When the auxiliary identifier is a symbol in the upper right corner of the operation identifier, and when the operation to be executed is represented as not being in the conjugate transpose state by omitting to display any information, and is represented as being in the conjugate transpose state by obtaining the auxiliary identifier, it can be understood as judging whether there is a symbol in the upper right corner of the operation identifier, and judging whether the operation to be executed is in the conjugate transpose state according to the existence or non-existence of the symbol. If it exists, it means that the operation to be executed is in the conjugate transpose state; if it does not exist, it means that the operation to be executed is not in the conjugate transpose state.
[0115] S2042: When the operation to be executed is not in the conjugate transpose state, perform the specific operation on the values corresponding to the sub-quantum states representing the first qubit and the values corresponding to the sub-quantum states of the second qubit position in each eigenstate of the quantum state space, and code the operation result to the second qubit position.
[0116] Exemplarily, taking the addition operation as an example for specific illustration, for the basic arithmetic operation O add to be executed, the effect to be achieved is: |>|b> → |a + b>|>. Where a and b are decimal numbers. Then the implementation process is as follows:
[0117] a. Obtain a set of qubits q0, q1, q2, q3, q4, q5, q6, q7, q8 input by the user. Representing the qubits from the 0th to the 8th position, sorted from the highest bit to the lowest bit as q8q7q6q5q4q3q2q1q0, where q3q2q1q0 is specified as the first qubit position for encoding a; q7q6q5q4 is specified as the second qubit position for encoding b before the specific operation and the operation result of a + b after the specific operation;
[0118] b. For the 2 9 = 512 eigenstates corresponding to this set of qubits, obtain the sub - quantum states corresponding to q3q2q1q0 and q7q6q5q4 respectively;
[0119] c. Perform an addition operation on the values corresponding to each sub - quantum state, and encode the operation result into the second qubit position, that is, encode it into q7q6q5q4.
[0120] It should be noted that the values corresponding to each sub - quantum state used for the addition operation in the above process can be binary values or decimal values. When it is a decimal value, the storage implementation of the decimal number on the quantum state can be simply described as converting the decimal number into a binary number and encoding the binary number onto the qubits with a specified number of bits. The specified number of bits can be equal to the number of bits of the binary number or greater than the number of bits of the binary number to ensure the storage accuracy of the decimal number.
[0121] It should be noted that the principles and methods of subtraction, multiplication, and division operations are the same as those of the above - mentioned addition operation, and will not be elaborated here.
[0122] S2043: When the operation to be executed is in the transpose conjugate state, perform the inverse operation of the specific operation on the values corresponding to the sub - quantum states representing the first qubit position and the values corresponding to the sub - quantum states representing the second qubit position in each eigenstate of the quantum state space, and encode the operation result into the second qubit position.
[0123] It can be understood that the inverse operation corresponding to the addition operation is the subtraction operation; the inverse operation corresponding to the subtraction operation is the addition operation; the inverse operation corresponding to the multiplication operation is the division operation; the inverse operation corresponding to the division operation is the multiplication operation.
[0124] Specifically, the auxiliary identifier can be obtained as the information carried by the operation identifier. Exemplarily, the auxiliary identifier can be a symbol in the upper right corner of the operation identifier.
[0125] At the same time, the auxiliary identifier has two states, which are used to represent that the operation to be executed is not in the transpose conjugate state and that the operation to be executed is in the transpose conjugate state respectively.
[0126] Optionally, this symbol has two states: non - existent state and existent state. The former is used to represent that the operation to be executed is not in the transpose conjugate state, and the latter is used to represent that the operation to be executed is in the transpose conjugate state.
[0127] Optionally, the former state representing non - existence can be represented by 0 or by omitting to display any information; the latter state representing existence can be represented by 1 or a specified symbol label; where the specified symbol can be in correspondence with the identifier of the transpose conjugate state of the quantum logic gate Consistent with (read as Dagger).
[0128] When the auxiliary identifier is a symbol in the upper right corner of the operation identifier, and when it is indicated by omitting any information representation that the operation to be performed is not in the transpose conjugate state, by indicating that the operation to be performed is in the transpose conjugate state, the auxiliary identifier can be obtained. It can be understood as judging whether there is a symbol in the upper right corner of the operation identifier, and judging whether the operation to be performed is in the transpose conjugate state according to the existence or non-existence of the symbol. The inverse operation of the basic arithmetic operation is marked by the transpose conjugate state symbol of the quantum logic gate mark.
[0129] Exemplarily, the addition operation is denoted as O add , and the inverse operation of the addition operation can be denoted as The subtraction operation is denoted as O sub , and the inverse operation of the subtraction operation can be denoted as The multiplication operation is denoted as O multi , and the inverse operation of the addition operation can be denoted as The division operation is denoted as O div , and the inverse operation of the division operation can be denoted as
[0130] Taking the inverse operation of the above addition operation as an example for specific illustration, when the operation identifier is that is, there is an auxiliary identifier in the upper right corner At this time, perform the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit and the value corresponding to the sub-quantum state representing the second qubit among the eigenstates of the quantum state space, that is, perform the inverse operation of the addition operation, the subtraction operation, and then realize the effect of |a + b>|b> → |a>|b>. At this time, encode |a + b> and |a> through the second qubit, and encode |b> through the first qubit.
[0131] It should be noted that the principles and methods of the inverse operations of subtraction, multiplication, and division are the same as those of the inverse operation of the above addition operation, and will not be elaborated here.
[0132] The above example completely shows the situation when the bit storing the operation result is one of the bits representing the operation object of the basic arithmetic operation. The following will give an example to illustrate the situation when the bit storing the operation result is not one of the bits representing the operation object of the basic arithmetic operation.
[0133] As another specific implementation of the quantum simulation method for the above operations to be executed, the specific operation is for the operation of two operands. The first qubit is used to represent the two operands of the specific operation, and the second qubit is used to represent the operation result of the specific operation. Among them, the specific operation is one of addition operation, subtraction operation, multiplication operation, and division operation.
[0134] Then, in step S204, according to whether the operation to be executed is in the transpose conjugate state, performing the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit and / or the value corresponding to the sub-quantum state representing the second qubit in each eigenstate of the quantum state space specifically includes:
[0135] S204-1: Judging whether the operation to be executed is in the transpose conjugate state according to the auxiliary identifier;
[0136] Specifically, judging whether there is an auxiliary identifier in the upper right corner of the operation identifier If it exists, it means that the operation to be executed is in the transpose conjugate state; if it does not exist, it means that the operation to be executed is not in the transpose conjugate state.
[0137] S204-2: When the operation to be executed is not in the transpose conjugate state, performing the specific operation on the value corresponding to the sub-quantum state representing the first qubit in each eigenstate of the quantum state space, and encoding the operation result to the second qubit.
[0138] Exemplarily, taking the addition operation as an example for specific illustration, for the basic arithmetic operation O of the operation to be executed add : |a>|b>|0> → |a>|b>|a + b>, where a and b are decimal numbers. The user inputs a set of qubits q0, q1, q2, q3, q4, q5, q6, q7, q8, representing the qubits from the 0th to the 8th bit, sorted from high to low as q8q7q6q5q4q3q2q1q0. Among them, q5q4q3q2q1q0 is specified as the first qubit and is used to encode a and encode b at the same time; q8q7q6 is specified as the second qubit and is used to encode the operation result of a + b. Then, among the 2 9 = 512 eigenstates corresponding to this set of qubits, obtaining the sub-quantum state corresponding to q5q4q3q2q1q0, performing the addition operation on the sub-quantum state values encoding a and encoding b in the q5q4q3q2q1q0 sub-quantum state, and encoding the operation result to the second qubit, that is, encoding to q8q7q6. In this process, the initial sub-quantum state of q8q7q6 can be set; optionally, the initial sub-quantum state of q8q7q6 is the 0 state.
[0139] It should be noted that when the first qubit q5q4q3q2q1q0 is used to encode a and encode b simultaneously, q5q4q3q2q1q0 can be evenly divided such that q5q4q3 is used to encode a and q2q1q0 is used to encode b, or vice versa.
[0140] In addition, it should be noted that in the above process, the initial sub - quantum state of the second qubit can be the 0 state. At this time, only the eigenstates with the initial sub - quantum state of the second qubit being the 0 state are used for extracting and operating on the sub - quantum states of q8q7q6, thereby achieving the effect of simplifying the calculation amount and improving the simulation speed.
[0141] S204 - 3: When the operation to be executed is in the transpose - conjugate state, restore the sub - quantum state representing the second qubit in each eigenstate of the quantum state space to the initial sub - quantum state.
[0142] Specifically, when the auxiliary identifier in the upper right corner of the operation identifier is that is, when the operation to be executed is in the transpose - conjugate state, at this time, restore the sub - quantum state representing the second qubit in each eigenstate of the quantum state space to the initial sub - quantum state.
[0143] Exemplarily, for the inverse operation of the addition operation there is an auxiliary identifier At this time, restore the sub - quantum state representing the second qubit in each eigenstate of the quantum state space to the initial sub - quantum state, that is, restore the operation result with the sub - quantum state represented on the second qubit being a + b to the initial sub - quantum state. Optionally, the initial sub - quantum state is the 0 state, thereby realizing the operation effect of representing |a>|b>|a + b> → |a>|b>|0>.
[0144] The above process fully illustrates that the specific operation of the operation to be executed is for the operation of two operation objects, including but not limited to addition operation, subtraction operation, multiplication operation, division operation, etc. Any operation for two operation objects carried out in accordance with the principles and methods of the above - mentioned scheme should be within the protection scope of the above - mentioned scheme.
[0145] As another specific implementation of the quantum simulation method for the above operation to be executed, the specific operation is for the operation of one operation object. The first qubit is used to represent one operation object of the specific operation, and the second qubit is used to represent the operation result of the specific operation. Among them, the specific operation is one of power function operation, exponential function operation, logarithmic function operation, trigonometric function operation, and inverse trigonometric function operation.
[0146] Then, according to whether the to-be-executed operation is in the transpose conjugate state, performing the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit in each eigenstate of the quantum state space and / or the value corresponding to the sub-quantum state of the second qubit specifically includes:
[0147] S204-a: Judging whether the to-be-executed operation is in the transpose conjugate state according to the auxiliary identifier.
[0148] Specifically, judging whether there is an auxiliary identifier in the upper right corner of the operation identifier , if it exists, it means that the to-be-executed operation is in the transpose conjugate state; if it does not exist, it means that the to-be-executed operation is not in the transpose conjugate state.
[0149] S204-b: When the to-be-executed operation is not in the transpose conjugate state, performing the specific operation on the value corresponding to the sub-quantum state representing the first qubit in each eigenstate of the quantum state space, and encoding the operation result to the second qubit. Exemplarily, taking the exponential function operation as an example for specific illustration, for the to-be-executed operation of the basic arithmetic operation Aa b : |b>|a> → |b>|a b >, where a is a known decimal number, and b is any decimal number that can be characterized by a quantum state.
[0150] The user inputs a set of qubits q0, q1, q2, q3, q4, q5, q6, q7, q8, representing the qubits from the 0th to the 8th bit. Sorted from high to low as q8q7q6q5q4q3q2q1q0, where q3q2q1q0 is specified as the first qubit for encoding b; q7q6q5q4 is specified as the second qubit for encoding b the operation result of a; then among the 2 9 = 512 eigenstates corresponding to this set of qubits, the sub-quantum state corresponding to q3q2q1q0 is obtained. Then, the exponential operation with base a is performed on the value corresponding to this sub-quantum state, and the operation result is encoded to the second qubit, that is, encoded to q7q6q5q4.
[0151] It should be noted that in the above process, the initial sub-quantum state of the second qubit can be the 0 state. At this time, it is only necessary to extract and perform operations on the sub-quantum state corresponding to q3q2q1q0 for the eigenstates with the initial sub-quantum state of the second qubit being the 0 state, thereby achieving the effect of reducing the calculation amount and improving the simulation speed.
[0152] The principles and methods of the power function operation, logarithmic function operation, trigonometric function operation, and inverse trigonometric function operation are the same as those of the above exponential function operation, and will not be elaborated here.
[0153] S204-c: When the operation to be executed is in the transpose conjugate state, restore the sub-quantum state representing the second qubit in each eigenstate of the quantum state space to the initial sub-quantum state.
[0154] Specifically, when the auxiliary identifier in the upper right corner of the operation identifier is i.e., when the operation to be executed is in the transpose conjugate state, at this time, restore the sub-quantum state representing the second qubit in each eigenstate of the quantum state space to the initial sub-quantum state.
[0155] Exemplarily, the inverse operation of the exponential function has an auxiliary identifier At this time, restore the sub-quantum state representing the second qubit in each eigenstate of the quantum state space to the initial sub-quantum state, that is, restore the operation result of the sub-quantum state represented on the second qubit to be a b to the initial sub-quantum state. Optionally, the initial sub-quantum state is the 0 state, thereby realizing representing |b>|a b >→|b>|a> operation effect.
[0156] In quantum applications, a kind of Oracle can be constructed, and the internal principle of this Oracle is the method flow of the present invention. Specifically, an Oracle can be understood as a module (similar to a black box) that completes specific functions in a quantum algorithm, and there will be specific implementation methods in specific problems.
[0157] Currently, the existing construction of quantum circuits often can only utilize existing single-qubit logic gates, two-qubit logic gates, etc. Usually, there are the following problems:
[0158] For quantum circuits with relatively complex functions, the number of qubits required will be very large. When using a classical computer for simulation, it will consume a huge amount of memory space, the number of logic gates required will be very large, and the simulation time will be very long. Moreover, some complex algorithms are difficult to be implemented by quantum circuits.
[0159] Based on this, by changing to the Oracle simulation method to implement the complex function of the mutual conversion between the quantum states corresponding to the quantum simulation representation of specific operation operations and to implement the controlled function. The parameters that the user passes into the Oracle can include: Oracle name (used to identify the functional purpose of the Oracle), the aforementioned group of qubit positions, operation identifiers, etc. It can use O M indicating converting the first representation to the second representation, setting the auxiliary identifier i.e., indicating converting the second representation to the first representation, where, OM Abbreviation for a specific operation represented by Oracle.
[0160] The advantage of this method is that, overall, Oracle is regarded as a known module without the need to pay attention to its internal implementation details. In quantum application scenarios such as the representation of quantum circuits, it will be very simple and clear. Since the Oracle functional module of classical simulation can be equivalent to quantum logic gates to construct complex quantum circuits, it saves the memory space required during operation and speeds up the simulation verification of quantum algorithms.
[0161] It can be seen that, compared with the prior art, the quantum simulation method for operations to be executed provided by the present invention establishes the relationship between the operation objects of the specific operations to be executed and the qubit positions. Through the operation of the corresponding values of the quantum states, it realizes the simulation of the operations to be executed that support specific operations or the inverse operations of the specific operations, enabling the operations to be executed to have the characteristics of supporting unitary transformation similar to quantum logic gates, and further realizing the simulation of the operations to be executed corresponding to specific operations in quantum circuits, filling the gaps in related technologies.
[0162] The above process fully illustrates the operation of the specific operation to be executed on one operation object, including but not limited to power function operations, exponential function operations, logarithmic function operations, trigonometric function operations, and inverse trigonometric function operations, etc. Any operation on one operation object carried out in accordance with the principles and methods of the above solutions shall be within the protection scope of the above solutions.
[0163] See Figure 3 , Figure 3 is the structural schematic diagram of a quantum simulation device for operations to be executed provided by an embodiment of the present invention. Corresponding to the process shown in Figure 2 , it may include:
[0164] An operation identifier acquisition module 301: used to acquire an operation identifier, where the operation identifier is used to represent the specific operation corresponding to the operation to be executed;
[0165] An auxiliary identifier acquisition module 302: used to acquire an auxiliary identifier, where the auxiliary identifier is used to represent whether the operation to be executed is in a transpose conjugate state;
[0166] A first acquisition module 303: connected to the operation identifier acquisition module, used to acquire a group of qubit positions and the quantum state space they represent; the group of qubit positions includes a first qubit position and a second qubit position; the first qubit position is used to represent the operation object of the specific operation, and the second qubit position is used to represent the operation object of the specific operation and / or represent the operation result of the specific operation;
[0167] Operation module 304: Connecting the auxiliary identifier acquisition module and the first acquisition module, and configured to perform the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit and / or the value corresponding to the sub-quantum state representing the second qubit in each eigenstate of the quantum state space according to whether the operation to be executed is in the transpose conjugate state.
[0168] Preferably, as Figure 4 shown in the structural schematic diagram of another quantum simulation device for an operation to be executed provided by an embodiment of the present invention, the first acquisition module 303 includes:
[0169] The first sub-operation module 3031, where the specific operation is for the operation of two operation objects, the first qubit is used to represent one operation object of the specific operation, and the second qubit is used to represent the other operation object of the specific operation and the operation result of the specific operation. Wherein, the specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
[0170] Preferably, continue as Figure 4 shown in the structural schematic diagram of another quantum simulation device for an operation to be executed provided by an embodiment of the present invention, the operation module 304 specifically includes:
[0171] The first judgment module 3041, configured to judge whether the operation to be executed is in the transpose conjugate state according to the auxiliary identifier;
[0172] The first execution module 3042, configured to, when the operation to be executed is not in the transpose conjugate state, perform the specific operation on the value corresponding to the sub-quantum state representing the first qubit and the value corresponding to the sub-quantum state representing the second qubit in each eigenstate of the quantum state space, and code the operation result to the second qubit;
[0173] When the operation to be executed is in the transpose conjugate state, perform the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit and the value corresponding to the sub-quantum state representing the second qubit in each eigenstate of the quantum state space, and code the operation result to the second qubit.
[0174] Preferably, as Figure 5 shown in the structural schematic diagram of another quantum simulation device for an operation to be executed provided by an embodiment of the present invention, the first acquisition module 303 includes:
[0175] The second sub - operation module 303 - 1 is used for the specific operation for the operation of two operation objects; the first qubit is used to represent the two operation objects of the specific operation, and the second qubit is used to represent the operation result of the specific operation. Wherein, the specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
[0176] The operation module 304 specifically includes:
[0177] The second judgment module 304 - 1 is used to judge whether the to - be - executed operation is in the transpose conjugate state according to the auxiliary identifier;
[0178] The second execution module 304 - 2 is used to, when the to - be - executed operation is not in the transpose conjugate state, perform the specific operation on the value corresponding to the sub - quantum state representing the first qubit in each eigenstate of the quantum state space, and code the operation result to the second qubit;
[0179] When the to - be - executed operation is in the transpose conjugate state, restore the sub - quantum state representing the second qubit in each eigenstate of the quantum state space to the initial sub - quantum state.
[0180] Preferably, as Figure 6 shown in the structural schematic diagram of another quantum simulation device for the to - be - executed operation provided by the embodiment of the present invention, the first acquisition module 303 includes:
[0181] The third sub - operation module 303 - a is used for the specific operation for the operation of one operation object; the first qubit is used to represent the one operation object of the specific operation, and the second qubit is used to represent the operation result of the specific operation. Wherein, the specific operation is one of power function operation, exponential function operation, logarithmic function operation, trigonometric function operation and inverse trigonometric function operation.
[0182] Preferably, continuing as Figure 6 shown in the structural schematic diagram of another quantum simulation device for the to - be - executed operation provided by the embodiment of the present invention, the operation module 304 specifically includes:
[0183] The third judgment module 304 - a is used to judge whether the to - be - executed operation is in the transpose conjugate state according to the auxiliary identifier;
[0184] The third execution module 304 - b is used to, when the to - be - executed operation is not in the transpose conjugate state, perform the specific operation on the value corresponding to the sub - quantum state representing the first qubit in each eigenstate of the quantum state space, and code the operation result to the second qubit;
[0185] When the to-be-executed operation is in the transpose conjugate state, restore the sub-quantum state representing the second qubit in each eigenstate of the quantum state space to the initial sub-quantum state.
[0186] An embodiment of the present invention provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0187] Specifically, the above electronic device may further include a transmission device and an input / output device. Among them, the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0188] Specifically, in this embodiment, the above processor may be configured to execute the following steps through a computer program:
[0189] S201: Obtain an operation identifier, where the operation identifier is used to represent the specific operation corresponding to the to-be-executed operation;
[0190] S202: Obtain an auxiliary identifier, where the auxiliary identifier is used to represent whether the to-be-executed operation is in the transpose conjugate state;
[0191] S203: Obtain a set of qubits and the quantum state space they represent; the set of qubits includes a first qubit and a second qubit; the first qubit is used to represent the operation object of the specific operation, and the second qubit is used to represent the operation object of the specific operation and / or represent the operation result of the specific operation;
[0192] S204: According to whether the to-be-executed operation is in the transpose conjugate state, perform the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first qubit in each eigenstate of the quantum state space and / or the value corresponding to the sub-quantum state representing the second qubit.
[0193] Compared with the prior art, the quantum simulation method of the to-be-executed operation provided by the present invention establishes the relationship between the operation object of the specific operation of the to-be-executed operation and the qubits. Through the operation of the values corresponding to the quantum states, the simulation of the to-be-executed operation that supports the specific operation or the inverse operation of the specific operation is realized, so that the to-be-executed operation has the characteristic of supporting unitary transformation analogous to a quantum logic gate, and further realizes the simulation of the to-be-executed operation corresponding to the specific operation in a quantum circuit, filling the gap in the related art.
[0194] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.
[0195] Specifically, in this embodiment, the above storage medium may be configured to store a computer program for performing the following steps:
[0196] S201: Obtain an operation identifier, where the operation identifier is used to represent a specific operation corresponding to the operation to be performed;
[0197] S202: Obtain an auxiliary identifier, where the auxiliary identifier is used to represent whether the operation to be performed is in a transpose conjugate state;
[0198] S203: Obtain a set of qubit bits and the quantum state space they represent; the set of qubit bits includes a first qubit bit and a second qubit bit; the first qubit bit is used to represent the operation object of the specific operation, and the second qubit bit is used to represent the operation object of the specific operation and / or represent the operation result of the specific operation;
[0199] S204: According to whether the operation to be performed is in a transpose conjugate state, perform the specific operation or the inverse operation of the specific operation on the value corresponding to the sub - quantum state representing the first qubit bit and / or the value corresponding to the sub - quantum state of the second qubit bit in each eigenstate of the quantum state space.
[0200] Specifically, in this embodiment, the above storage medium may include but is not limited to: various media such as USB flash drives, read - only memories (ROMs), random access memories (RAMs), external hard drives, magnetic disks, or optical discs that can store computer programs.
[0201] Compared with the prior art, the quantum simulation method for the operation to be performed provided by the present invention establishes the relationship between the operation object of the specific operation of the operation to be performed and the qubit bits. By performing operations on the values corresponding to the quantum states, it realizes the simulation of the operation to be performed that supports the specific operation or the inverse operation of the specific operation, making the operation to be performed have the characteristic of supporting unitary transformation similar to a quantum logic gate. Furthermore, it realizes the simulation of the operation to be performed corresponding to the specific operation in a quantum circuit, filling the gap in the related technology.
[0202] The above has detailed the structure, characteristics, and effects of the present invention based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present invention, but the present invention is not limited by the scope shown in the drawings. Any changes made in accordance with the concept of the present invention, or modified into equivalent embodiments with equivalent changes, still within the spirit covered by the specification and the drawings, should be within the protection scope of the present invention.
Claims
1. A quantum simulation method for an operation to be executed, characterized in that The method includes: Obtaining an operation identifier, which is used to represent the specific operation corresponding to the operation to be performed; Obtaining an auxiliary identifier, which is used to represent whether the operation to be performed is in the transpose conjugate state; Obtaining a set of qubit bits and the quantum state space they represent; the set of qubit bits includes a first qubit bit and a second qubit bit; the specific operation is for the operation of two operation objects, the first qubit bit is used to represent the two operation objects of the specific operation, and the second qubit bit is used to represent the operation result of the specific operation; According to whether the operation to be performed is in the transpose conjugate state, perform the specific operation on the value corresponding to the sub-quantum state representing the first qubit bit in each eigenstate of the quantum state space.
2. The quantum simulation method for an operation to be executed according to claim 1, wherein The specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
3. The quantum simulation method of the operation to be executed according to claim 1, characterized in that, The performing the specific operation on the value corresponding to the sub-quantum state representing the first qubit bit in each eigenstate of the quantum state space according to whether the operation to be performed is in the transpose conjugate state specifically includes: Judging whether the operation to be performed is in the transpose conjugate state according to the auxiliary identifier; When the operation to be performed is not in the transpose conjugate state, perform the specific operation on the value corresponding to the sub-quantum state representing the first qubit bit in each eigenstate of the quantum state space, and code the operation result to the second qubit bit.
4. The quantum simulation method of the operation to be executed according to claim 3, characterized in that, When the operation to be performed is in the transpose conjugate state, restore the sub-quantum state representing the second qubit bit in each eigenstate of the quantum state space to the initial sub-quantum state.
5. A quantum simulation device for an operation to be executed, characterized in that, The device includes: An operation identifier acquisition module, which is used to acquire an operation identifier, and the operation identifier is used to represent the specific operation corresponding to the operation to be performed; An auxiliary identifier acquisition module, which is used to acquire an auxiliary identifier, and the auxiliary identifier is used to represent whether the operation to be performed is in the transpose conjugate state; A first acquisition module, connected to the operation identifier acquisition module, which is used to acquire a set of qubit bits and the quantum state space they represent; the set of qubit bits includes a first qubit bit and a second qubit bit; the specific operation is for the operation of two operation objects, the first qubit bit is used to represent the two operation objects of the specific operation, and the second qubit bit is used to represent the operation result of the specific operation; An operation module, connected to the auxiliary identifier acquisition module and the first acquisition module, which is used to perform the specific operation on the value corresponding to the sub-quantum state representing the first qubit bit in each eigenstate of the quantum state space according to whether the operation to be performed is in the transpose conjugate state.
6. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is set to run the computer program to execute the method described in any one of claims 1 to 4.
7. A storage medium, characterized in that, A computer program is stored in the storage medium, wherein the computer program is set to execute the method described in any one of claims 1 to 4 when running.