CN113222153B - Quantum state simulation method and device, storage medium and electronic device - Google Patents

Quantum state simulation method and device, storage medium and electronic device Download PDF

Info

Publication number
CN113222153B
CN113222153B CN202010072044.0A CN202010072044A CN113222153B CN 113222153 B CN113222153 B CN 113222153B CN 202010072044 A CN202010072044 A CN 202010072044A CN 113222153 B CN113222153 B CN 113222153B
Authority
CN
China
Prior art keywords
quantum
quantum state
state
bit
bits
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.)
Active
Application number
CN202010072044.0A
Other languages
Chinese (zh)
Other versions
CN113222153A (en
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 CN202010072044.0A priority Critical patent/CN113222153B/en
Publication of CN113222153A publication Critical patent/CN113222153A/en
Application granted granted Critical
Publication of CN113222153B publication Critical patent/CN113222153B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Landscapes

  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Optical Modulation, Optical Deflection, Nonlinear Optics, Optical Demodulation, Optical Logic Elements (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a quantum state simulation method, a device, a storage medium and an electronic device, wherein the method comprises the steps of obtaining a first quantum state of a group of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, the first quantum state being: a superposition of all eigenstates of the set of quantum bits; for each eigenstate composing the first quantum state, performing an evolution operation of the quantum state to encode a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the set of quantum bits, thereby obtaining an evolved eigenstate; outputting the evolved second quantum state; wherein the second quantum state is composed of each of the evolving eigenstates. The invention provides a technology capable of simulating basic function operation in a quantum circuit, and fills the blank of the related technology.

Description

Quantum state simulation method and device, storage medium and electronic device
Technical Field
The invention belongs to the field of quantum computing, and particularly relates to a quantum state simulation method, a quantum state simulation device, a storage medium and an electronic device.
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 process of the quantum algorithm, the quantum algorithm is generally required to be built by means of various quantum logic gates, but when the quantum algorithm is built by means of various quantum logic gates, quantum logic gates which are operated corresponding to basic function operations of classical operations such as exponential functions, logarithmic functions, trigonometric functions, inverse trigonometric functions and the like are not available. Meanwhile, when an equivalent quantum logic gate for realizing the basic function operation function is constructed by means of various quantum logic gates, the number of various quantum logic gates required is huge, and quantum circuits corresponding to the constructed quantum algorithm are too complex, so that the research of quantum calculation is seriously hampered.
Therefore, there is a strong need to provide a technique capable of simulating the basic function operation in the quantum circuit, so as to fill the gap of the related art.
Disclosure of Invention
The invention aims to provide a quantum state simulation method, a quantum state simulation device, a storage medium and an electronic device, so as to solve the defects in the prior art, provide a technology for simulating basic function operation in a quantum circuit and fill the blank of the related technology.
The technical scheme adopted by the invention is as follows:
a method of modeling a quantum state, comprising:
obtaining a first quantum state of a set of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, the first quantum state being: a superposition of all eigenstates of the set of quantum bits;
for each eigenstate composing the first quantum state, performing an evolution operation of the quantum state to encode a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the set of quantum bits, thereby obtaining an evolved eigenstate;
outputting the evolved second quantum state; wherein the second quantum state is composed of each of the evolving eigenstates.
The quantum state simulation method as described above, wherein the preset operation preferably includes one of an exponential function operation, a logarithmic function operation, a trigonometric function operation, an inverse trigonometric function operation, and a power function operation.
In the above method for simulating a quantum state, preferably, the result of performing the preset operation on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate is encoded on the set of quantum bits, and specifically includes:
obtaining a binary value of the first bit corresponding to the current eigenstate as the sub-quantum state;
obtaining decimal values corresponding to the sub-quantum states;
executing the preset operation on the decimal value;
and encoding the operation result of the preset operation to the group of quantum bits.
The quantum state simulation method as described above, wherein preferably, the encoding the operation result of the preset operation onto the set of quantum bits includes:
the integer portion of the operation result is encoded to a second bit of the set of qubits and the fractional portion of the operation result is encoded to a third bit of the set of qubits.
A method of modeling quantum states as described above, wherein preferably the set of quantum bits further comprises a fourth bit;
the method further comprises the steps of: and judging whether to execute the evolution operation of the quantum state according to the fourth bit.
The above method for simulating a quantum state, wherein preferably, the determining whether to execute the evolution operation of the quantum state according to the fourth bit includes:
obtaining a sub-quantum state corresponding to the fourth bit in the current eigenstate;
and when all bits of the sub-quantum state are 1, performing evolution operation of the quantum state.
A method of modeling a quantum state as described above, wherein preferably the method further comprises:
and performing transpose conjugation operation corresponding to the evolution operation of the quantum state so as to restore the second quantum state after evolution to the first quantum state.
A method of modeling quantum states as described above, wherein preferably all eigenstates constituting the superposition state include:
one eigenstate with amplitude 1 and the rest eigenstates with amplitude 0.
A quantum state simulation apparatus, comprising:
the obtaining module is used for obtaining a first quantum state of a group of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, the first quantum state being: a superposition of all eigenstates of the set of quantum bits;
the encoding module is used for executing the evolution operation of the quantum state for each eigenstate forming the first quantum state so as to encode the result of the preset operation of the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate to the group of quantum bit to obtain the evolved eigenstate;
the output module is used for outputting the second quantum state after evolution; wherein the second quantum state is composed of each of the evolving eigenstates.
The preset operation comprises one of exponential function operation, logarithmic function operation, trigonometric function operation, inverse trigonometric function operation and power function operation.
The coding module is specifically configured to:
encoding the result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the group of quantum bits, specifically including:
obtaining a binary value of the first bit corresponding to the current eigenstate as the sub-quantum state;
obtaining decimal values corresponding to the sub-quantum states;
executing the preset operation on the decimal value;
and encoding the operation result of the preset operation to the group of quantum bits.
The encoding the operation result of the preset operation onto the set of quantum bits includes:
the integer portion of the operation result is encoded to a second bit of the set of qubits and the fractional portion of the operation result is encoded to a third bit of the set of qubits.
The set of quantum bits further includes a fourth bit;
the method further comprises the steps of: and judging whether to execute the evolution operation of the quantum state according to the fourth bit.
The determining whether to execute the evolution operation of the quantum state according to the fourth bit includes:
obtaining a sub-quantum state corresponding to the fourth bit in the current eigenstate;
and when all bits of the sub-quantum state are 1, performing evolution operation of the quantum state.
The method further comprises the steps of:
and performing transpose conjugation operation corresponding to the evolution operation of the quantum state so as to restore the second quantum state after evolution to the first quantum state.
All eigenstates that make up the superposition state include:
one eigenstate with amplitude 1 and the rest eigenstates with amplitude 0.
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.
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
Compared with the prior art, the invention provides a quantum state simulation method, which comprises the steps of obtaining a first quantum state of a group of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, the first quantum state being: a superposition of all eigenstates of the set of quantum bits; for each eigenstate composing the first quantum state, performing an evolution operation of the quantum state to encode a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the set of quantum bits, thereby obtaining an evolved eigenstate; outputting the evolved second quantum state; wherein the second quantum state is composed of each of the evolving eigenstates. The invention provides a technology capable of simulating basic function operation in a quantum circuit, and fills the blank of the related technology.
Drawings
FIG. 1 is a block diagram of a hardware architecture of a computer terminal of a quantum state simulation method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a quantum state simulation method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a quantum state simulation device according to an embodiment of the present invention.
Detailed Description
The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
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 invention provides a quantum state simulation method, which is used for simulating the quantum state simulation operation in a quantum circuit, wherein the quantum state simulation operation corresponds to specific preset operation, 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 structure according to an embodiment of the present 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 embodiments 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 basic function operation functions that can be implemented, and exemplary: in order to realize the above functions in a quantum program, a large number of common logic gates are generally used for constructing complex quantum circuits to realize 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.
The embodiment of the invention provides a quantum state simulation method, which is used for simulating basic function operation, wherein the basic function operation can be one of exponential function operation, logarithmic function operation, trigonometric function operation, inverse trigonometric function operation and power function operation, and as shown in a flow diagram of the quantum state simulation method provided in fig. 2, the quantum state simulation method comprises the following steps:
s201: obtaining a first quantum state of a set of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, the first quantum state being: and an superposition state composed of all eigenstates of the set of quantum bits.
In particular, a qubit is analogous to a bit in classical computing, referring to the basic unit in quantum computing. Correspondingly, a qubit is analogous to a classical bit, each bit corresponds to one qubit, and the value on the bit is 1 or 0, which means that the qubit is in 1 state or 0 state, and is denoted as |1> or |0>, the physical meaning of the qubit is represented as a ground state or an excited state in a two-level quantum system, and | > is a dirac symbol.
The quantum states are described by vectors in the hilbert space, so the eigenstates are eigenvectors.
The quantum state space represented by the quantum bit refers to quantum state information represented by all eigenvalues corresponding to the quantum bit, and the number of all eigenvalues is 2 n Where n is the number of qubits.
Quantum states, which are then logical states of the qubit, are represented in binary in the quantum algorithm (or weighing subroutine). For example, a group of qubits q0, q1, q2, representing the 0 th, 1 st, and 2 nd qubits, ordered from high order to low order as q2q1q0, the quantum state of the group of qubits being 2 3 The superposition of the individual eigenstates, wherein 8 eigenstates (defined states) refer to: i000>、|001>、|010>、|011>、|100>、|101>、|110>、|111>Each quantum state corresponds to a qubit, e.g., |000>In states, 000 corresponds to q2q1q0 from high to low.
Described in terms of a single qubit, the logic state of the single qubitMay be at |0>State, |1>State, |0>State sum |1>The superimposed state (uncertain state) of states, which can be expressed in particular as +.>Where a and b are complex numbers representing the quantum state amplitude (probability amplitude). After measurement, the quantum state collapses to a fixed quantum state, where it collapses to |0>The probability of (a) is a 2 Collapse to |1>The probability of (b) is b 2 And a 2 +b 2 In short, the quantum state is an overlapped state composed of each eigenstate, and when the probability of the other state is 0, i.e., it is in one of the determined eigenstates.
A first quantum state of a set of quantum bits is obtained, illustratively, 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 ψ:
ψ=a 0 |000>+a 1 |001>+a 2 |010>+a 3 |011>+a 4 |100>+a 5 |101>+a 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 obtaining of a group of qubits may be achieved by user input, and the number of the group of qubits may be set according to a basic operation of a preset operation. Under the condition of sufficient computing resources, a large number of qubits can be set, and the requirements of the qubits under most conditions are satisfied unconditionally.
Wherein, the preset operation includes, but is not limited to, one of an exponential function operation, a logarithmic function operation, a trigonometric function operation, an inverse trigonometric function operation and a power function operation. Settable operation identifier "A y "represents a preset operation, wherein" A "is a representation of basic function operation such as a basic elementary function, has no exact meaning per se, and can 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.
In a quantum circuit, the set of qubits is a qubit having an initial state, or a qubit carrying information of an evolved quantum state. Wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation is used as a connecting bridge between a specific operation corresponding to the preset operation and a quantum bit, and the first quantum state is as follows: and an superposition state composed of all eigenstates of the set of quantum bits.
S202: and executing the evolution operation of the quantum state aiming at each eigenstate forming the first quantum state so as to encode the result of executing the preset operation on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate to the group of quantum bits to obtain the evolved eigenstate.
Specifically, the set of qubits may further include: the partial bits of the result of the preset operation may be only the second bits of the integer part of the result of the preset operation or may include the second bits of the integer part of the result of the preset operation and the third bits of the fractional part of the result of the preset operation.
For example, a user wants to perform a logarithmic function operation: log of 2 4, the value of the operation object is 4. The binary representation of 4 is 100, and the first bit of the available code 100 requires at least 3 bits; user pre-calculation log 2 The binary representation of 4=2, 2 is 10, and the second bit of the available code 10 requires at least 2 bits. Assuming that the user needs to encode the fractional portion and set to 2 bits precision, the third bit is set to 2 bits and the set of quantum bits input by the end user needs at least 7 bits.
In practical applications, the set of qubits may further include: a fourth bit for controlled operation, specifically: and judging whether to execute the evolution operation of the quantum state according to the fourth bit. The fourth bit is used as a controlled identification bit, has no other physical significance, is not limited, and is preferably one bit in order to reduce the occupation of computing resources.
Specifically, determining whether to execute the evolution operation of the quantum state according to the fourth bit includes: obtaining a sub-quantum state corresponding to the fourth bit in the current eigenstate; and when all bits of the sub-quantum state are 1, executing the evolution operation of the quantum state, otherwise, not executing. Of course, when all bits of the sub-quantum state can be set to 0, the evolution operation of the sub-quantum state is performed, and only all bits are set to 1 more commonly.
Exemplary, a set of qubits, q0, q1, q2, q3, q4, q5, q6, q7, q8, representing the 0 th to 8 th qubits, is input, ordered from high to low as q8q7q6q5q4q3q2q1q0, wherein the set of qubits corresponds to 2 9 In the 512 eigenstates, the evolution operation of the quantum state is performed, and q2q1q0 is designated as the first bit, q5q4q3 is designated as the second bit, q7q6 is designated as the third bit, and q8 is designated as the fourth bit.
It can be understood that the specific division of a group of quantum bits can be specifically allocated according to the user requirement (precision of the decimal part) and the bit number required by the preset operation object and the integer part of the operation result, and is not limited in a unified way.
For each eigenstate constituting the first quantum state of the above example, performing an evolution operation of the quantum state to encode a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the set of quantum bits, including:
s2021, obtaining the binary value of the first bit corresponding to the current eigenstate as the sub-quantum state.
Illustratively, the binary value of the current first bit q2q1q0 is 100, and the current binary value 100 is taken as the corresponding sub-quantum state |100>, if the current eigenstate is |100101100>, among the 512 eigenstates.
S2022: and obtaining the decimal value corresponding to the sub-quantum state.
Illustratively, after obtaining the sub-quantum state represented by the binary value corresponding to the first bit, converting the binary value corresponding to the sub-quantum into the corresponding decimal value. For example, the sub-quantum state |100> corresponding to the binary value 100 is converted to the corresponding decimal value 4.
S2023: and executing the preset operation on the decimal value.
Specifically, the decimal number obtained through conversion is subjected to a preset operation, wherein the preset operation can be one of an exponential function operation, a logarithmic function operation, a trigonometric function operation, an inverse trigonometric function operation and a power function operation.
Log function by preset operation 2 a is illustrated as an example, where a is the decimal value corresponding to the sub-quantum state, e.g., 4, log is performed 2 4.
S2024: and encoding the operation result of the preset operation to the group of quantum bits.
Taking the above example as an illustration, it is known that the user inputs a set of qubits q0, q1, q2, q3, q4, q5, q6, q7, q8, respectively, encodes the operation result of the preset operation into a second bit of the set of qubits, and encodes the fractional part of the operation result into a third bit of the set of qubits.
Specifically, q2q1q0 is a first bit, and is used for encoding an operation object representing a preset operation, and encoding the sub-quantum state |100>, i.e. q2 encodes 1, q1 and q0 encodes 0 respectively; q5q4q3 is a second bit, and is used for encoding an integer part of the operation result of the preset operation, wherein the integer part of the operation result of the preset operation is 2, and the integer part is converted into a binary number of 010, namely, q5 encodes 0, q4 encodes 1 and q3 encodes 0; q7q6 is a third bit, and is used for encoding the decimal part of the operation result of the preset operation, the precision of the decimal part of the operation result is set by a user according to the needs, and here, the reserved two-bit decimal part is represented, wherein the decimal part of the operation result of the preset operation is 0, and according to the binary numbers corresponding to the decimal part, namely, q7 and q6 are respectively encoded with 0, q8 bits are kept unchanged, so that the evolving eigenstate is |100010100>.
S203: outputting the evolved second quantum state; wherein the second quantum state is composed of each of the evolving eigenstates.
Exemplary, from the foregoing, a user enters a set of quantum bit divisionsQ0, q1, q2, q3, q4, q5, q6, q7, q8, respectively, represent 0 th to 8 th quantum bits, and are ordered from high to low as q8q7q6q5q4q3q2q1q0, and after a preset operation, the operation result of the preset operation is encoded onto the group of quantum bits to output an evolved second quantum state, where the second quantum state is composed of each evolved eigenstate, i.e., ψ' =a 0 |000000000>+a 1 |000000001>+…+a 276 |100010100>+…+a 510 |111111110>+a 511 |111111111>Wherein a is 0 、a 1 、…、a 276 、…、a 510 、a 511 Are all plural and
it should be noted that the predetermined operation is a log function 2 a is exemplified, and of the 512 eigenstates, the first bit q2q1q0 is an eigenstate of a binary value of 000, for example |100101000>Wherein the decimal value corresponding to the first bit is 0, log is calculated by the logarithmic function 2 0 does not exist, at this time, the eigenstate is kept unchanged for output, and then the processing continues by jumping to the next eigenstate. The other kinds of preset operations are the same.
In practice, all eigenstates constituting the first quantum state may include one eigenstate with an amplitude of 1 and the rest of eigenstates with an amplitude of 0.
Continuing with the above example, the user wants to achieve log 2 4, the amplitude of the eigenstate with the first bit being 100 is set to 1, the amplitudes of the rest eigenstates are set to 0, assuming ψ=1|100000100>. After the evolution of the above example, it gets ψ' =1|100010100>Carrying operation object information and operation result information. Because of the evolved quantum state space, only one unique determined eigenstate exists, the amplitude of the eigenstate is 1, namely the probability is 1, and the subsequent measurement of the evolution result is facilitated.
The above examples fully demonstrate the evolution operation condition of the quantum state when the preset operation is a logarithmic function, and it can be understood that the operation principles and methods of the exponential function, the trigonometric function, the inverse trigonometric function, the power function, and the like are the same as those of the exponential function, and are not repeated herein.
The following will describe a method of evolving a quantum state when performing a transpose conjugation operation corresponding to the evolution operation of the quantum state. Specifically, when the evolution operation of the quantum state exists a transposed conjugate identifier(reading as Dagger) indicates that the evolution operation of the execution quantum state is in a transposed conjugated state, where the second quantum state after evolution needs to be restored to the first quantum state.
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 mutual evolution between quantum states corresponding to basic elementary function operation is realized by changing an Oracle simulation mode, and a controlled function is realized. Parameters of the user's incoming Oracle may include: oracle name (for identifying the functional purpose of Oracle), the aforementioned set of quantum bits, the operation object of a preset operation, and the like. A can be used y Representing a second quantum state after evolution of the first quantum state, setting an identifierI.e. < ->Representing the reduction of the evolved second quantum state to the first quantum state, wherein A y Is a representation of the simulated preset operation in 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 invention discloses a quantum state simulation method, which comprises the steps of obtaining a first quantum state of a group of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, the first quantum state being: a superposition of all eigenstates of the set of quantum bits; for each eigenstate composing the first quantum state, performing an evolution operation of the quantum state to encode a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the set of quantum bits, thereby obtaining an evolved eigenstate; outputting the evolved second quantum state; wherein the second quantum state is composed of each of the evolving eigenstates. The invention provides a technology capable of simulating basic function operation in a quantum circuit, and fills the blank of the related technology.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a quantum state simulation device according to an embodiment of the present invention, which corresponds to the flow shown in fig. 2, and may include:
the obtaining module 301: a first quantum state for obtaining a set of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, the first quantum state being: a superposition of all eigenstates of the set of quantum bits;
encoding module 302: for each eigenstate constituting the first quantum state, performing an evolution operation of the quantum state to encode a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the set of quantum bits, thereby obtaining an evolved eigenstate;
the output module 303: the method comprises the steps of outputting a second quantum state after evolution; wherein the second quantum state is composed of each of the evolving eigenstates.
Specifically, the preset operation includes one of an exponential function operation, a logarithmic function operation, a trigonometric function operation, an inverse trigonometric function operation and a power function operation.
Specifically, the coding module is specifically configured to:
encoding the result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the group of quantum bits, specifically including:
obtaining a binary value of the first bit corresponding to the current eigenstate as the sub-quantum state;
obtaining decimal values corresponding to the sub-quantum states;
executing the preset operation on the decimal value;
and encoding the operation result of the preset operation to the group of quantum bits.
Specifically, the encoding the operation result of the preset operation onto the set of quantum bits includes:
the integer portion of the operation result is encoded to a second bit of the set of qubits and the fractional portion of the operation result is encoded to a third bit of the set of qubits.
Specifically, the set of quantum bits further includes a fourth bit;
the method further comprises the steps of: and judging whether to execute the evolution operation of the quantum state according to the fourth bit.
Specifically, the determining, according to the fourth bit, whether to execute the evolution operation of the quantum state includes:
obtaining a sub-quantum state corresponding to the fourth bit in the current eigenstate;
and when all bits of the sub-quantum state are 1, performing evolution operation of the quantum state.
Specifically, the method further comprises the following steps:
and performing transpose conjugation operation corresponding to the evolution operation of the quantum state so as to restore the second quantum state after evolution to the first quantum state.
Specifically, all eigenstates that make up the superposition state include:
one eigenstate with amplitude 1 and the rest eigenstates with amplitude 0.
Compared with the prior art, the invention discloses a quantum state simulation method, which comprises the steps of obtaining a first quantum state of a group of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, the first quantum state being: a superposition of all eigenstates of the set of quantum bits; for each eigenstate composing the first quantum state, performing an evolution operation of the quantum state to encode a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the set of quantum bits, thereby obtaining an evolved eigenstate; outputting the evolved second quantum state; wherein the second quantum state is composed of each of the evolving eigenstates. The invention provides a technology capable of simulating basic function operation in a quantum circuit, and fills the blank of the related technology.
The embodiments of the present invention further comprise a storage medium having a computer program stored therein, 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, obtaining a first quantum state of a group of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, the first quantum state being: a superposition of all eigenstates of the set of quantum bits;
s202, for each eigenstate forming the first quantum state, performing an evolution operation of the quantum state to encode a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the group of quantum bits to obtain an evolved eigenstate;
s203, outputting the evolved second quantum state; wherein the second quantum state is composed of each of the evolving eigenstates.
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 invention discloses a quantum state simulation method, which comprises the steps of obtaining a first quantum state of a group of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, the first quantum state being: a superposition of all eigenstates of the set of quantum bits; for each eigenstate composing the first quantum state, performing an evolution operation of the quantum state to encode a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the set of quantum bits, thereby obtaining an evolved eigenstate; outputting the evolved second quantum state; wherein the second quantum state is composed of each of the evolving eigenstates. The invention provides a technology capable of simulating basic function operation in a quantum circuit, and fills the blank of the related technology.
The present invention also includes an electronic device comprising a memory having a computer program stored therein and a processor configured 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, obtaining a first quantum state of a group of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, the first quantum state being: a superposition of all eigenstates of the set of quantum bits;
s202, for each eigenstate forming the first quantum state, performing an evolution operation of the quantum state to encode a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the group of quantum bits to obtain an evolved eigenstate;
s203, outputting the evolved second quantum state; wherein the second quantum state is composed of each of the evolving eigenstates.
Compared with the prior art, the invention discloses a quantum state simulation method, which comprises the steps of obtaining a first quantum state of a group of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, the first quantum state being: a superposition of all eigenstates of the set of quantum bits; for each eigenstate composing the first quantum state, performing an evolution operation of the quantum state to encode a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate onto the set of quantum bits, thereby obtaining an evolved eigenstate; outputting the evolved second quantum state; wherein the second quantum state is composed of each of the evolving eigenstates. The invention provides a technology capable of simulating basic function 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 (9)

1. A method of quantum state simulation, comprising:
obtaining a first quantum state of a set of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, wherein the first quantum state is a superposition state formed by all eigenvalues of the group of quantum bits, and the preset operation comprises one of exponential function operation, logarithmic function operation, trigonometric function operation, inverse trigonometric function operation and power function operation;
for each eigenstate composing the first quantum state, performing an evolution operation of the quantum state, so as to perform the preset operation on a corresponding value of a sub-quantum state of the first bit corresponding to the current eigenstate, and encoding an operation result obtained by performing the preset operation onto the group of quantum bits to obtain an evolved eigenstate, where the encoding mode includes: obtaining a binary value of the first bit corresponding to the current eigenstate as the sub-quantum state; obtaining decimal values corresponding to the sub-quantum states; executing the preset operation on the decimal value; encoding an operation result of the preset operation onto the group of quantum bits;
outputting the evolved second quantum state; wherein the second quantum state is composed of each of the evolving eigenstates.
2. The method of claim 1, wherein encoding the result of the predetermined operation onto the set of quantum bits comprises:
the integer portion of the operation result is encoded to a second bit of the set of qubits and the fractional portion of the operation result is encoded to a third bit of the set of qubits.
3. The method of claim 1, wherein the set of quantum bits further comprises a fourth bit;
the method further comprises the steps of: and judging whether to execute the evolution operation of the quantum state according to the fourth bit.
4. A method of modeling a quantum state according to claim 3, wherein said determining whether to perform an evolution operation of the quantum state based on the fourth bit comprises:
obtaining a sub-quantum state corresponding to the fourth bit in the current eigenstate;
and when all bits of the sub-quantum state are 1, performing evolution operation of the quantum state.
5. A method of modeling a quantum state as claimed in claim 1, further comprising:
and performing transpose conjugation operation corresponding to the evolution operation of the quantum state so as to restore the second quantum state after evolution to the first quantum state.
6. A method of modeling quantum states as claimed in claim 1 wherein all eigenstates that make up the superposition state include:
one eigenstate with amplitude 1 and the rest eigenstates with amplitude 0.
7. A quantum state simulation device, comprising:
the obtaining module is used for obtaining a first quantum state of a group of quantum bits; wherein the set of quantum bits comprises: a first bit representing an operation object of a preset operation, wherein the first quantum state is a superposition state formed by all eigenstates of the group of quantum bits; the preset operation comprises one of exponential function operation, logarithmic function operation, trigonometric function operation, inverse trigonometric function operation and power function operation;
the encoding module is configured to perform, for each eigenstate that constitutes the first quantum state, an evolution operation of the quantum state, to perform the preset operation on a corresponding value of a sub-quantum state of the first bit corresponding to a current eigenstate, and encode an operation result obtained by performing the preset operation onto the set of quantum bits to obtain an evolved eigenstate, where the encoding mode includes: obtaining a binary value of the first bit corresponding to the current eigenstate as the sub-quantum state; obtaining decimal values corresponding to the sub-quantum states; executing the preset operation on the decimal value; encoding an operation result of the preset operation onto the group of quantum bits;
the output module is used for outputting the second quantum state after evolution; wherein the second quantum state is composed of each of the evolving eigenstates.
8. 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 6 when run.
9. 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 6.
CN202010072044.0A 2020-01-21 2020-01-21 Quantum state simulation method and device, storage medium and electronic device Active CN113222153B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010072044.0A CN113222153B (en) 2020-01-21 2020-01-21 Quantum state simulation method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010072044.0A CN113222153B (en) 2020-01-21 2020-01-21 Quantum state simulation method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN113222153A CN113222153A (en) 2021-08-06
CN113222153B true CN113222153B (en) 2023-08-08

Family

ID=77085270

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010072044.0A Active CN113222153B (en) 2020-01-21 2020-01-21 Quantum state simulation method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN113222153B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115809706B (en) * 2021-09-14 2024-06-14 本源量子计算科技(合肥)股份有限公司 Quantum modulus multiplication operation method and device, electronic device and modulus arithmetic component
CN115809707B (en) * 2021-09-14 2024-06-14 本源量子计算科技(合肥)股份有限公司 Quantum comparison operation method, device, electronic device and basic arithmetic component
CN114925840A (en) * 2022-05-31 2022-08-19 北京百度网讯科技有限公司 Simulation method, apparatus and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110188885A (en) * 2019-06-28 2019-08-30 合肥本源量子计算科技有限责任公司 A kind of quantum calculation analogy method, device, storage medium and electronic device
CN110598867A (en) * 2019-09-17 2019-12-20 合肥本源量子计算科技有限责任公司 Quantum state information conversion method
CN110705711A (en) * 2019-09-17 2020-01-17 合肥本源量子计算科技有限责任公司 Quantum state information dimension reduction coding method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3292466A4 (en) * 2015-05-05 2019-01-02 Kyndi, Inc. Quanton representation for emulating quantum-like computation on classical processors
US10565514B2 (en) * 2016-03-31 2020-02-18 Board Of Regents, The University Of Texas System System and method for emulation of a quantum computer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110188885A (en) * 2019-06-28 2019-08-30 合肥本源量子计算科技有限责任公司 A kind of quantum calculation analogy method, device, storage medium and electronic device
CN110598867A (en) * 2019-09-17 2019-12-20 合肥本源量子计算科技有限责任公司 Quantum state information conversion method
CN110705711A (en) * 2019-09-17 2020-01-17 合肥本源量子计算科技有限责任公司 Quantum state information dimension reduction coding method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郭光灿等."量子信息技术发展概况".《南京邮电大学学报(自然科学版)》.2017,第37卷(第3期),第1-14页. *

Also Published As

Publication number Publication date
CN113222153A (en) 2021-08-06

Similar Documents

Publication Publication Date Title
CN112114776B (en) Quantum multiplication method, device, electronic device and storage medium
CN112232513B (en) Quantum state preparation method and device
CN113222153B (en) Quantum state simulation method and device, storage medium and electronic device
CN112633508B (en) Quantum circuit generation method and device, storage medium and electronic device
CN112633507B (en) Method and device for encoding complex vector to quantum circuit
CN111582491A (en) Construction method and device of quantum line
CN113222150B (en) Quantum state transformation method and device
CN113222161B (en) Implementation method and device of custom quantum logic gate
CN113222159B (en) Quantum state determination method and device
CN115293254A (en) Quantum multilayer perceptron-based classification method and related equipment
CN114358319A (en) Machine learning framework-based classification method and related device
CN113222151B (en) Quantum state transformation method and device
CN112214200B (en) Quantum subtraction operation method, device, electronic device and storage medium
CN113222156B (en) Quantum simulation method and device for operation to be executed
CN113222157B (en) Quantum simulation method, quantum simulation device, electronic device and storage medium
CN115809707B (en) Quantum comparison operation method, device, electronic device and basic arithmetic component
CN115983392A (en) Method, device, medium and electronic device for determining quantum program mapping relation
CN114764619A (en) Convolution operation method and device based on quantum circuit
CN115713122B (en) Method and device for determining size relation between quantum data and classical data
CN114372582B (en) Quantum automatic coding method based on machine learning framework and related device
CN114764618B (en) Quantum preprocessing method and device for linear system
CN115879560B (en) Equivalent relation judging method and device for quantum data and classical data
CN115879552B (en) Quantum modulus multiplication inverse operation method and device, electronic device and modulus arithmetic component
CN114692879B (en) Quantum preprocessing method and device based on sparse linear system
CN115879554B (en) Quantum modulus square operation method and device, electronic 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 230088 6th floor, E2 building, phase II, innovation industrial park, 2800 innovation Avenue, high tech Zone, Hefei City, Anhui Province

Applicant after: Benyuan Quantum Computing Technology (Hefei) Co.,Ltd.

Address before: 230088 6th floor, E2 building, phase II, innovation industrial park, 2800 innovation Avenue, high tech Zone, Hefei City, Anhui Province

Applicant before: ORIGIN QUANTUM COMPUTING COMPANY, LIMITED, HEFEI

GR01 Patent grant
GR01 Patent grant