CN116702913A - Quantum simulation method and device for operation to be executed - Google Patents

Quantum simulation method and device for operation to be executed Download PDF

Info

Publication number
CN116702913A
CN116702913A CN202310771106.0A CN202310771106A CN116702913A CN 116702913 A CN116702913 A CN 116702913A CN 202310771106 A CN202310771106 A CN 202310771106A CN 116702913 A CN116702913 A CN 116702913A
Authority
CN
China
Prior art keywords
quantum
state
representing
qubit
executed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310771106.0A
Other languages
Chinese (zh)
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Benyuan Quantum Computing Technology Hefei Co ltd
Original Assignee
Benyuan Quantum Computing Technology Hefei Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Benyuan Quantum Computing Technology Hefei Co ltd filed Critical Benyuan Quantum Computing Technology Hefei Co ltd
Priority to CN202310771106.0A priority Critical patent/CN116702913A/en
Publication of CN116702913A publication Critical patent/CN116702913A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/20Models of quantum computing, e.g. quantum circuits or universal quantum computers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/60Quantum algorithms, e.g. based on quantum optimisation, quantum Fourier or Hadamard transforms
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computing Systems (AREA)
  • Computational Mathematics (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Computer Hardware Design (AREA)
  • Geometry (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Complex Calculations (AREA)

Abstract

The application discloses a quantum simulation method and a device for an operation to be executed, wherein the method comprises the following steps: acquiring an operation identifier, which is used for representing a specific operation corresponding to an operation to be executed; acquiring an auxiliary identifier for indicating whether an operation to be performed is in a transposed conjugation state; acquiring a group of quantum bits and a quantum state space represented by the group of quantum bits; one qubit comprises a first qubit and a second qubit; the first quantum bit is used for representing an operation object of a specific operation, and the second quantum bit is used for representing the operation object of the specific operation and/or representing an operation result of the specific operation; and executing specific operation or 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 representing the second quantum bit in each eigenstate of the quantum state space according to whether the operation to be executed is in a transposed conjugated state. The application establishes the relation between the operation to be executed and the qubit and fills the technical blank.

Description

Quantum simulation method and device for operation to be executed
The application discloses a quantum simulation method and a device for operation to be executed, which are classified application with the application date of 2020, 01 and 21, the application number of 202010072072.2 and the patent name of the quantum simulation method and the device.
Technical Field
The invention belongs to the field of quantum computing, and particularly relates to a quantum simulation method and device for operation to be executed, an electronic device and a storage medium.
Background
Quantum computers use the superposition of quanta and in theory have the ability to accelerate exponentially in some cases. For example, cracking RSA keys takes hundreds of years on classical computers, while executing quantum algorithms on quantum computers takes only a few hours. However, the current quantum computer is limited by the limited number of controllable bits caused by the development of quantum chip hardware, so that the computing power is limited, and the quantum algorithm cannot be universally run. Generally, quantum algorithms are operated by quantum computing simulation methods.
In the simulation implementation of the quantum algorithm, it is generally necessary to construct the quantum algorithm by means of various quantum logic gates, but when the quantum algorithm is constructed by means of various quantum logic gates, there is no quantum logic gate operation corresponding to basic arithmetic operation functions such as addition, subtraction, multiplication, division and the like of numerical values and corresponding inverse operation operations thereof, and there is no quantum logic gate operation capable of realizing basic elementary function operation functions such as power functions, exponential functions, logarithmic functions, trigonometric functions, inverse trigonometric functions and the like of numerical values and corresponding inverse operation operations thereof. When the equivalent quantum logic gate for realizing the corresponding functions is constructed by means of various quantum logic gates, the quantity of various quantum logic gates needed is huge, and quantum circuits corresponding to the constructed quantum algorithm are too complex, so that the research of quantum computing is seriously hampered.
Therefore, it is highly desirable to provide a quantum simulation method for simulating the above functional arithmetic operations in a quantum circuit, so as to fill the gap of the related art.
Disclosure of Invention
The invention aims to provide a quantum simulation method, a device, an electronic device and a storage medium for an operation to be executed, which are used for solving the defects in the prior art, filling the blank of the related art and simulating the operation to be executed in a quantum circuit.
The technical scheme adopted by the invention is as follows:
a quantum simulation method of an operation to be performed, the method comprising:
acquiring an operation identifier, wherein the operation identifier is used for representing a specific operation corresponding to an operation to be executed;
acquiring an auxiliary identifier, wherein the auxiliary identifier is used for indicating whether an operation to be performed is in a transpose conjugation state;
acquiring a group of quantum bits and a quantum state space represented by the group of quantum bits; the set of qubits includes a first qubit and a second qubit; the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing the operation object of the specific operation and/or representing an operation result of the specific operation;
And executing 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 executed is in a transposed conjugated state.
The quantum simulation method of an operation to be performed as described above, wherein preferably the specific operation is an operation for two operation objects;
the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing another operation object of the specific operation and representing an operation result of the specific operation.
The quantum simulation method of an operation to be performed as described above, wherein preferably the specific operation is one of an addition operation, a subtraction operation, a multiplication operation, and a division operation.
In the quantum simulation method for an operation to be performed 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 representing the first qubit and/or the value corresponding to the sub-quantum state of the second qubit in each eigenstate of the quantum state space according to whether the operation to be performed is in a transposed conjugated state specifically includes:
Judging whether the operation to be executed is in a transpose conjugation state or not according to the auxiliary identifier;
and when the operation to be executed is not in a transposed conjugated state, executing the specific operation on the numerical value corresponding to the sub-quantum state representing 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 compiling an operation result to the second quantum bit.
In the quantum simulation method for an operation to be performed as described above, it is preferable that when the operation to be performed is in a transposed conjugated state, an inverse operation of the specific operation is performed on a value corresponding to a sub-quantum state representing the first qubit and a value corresponding to a sub-quantum state of the second qubit in each eigenstate of the quantum state space, and an operation result is compiled to the second qubit.
The quantum simulation method of an operation to be performed as described above, wherein preferably the specific operation is an operation for two operation objects;
the first qubit is used for representing two operation objects of the specific operation, and the second qubit is used for representing an operation result of the specific operation.
The quantum simulation method of an operation to be performed as described above, wherein preferably the specific operation is one of an addition operation, a subtraction operation, a multiplication operation, and a division operation.
In the quantum simulation method for an operation to be performed 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 representing the first qubit and/or the value corresponding to the sub-quantum state of the second qubit in each eigenstate of the quantum state space according to whether the operation to be performed is in a transposed conjugated state specifically includes:
judging whether the operation to be executed is in a transpose conjugation state or not according to the auxiliary identifier;
and when the operation to be executed is not in a transposed conjugated state, executing 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 compiling an operation result to the second quantum bit.
In the quantum simulation method for an operation to be performed as described above, it is preferable that when the operation to be performed is in a transposed conjugated state, a sub-quantum state representing the second qubit in each eigenstate of the quantum state space is restored to an initial sub-quantum state.
The quantum simulation method of an operation to be performed as described above, wherein preferably the specific operation is for an operation of one operation object;
the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing an operation result of the specific operation.
The quantum simulation method of an operation to be performed as described above, wherein it is preferable that the specific operation is one of a power function operation, an exponential function operation, a logarithmic function operation, a trigonometric function operation, and an inverse trigonometric function operation.
In the quantum simulation method for an operation to be performed 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 representing the first qubit and/or the value corresponding to the sub-quantum state of the second qubit in each eigenstate of the quantum state space according to whether the operation to be performed is in a transposed conjugated state specifically includes:
judging whether the operation to be executed is in a transpose conjugation state or not according to the auxiliary identifier;
and when the operation to be executed is not in a transposed conjugated state, executing 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 compiling an operation result to the second quantum bit.
In the quantum simulation method for an operation to be performed as described above, it is preferable that when the operation to be performed is in a transposed conjugated state, a sub-quantum state representing the second qubit in each eigenstate of the quantum state space is restored to an initial sub-quantum state.
A quantum simulation device to perform an operation, the device comprising:
the operation identifier acquisition module is used for acquiring an operation identifier, wherein the operation identifier is used for representing a specific operation corresponding to an operation to be executed;
the auxiliary identifier acquisition module is used for acquiring an auxiliary identifier, wherein the auxiliary identifier is used for indicating whether an operation to be executed is in a transpose conjugation state or not;
the first acquisition module is connected with the operation identifier acquisition module and is used for acquiring a group of quantum bits and a quantum state space represented by the quantum bits; the set of qubits includes a first qubit and a second qubit; the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing the operation object of the specific operation and/or representing an operation result of the specific operation;
the operation module is connected with the auxiliary identifier acquisition module and the first acquisition module and is used for executing 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 operation to be executed is in a transposed conjugation state.
The specific operation is used for the operation of two operation objects;
the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing another operation object of the specific operation and representing an operation result of the specific operation.
The specific operation is one of an addition operation, a subtraction operation, a multiplication operation, and a division operation.
Specifically, the operation module is specifically configured to:
judging whether the operation to be executed is in a transpose conjugation state or not according to the auxiliary identifier;
and when the operation to be executed is not in a transposed conjugated state, executing the specific operation on the numerical value corresponding to the sub-quantum state representing 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 compiling an operation result to the second quantum bit.
And when the operation to be executed is in a transposed conjugated state, performing inverse operation of the specific operation on the numerical value corresponding to the sub-quantum state representing the first quantum bit and the numerical value corresponding to the sub-quantum state representing the second quantum bit in each eigenstate of the quantum state space, and compiling an operation result to the second quantum bit.
The specific operation is used for the operation of two operation objects;
the first qubit is used for representing two operation objects of the specific operation, and the second qubit is used for representing an operation result of the specific operation.
The specific operation is one of an addition operation, a subtraction operation, a multiplication operation, and a division operation.
Judging whether the operation to be executed is in a transpose conjugation state or not according to the auxiliary identifier;
and when the operation to be executed is not in a transposed conjugated state, executing 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 compiling an operation result to the second quantum bit.
And when the operation to be executed is in a transposed conjugated 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.
The specific operation is used for the operation of one operation object;
the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing an operation result of the specific operation.
The specific operation is one of power function operation, exponential function operation, logarithmic function operation, trigonometric function operation and inverse trigonometric function operation.
The executing the specific operation or the inverse operation of the specific operation on the value corresponding to the sub-quantum state representing the first quantum bit and/or the value corresponding to the sub-quantum state representing the second quantum bit in each eigenstate of the quantum state space according to whether the operation to be executed is in a transposed conjugated state specifically includes:
judging whether the operation to be executed is in a transpose conjugation state or not according to the auxiliary identifier;
and when the operation to be executed is not in a transposed conjugated state, executing 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 compiling an operation result to the second quantum bit.
And when the operation to be executed is in a transposed conjugated 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.
An electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the method of any of the preceding claims.
A storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of the preceding claims when run.
Compared with the prior art, the quantum simulation method for the operation to be executed establishes the relation between the operation object of the specific operation of the operation to be executed and the quantum bit, and specifically comprises the following steps: the set of qubits includes a first qubit and a second qubit; the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing the operation object of the specific operation and/or representing an operation result of the specific operation; and according to the transposed conjugated state of the operation to be performed, 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 of one quantum bit. Furthermore, through the operation of the corresponding numerical value of the quantum state, the simulation of the operation to be executed supporting 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 of an analog quantum logic gate, the simulation of the operation to be executed corresponding to the specific operation in the quantum circuit is realized, and the blank of the related technology is filled.
Drawings
Fig. 1 is a hardware block diagram of a computer terminal of a quantum simulation method to be operated according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a quantum simulation method for performing an operation according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a quantum simulation device to be operated according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a quantum simulation device to be operated according to another embodiment of the present application;
FIG. 5 is a schematic diagram of a quantum simulation device to be operated according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of a quantum simulation device to be operated according to still another embodiment of the present application.
Detailed Description
The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application.
It should be noted that the terms "first," "second," and the like in the description and in the claims are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The embodiment of the application provides a quantum simulation method for realizing operations to be executed, which is used for simulating the operations to be executed in a quantum circuit, wherein the operations to be executed correspond to specific operations, and the method can be applied to electronic equipment such as mobile terminals, particularly mobile phones and tablet computers; such as computer terminals, in particular general computers, quantum computers, etc.
The following describes the operation of the computer terminal in detail by taking it as an example. FIG. 1 is a block diagram of a quantum computing analog hardware architecture according to an embodiment of the application. As shown in fig. 1, the computer terminal 10 may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and optionally, a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the quantum computing simulation method in the embodiment of the present application, and the processor 102 executes the software programs and modules stored in the memory 104 to perform various functional applications and data processing, i.e., implement the method described above. 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 examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. The specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
It should be noted that a real quantum computer is a hybrid structure, which includes two major parts: part of the computers are classical computers and are responsible for performing classical computation and control; the other part is quantum equipment, which is responsible for running quantum programs so as to realize quantum computation. The quantum program is a series of instruction sequences written by a quantum language such as the qlunes language and capable of running on a quantum computer, so that the support of quantum logic gate operation is realized, and finally, quantum computing is realized. Specifically, the quantum program is a series of instruction sequences for operating the quantum logic gate according to a certain time sequence.
In practical applications, quantum computing simulations are often required to verify quantum algorithms, quantum applications, etc., due to the development of quantum device hardware. Quantum computing simulation is a process of realizing simulated operation of a quantum program corresponding to a specific problem by means of a virtual architecture (namely a quantum virtual machine) built by resources of a common computer. In general, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program, namely the program for representing the quantum bit and the evolution thereof written in the classical language, wherein the quantum bit, the quantum logic gate and the like related to quantum computation are all represented by corresponding classical codes.
Quantum circuits, which are one embodiment of quantum programs, also weigh sub-logic circuits, are the most commonly used general quantum computing models, representing circuits that operate on qubits under an abstract concept, the composition of which includes qubits, circuits (timelines), and various quantum logic gates, and finally the results often need to be read out by quantum measurement operations.
Unlike conventional circuits, which are connected by metal lines to carry voltage or current signals, in a quantum circuit, the circuit can be seen as being connected by time, i.e., the state of the qubit naturally evolves over time, as indicated by the hamiltonian operator, during which it is operated until a logic gate is encountered.
One quantum program is corresponding to one total quantum circuit, and the quantum program refers to the total quantum circuit, wherein the total number of quantum bits in the total quantum circuit is the same as the total number of quantum bits of the quantum program. It can be understood that: one quantum program may consist of a quantum circuit, a measurement operation for the quantum bits in the quantum circuit, a register to hold the measurement results, and a control flow node (jump instruction), and one quantum circuit may contain several tens to hundreds or even thousands of quantum logic gate operations. The execution process of the quantum program is a process of executing all quantum logic gates according to a certain time sequence. Note that the timing is the time sequence in which a single quantum logic gate is executed.
It should be noted that in classical computation, the most basic unit is a bit, and the most basic control mode is a logic gate, and the purpose of the control circuit can be achieved by a combination of logic gates. Similarly, the way in which the qubits are handled is a quantum logic gate. Quantum logic gates are used, which are the basis for forming a quantum circuit, and comprise single-bit quantum logic gates, such as Hadamard gates (H gates), pauli-X gates, pauli-Y gates, pauli-Z gates, RX gates, RY gates and RZ gates; multi-bit quantum logic gates such as CNOT gate, CR gate, iSWAP gate, toffoli gate. Quantum logic gates are typically represented using unitary matrices, which are not only in matrix form, but also an operation and transformation.
Currently, there are no classical operations such as four-law operation functions that can be implemented, and an example is: add, subtract, multiply, divide, or substantially elementary function functions, exemplary: in order to realize the above functions in a quantum program, a complex quantum circuit is usually constructed by a large number of common logic gates to realize the target function operation, thereby seriously affecting the development of quantum computation, and the expansion and landing of the quantum application field. The quantum implementation of the functions can play a role in verifying the construction of quantum programs and the solution of complex quantum computing problems.
As shown in fig. 2, an embodiment of the present invention provides a flow chart of a quantum simulation method for an operation to be performed, where the method includes:
s201: and acquiring an operation identifier, wherein the operation identifier is used for representing a specific operation corresponding to the operation to be executed.
An operation identifier refers to a symbol that is used to identify a particular operation, with different symbols representing different operations. In quantum simulation operations, the corresponding operation identifier may be set according to the meaning of a specific operation of a classical arithmetic operation to be simulated (i.e., an operation to be performed). The classical arithmetic operation may be a basic arithmetic operation, a basic elementary function operation, or the like.
Specifically, when the classical arithmetic operation to be simulated is a basic arithmetic operation including addition, subtraction, multiplication, 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 may be set according to the classical arithmetic operation of the operation to be performed.
For example, when the classical arithmetic operation to be simulated is a basic arithmetic operation setting, the operation identifier may be set to "O M "wherein" O "is a representation of the type of basic arithmetic operation to be performed, and is not itself meant to be exact, but may be represented by other letters; "M" represents a specific basic arithmetic operation type, which together form an operation identifier.
Illustratively, 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; setting operation identifier "O" when operation to be performed is subtraction operation sub ", which represents that the specific operation to be performed is a subtraction operation; setting operation identifier "O" when operation to be performed is multiplication operation multi "representing that the specific operation to be performed is a multiplication operation; setting operation identifier "O" when operation to be performed is division operation div "it represents that the specific operation to be performed is a division operation.
Further exemplary, when the specific operation of the operation to be performed is a basic elementary function operation, an operation identifier "A" may be set y "representative" wherein "a" is a representation of the operation to be performed, such as a basic elementary function, and has no definite meaning per se, and may be represented by other letters; "y" represents a specific basis function, which together form an operation identifier.
Illustratively, when y=sinx, the operation identifier "Asinx" represents a sinusoidal trigonometric function operation.
The other elementary function operation identifiers have similar expression patterns to those of the trigonometric function operation identifiers, and are not described in detail herein.
S202: a secondary identifier is obtained, the secondary identifier being used to indicate whether the operation to be performed is in a transpose conjugation state.
Specifically, the auxiliary identifier may be obtained as carrying information of the operation identifier, and the auxiliary identifier may be a symbol in the upper right corner of the operation identifier.
Meanwhile, the auxiliary identifier has two states, which are respectively used for indicating that the operation to be executed is not in the transposed conjugation state and the operation to be executed is in the transposed conjugation state.
Alternatively, the symbol has two states, an absent state and an present state, the former being used to indicate that the operation to be performed is not in a transposed conjugated state and the latter being used to indicate that the operation to be performed is in a transposed conjugated state.
Alternatively, the former state indicating absence may be indicated by 0, or any information indication may be omitted from being displayed; the latter representing the presence status may be numbered with a 1 or a designated symbol; wherein the designated symbol may beIdentifier in the state conjugated to the transpose of the quantum logic gate +.>(reading Dagger) is consistent.
When the auxiliary identifier is an operation labelA symbol in the upper right corner of the identifier, and when the operation to be performed is indicated not to be in the transposed conjugated state by omitting the display of no information representation, by When the operation to be performed is in the transpose conjugation state, the auxiliary identifier is obtained, which can be understood as judging whether the upper right corner of the operation identifier is in the +.>Sign according to->The presence or absence of a symbol determines whether an operation to be performed is in a transpose conjugated state.
S203: acquiring a group of quantum bits and a quantum state space represented by the group of quantum bits; the set of qubits includes a first qubit and a second qubit; the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing the operation object of the specific operation and/or representing an operation result of the specific operation.
Specifically, the quantum state space represented by the qubit refers to quantum state information carried by the qubit and characterized by all eigenstates of the qubit. The number of all eigenstates corresponding to the quantum bit is the power of the number of the quantum bit of 2, and the quantum state information represented by all eigenstates is the linear superposition of all eigenstates.
For example: the set of qubits is q0, q1 and q2, and represents the 0 th, 1 st and 2 nd qubits, and the sequence from the high order to the low order is q2q1q0, so that the total number of eigenstates corresponding to the set of qubits is 8, and the eigenstates are respectively: the superposition states among the 8 eigenstates together constitute a quantum state space ψ:
ψ= 0 |000>+a 1 |001>+a 2 |010>+a 3 |011>+a 4 |100>+a 5 |101>+ 6 |110>+a 7 |111>Wherein a is 0 、a 1 、a 2 、a 3 、a 4 、a 5 、a 6 、a 7 Are all plural and
the acquisition of a set of qubits is achieved by user input, the number of the set of qubits being settable according to the basic operation of the operation to be performed. In a quantum circuit, the set of qubits is a qubit having an initial state, or a qubit carrying information of an evolving quantum state.
As a connecting bridge between a specific operation corresponding to the operation to be simulated and the qubit, the set of qubit bits includes a first qubit bit and a second qubit bit, the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing the operation object of the specific operation and/or representing an operation result of the specific operation.
It is understood that, when the operand is subjected to a specific operation to obtain an operation result, the second qubit is used to indicate the specific operation and indicate the operation result of the specific operation, that is, the bit storing the operation result is the bit indicating the one operand of the basic arithmetic operation, that is, the second qubit has the dual function of storing the operand and the operation result before and after the specific operation.
When the second qubit has the dual functions of storing an operation object and an operation result before and after a specific operation, on one hand, the number of qubits required for simulating basic arithmetic operation is reduced; on the other hand, the simulation of the basic arithmetic operation reverse operation can be facilitated.
S204: and executing 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 executed is in a transposed conjugated state.
As described above, the auxiliary identifier is used to indicate whether the operation to be performed is in a transpose conjugated state; during specific operation, whether the operation to be executed is in a transpose conjugation state or not can be judged according to the auxiliary identifier; and then executing 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 the judging result.
Through steps S201 to S204, a relationship between an operand of a specific operation to be performed and a qubit is established, specifically: the set of qubits includes a first qubit and a second qubit; the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing the operation object of the specific operation and/or representing an operation result of the specific operation; and according to the transposed conjugated state of the operation to be performed, 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 of one quantum bit. Furthermore, through the operation of the corresponding numerical value of the quantum state, the simulation of the operation to be executed supporting 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 of an analog quantum logic gate, the simulation of the operation to be executed corresponding to the specific operation in the quantum circuit is realized, and the blank of the related technology is filled.
As a specific implementation of the above quantum simulation method of an operation to be performed, the specific operation is for an operation of two operation objects, the first qubit is for representing one operation object of the specific operation, and the second qubit is for representing another operation object of the specific operation and an operation result representing the specific operation. Wherein the specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
Step S204, according to whether the operation to be performed is in a transposed conjugated state, of performing the specific operation or an 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 of the second qubit in each eigenstate of the quantum state space, specifically including:
s2041: and judging whether the operation to be executed is in a transpose conjugation state or not according to the auxiliary identifier.
Specifically, the auxiliary identifier may be obtained as carrying information of the operation identifier, and the auxiliary identifier may be a symbol in the upper right corner of the operation identifier.
Meanwhile, the auxiliary identifier has two states, which are respectively used for indicating that the operation to be executed is not in the transposed conjugation state and the operation to be executed is in the transposed conjugation state.
Alternatively, the symbol has two states, an absent state and an present state, the former being used to indicate that the operation to be performed is not in a transposed conjugated state and the latter being used to indicate that the operation to be performed is in a transposed conjugated state.
Alternatively, the former state indicating absence may be indicated by 0, or any information indication may be omitted from being displayed; the latter representing the presence status may be numbered with a 1 or a designated symbol; wherein the designated symbol may beIdentifier in the state conjugated to the transpose of the quantum logic gate +.>(reading Dagger) is consistent.
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 conjugated state by omitting any informationWhen the operation to be performed is in the transpose conjugation state, the auxiliary identifier is obtained, which can be understood as judging whether the upper right corner of the operation identifier is in the +.>Sign according to->The presence or absence of a symbol determines whether an operation to be performed is in a transpose conjugated state. If yes, indicating that the operation to be executed is in a transposed conjugation state; if not, the operation to be executed is not in the transposed conjugation state.
S2042: and when the operation to be executed is not in a transposed conjugated state, executing the specific operation on the numerical value corresponding to the sub-quantum state representing 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 compiling an operation result to the second quantum bit.
Illustratively, the addition operation is taken as an example to specifically describe the basic arithmetic operation O for the operation to be performed add The effect to be achieved is that: |>|b>→|a+b>|>. Wherein a and b are decimal numbers. The implementation procedure is as follows:
a. a set of qubits q0, q1, q2, q3, q4, q5, q6, q7, q8 input by the user is obtained. Representing the 0 th to 8 th qubits, ordered from high to low as q8q7q6q5q4q3q2q1q0, wherein q3q2q1q0 is designated as the first qubit for encoding a; designating q7q6q5q4 as a second qubit for encoding b before a specific operation and a+b operation result after the specific operation is performed;
b. 2 for the set of quantized sub-bits 9 Of the 512 eigenstates, sub-quantum states corresponding to q3q2q1q0 and q7q6q5q4 are obtained;
c. and adding the numerical values corresponding to the sub-quantum states, and encoding the operation result to a second quantum bit, namely encoding to q7q6q5q4.
It should be noted that, the numerical value corresponding to each sub-quantum state used for the addition operation in the above process may be a binary value or a decimal value. In the case of decimal values, the storage implementation of a decimal number on a quantum state can be described simply as converting the decimal number to a binary number, encoding the binary number onto a quantum bit of the specified number of bits. The specified number of bits may 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.
It should be noted that the principle and method of the operations of subtraction, multiplication and division are the same as those of the addition operation described above, and will not be described here again.
S2043: and when the operation to be executed is in a transposed conjugated state, performing inverse operation of the specific operation on the numerical value corresponding to the sub-quantum state representing the first quantum bit and the numerical value corresponding to the sub-quantum state representing the second quantum bit in each eigenstate of the quantum state space, and compiling an operation result to the second quantum bit.
It will be appreciated that the inverse operation corresponding to the addition operation is a subtraction operation; the inverse operation corresponding to the subtraction operation is addition operation; the inverse operation corresponding to the multiplication operation is division operation; the inverse operation corresponding to the division operation is a multiplication operation.
Specifically, the auxiliary identifier may be obtained as carrying information of the operation identifier, and the auxiliary identifier may be a symbol in the upper right corner of the operation identifier.
Meanwhile, the auxiliary identifier has two states, which are respectively used for indicating that the operation to be executed is not in the transposed conjugation state and the operation to be executed is in the transposed conjugation state.
Alternatively, the symbol has two states, an absent state and an present state, the former being used to indicate that the operation to be performed is not in a transposed conjugated state and the latter being used to indicate that the operation to be performed is in a transposed conjugated state.
Alternatively, the former state indicating absence may be indicated by 0, or any information indication may be omitted from being displayed; the latter representing the presence status may be numbered with a 1 or a designated symbol; wherein the designated symbol may beIdentifier in the state conjugated to the transpose of the quantum logic gate +.>(reading Dagger) is consistent.
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 conjugated state by omitting the display of no information representation, the operation is performed byWhen the operation to be performed is in the transpose conjugation state, the auxiliary identifier is obtained, which can be understood as judging whether the upper right corner of the operation identifier is in the +.>Sign according to->The presence or absence of a symbol determines whether an operation to be performed is in a transpose conjugated state. The inverse of the basic arithmetic operation transposes the conjugate state symbols by quantum logic gates>And (5) marking.
Illustratively, the add operation is identified as O add The inverse of the addition operation may be identified asThe subtraction operation is identified as O sub The inverse of the subtraction operation can be identified as +.>Multiplication operation is identified as O multi The inverse of the addition operation may be identified as +.>Division operation is marked as O div The inverse of the division operation can be identified as +. >
In the specific explanation, the inverse operation of the addition operation is taken as an example, and when the operation identifier isI.e. there is a supplementary identifier in the upper right hand corner +.>At this time, the inverse operation of the specific operation, that is, the inverse operation subtraction operation of the addition 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 of the second qubit in each eigenstate of the quantum state space, thereby realizing->|a+b>|b>→|a>|b>Is effective in (1). At this time, the |a+b is encoded by the second qubit>And |a>Encoding b by a first qubit>。
It should be noted that the inverse operation principle and method of the subtraction operation, the multiplication operation and the division operation are the same as the inverse operation of the addition operation, and will not be described here again.
The above example fully shows the case when the bit of the stored operation result is one of the bits representing the operation object of the basic arithmetic operation, and the case when the bit of the stored operation result is not one of the bits representing the operation object of the basic arithmetic operation will be exemplified below.
As another implementation of the above quantum simulation method of an operation to be performed, the specific operation is for an operation of two operation objects, the first qubit is for representing the two operation objects of the specific operation, and the second qubit is 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.
Step S204, according to whether the operation to be performed is in a transposed conjugated state, of performing the specific operation or an 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 of the second qubit in each eigenstate of the quantum state space, specifically including:
s204-1: judging whether the operation to be executed is in a transpose conjugation state or not according to the auxiliary identifier;
specifically, it is determined whether the auxiliary identifier exists in the upper right corner of the operation identifierIf yes, indicating that the operation to be executed is in a transposed conjugation state; if not, the operation to be executed is not in the transposed conjugation state.
S204-2: and when the operation to be executed is not in a transposed conjugated state, executing 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 compiling an operation result to the second quantum bit.
Illustratively, the addition operation is taken as an example to specifically describe the basic arithmetic operation O for the operation to be performed add :|a>|b>|0>→|a>|b>|a+b>Wherein a and b are decimal numbers. The user inputs a group of qubits respectively q0, q1, q2, q3, q4, q5, q6, q7 and q8, representing the 0 th to 8 th qubits, and the sequence from the high order to the low order is q8q7q6q5q4q3q2q1q0, wherein q5q4q3q2q1q0 is designated as the first qubit, and is used for encoding a and b at the same time; designating q8q7q6 as a second qubit for encoding the operation result of a+b; then the set of quantized sub-bits corresponds to 2 9 In 512 eigenstates, a sub-quantum state corresponding to q5q4q3q2q1q0 is obtained, and the sub-quantum state values of the sub-quantum states of q5q4q3q2q1q0, which are respectively encoded a and b, are added, and the operation result is encodedCode to the second qubit, i.e., to q8q7q6. In the process, an initial sub-quantum state of q8q7q6 can be set; alternatively, the initial sub-quantum state of q8q7q6 is 0 state.
It should be noted that when the first qubit q5q4q3q2q1q0 is used to encode a and encode b at the same time, q5q4q3q2q1q0 may be equally divided such that q5q4q3 is used to encode a, q2q1q0 is used to encode b, or vice versa.
In addition, it should be noted that in the above process, the initial sub-quantum state of the second qubit may be 0 state, and at this time, only the eigen state of the initial sub-quantum state of the second qubit being 0 state may be extracted and operated in the sub-quantum state corresponding to q8q7q6, so as to achieve the effects of simplifying the calculation amount and improving the simulation speed.
S204-3: and when the operation to be executed is in a transposed conjugated 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.
Specifically, when the auxiliary identifier of the upper right corner of the operation identifier is And when the operation to be executed is in a transposed conjugated 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.
Exemplary, the inverse of the addition operationPresence of auxiliary identifier +.>At this time, the sub-quantum state representing the second quantum bit in each eigenstate of the quantum state space is recovered to be an initial sub-quantum state, that is, the operation result of the sub-quantum state represented on the second quantum bit being a+b is recovered to be an initial sub-quantum state, and optionally, the initial sub-quantum state is 0 state, thereby realizing->Represents |a>|b>|a+b>→|a>|b>|0>Is a combination of the above-described operation effects.
The above procedure fully describes that the specific operation to be performed is applied to the two operations of the two operation objects, including but not limited to addition operation, subtraction operation, multiplication operation, division operation, etc., and all operations applied to the two operation objects according to the principle and method of the above scheme should be within the protection scope of the above scheme.
As still another implementation of the above quantum simulation method for an operation to be performed, the specific operation is for an operation of one operation object, the first qubit is for representing an operation object of the specific operation, and the second qubit is for representing an 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.
Step S204, according to whether the operation to be performed is in a transposed conjugated state, of performing the specific operation or an 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 of the second qubit in each eigenstate of the quantum state space, specifically including:
s204-a: and judging whether the operation to be executed is in a transpose conjugation state or not according to the auxiliary identifier.
Specifically, it is determined whether the auxiliary identifier exists in the upper right corner of the operation identifierIf yes, indicating that the operation to be executed is in a transposed conjugation state; if not, the operation to be executed is not in the transposed conjugation state.
S204-b: when the operation to be performed is not in a transposed conjugated state, performing the specific operation on the numerical value corresponding to the sub-quantum state representing the first qubit in each eigenstate of the quantum state space, and performing the operationThe result is encoded into the second qubit. Illustratively, the basic arithmetic operation Aa for the operation to be performed will be specifically described by taking the exponential function operation as an example 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.
The user inputs a group of qubits respectively q0, q1, q2, q3, q4, q5, q6, q7 and q8, representing the 0 th to 8 th qubits, and the sequence from the high order to the low order is q8q7q6q5q4q3q2q1q0, wherein q3q2q1q0 is designated as the first qubit for encoding b; designating q7q6q5q4 as the second qubit for encoding a b Is a result of the operation of (a); then the set of quantized sub-bits corresponds to 2 9 Of the 512 eigenstates, the corresponding q3q2q1q0 sub-quantum state is obtained. Then, the corresponding numerical value of the sub-quantum state carries out exponential operation with a base number of a, and the operation result is encoded to a second quantum bit, namely, q7q6q5q4.
In the above process, the initial sub-quantum state of the second qubit may be 0 state, and at this time, the sub-quantum state extraction and operation corresponding to q3q2q1q0 may be performed only on the eigen state of the second qubit, where the initial sub-quantum state is 0 state, so as to achieve the effects of simplifying the calculation amount and increasing the simulation speed.
The principles and methods of the power function operation, the logarithmic function operation, the trigonometric function operation and the inverse trigonometric function operation are the same as those of the above-mentioned exponential function operation, and are not repeated here.
S204-c: and when the operation to be executed is in a transposed conjugated 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.
Specifically, when the auxiliary identifier of the upper right corner of the operation identifier isWhen the operation to be executed is in a transposed conjugated 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。
Exemplary, inverse of the exponential functionPresence of auxiliary identifier +.>At this time, the sub-quantum state representing the second qubit in each eigenstate of the quantum state space is restored to the initial sub-quantum state, namely the sub-quantum state represented on the second qubit is a b The operation result of (a) is restored to an initial sub-quantum state, and optionally, the initial sub-quantum state is 0 state, thereby realizing +.>Represents |b>|a b >→|b>|a>Is a combination of the above-described operation effects.
In quantum application, an Oracle can be constructed, and the internal principle of the Oracle is the flow of the method. In particular, oracle, a module (like a black box) that performs a specific function in a quantum algorithm, and a specific implementation will be understood in a specific problem.
Currently, existing quantum circuit construction can only utilize existing single quantum logic gates, double quantum logic gates and the like, and the following problems generally exist:
for a quantum circuit with complex functions, the number of quantum bits required is very large, huge memory space is consumed when a classical computer is used for simulation, the number of logic gates required is very large, and the simulation time is very long. And, some complex algorithms are difficult to implement using quantum wires.
Based on the method, the complex function of the mutual conversion between quantum states corresponding to the quantum simulation representation of the specific operation is realized by changing the Oracle simulation mode, and the controlled function is realized. Parameters of the user's incoming Oracle may include: oracle name (the functional purpose for identifying Oracle), the aforementioned set of quantum bits, an operation identifier, and so forth. O can be used M The representation is converted from the first representation to the second representation, and the auxiliary identifier is setI.e. < ->Converting the second representation into the first representation, wherein O M Is an abbreviation for the specific operation denoted Oracle.
The advantage of this approach is that Oracle as a whole is a known module, without paying attention to the implementation details inside it, which is very straightforward in quantum application scenarios such as quantum wire representation. Because the classical simulated Oracle function module can be equivalent to a quantum logic gate to construct a complex quantum circuit, the memory space required by running is saved, and the simulation verification of a quantum algorithm is quickened.
Compared with the prior art, the quantum simulation method for the operation to be executed establishes the relation between the operation object of the specific operation of the operation to be executed and the quantum bit, realizes the operation simulation for the operation to be executed supporting the specific operation or the inverse operation of the specific operation by the operation on the corresponding value of the quantum state, ensures that the operation to be executed has the characteristic of supporting unitary transformation of an analog quantum logic gate, realizes the simulation for the operation to be executed corresponding to the specific operation in a quantum circuit, and fills the blank of the related technology.
The above process completely describes that the specific operation to be performed is an operation for one operation object, including but not limited to power function operation, exponential function operation, logarithmic function operation, trigonometric function operation, inverse trigonometric function operation, etc., and all operations for one operation object performed according to the principles and methods of the above scheme are within the protection scope of the above scheme.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a quantum simulation device to be operated according to an embodiment of the present invention, which corresponds to the flow shown in fig. 2 and may include:
the operation identifier acquisition module 301: the method comprises the steps of acquiring an operation identifier, wherein the operation identifier is used for representing a specific operation corresponding to an operation to be executed;
auxiliary identifier acquisition module 302: the method comprises the steps of acquiring a secondary identifier, wherein the secondary identifier is used for representing whether an operation to be performed is in a transpose conjugation state;
the first acquisition module 303: the operation identifier acquisition module is connected and used for acquiring a group of quantum bits and a quantum state space represented by the quantum bits; the set of qubits includes a first qubit and a second qubit; the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing the operation object of the specific operation and/or representing an operation result of the specific operation;
The operation module 304: the auxiliary identifier acquisition module is connected with the first acquisition module and is used for executing 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 operation to be executed is in a transposed conjugated state.
Preferably, as shown in fig. 4, the first obtaining module 303 includes:
the first sub-operation module 3031 is configured to use the specific operation for an operation of two operation objects, the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing another operation object of the specific operation and an operation result of the specific operation. Wherein the specific operation is one of addition operation, subtraction operation, multiplication operation and division operation.
Preferably, the structure schematic diagram of the quantum simulation device to be operated according to the embodiment of the present invention further shown in fig. 4 is further shown, and the operation module 304 specifically includes:
A first judging module 3041, configured to judge whether the operation to be performed is in a transpose conjugation state according to the auxiliary identifier;
the first execution module 3042 is configured to execute, when the operation to be executed is not in a transposed conjugated state, the specific operation on a value corresponding to a sub-quantum state representing the first quantum bit and a value corresponding to a sub-quantum state of the second quantum bit in each eigenstate of the quantum state space, and encode an operation result to the second quantum bit;
and when the operation to be executed is in a transposed conjugated state, performing inverse operation of the specific operation on the numerical value corresponding to the sub-quantum state representing the first quantum bit and the numerical value corresponding to the sub-quantum state representing the second quantum bit in each eigenstate of the quantum state space, and compiling an operation result to the second quantum bit.
Preferably, as shown in fig. 5, the first obtaining module 303 includes:
a second sub-operation module 303-1, configured to perform the specific operation on two operation objects; the first qubit is used for representing two operation objects of the specific operation, and the second qubit 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.
The operation module 304 specifically includes:
a second judging module 304-1, configured to judge whether the operation to be performed is in a transpose conjugation state according to the auxiliary identifier;
the second execution module 304-2 is configured to execute the specific operation on a value corresponding to a sub-quantum state representing the first qubit in each eigenstate of the quantum state space when the operation to be executed is not in a transposed conjugated state, and encode an operation result to the second qubit;
and when the operation to be executed is in a transposed conjugated 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.
Preferably, as shown in fig. 6, the first obtaining module 303 includes:
a third sub-operation module 303-a, configured to use the specific operation for an operation of an operation object; the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing an 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.
Preferably, the structure schematic diagram of the quantum simulation device to be operated according to the embodiment of the present invention further shown in fig. 6 is further shown, and the operation module 304 specifically includes:
a third judging module 304-a, configured to judge whether the operation to be performed is in a transpose conjugation state according to the auxiliary identifier;
a third execution module 304-b, configured to execute, when the operation to be executed is not in a transposed conjugated state, the specific operation on a value corresponding to a sub-quantum state representing the first qubit in each eigenstate of the quantum state space, and encode an operation result to the second qubit;
and when the operation to be executed is in a transposed conjugated 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.
An embodiment of the invention provides an electronic device comprising a memory in which a computer program is stored and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Specifically, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Specifically, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s201: acquiring an operation identifier, wherein the operation identifier is used for representing a specific operation corresponding to an operation to be executed;
s202: acquiring an auxiliary identifier, wherein the auxiliary identifier is used for indicating whether an operation to be performed is in a transpose conjugation state;
s203: acquiring a group of quantum bits and a quantum state space represented by the group of quantum bits; the set of qubits includes a first qubit and a second qubit; the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing the operation object of the specific operation and/or representing an operation result of the specific operation;
s204: and executing 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 executed is in a transposed conjugated state.
Compared with the prior art, the quantum simulation method for the operation to be executed establishes the relation between the operation object and the quantum bit of the specific operation of the operation to be executed, realizes the operation simulation for the operation to be executed supporting the specific operation or the inverse operation of the specific operation through the operation of the corresponding numerical value of the quantum state, ensures that the operation to be executed has the characteristic of supporting unitary transformation of an analog quantum logic gate, further realizes the simulation of the operation to be executed which can be used for the specific operation in a quantum circuit, and fills the blank of the related technology.
The embodiment of the invention also provides a storage medium in which a computer program is stored, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Specifically, in the present embodiment, the above-described storage medium may be configured to store a computer program for executing the steps of:
s201: acquiring an operation identifier, wherein the operation identifier is used for representing a specific operation corresponding to an operation to be executed;
s202: acquiring an auxiliary identifier, wherein the auxiliary identifier is used for indicating whether an operation to be performed is in a transpose conjugation state;
s203: acquiring a group of quantum bits and a quantum state space represented by the group of quantum bits; the set of qubits includes a first qubit and a second qubit; the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing the operation object of the specific operation and/or representing an operation result of the specific operation;
s204: and executing 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 executed is in a transposed conjugated state.
Specifically, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Compared with the prior art, the quantum simulation method for the operation to be executed establishes the relation between the operation object and the quantum bit of the specific operation of the operation to be executed, realizes the operation simulation for the operation to be executed supporting the specific operation or the inverse operation of the specific operation through the operation of the corresponding numerical value of the quantum state, ensures that the operation to be executed has the characteristic of supporting unitary transformation of an analog quantum logic gate, further realizes the simulation of the operation to be executed which can be used for the specific operation in a quantum circuit, and fills the blank of the related technology.
While the foregoing is directed to embodiments of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow.

Claims (7)

1. A quantum simulation method of an operation to be performed, the method comprising:
acquiring an operation identifier, wherein the operation identifier is used for representing a specific operation corresponding to an operation to be executed;
acquiring an auxiliary identifier, wherein the auxiliary identifier is used for indicating whether an operation to be performed is in a transpose conjugation state;
acquiring a group of quantum bits and a quantum state space represented by the group of quantum bits; the set of qubits includes a first qubit and a second qubit; the specific operation is used for the operation of one operation object; the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing an operation result of the specific operation;
and executing 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 according to whether the operation to be executed is in a transposed conjugated state.
2. The quantum simulation method of an operation to be performed according to claim 1, wherein the specific operation is one of a power function operation, an exponential function operation, a logarithmic function operation, a trigonometric function operation, and an inverse trigonometric function operation.
3. The quantum simulation method of claim 1, wherein the 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 according to whether the operation to be performed is in a transposed conjugated state, specifically includes:
judging whether the operation to be executed is in a transpose conjugation state or not according to the auxiliary identifier;
and when the operation to be executed is not in a transposed conjugated state, executing 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 compiling an operation result to the second quantum bit.
4. A quantum simulation method of an operation to be performed according to claim 3, wherein when the operation to be performed is in a transposed conjugated state, a sub-quantum state representing the second qubit in each eigenstate of the quantum state space is restored to an initial sub-quantum state.
5. A quantum simulation apparatus for an operation to be performed, the apparatus comprising:
the operation identifier acquisition module is used for acquiring an operation identifier, wherein the operation identifier is used for representing a specific operation corresponding to an operation to be executed;
The auxiliary identifier acquisition module is used for acquiring an auxiliary identifier, wherein the auxiliary identifier is used for indicating whether an operation to be executed is in a transpose conjugation state or not;
the first acquisition module is connected with the operation identifier acquisition module and is used for acquiring a group of quantum bits and a quantum state space represented by the quantum bits; the set of qubits includes a first qubit and a second qubit; the specific operation is used for the operation of one operation object; the first qubit is used for representing an operation object of the specific operation, and the second qubit is used for representing an operation result of the specific operation;
the operation module is connected with the auxiliary identifier acquisition module and the first acquisition module and is used for executing 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 according to whether the operation to be executed is in a transposed conjugation state.
6. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 4.
7. A storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of claims 1 to 4 when run.
CN202310771106.0A 2020-01-21 2020-01-21 Quantum simulation method and device for operation to be executed Pending CN116702913A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310771106.0A CN116702913A (en) 2020-01-21 2020-01-21 Quantum simulation method and device for operation to be executed

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310771106.0A CN116702913A (en) 2020-01-21 2020-01-21 Quantum simulation method and device for operation to be executed
CN202010072072.2A CN113222156B (en) 2020-01-21 2020-01-21 Quantum simulation method and device for operation to be executed

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202010072072.2A Division CN113222156B (en) 2020-01-21 2020-01-21 Quantum simulation method and device for operation to be executed

Publications (1)

Publication Number Publication Date
CN116702913A true CN116702913A (en) 2023-09-05

Family

ID=77085428

Family Applications (3)

Application Number Title Priority Date Filing Date
CN202310771107.5A Pending CN116796848A (en) 2020-01-21 2020-01-21 Quantum simulation method and device for operation to be executed
CN202310771106.0A Pending CN116702913A (en) 2020-01-21 2020-01-21 Quantum simulation method and device for operation to be executed
CN202010072072.2A Active CN113222156B (en) 2020-01-21 2020-01-21 Quantum simulation method and device for operation to be executed

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202310771107.5A Pending CN116796848A (en) 2020-01-21 2020-01-21 Quantum simulation method and device for operation to be executed

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202010072072.2A Active CN113222156B (en) 2020-01-21 2020-01-21 Quantum simulation method and device for operation to be executed

Country Status (1)

Country Link
CN (3) CN116796848A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115809042B (en) * 2021-09-14 2024-06-14 本源量子计算科技(合肥)股份有限公司 Quantum modulus addition operation method and device, electronic device and modulus arithmetic component
CN115879552B (en) * 2021-09-28 2024-06-14 本源量子计算科技(合肥)股份有限公司 Quantum modulus multiplication inverse operation method and device, electronic device and modulus arithmetic component

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4847914B2 (en) * 2007-04-16 2011-12-28 日本電信電話株式会社 Quantum addition operation method and quantum addition operation device
JP5496921B2 (en) * 2011-01-06 2014-05-21 日本電信電話株式会社 Quantum operation method and quantum operation device
CN108280800A (en) * 2018-01-29 2018-07-13 重庆邮电大学 A kind of quantum image convolution method
CN108932388B (en) * 2018-07-10 2022-07-12 华东交通大学 Mode 2 based on quantum superposition statenDesign method of subtracter
CN109002894B (en) * 2018-07-10 2021-10-08 华东交通大学 Quantum adder design method based on quantum superposition state
CN109858628B (en) * 2019-02-28 2021-04-27 北京百度网讯科技有限公司 Method, apparatus, device and computer readable storage medium for compiling quantum circuit
CN110188885B (en) * 2019-06-28 2021-04-06 合肥本源量子计算科技有限责任公司 Quantum calculation simulation method and device, storage medium and electronic device
CN110705711B (en) * 2019-09-17 2023-08-11 本源量子计算科技(合肥)股份有限公司 Method and device for determining quantum logic gate for quantum state information dimension reduction coding

Also Published As

Publication number Publication date
CN113222156A (en) 2021-08-06
CN116796848A (en) 2023-09-22
CN113222156B (en) 2023-08-08

Similar Documents

Publication Publication Date Title
CN112114776B (en) Quantum multiplication method, device, electronic device and storage medium
CN112162723B (en) Quantum subtraction operation method, device, electronic device and storage medium
CN113222155B (en) Quantum circuit construction method and device, electronic device and storage medium
CN113222153B (en) Quantum state simulation method and device, storage medium and electronic device
CN113222156B (en) Quantum simulation method and device for operation to be executed
CN113222161B (en) Implementation method and device of custom quantum logic gate
CN114511094B (en) Quantum algorithm optimization method and device, storage medium and electronic device
CN113222157B (en) Quantum simulation method, quantum simulation device, electronic device and storage medium
CN112214200B (en) Quantum subtraction operation method, device, electronic device and storage medium
CN113222151B (en) Quantum state transformation method and device
CN116431807B (en) Text classification method and device, storage medium and electronic device
CN115809707B (en) Quantum comparison operation method, device, electronic device and basic arithmetic component
CN114819163B (en) Training method and device for quantum generation countermeasure network, medium and electronic device
CN115775029B (en) Quantum circuit conversion method, quantum circuit conversion device, quantum circuit conversion medium and electronic device
CN112162725B (en) Quantum division operation method, quantum division operation device, electronic device and storage medium
CN115713122B (en) Method and device for determining size relation between quantum data and classical data
CN115809706B (en) Quantum modulus multiplication operation method and device, electronic device and modulus arithmetic component
CN115879557B (en) Quantum circuit-based data size comparison method and device and quantum computer
CN115730670B (en) Method and device for generating mode file, medium and electronic device
CN115879555B (en) Quantum modulus rapid multiplication operation method, device and modulus arithmetic component
CN115879558B (en) Method and device for comparing sizes of multiple quantum states
CN115879552B (en) Quantum modulus multiplication inverse operation method and device, electronic device and modulus arithmetic component
CN115879554B (en) Quantum modulus square operation method and device, electronic device and modulus arithmetic component
CN115879560B (en) Equivalent relation judging method and device for quantum data and classical data
CN115879553B (en) Quantum modulus complete multiplication method and device and modulus arithmetic component

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination