A quantum simulation method and apparatus for an operation to be performed
By utilizing operational identifiers and auxiliary identifiers in quantum computing to perform operations based on transpose and conjugate states, the problem that quantum computers cannot perform basic arithmetic and elementary function operations has been solved, enabling simulated operations in quantum circuits and improving quantum computing capabilities.
Patent Information
- Application Number
- CN202310771106.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-21
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2040-01-21
AI Technical Summary
Existing quantum computers are limited by the development of quantum chip hardware, making it impossible to effectively perform basic arithmetic operations and elementary function operations, which restricts quantum computing research and applications.
By acquiring operational identifiers and auxiliary identifiers, utilizing the quantum state space of qubits, specific operations or inverse operations are performed based on the transpose and conjugate states, establishing the relationship between the operand and the qubit, and realizing operations such as addition, subtraction, multiplication, division, and power functions, exponential functions, logarithmic functions, and trigonometric functions.
It enables the simulation of basic arithmetic operations and elementary function operations in quantum circuits, filling a gap in existing technology, supporting the unitary transformation characteristics of analog quantum logic gates, and improving the simulation capability of quantum computing.
Smart Images

Figure CN116702913B_ABST
Abstract
Description
[0001] This application is a divisional application of the patent application with the application date of January 21, 2020, the application number of 202010072072.2, and the patent name of a quantum simulation method and device for to-be-executed operations. TECHNICAL FIELD
[0002] The application belongs to the field of quantum computing, and particularly relates to a quantum simulation method and device for to-be-executed operations, an electronic device, and a storage medium. BACKGROUND
[0003] A quantum computer has an exponential acceleration ability in theory in some cases by using the superposition of a quantum. For example, it takes hundreds of years to crack an RSA key on a classical computer, but only takes a few hours to execute a quantum algorithm on a quantum computer. However, the quantum computer is currently limited by the development of quantum chip hardware, resulting in a limited number of controllable bits, so the computing capacity is limited and the quantum algorithm cannot be universally run. Universal quantum algorithm usually needs to use a quantum computing simulation method.
[0004] In the simulation implementation process of the quantum algorithm, various quantum logic gates are usually used to construct the quantum algorithm. However, when the quantum algorithm is constructed by using various quantum logic gates, there is no quantum logic gate operation corresponding to the basic arithmetic operation functions such as addition, subtraction, multiplication, and division and the corresponding inverse operation, and there is no quantum logic gate operation capable of realizing the basic elementary function operation functions such as power function, exponential function, logarithmic function, trigonometric function, and inverse trigonometric function and the corresponding inverse operation. When the equivalent quantum logic gate is constructed to realize the corresponding functions described above, the number of various quantum logic gates required is large, the quantum circuit corresponding to the constructed quantum algorithm is too complex, and the research of quantum computing is seriously hindered.
[0005] Therefore, it is urgent to provide a quantum simulation method capable of simulating the above function operation in a quantum circuit to fill the gap in the related art. SUMMARY
[0006] The application aims to provide a quantum simulation method and device for to-be-executed operations, an electronic device, and a storage medium to solve the problems in the prior art, fill the gap in the related art, and simulate to-be-executed operations in a quantum circuit.
[0007] The technical solutions adopted by the application are as follows:
[0008] A quantum simulation method for to-be-executed operations, the method comprising:
[0009] An operation identifier is obtained, the operation identifier being used to represent a specific operation corresponding to a to-be-executed operation;
[0010] obtaining an auxiliary identifier, the auxiliary identifier being used to indicate whether the to-be-executed operation is in a transposed conjugate state;
[0011] obtaining a set of quantum bit positions and a quantum state space represented thereby; the set of quantum bit positions comprises a first quantum bit position and a second quantum bit position; the first quantum bit position is used to represent an 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 an operation result of the specific operation;
[0012] performing the specific operation or an inverse operation of the specific operation on a value corresponding to a sub-quantum state of the first quantum bit position and / or a value corresponding to a sub-quantum state of the second quantum bit position in each eigenstate of the quantum state space according to whether the to-be-executed operation is in a transposed conjugate state.
[0013] The quantum simulation method of a to-be-executed operation as described above, preferably, the specific operation is used for the operation of two operation objects.
[0014] The first quantum bit position is used to represent one operation object of the specific operation, and the second quantum bit position is used to represent another operation object of the specific operation and represent an operation result of the specific operation.
[0015] The quantum simulation method of a to-be-executed operation as described above, preferably, the specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
[0016] The quantum simulation method of a to-be-executed operation as described above, preferably, the performing the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state of the first quantum bit position and / or the value corresponding to the sub-quantum state of the second quantum bit position in each eigenstate of the quantum state space according to whether the to-be-executed operation is in a transposed conjugate state comprises:
[0017] judging whether the to-be-executed operation is in a transposed conjugate state according to the auxiliary identifier;
[0018] when the to-be-executed operation is not in a transposed conjugate state, performing the specific operation on the value corresponding to the sub-quantum state of the first quantum bit position and the value corresponding to the sub-quantum state of the second quantum bit position in each eigenstate of the quantum state space, and encoding an operation result to the second quantum bit position.
[0019] The quantum simulation method of an operation to be performed as described above, wherein preferably, when the operation to be performed is in a transposed conjugate state, an inverse operation of the specific operation is performed on the value corresponding to the sub quantum state of the first quantum bit and the value corresponding to the sub quantum state of the second quantum bit in each eigenstate of the quantum state space, and the operation result is recorded to the second quantum bit.
[0020] The quantum simulation method of an operation to be performed as described above, wherein preferably, the specific operation is used for the operation of two operation objects.
[0021] The first quantum bit is used to represent one operation object of the specific operation, and the second quantum bit is used to represent the operation result of the specific operation.
[0022] The quantum simulation method of an operation to be performed as described above, wherein preferably, the specific operation is one of addition, subtraction, multiplication and division.
[0023] The quantum simulation method of an operation to be performed as described above, wherein preferably, according to whether the operation to be performed is in a transposed conjugate state, the specific operation or the inverse operation of the specific operation is performed on the value corresponding to the sub quantum state of the first quantum bit and / or the value corresponding to the sub quantum state of the second quantum bit in each eigenstate of the quantum state space, specifically including:
[0024] According to the auxiliary identifier, it is judged whether the operation to be performed is in a transposed conjugate state.
[0025] When the operation to be performed is not in a transposed conjugate state, the specific operation is performed on the value corresponding to the sub quantum state of the first quantum bit in each eigenstate of the quantum state space, and the operation result is recorded to the second quantum bit.
[0026] The quantum simulation method of an operation to be performed as described above, wherein preferably, when the operation to be performed is in a transposed conjugate state, the sub quantum state of the second quantum bit in each eigenstate of the quantum state space is restored to the initial sub quantum state.
[0027] The quantum simulation method of an operation to be performed as described above, wherein preferably, the specific operation is used for the operation of one operation object.
[0028] The first quantum bit is used to represent one operation object of the specific operation, and the second quantum bit is used to represent the operation result of the specific operation.
[0029] The quantum simulation method of an operation to be performed as described above, wherein preferably the specific operation is one of a power function operation, an exponential function operation, a logarithm function operation, a trigonometric function operation, and an inverse trigonometric function operation.
[0030] The quantum simulation method of an operation to be performed as described above, wherein preferably 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 and / or the numerical value corresponding to the sub quantum state of the second quantum bit in each eigenstate of the quantum state space according to whether the operation to be performed is in a transposed conjugate state, specifically comprising:
[0031] determining whether the operation to be performed is in a transposed conjugate state according to the auxiliary identifier;
[0032] when the operation to be performed is not in a transposed conjugate state, performing the specific operation on the numerical value corresponding to the sub quantum state representing the first quantum bit in each eigenstate of the quantum state space and encoding the operation result to the second quantum bit.
[0033] The quantum simulation method of an operation to be performed as described above, wherein preferably when the operation to be performed is in a transposed conjugate state, the sub quantum state representing the second quantum bit in each eigenstate of the quantum state space is restored to an initial sub quantum state.
[0034] A quantum simulation device of an operation to be performed, the device comprising:
[0035] an operation identifier acquisition module configured to acquire an operation identifier, the operation identifier being used to represent a specific operation corresponding to an operation to be performed;
[0036] an auxiliary identifier acquisition module configured to acquire an auxiliary identifier, the auxiliary identifier being used to represent whether an operation to be performed is in a transposed conjugate state;
[0037] a first acquisition module connected to the operation identifier acquisition module and configured to acquire a set of quantum bits and a quantum state space represented thereby; the set of quantum bits comprising a first quantum bit and a second quantum bit; the first quantum bit being used to represent an operation object of the specific operation, and the second quantum bit being used to represent the operation object of the specific operation and / or an operation result of the specific operation;
[0038] an operation module connected to 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 numerical value corresponding to the sub quantum state representing the first quantum bit and / or the numerical value corresponding to the sub quantum state of the second quantum bit in each eigenstate of the quantum state space according to whether the operation to be performed is in a transposed conjugate state.
[0039] The specific operation is used for operation of two operation objects;
[0040] The first quantum bit is used for representing one operation object of the specific operation, and the second quantum bit is used for representing another operation object of the specific operation and representing an 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] determining whether the to-be-executed operation is in a transpose conjugate state according to the auxiliary identifier;
[0044] when the to-be-executed operation is not in the transpose conjugate state, performing the specific operation on values corresponding to sub-quantum states of the first quantum bit and values corresponding to sub-quantum states of the second quantum bit in each eigenstate of the quantum state space, and encoding an operation result to the second quantum bit.
[0045] when the to-be-executed operation is in the transpose conjugate state, performing an inverse operation of the specific operation on values corresponding to sub-quantum states of the first quantum bit and values corresponding to sub-quantum states of the second quantum bit in each eigenstate of the quantum state space, and encoding an operation result to the second quantum bit.
[0046] The specific operation is used for operation of two operation objects;
[0047] The first quantum bit is used for representing one operation object of the specific operation, and the second quantum bit is used for representing another operation object of the specific operation and representing an operation result of the specific operation.
[0048] The specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
[0049] determining whether the to-be-executed operation is in a transpose conjugate state according to the auxiliary identifier;
[0050] when the to-be-executed operation is not in the transpose conjugate state, performing the specific operation on values corresponding to sub-quantum states of the first quantum bit and values corresponding to sub-quantum states of the second quantum bit in each eigenstate of the quantum state space, and encoding an operation result to the second quantum bit.
[0051] when the to-be-executed operation is in the transpose conjugate state, restoring sub-quantum states of the second quantum bit in each eigenstate of the quantum state space to initial sub-quantum states.
[0052] The specific operation is used for operation of an operation object;
[0053] The first quantum bit is used for representing an operation object of the specific operation, and the second quantum bit is used for representing an operation result of the specific operation.
[0054] The specific operation is one of a power function operation, an exponential function operation, a logarithm function operation, a trigonometric function operation, and an inverse trigonometric function operation.
[0055] According to whether the to-be-executed operation is in a transpose conjugate state, the specific operation or the inverse operation of the specific operation is performed on a value corresponding to a sub quantum state of the first quantum bit and / or a value corresponding to a sub quantum state of the second quantum bit in each eigenstate of the quantum state space, specifically comprising:
[0056] According to the auxiliary identifier, it is judged whether the to-be-executed operation is in a transpose conjugate state.
[0057] When the to-be-executed operation is not in a transpose conjugate state, the specific operation is performed on a value corresponding to a sub quantum state of the first quantum bit in each eigenstate of the quantum state space, and an operation result is encoded to the second quantum bit.
[0058] When the to-be-executed operation is in a transpose conjugate state, a sub quantum state of the second quantum bit in each eigenstate of the quantum state space is restored to an initial sub quantum state.
[0059] An electronic device comprises a memory and a processor, the memory stores a computer program, 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 run to execute the method described in any one of the above.
[0061] Compared with the prior art, the quantum simulation method for the to-be-executed operation provided by the application establishes the relationship between the operation object of the specific operation to be executed and the quantum bit, specifically: the set of quantum bits includes a first quantum bit and a second quantum bit; the first quantum bit is used to represent the operation object of the specific operation, and the second quantum bit 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 transposed conjugate state of the to-be-executed operation, the specific operation or the inverse operation of the specific operation is performed on the values corresponding to the sub-quantum state of the first quantum bit and / or the values corresponding to the sub-quantum state of the second quantum bit in each eigenstate of the quantum state space of a quantum bit. Further, by operating the quantum state corresponding values, the to-be-executed operation simulation supporting 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 of the analog quantum logic gate, and the simulation of the to-be-executed operation corresponding to the specific operation in the quantum circuit is realized, which fills the gap in the related art. BRIEF DESCRIPTION OF DRAWINGS
[0062] Figure 1 is a hardware structure block diagram of a computer terminal of a quantum simulation method for a to-be-executed operation provided by an embodiment of the application;
[0063] Figure 2 is a flowchart of a quantum simulation method for a to-be-executed operation provided by an embodiment of the application;
[0064] Figure 3 is a structure diagram of a quantum simulation device for a to-be-executed operation provided by an embodiment of the application;
[0065] Figure 4 is a structure diagram of another quantum simulation device for a to-be-executed operation provided by an embodiment of the application;
[0066] Figure 5 is a structure diagram of another quantum simulation device for a to-be-executed operation provided by an embodiment of the application;
[0067] Figure 6 is a structure diagram of another quantum simulation device for a to-be-executed operation provided by an embodiment of the application. DETAILED DESCRIPTION
[0068] The embodiments described below with reference to the drawings are exemplary and are only used to explain the application, and cannot be explained as a limitation on the application.
[0069] It should be noted that the terms "first", "second" and the like in the specification and claims of the application are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.
[0070] The embodiments of the present invention provide a quantum simulation method for implementing an operation to be executed, which is used to simulate the operation to be executed in a quantum circuit, wherein the operation to be executed corresponds to a specific operation. The method can be applied to electronic devices, such as mobile terminals, specifically mobile phones and tablet computers; or computer terminals, specifically ordinary computers and quantum computers.
[0071] The following detailed explanation uses a computer terminal as an example. Figure 1 This is a block diagram of a quantum computing simulation hardware structure according to an embodiment of this application. For example... Figure 1 As shown, computer terminal 10 may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0072] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the quantum computing simulation method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0073] The transmission device 106 is configured to receive or send data via a network. The network can include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network interface controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module configured to communicate with the Internet wirelessly.
[0074] It should be noted that a real quantum computer is a hybrid structure, which includes two parts: one part is a classical computer responsible for performing classical computation and control; the other part is a quantum device responsible for running a quantum program to implement quantum computation. The quantum program is a sequence of instructions written in a quantum language such as QRunes language that can run on a quantum computer, which supports quantum logic gate operations and ultimately realizes quantum computation. Specifically, the quantum program is a sequence of instructions for operating quantum logic gates in a certain time sequence.
[0075] In practical applications, due to the limitations of the development of quantum device hardware, quantum computation simulation is usually needed to verify quantum algorithms, quantum applications, and the like. Quantum computation simulation is a process of simulating the running of a quantum program corresponding to a specific problem by means of a virtual architecture (i.e., a quantum virtual machine) built by an ordinary computer. Generally, a quantum program corresponding to a specific problem needs to be constructed. The quantum program referred to in the embodiments of the present application is a program written in a classical language representing quantum bits and their evolution, in which quantum bits, quantum logic gates, and the like related to quantum computation are represented by corresponding classical codes.
[0076] As an embodiment 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 quantum bits in an abstract concept, and its composition includes quantum bits, a circuit (a time line), and various quantum logic gates, and finally the result needs to be read out through a quantum measurement operation.
[0077] Unlike a traditional circuit 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 a quantum bit naturally evolves with time, and in this process, the quantum bit is operated according to the instruction of a Hamiltonian operator until it encounters a logic gate.
[0078] A quantum program corresponds to a total quantum circuit as a whole, and the quantum program refers to the total quantum circuit, wherein the total number of qubits in the total quantum circuit is the same as the total number of qubits of the quantum program. It can be understood that a quantum program can be composed of a quantum circuit, a measurement operation for a qubit in the quantum circuit, a register for storing a measurement result, and a control flow node (jump instruction). A quantum circuit can include tens, 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 refers to the time sequence of executing a single quantum logic gate.
[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, which can be combined to achieve the purpose of controlling the circuit. Similarly, the way to process qubits is quantum logic gates. Using quantum logic gates can evolve quantum states. Quantum logic gates are the basis of quantum circuits, and quantum logic gates include single-bit quantum logic gates such as Hadamard gate (H gate), Pauli-X gate, Pauli-Y gate, Pauli-Z gate, RX gate, RY gate, and RZ gate; multi-bit quantum logic gates such as CNOT gate, CR gate, iSWAP gate, and Toffoli gate. Quantum logic gates are generally represented by unitary matrices, and unitary matrices are not only matrix forms, but also operations and transformations.
[0080] Currently, there is no combination of quantum logic gates that can implement some classical operations such as four arithmetic operations, for example, addition, subtraction, multiplication, and division, or basic elementary function functions, for example, power function, exponential function, logarithmic function, trigonometric function, and inverse trigonometric function. In order to implement the above functions in a quantum program, a large number of common logic gates are usually used to construct complex quantum circuits to achieve the target function operation, which seriously affects the development of quantum computing and the expansion and landing of quantum application fields. The quantum implementation of the above functions can verify the construction of quantum programs and the solution of complex quantum computing problems.
[0081] As shown in FIG. 1, Figure 2 The embodiment of the present application provides a flowchart of a quantum simulation method of an operation to be executed, and the method comprises the following steps:
[0082] S201: An operation identifier is obtained, and the operation identifier is used to represent a specific operation corresponding to an operation to be executed.
[0083] The 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 executed). 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 a power function, an exponential function, a logarithmic function, a trigonometric function, and an inverse trigonometric function, the operation identifier can be set according to the classical arithmetic operation to be executed.
[0085] For example, when the classical arithmetic operation to be simulated is a basic arithmetic operation, the operation identifier can be set as "O M ", where "O" represents the basic arithmetic operation of the operation to be executed and has no specific meaning, 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] For example, when the operation to be executed is an addition operation, the operation identifier is set as "O add ", which represents that the specific operation of the operation to be executed is an addition operation; when the operation to be executed is a subtraction operation, the operation identifier is set as "O sub ", which represents that the specific operation of the operation to be executed is a subtraction operation; when the operation to be executed is a multiplication operation, the operation identifier is set as "O multi ", which represents that the specific operation of the operation to be executed is a multiplication operation; and when the operation to be executed is a division operation, the operation identifier is set as "O div ", which represents that the specific operation of the operation to be executed is a division operation.
[0087] For another example, when the specific operation of the operation to be executed is a basic elementary function operation, the operation identifier "A y " can be set, where "A" represents the basic elementary function of the operation to be executed and has no specific meaning, and can also be represented by other letters; "y" represents the specific basic function, and the two together form an operation identifier.
[0088] For example, when y=sinx, the operation identifier "Asinx" represents a sine trigonometric function operation.
[0089] The remaining elementary function operation identifiers have similar forms to the trigonometric function operation identifiers, and will not be described here.
[0090] S202: Obtain an auxiliary identifier, which is used to indicate whether the operation to be executed is in a transposed conjugate state.
[0091] Specifically, the auxiliary identifier is a symbol that can be acquired as the carrying information of the operation identifier. For example, 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 used to represent that the to-be-executed operation is not in the transpose conjugate state and that the to-be-executed operation is in the transpose conjugate state.
[0093] Optionally, the symbol has two states, which are an existing state and a non-existing state. The former is used to represent that the to-be-executed operation is not in the transpose conjugate state, and the latter is used to represent that the to-be-executed operation is in the transpose conjugate state.
[0094] Optionally, the former non-existing state can be represented by 0 or by not displaying any information by omission; and the latter existing state can be represented by 1 or a specified symbol. The auxiliary identifier is consistent with 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 to-be-executed operation is not in the transpose conjugate state is represented by not displaying any information by omission, the auxiliary identifier is acquired by determining whether the symbol in the upper right corner of the operation identifier exists. When the to-be-executed operation is in the transpose conjugate state is represented by displaying the symbol, the auxiliary identifier can be understood as determining whether the symbol in the upper right corner of the operation identifier exists. And determining whether the to-be-executed operation is in the transpose conjugate state according to whether the symbol exists.
[0096] S203: Acquire a group of quantum bit positions and quantum state spaces represented thereby; the group of quantum bit positions comprises a first quantum bit position and a second quantum bit position; the first quantum bit position is used to represent an 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 an operation result of the specific operation.
[0097] Specifically, the quantum state space represented by the quantum bit position refers to quantum state information carried by the quantum bit position and represented by all eigenstates of the quantum bit position. The number of all eigenstates corresponding to the quantum bit position is 2 raised to the power of the number of quantum bit positions, and the quantum state information represented by all eigenstates is a linear superposition of all eigenstates.
[0098] For example, a set of qubits is q0, q1, q2, representing the 0th, 1st, and 2nd qubits, and the order from high to low is q2q1q0. The eigenstate corresponding to this set of qubits has a total of 8, which are |000>, |001>, |010>, |011>, |100>, |101>, |110>, and |111>. The superposition state between the 8 eigenstates together constitutes a quantum state space ψ:
[0099] ψ = a0|000> + a1|001> + a2|010> + a3|011> + a4|100> + a5|101> + a6|110> + a7|111>, where a0, a1, a2, a3, a4, a5, a6, and a7 are complex numbers, and
[0100] A set of qubits is obtained through user input, and the number of qubits can be set according to the basic operation of the operation to be performed. In the quantum circuit, the set of qubits is a qubit with an initial state or a qubit carrying evolved quantum state information.
[0101] As a bridge between the specific operation corresponding to the operation to be simulated and the qubits, 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 the operation result of the specific operation.
[0102] It can be understood that the operation object is obtained by the specific operation, so when the second qubit is used to represent the operation object of the specific operation and the operation result of the specific operation, the bit storing the operation result is the bit representing the operation object of the basic arithmetic operation, i.e., 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 executed is in a transposed conjugate state, the specific operation or the inverse operation of the specific operation is performed on the values corresponding to the sub-qubits representing the first qubit and / or the values corresponding to the sub-qubits of the second qubit in each eigenstate of the quantum state space.
[0105] As described above, the auxiliary identifier is used to indicate whether the to-be-executed operation is in a transpose conjugate state; in a specific operation, it can be judged according to the auxiliary identifier whether the to-be-executed operation is in a transpose conjugate state; then according to the judgment result, the specific operation or the inverse operation of the specific operation is performed on the values corresponding to the sub quantum state of the first quantum bit and / or the values corresponding to the sub quantum state of the second quantum bit in each eigenstate of the quantum state space.
[0106] Through steps S201 to S204, the relationship between the operation object of the specific operation to be executed and the quantum bit is established, specifically: the group of quantum bits includes a first quantum bit and a second quantum bit; the first quantum bit is used to represent the operation object of the specific operation, and the second quantum bit 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 to-be-executed operation, the specific operation or the inverse operation of the specific operation is performed on the values corresponding to the sub quantum state of the first quantum bit and / or the values corresponding to the sub quantum state of the second quantum bit in each eigenstate of the quantum state space. Further, through the operation on the quantum state corresponding value, the to-be-executed operation simulation supporting 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 of analog quantum logic gate, and the simulation of the to-be-executed operation corresponding to the specific operation in the quantum circuit is realized, which fills the gap in the related art.
[0107] As a specific implementation of the above quantum simulation method of to-be-executed operation, the specific operation is used for the operation of two operation objects, the first quantum bit is used to represent one operation object of the specific operation, and the second quantum bit is used to represent another operation object of the specific operation and represent the operation result of the specific operation. Wherein, the specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
[0108] Then, according to whether the to-be-executed operation is in a transpose conjugate state, the specific operation or the inverse operation of the specific operation is performed on the values corresponding to the sub quantum state of the first quantum bit and / or the values corresponding to the sub quantum state of the second quantum bit in each eigenstate of the quantum state space.
[0109] S2041: judging whether the to-be-executed operation is in a transpose conjugate state according to the auxiliary identifier.
[0110] Specifically, the auxiliary identifier can be obtained as the carrying information of the operation identifier. For example, the auxiliary identifier can be a symbol in the upper right corner of the operation identifier.
[0111] Meanwhile, the auxiliary identifier has two states, respectively indicating that the to-be-executed operation is not in the transpose conjugate state and that the to-be-executed operation is in the transpose conjugate state.
[0112] Optionally, the symbol has two states, i.e., an existing state and a non-existing state, the former indicating that the to-be-executed operation is not in the transpose conjugate state, and the latter indicating that the to-be-executed operation is in the transpose conjugate state.
[0113] Optionally, the non-existing state can be represented by 0 or by not displaying any information by omission; and the existing state can be represented by 1 or a designated symbol. The auxiliary identifier is consistent with the symbol of the transpose conjugate 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 to-be-executed operation is not in the transpose conjugate state is represented by not displaying any information by omission, the to-be-executed operation is in the transpose conjugate state is represented by acquiring the auxiliary identifier can be understood as judging whether the symbol in the upper right corner of the operation identifier exists or not, and judging whether the to-be-executed operation is in the transpose conjugate state according to the existence or nonexistence of the symbol. If the symbol exists, it indicates that the to-be-executed operation is in the transpose conjugate state; if the symbol does not exist, it indicates that the to-be-executed operation is not in the transpose conjugate state.
[0115] S2042: When the to-be-executed operation is not in the transpose conjugate state, performing the specific operation on the values corresponding to the sub-quantum state of the first quantum bit and the sub-quantum state of the second quantum bit in each eigenstate of the quantum state space, and encoding the operation result to the second quantum bit.
[0116] For example, taking the addition operation as an example, the to-be-executed operation is a basic arithmetic operation O add , and the effect to be achieved is: | > | b > → | a + b >. Wherein, a and b are decimal numbers. The implementation process is as follows:
[0117] a. Acquire a set of quantum bits input by a user, i.e., q0, q1, q2, q3, q4, q5, q6, q7, q8. Representing the 0th to 8th quantum bits, the order from high to low is q8q7q6q5q4q3q2q1q0, wherein q3q2q1q0 is designated as the first quantum bit, and q7q6q5q4 is designated as the second quantum bit, which is used to encode b before the specific operation and the operation result of a + b after the specific operation.
[0118] b、for the set of qubits corresponding to 2 9 = 512 eigenstates, each of which corresponds to a sub-state of q3q2q1q0and q7q6q5q4;
[0119] c、the values corresponding to each sub-state are added, and the result is encoded into the second quantum bit, i.e., q7q6q5q4.
[0120] It should be noted that the values corresponding to each sub-state used in the above process for addition can be binary values or decimal values. When it is a decimal value, the storage of the decimal number on the quantum state can be simply described as converting the decimal number to a binary number, and encoding the binary number to a quantum bit with a specified number of bits. The specified number of bits can be equal to 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 the above addition operation, which will not be described here.
[0122] S2043: When the to-be-executed operation is in the transposed conjugate state, the inverse operation of the specific operation is performed on the values corresponding to the sub-state of the first quantum bit and the sub-state of the second quantum bit in each eigenstate of the quantum state space, and the result is encoded into the second quantum bit.
[0123] It can be understood that the inverse operation of addition operation is subtraction operation; the inverse operation of subtraction operation is addition operation; the inverse operation of multiplication operation is division operation; and the inverse operation of division operation is multiplication operation.
[0124] Specifically, the auxiliary identifier is information carried by the operation identifier, and the auxiliary identifier can be a symbol in the upper right corner of the operation identifier, for example.
[0125] At the same time, the auxiliary identifier has two states, which are used to represent that the to-be-executed operation is not in the transposed conjugate state and the to-be-executed operation is in the transposed conjugate state, respectively.
[0126] Optionally, the two states of the symbol are non-existent state and existing state, the former is used to represent that the to-be-executed operation is not in the transposed conjugate state, and the latter is used to represent that the to-be-executed operation is in the transposed conjugate state.
[0127] Optionally, the non-existent state can be represented by 0, or it can be represented by omitting any information; the existing state can be represented by 1 or a specified symbol; and the specified symbol can be The identifier of the transposed conjugate state of the quantum logic gate (read as Dagger) is consistent.
[0128] When the auxiliary identifier is a symbol in the upper right corner of the operation identifier, and when the operation to be performed is not in the transposed conjugate state, the auxiliary identifier is obtained by When the operation to be performed is in the transposed conjugate state, 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 performed is in the transposed conjugate state according to the presence or absence of the symbol. The inverse operation of the basic arithmetic operation is marked by the transposed conjugate state symbol .
[0129] For example, the addition operation identifier is O add , and the inverse operation of the addition operation can be identified as The subtraction operation identifier is O sub , and the inverse operation of the subtraction operation can be identified as The multiplication operation identifier is O multi , and the inverse operation of the addition operation can be identified as The division operation identifier is O div , and the inverse operation of the division operation can be identified as
[0130] The above inverse operation of the addition operation is taken as an example for specific description. When the operation identifier is , that is, there is an auxiliary identifier in the upper right corner. At this time, the inverse operation of the specific operation is performed on the values corresponding to the sub-quantum state representing the first quantum bit and the sub-quantum state representing the second quantum bit in each eigenstate of the quantum state space, that is, the inverse operation of the addition operation, the subtraction operation, is performed, and then the effect of |a+b>|b>→|a>|b> is realized. At this time, |a+b> and |a> are encoded by the second quantum bit, and |b> is encoded by the first quantum bit.
[0131] It should be noted that the inverse operation principles and methods of subtraction, multiplication, and division operations are the same as those of the above inverse operation of the addition operation, and will not be described here.
[0132] The above examples completely show the case when the bit storing the operation result is one of the bits representing the operation objects of the basic arithmetic operation. The case when the bit storing the operation result is not one of the bits representing the operation objects of the basic arithmetic operation will be illustrated below.
[0133] As another specific implementation of the quantum simulation method of the above to-be-executed operation, the specific operation is used for operation of two operation objects, the first quantum bit is used for representing two operation objects of the specific operation, and the second quantum bit is used for representing an operation result of the specific operation. Wherein, the specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
[0134] Then, step S204 includes: performing the specific operation or the inverse operation of the specific operation on the value corresponding to the sub quantum state of the first quantum bit and / or the value corresponding to the sub quantum state of the second quantum bit in each eigenstate of the quantum state space according to whether the to-be-executed operation is in the transposed conjugate state, specifically including:
[0135] S204-1: judging whether the to-be-executed operation is in the transposed conjugate state according to the auxiliary identifier;
[0136] Specifically, it is judged whether there is an auxiliary identifier in the upper right corner of the operation identifier If there is, it indicates that the to-be-executed operation is in the transposed conjugate state; if not, it indicates that the to-be-executed operation is not in the transposed conjugate state.
[0137] S204-2: when the to-be-executed operation is not in the transposed conjugate state, performing the specific operation on the value corresponding to the sub quantum state of the first quantum bit in each eigenstate of the quantum state space, and encoding the operation result to the second quantum bit.
[0138] For example, taking the addition operation as an example for specific description, the to-be-executed operation is a basic arithmetic operation O add : |a>|b>|0>→|a>|b>|a+b>, wherein a and b are decimal numbers. A user inputs a group of quantum bits q0, q1, q2, q3, q4, q5, q6, q7, q8, representing the 0th to 8th quantum bits, and the order from high to low is q8q7q6q5q4q3q2q1q0, wherein q5q4q3q2q1q0 is specified as the first quantum bit, and is used to encode a and encode b at the same time; q8q7q6 is specified as the second quantum bit, and is used to encode the operation result of a+b. Among 2 9 =512 eigenstates, the sub quantum state corresponding to q5q4q3q2q1q0 is obtained, and the values of the sub quantum states of q5q4q3q2q1q0 encoding a and encoding b are added, and the operation result is encoded to the second quantum bit, i.e. to q8q7q6. In this process, the initial sub quantum state of q8q7q6 can be set; optionally, the initial sub quantum state of q8q7q6 is 0 state.
[0139] It should be noted that when the first quantum bit q5q4q3q2q1q0 is used to encode a and encode b at the same time, q5q4q3q2q1q0 can be equally divided, so that q5q4q3 is used to encode a, 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 quantum bit can be a 0 state, at which time only the eigenstate of the initial sub quantum state of the second quantum bit can be extracted and operated on the sub quantum state of q8q7q6, thereby achieving the effect of simplifying the calculation amount and improving the simulation speed.
[0141] S204-3: When the to-be-executed operation is in a transpose conjugate state, the sub quantum state representing the second quantum bit in each eigenstate of the quantum state space is restored 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 to-be-executed operation is in a transpose conjugate state, the sub quantum state representing the second quantum bit in each eigenstate of the quantum state space is restored to the initial sub quantum state.
[0143] An exemplary inverse operation of the addition operation There is an auxiliary identifier At this time, the sub quantum state representing the second quantum bit in each eigenstate of the quantum state space is restored to the initial sub quantum state, that is, the sub quantum state representing the operation result a+b on the second quantum bit is restored to the initial sub quantum state, and optionally, the initial sub quantum state is a 0 state, thereby realizing The operation effect represented by |a>|b>|a+b>→|a>|b>|0>.
[0144] The above process completely describes the specific operation of the to-be-executed operation for the operation of two operation objects, including but not limited to addition, subtraction, multiplication, division, etc. Any operation for two operation objects performed according to the principles and methods of the above scheme should be within the protection scope of the above scheme.
[0145] As another specific implementation of the above quantum simulation method of the to-be-executed operation, the specific operation is used for the operation of one operation object, the first quantum bit is used to represent an operation object of the specific operation, and the second quantum bit 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.
[0146] If the operation to be executed is in the transposed conjugate state, the specific operation or the inverse operation of the specific operation is performed on the numerical value corresponding to the sub quantum state of the first quantum bit and / or the numerical value corresponding to the sub quantum state of the second quantum bit in each eigenstate of the quantum state space according to whether the operation to be executed is in the transposed conjugate state, specifically comprising:
[0147] S204-a: judging whether the operation to be executed is in the transposed conjugate state according to the auxiliary identifier.
[0148] Specifically, it is judged whether there is an auxiliary identifier in the upper right corner of the operation identifier If there is, it indicates that the operation to be executed is in the transposed conjugate state; if not, it indicates that the operation to be executed is not in the transposed conjugate state.
[0149] S204-b: when the operation to be executed is not in the transposed conjugate state, the specific operation is performed on the numerical value corresponding to the sub quantum state of the first quantum bit in each eigenstate of the quantum state space, and the operation result is encoded to the second quantum bit. For example, the exponential function operation is taken as an example for specific description, and the basic arithmetic operation Aa b : |b>|a>→|b>|a b , wherein a is a known decimal number, and b is an arbitrary decimal number that can be represented by a quantum state.
[0150] The user inputs a set of quantum bits q0, q1, q2, q3, q4, q5, q6, q7, q8, representing the 0th to 8th quantum bits, and the order from high to low is q8q7q6q5q4q3q2q1q0, wherein q3q2q1q0 is specified as the first quantum bit and is used to encode b; q7q6q5q4 is specified as the second quantum bit and is used to encode the operation result of a b 9 Among the 2=512 eigenstates corresponding to the set of quantum bits, the corresponding q3q2q1q0 sub quantum state is obtained. Then the numerical value corresponding to the sub quantum state is subjected to exponential operation with base a, and the operation result is encoded to the second quantum bit, i.e. q7q6q5q4.
[0151] It should be noted that in the above process, the initial sub quantum state of the second quantum bit can be 0 state, at this time only the eigenstate with the initial sub quantum state of the second quantum bit as 0 state can be subjected to the extraction of the sub quantum state corresponding to q3q2q1q0 and the operation, thereby achieving the effect of simplifying the calculation amount and improving the simulation speed.
[0152] The principles and methods of power function operation, logarithmic function operation, trigonometric function operation and inverse trigonometric function operation are the same as the above exponential function operation, which will not be repeated here.
[0153] S204-c: when the to-be-executed operation is in a transpose conjugate state, restoring the sub quantum state representing the second quantum bit in each eigenstate of the quantum state space to an initial sub quantum state.
[0154] Specifically, when the auxiliary identifier in the upper right corner of the operation identifier is , that is, when the to-be-executed operation is in a transpose conjugate state, the sub quantum state representing the second quantum bit in each eigenstate of the quantum state space is restored to an initial sub quantum state.
[0155] Exemplarily, the inverse operation of the exponential function has an auxiliary identifier , the sub quantum state representing the second quantum bit is restored to an initial sub quantum state, that is, the sub quantum state representing the second quantum bit is restored to a b , the operation result is restored to an initial sub quantum state, and optionally, the initial sub quantum state is a 0 state, thereby realizing represents the operation effect of |b>|a b .
[0156] In quantum applications, an Oracle can be constructed, and the internal principle of the Oracle is the method flow of the present application. Specifically, the Oracle can be understood as a module (similar to a black box) that completes a specific function in a quantum algorithm, and in specific problems, there will be specific implementation methods.
[0157] At present, existing quantum circuit construction can often only use existing single quantum logic gates, double quantum logic gates, etc., and usually has the following problems:
[0158] For quantum circuits with relatively complex functions, a large number of quantum bits are needed, which will consume a huge amount of memory space when simulated using a classical computer, and a large number of logic gates are needed, which will take a very long time to simulate. In addition, some complex algorithms are difficult to implement using quantum circuits.
[0159] Therefore, the complex function of mutual conversion between quantum states corresponding to the quantum simulation representation of the specific operation operation of the Oracle simulation is realized, and the controlled function is realized. The parameters of the Oracle input by the user can include: Oracle name (used to identify the function of the Oracle), the aforementioned group of quantum bits, operation identifier, etc. The O M represents the conversion of the first representation to the second representation, and the auxiliary identifier , that is represents the conversion of the second representation to the first representation, wherein OM Oracle is an abbreviation of the specific operation represented by Oracle.
[0160] The advantage of this way is that the Oracle is taken as a known module as a whole without paying attention to the internal implementation details, and it is very simple and clear on the representation of quantum application scenarios such as quantum circuits. Since the Oracle function module of classical simulation can be equivalent to a quantum logic gate to construct a complex quantum circuit, the memory space required at runtime is saved, and the simulation verification of the quantum algorithm is accelerated.
[0161] It can be seen that, compared with the prior art, the quantum simulation method of the operation to be executed provided by the present application establishes the relationship between the operation object of the specific operation to be executed and the quantum bit, and realizes the simulation of the operation to be executed supporting the specific operation or the inverse operation of the specific operation by operating the quantum state corresponding value, so that the operation to be executed has the characteristic of supporting unitary transformation of analog quantum logic gates, and further realizes the simulation of the operation to be executed corresponding to the specific operation in the quantum circuit, filling the gap in the related art.
[0162] The above process completely describes the operation of the specific operation to be executed on an operation object, including but not limited to power function operation, exponential function operation, logarithmic function operation, trigonometric function operation and inverse trigonometric function operation, etc. Any operation for an operation object performed according to the principles and methods of the above scheme should be within the protection scope of the above scheme.
[0163] Referring to Figure 3 , Figure 3 is a structural schematic diagram of a quantum simulation device for an operation to be executed provided by an embodiment of the present application, and Figure 2 corresponding to the flow shown in FIG. 1, can include:
[0164] The operation identifier acquisition module 301 is configured to acquire an operation identifier, wherein the operation identifier is used to represent a specific operation corresponding to the operation to be executed.
[0165] The auxiliary identifier acquisition module 302 is configured to acquire an auxiliary identifier, wherein the auxiliary identifier is used to represent whether the operation to be executed is in a transposed conjugate state.
[0166] The first acquisition module 303 is connected with the operation identifier acquisition module and is configured to acquire a group of quantum bit positions and quantum state spaces represented thereby; 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 an 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 an operation result of the specific operation.
[0167] The operation module 304 is connected with the auxiliary identifier obtaining module and the first obtaining module, and is configured to perform the specific operation or the inverse operation of the specific operation on the numerical value corresponding to the sub quantum state of the first quantum bit and / or the numerical value corresponding to the sub quantum state of the second quantum bit in each eigenstate of the quantum state space according to whether the to-be-executed operation is in the transposed conjugate state.
[0168] Preferably, as shown in the structural schematic diagram of the quantum simulation device for a to-be-executed operation provided by the embodiment of the application, the first obtaining module 303 comprises: Figure 4
[0169] The first sub operation module 3031 is configured to perform the specific operation on two operation objects, the first quantum bit is configured to represent one operation object of the specific operation, the second quantum bit is configured to represent another operation object of the specific operation and represent the operation result of the specific operation. The specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
[0170] Preferably, as shown in the structural schematic diagram of the quantum simulation device for a to-be-executed operation provided by the embodiment of the application, the operation module 304 specifically comprises: Figure 4
[0171] The first judgment module 3041 is configured to determine whether the to-be-executed operation is in the transposed conjugate state according to the auxiliary identifier.
[0172] The first execution module 3042 is configured to perform the specific operation on the numerical value corresponding to the sub quantum state of the first quantum bit and the numerical value corresponding to the sub quantum state of the second quantum bit in each eigenstate of the quantum state space and encode the operation result to the second quantum bit when the to-be-executed operation is not in the transposed conjugate state.
[0173] When the to-be-executed operation is in the transposed conjugate state, the inverse operation of the specific operation is performed on the numerical value corresponding to the sub quantum state of the first quantum bit and the numerical value corresponding to the sub quantum state of the second quantum bit in each eigenstate of the quantum state space, and the operation result is encoded to the second quantum bit.
[0174] Preferably, as shown in the structural schematic diagram of the quantum simulation device for a to-be-executed operation provided by the embodiment of the application, the first obtaining module 303 comprises: Figure 5
[0175] The second sub-operation module 303-1 is configured to perform the specific operation on two operation objects; the first quantum bit is configured to represent two operation objects of the specific operation, and the second quantum bit is configured to represent an operation result of the specific operation. The specific operation is one of addition, subtraction, multiplication and division.
[0176] The operation module 304 specifically includes:
[0177] The second judgment module 304-1 is configured to determine whether the to-be-executed operation is in a transpose conjugate state according to the auxiliary identifier.
[0178] The second execution module 304-2 is configured to perform the specific operation on a value corresponding to a sub quantum state representing the first quantum bit in each eigenstate of the quantum state space, and encode an operation result to the second quantum bit when the to-be-executed operation is not in the transpose conjugate state.
[0179] The sub quantum state representing the second quantum bit in each eigenstate of the quantum state space is restored to an initial sub quantum state when the to-be-executed operation is in the transpose conjugate state.
[0180] Preferably, as shown in Figure 6 The first acquisition module 303 includes:
[0181] The third sub-operation module 303-a is configured to perform the specific operation on one operation object; the first quantum bit is configured to represent one operation object of the specific operation, and the second quantum bit is configured to represent an operation result of the specific operation. The specific operation is one of a power function operation, an exponential function operation, a logarithm function operation, a trigonometric function operation and an inverse trigonometric function operation.
[0182] Preferably, as shown in Figure 6 The operation module 304 specifically includes:
[0183] The third judgment module 304-a is configured to determine whether the to-be-executed operation is in a transpose conjugate state according to the auxiliary identifier.
[0184] The third execution module 304-b is configured to perform the specific operation on a value corresponding to a sub quantum state representing the first quantum bit in each eigenstate of the quantum state space, and encode an operation result to the second quantum bit when the to-be-executed operation is not in the transpose conjugate state.
[0185] When the to-be-executed operation is in a transposed conjugate state, a sub quantum state representing the second quantum bit in each eigenstate of the quantum state space is restored to an initial sub quantum state.
[0186] An electronic device is provided, including a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the method embodiments.
[0187] Specifically, the electronic device can further include a transmission device connected to the processor and an input / output device connected to the processor.
[0188] Specifically, in the embodiment, the processor can be configured to perform the following steps through the computer program:
[0189] S201: Obtain an operation identifier, the operation identifier being used to represent a specific operation corresponding to a to-be-executed operation;
[0190] S202: Obtain an auxiliary identifier, the auxiliary identifier being used to represent whether the to-be-executed operation is in a transposed conjugate state;
[0191] S203: Obtain a set of quantum bits and a quantum state space represented thereby; the set of quantum bits includes a first quantum bit and a second quantum bit; the first quantum bit is used to represent an operation object of the specific operation, and the second quantum bit is used to represent the operation object of the specific operation and / or represent an operation result of the specific operation;
[0192] S204: According to whether the to-be-executed operation is in the transposed conjugate state, perform the specific operation or an inverse operation of the specific operation on a value corresponding to a sub quantum state representing the first quantum bit in each eigenstate of the quantum state space and / or a value corresponding to a sub quantum state of the second quantum bit.
[0193] Compared with the prior art, the quantum simulation method of the to-be-executed operation provided by the present application establishes the relationship between the operation object of the specific operation of the to-be-executed operation and the quantum bit, and realizes the simulation of the to-be-executed operation supporting the specific operation or the inverse operation of the specific operation by operating the quantum state corresponding value, so that the to-be-executed operation has the characteristic of supporting unitary transformation of the analog quantum logic gate, and the simulation of the to-be-executed operation corresponding to the specific operation in the quantum circuit is realized, which fills the gap in the related art.
[0194] The embodiment of the present application further provides a storage medium, the storage medium stores a computer program, and the computer program is configured to perform the steps in any of the method embodiments when running.
[0195] Specifically, in the embodiment, the storage medium can be configured to store a computer program for executing the following steps:
[0196] S201: Obtain an operation identifier, the operation identifier being used to indicate a specific operation corresponding to a to-be-executed operation;
[0197] S202: Obtain an auxiliary identifier, the auxiliary identifier being used to indicate whether the to-be-executed operation is in a transposed conjugate state;
[0198] S203: Obtain a set of quantum bit positions and quantum state spaces represented thereby; the set of quantum bit positions comprises a first quantum bit position and a second quantum bit position; the first quantum bit position is used to represent an 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 an operation result of the specific operation;
[0199] S204: According to whether the to-be-executed operation is in the transposed conjugate state, perform the specific operation or an inverse operation of the specific operation on values corresponding to sub-quantum states of the first quantum bit position and / or values corresponding to sub-quantum states of the second quantum bit position in each eigenstate of the quantum state space.
[0200] Specifically, in the embodiment, the storage medium can include but is not limited to a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various storage media that can store a computer program.
[0201] Compared with the prior art, the quantum simulation method of the to-be-executed operation provided by the present application establishes a relationship between an operation object of a specific operation of a to-be-executed operation and a quantum bit position, and realizes simulation of the to-be-executed operation supporting the specific operation or an inverse operation of the specific operation by operating values corresponding to quantum states, so that the to-be-executed operation has a characteristic of supporting unitary transformation similar to a quantum logic gate, and thus the simulation of the to-be-executed operation corresponding to the specific operation in a quantum circuit is realized, and a blank in related technologies is filled.
[0202] The above describes the structure, features and effects of the present application in detail according to the embodiments shown in the drawings, and the above description is only a preferred embodiment of the present application, but the present application is not limited to the embodiments shown in the drawings, any change or modification made according to the concept of the present application, or an equivalent embodiment with equivalent changes, as long as it is within the scope of the present application, should be within the protection scope of the present application.
Claims
1. A quantum simulation method of an operation to be performed, characterized by, The method comprises: an operation identifier is acquired, the operation identifier being used to indicate a specific operation corresponding to an operation to be executed; an auxiliary identifier is acquired, the auxiliary identifier being used to indicate whether the operation to be executed is in a transposed conjugate state; a set of quantum bit positions and a quantum state space represented thereby are acquired; the set of quantum bit positions comprises a first quantum bit position and a second quantum bit position; the specific operation is used for operation on an operation object; the first quantum bit position is used to represent an operation object of the specific operation, and the second quantum bit position is used to represent an operation result of the specific operation; the specific operation is executed on a value corresponding to a sub-quantum state represented by the first quantum bit position in each eigenstate of the quantum state space according to whether the operation to be executed is in the transposed conjugate state. 2.The quantum simulation method of operations to be performed according to claim 1, wherein, The specific operation is one of a power function operation, an exponential function operation, a logarithm function operation, a trigonometric function operation, and an inverse trigonometric function operation. 3.The method of Claim 1, wherein, The specific operation is executed on a value corresponding to a sub-quantum state represented by the first quantum bit position in each eigenstate of the quantum state space according to whether the operation to be executed is in the transposed conjugate state, and specifically comprises: whether the operation to be executed is in the transposed conjugate state is determined according to the auxiliary identifier; when the operation to be executed is not in the transposed conjugate state, the specific operation is executed on a value corresponding to a sub-quantum state represented by the first quantum bit position in each eigenstate of the quantum state space, and an operation result is recorded in the second quantum bit position.
4. The quantum simulation method of an operation to be performed according to claim 3, wherein, when the operation to be executed is in the transposed conjugate state, a sub-quantum state represented by the second quantum bit position in each eigenstate of the quantum state space is restored to an initial sub-quantum state.
5. A quantum simulation apparatus to be executed an operation, characterized by, The device comprises: an operation identifier acquisition module, configured to acquire an operation identifier, the operation identifier being used to indicate a specific operation corresponding to an operation to be executed; an auxiliary identifier acquisition module, configured to acquire an auxiliary identifier, the auxiliary identifier being used to indicate whether the operation to be executed is in a transposed conjugate state; a first acquisition module connected to the operation identifier acquisition module, configured to acquire a set of quantum bit positions and a quantum state space represented thereby; the set of quantum bit positions comprises a first quantum bit position and a second quantum bit position; the specific operation is used for operation on an operation object; the first quantum bit position is used to represent an operation object of the specific operation, and the second quantum bit position is used to represent an operation result of the specific operation; an operation module connected to the auxiliary identifier acquisition module and the first acquisition module, configured to execute the specific operation on a value corresponding to a sub-quantum state represented by the first quantum bit position in each eigenstate of the quantum state space according to whether the operation to be executed is in the transposed conjugate state. 6.An electronic device comprising a memory and a processor, the electronic device comprising: The memory stores a computer program, and the processor is configured to execute the computer program to perform the method in any one of claims 1 to 4.
7. A storage medium, characterized by The storage medium stores a computer program, and the computer program is configured to execute the method in any one of claims 1 to 4 when executed.
Citation Information
Patent Citations
Low-complexity quantum circuit simulation system
CN108154240A
Quantum phase estimation of multiple eigenvalues
CN109074518A