CN113222153A - 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
CN113222153A
CN113222153A CN202010072044.0A CN202010072044A CN113222153A CN 113222153 A CN113222153 A CN 113222153A CN 202010072044 A CN202010072044 A CN 202010072044A CN 113222153 A CN113222153 A CN 113222153A
Authority
CN
China
Prior art keywords
quantum state
quantum
bit
qubits
eigenstate
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.)
Granted
Application number
CN202010072044.0A
Other languages
Chinese (zh)
Other versions
CN113222153B (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.)
Origin Quantum Computing Technology Co Ltd
Original Assignee
Origin Quantum Computing Technology 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 Origin Quantum Computing Technology Co Ltd filed Critical Origin Quantum Computing Technology 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

Images

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

Abstract

The invention discloses a simulation method, a simulation device, a storage medium and an electronic device of a quantum state, wherein the method comprises the steps of obtaining a first quantum state of a group of quantum bit; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits; for each eigenstate forming the first quantum state, performing an evolution operation of the quantum state to encode a value corresponding to the sub-quantum state of the first bit corresponding to the current eigenstate onto the group of quantum bits by performing the preset operation, and obtaining an evolved eigenstate; outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved eigenstates. The invention provides a technology capable of simulating the basic function operation in a quantum line, 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 quantum state simulation storage medium and an electronic device.
Background
Quantum computers take advantage of the quantum's superposition, theoretically having the ability to accelerate exponentially in some cases. For example, the RSA key is decrypted in hundreds of years in a classical computer, whereas the quantum algorithm is executed in a quantum computer in hours. However, the current quantum computer is limited in the number of controllable bits due to the development of quantum chip hardware, so that the computing power is limited, and quantum algorithms cannot be generally operated. The common practice of quantum algorithms generally requires simulation via quantum computation.
In the simulation implementation process of the quantum algorithm, various quantum logic gates are usually needed to construct the quantum algorithm, but when the quantum algorithm is constructed only by the various quantum logic gates, the quantum logic gates which are operated corresponding to the classical operation such as the basic function operation of exponential function, logarithmic function, trigonometric function, inverse trigonometric function and the like are not available. Meanwhile, when an equivalent quantum logic gate for realizing the basic function operation function is constructed by depending on various quantum logic gates, the quantity of the various required quantum logic gates is huge, and a quantum circuit corresponding to the constructed quantum algorithm is too complex, so that the research of quantum calculation is seriously hindered.
Therefore, it is desirable to provide a technique capable of simulating the primitive operation in the quantum wires, so as to fill the gap in the related art.
Disclosure of Invention
The invention aims to provide a quantum state simulation method, a quantum state simulation device, a quantum state storage medium and an electronic device, aims to overcome the defects in the prior art, can provide a technology for simulating fundamental function operation in a quantum circuit, and fills up the blank of the related technology.
The technical scheme adopted by the invention is as follows:
a method of simulating a quantum state, comprising:
obtaining a first quantum state of a set of qubits; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits;
for each eigenstate forming the first quantum state, performing an evolution operation of the quantum state to encode a value corresponding to the sub-quantum state of the first bit corresponding to the current eigenstate onto the group of quantum bits by performing the preset operation, and obtaining an evolved eigenstate;
outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved eigenstates.
The method for simulating a quantum state as described above, wherein the predetermined 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.
The method for simulating a quantum state as described above, wherein preferably, the encoding the result of performing the preset operation on the sub-quantum-state corresponding value of the first bit corresponding to the current eigenstate onto the group of quantum bits 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;
performing the preset operation on the decimal value;
and encoding the operation result of the preset operation to the group of quantum bit.
The method for simulating a quantum state as described above, wherein preferably, the encoding the operation result of the preset operation onto the group of qubits includes:
encoding an integer portion of the operation result to a second bit of the set of qubits and encoding a fractional portion of the operation result to a third bit of the set of qubits.
The method for simulating a quantum state as described above, wherein preferably, the set of qubits further includes a fourth bit;
the method further comprises the following steps: and judging whether to execute the evolution operation of the quantum state or not according to the fourth bit.
The method for simulating a quantum state as described above, wherein preferably, the determining whether to perform the operation of evolving the quantum state according to the fourth bit includes:
acquiring a sub-quantum state corresponding to the fourth bit in the current eigenstate;
performing an evolution operation of the quantum state when all bits of the sub-quantum state are 1.
The method for simulating a quantum state as described above, wherein preferably, the method further comprises:
and executing transposition conjugation operation corresponding to the evolution operation of the quantum state so as to restore the evolved second quantum state to the first quantum state.
The method of simulating a quantum state as described above, wherein preferably all the eigenstates constituting the superposition state include:
one eigenstate with amplitude 1 and the remaining eigenstates with amplitude 0.
An analog device of quantum states, comprising:
an obtaining module for obtaining a first quantum state of a set of qubits; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits;
the encoding module is used for executing the evolution operation of the quantum state aiming at each eigenstate forming the first quantum state so as to encode the result of the preset operation executed on the sub quantum state corresponding to the first bit position corresponding to the current eigenstate onto the group of quantum bit positions to obtain the eigenstate after the evolution;
an output module for outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved 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 encoding module is specifically configured to:
encoding a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate to 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;
performing the preset operation on the decimal value;
and encoding the operation result of the preset operation to the group of quantum bit.
The encoding of the operation result of the preset operation onto the set of qubits comprises:
encoding an integer portion of the operation result to a second bit of the set of qubits and encoding a fractional portion of the operation result to a third bit of the set of qubits.
The set of qubits further comprises a fourth bit;
the method further comprises the following steps: and judging whether to execute the evolution operation of the quantum state or not according to the fourth bit.
The determining whether to perform the evolution operation of the quantum state according to the fourth bit includes:
acquiring a sub-quantum state corresponding to the fourth bit in the current eigenstate;
performing an evolution operation of the quantum state when all bits of the sub-quantum state are 1.
The method further comprises the following steps:
and executing transposition conjugation operation corresponding to the evolution operation of the quantum state so as to restore the evolved second quantum state to the first quantum state.
All eigenstates that make up the stacked state include:
one eigenstate with amplitude 1 and the remaining 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 above 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 above
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 bit; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits; for each eigenstate forming the first quantum state, performing an evolution operation of the quantum state to encode a value corresponding to the sub-quantum state of the first bit corresponding to the current eigenstate onto the group of quantum bits by performing the preset operation, and obtaining an evolved eigenstate; outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved eigenstates. The invention provides a technology capable of simulating the basic function operation in a quantum line, and fills the blank of the related technology.
Drawings
Fig. 1 is a block diagram of a hardware structure 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 apparatus according to an embodiment of the present invention.
Detailed Description
The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
It is noted that the terms first, second and the like in the description and in the claims of the present invention are used for distinguishing between similar elements 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 simulation operation of a quantum state in a quantum circuit, wherein the simulation operation of the quantum state corresponds to specific preset operation, and the method can be applied to electronic equipment, such as a mobile terminal, specifically a mobile phone and a tablet computer; such as a computer terminal, specifically a general computer, a quantum computer, etc.
This will be described in detail below by way of example as it would run on a computer terminal. Fig. 1 is a block diagram of a quantum computing simulation 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 shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the computer terminal. 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 various functional applications and data processing by running the software programs and modules stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some 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 device 106 is used for receiving or transmitting data via a network. 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 (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
It should be noted that a true quantum computer is a hybrid structure, which includes two major components: one part is a classic computer which is responsible for executing classic calculation and control; the other part is quantum equipment which is responsible for running a quantum program to further realize quantum computation. The quantum program is a string of instruction sequences which can run on a quantum computer and are written by a quantum language such as a Qrun language, so that the support of the operation of the quantum logic gate is realized, and the quantum computation is finally realized. In particular, a quantum program is a sequence of instructions that operate quantum logic gates in a time sequence.
In practical applications, due to the limited development of quantum device hardware, quantum computation simulation is usually required to verify quantum algorithms, quantum applications, and the like. The quantum computing simulation is a process of realizing the simulation 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 build quantum programs for a particular problem. The quantum program referred in the embodiment of the invention is a program written in a classical language for representing quantum bits and evolution thereof, wherein the quantum bits, quantum logic gates and the like related to quantum computation are all represented by corresponding classical codes.
A quantum circuit, which is an embodiment of a quantum program and also a weighing sub-logic circuit, is the most common general quantum computation model, and represents a circuit that operates on a quantum bit under an abstract concept, and the circuit includes the quantum bit, a circuit (timeline), and various quantum logic gates, and finally, a result is often read through a quantum measurement operation.
Unlike conventional circuits that are connected by metal lines to pass either voltage or current signals, in quantum circuits, the lines can be viewed as being connected by time, i.e., the state of a qubit evolves naturally over time, in the process being operated on as indicated by the hamiltonian until a logic gate is encountered.
The quantum program refers to the total quantum circuit, wherein the total number of the quantum bits in the total quantum circuit is the same as the total number of the quantum bits of the quantum program. It can be understood that: a quantum program may consist of quantum wires, measurement operations for quantum bits in the quantum wires, registers to hold measurement results, and control flow nodes (jump instructions), and a quantum wire may contain tens to hundreds or even thousands of quantum logic gate operations. The execution process of the quantum program is a process executed for all the quantum logic gates according to a certain time sequence. It should be noted that timing is the time sequence in which the single quantum logic gate is executed.
It should be noted that in the classical calculation, 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 through the combination of the logic gates. Similarly, the way qubits are handled is quantum logic gates. The quantum logic gate is used for enabling the quantum state to evolve and is the basis for forming a quantum circuit, and comprises single-bit quantum logic gates such as a Hadamard gate (H gate), a Pauli-X gate, a Pauli-Y gate, a Pauli-Z gate, an RX gate, a RY gate and an RZ gate; and multi-bit quantum logic gates such as CNOT gate, CR gate, iSWAP gate, and Toffoli gate. Quantum logic gates are typically represented using unitary matrices, which are not only matrix-form but also an operation and transformation.
At present, some classical operations such as basic function operation functions can not be realized, and the following are exemplary: in order to implement the above functions in a quantum program, a quantum logic gate using a power function, an exponential function, a logarithmic function, a trigonometric function, an inverse trigonometric function, and the like usually constructs a complex quantum circuit by using a large number of the above common logic gates to implement a target functional 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 verification role in the construction of quantum programs and the solution of complex quantum computing problems.
An embodiment of the present invention provides a quantum state simulation method, configured to simulate a basic function operation, where the basic function operation may be one of exponential function operation, logarithmic function operation, trigonometric function operation, inverse trigonometric function operation, and power function operation, as shown in a flow diagram of a quantum state simulation method provided in fig. 2, the quantum state simulation method includes:
s201: obtaining a first quantum state of a set of qubits; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits.
Specifically, a qubit refers to a basic unit in quantum computation, in analogy to bits in classical computation. Accordingly, qubits are analogous to classical bits, each bit corresponding to a qubit, and the value of the qubit is 1 or 0, which means that the qubit is in 1 state or 0 state, denoted as |1> or |0>, whose physical meaning is expressed as the ground state or excited state in a two-level quantum system, | > is a dirac symbol.
The quantum states are described by vectors in the hilbert space, and thus the eigenstates are eigenvectors.
The quantum state space represented by the qubit refers to quantum state information represented by all eigenstates corresponding to the qubit, and the number of all eigenstates is 2nAnd n is the number of the quantum bits.
The quantum state refers to the logic state of a qubit, and is represented in a binary representation in a quantum algorithm (or quantum program). For example, a set of qubits q0, q1, q2 representing the 0 th, 1 st, and 2 nd qubits, ordered from high to low as q2q1q0, has a quantum state of 23Superposition of eigenstates, of which 8 eigenstates (defined states) mean: |000>、|001>、|010>、|011>、|100>、|101>、|110>、|111>Each quantum state corresponding to a qubit, e.g. |000>The state 000 from high to low corresponds to q2q1q 0.
Illustrating the logic state of a single qubit in terms of a single qubit
Figure BDA0002377547500000081
May be at |0>State, |1>State, |0>Sum of states |1>The superposition state (indeterminate state) of the states can be specifically expressed as
Figure BDA0002377547500000082
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>Has a probability of2Collapse to |1>Has a probability of b2And a is a2+b2In short, a quantum state is a superposition state of the eigenstates, and is in one of the determined eigenstates when the probability of the other states is 0.
Obtaining a first quantum state of a set of qubits, illustratively, for example: a group of qubits q0, q1, q2, representing 0 th, 1 st, 2 nd qubits, ordered from high to low as q2q1q0, the eigenstates corresponding to the group of qubits being 8 in total, each being: i000 >, |001>, |010>, |011>, |100>, |101>, |110>, |111>, the superposition states between the 8 eigenstates together constitute the quantum state space ψ:
ψ=a0|000>+a1|001>+a2|010>+a3|011>+a4|100>+a5|101>+a6|110>+a7|111>wherein a is0、a1、a2、a3、a4、a5、a6、a7Are all plural, and
Figure BDA0002377547500000083
obtaining a group of qubits can be achieved by user input, and the number of the group of qubits can be set according to basic operation of preset operation. Under the condition of sufficient computing resources, a large number of qubits can be set, and the qubit requirements under most conditions are unconditionally met.
Wherein the predetermined operation includes, but is not limited to, an exponential function operation, a logarithmic function operation, a trigonometric function operation, an inverse trigonometric function operation, and a power function operationOne of a number operation. Can set operation identifier' Ay"represents preset operation, wherein" A "is the representation of operation of basic functions such as basic elementary functions, and has no exact meaning per se, and can also be represented by other letters; "y" represents a specific basis function, which together form an operation identifier.
For example, when y is sinx, the operation identifier "Asinx" represents a sine trigonometric function operation.
The other expression forms of the elementary function operation identifiers are similar to the expression forms of the trigonometric function operation identifiers, and are not described in detail herein.
In a quantum wire, the set of qubits is either a qubit with an initial state or a qubit carrying evolved quantum state information. Wherein the set of qubits comprises: a first bit representing an operation object of a preset operation is used as a connection bridge between a specific operation corresponding to the preset operation and a quantum bit, and the first quantum state is as follows: a superposition of all eigenstates of the set of qubits.
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 value corresponding to the sub quantum state of the first bit corresponding to the current eigenstate to the group of quantum bits, and obtain the eigenstate after the evolution.
Specifically, the set of qubits may further include: the partial bits of the result of the predetermined operation are encoded, and the partial bits may be only the second bits of the integer part of the result of the predetermined operation, or include the second bits of the integer part of the result of the encoding operation and the third bits of the fractional part of the result of the encoding operation.
For example, a user wants to perform a logarithmic function operation: log (log)24, the value of the operand is 4. 4 is 100, the first bit of the available code 100 requires at least 3 bits; user precomputed log2The binary representation of 4-2, 2 is 10, and at least 2 bits are needed to obtain the second bit of code 10. Suppose a user desires to compileAnd if the decimal part of the code is set to be 2-bit precision, the third bit is set to be 2 bits, and a group of quantum bits input by an end user needs at least 7 bits.
In practical applications, a group of qubits may further include: a fourth bit for controlled operation, specifically: and judging whether to execute the evolution operation of the quantum state or not according to the fourth bit. The fourth bit is used as a controlled identification bit, has no other physical significance, does not limit the number of bits, and preferably has one bit in order to reduce the occupation of computing resources.
Specifically, the determining whether to execute the evolution operation of the quantum state according to the fourth bit includes: acquiring 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, otherwise, not performing. Of course, when all bits of the sub-quantum state are set to be 0, the evolution operation of the quantum state is performed, but all bits are set to be 1 and are more common.
Illustratively, a group of input qubits are q0, q1, q2, q3, q4, q5, q6, q7 and q8 respectively, represent 0 th to 8 th qubits, and are ordered from high to low as q8q7q6q5q4q3q2q1q0, wherein the qubits of the group correspond to 29The evolution operations of the quantum states are performed for 512 eigenstates, and q2q1q0 is designated as the first bit, q5q4q3 as the second bit, q7q6 as the third bit, and q8 as the fourth bit.
It can be understood that the specific division of a group of qubits can be specifically allocated according to user requirements (precision of a decimal part) and bit numbers required by a preset operation object and an integer part of an operation result, and is not limited herein.
For each eigenstate constituting the above example first quantum state, performing an evolution operation of a quantum state to encode a result of performing the preset operation on a sub-quantum state corresponding to the first bit corresponding to the current eigenstate onto the group of quantum bits, specifically including:
s2021, obtaining a binary value of the first bit corresponding to the current eigen state as the sub-quantum state.
Illustratively, of the 512 eigenstates, for example, the current eigenstate is |100101100>, 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 >.
S2022: and obtaining a decimal value corresponding to the sub quantum state.
For example, after obtaining the sub-quantum state represented by the binary value corresponding to the first bit, the binary value corresponding to the sub-quantum is converted into the corresponding decimal value. For example, the corresponding sub-quantum state |100> of binary value 100 is converted to the corresponding decimal value 4.
S2023: performing the preset operation on the decimal value.
Specifically, the decimal number obtained by the conversion is subjected to a preset operation, wherein the preset operation may be one of exponential function operation, logarithmic function operation, trigonometric function operation, inverse trigonometric function operation and power function operation.
Using a predetermined operation as a logarithmic function log2a is illustrated as an example, where a is the decimal value corresponding to the sub-quantum state, e.g., the decimal value is 4, then log is performed24.
S2024: and encoding the operation result of the preset operation to the group of quantum bit.
Taking the above as an example, it can be seen that the user inputs a group of qubits q0, q1, q2, q3, q4, q5, q6, q7, and q8, respectively, encodes the operation result of the preset operation into the second bit of the group of qubits, and encodes the fractional part of the operation result into the third bit of the group of qubits.
Specifically, q2q1q0 is a first bit used for encoding an operation object representing a preset operation, and a sub quantum state |100> is encoded, namely q2 encoding 1, q1 and q0 encoding 0 respectively; q5q4q3 is a second bit for encoding an integer part of the operation result of the predetermined operation, wherein the integer part of the operation result of the predetermined operation is 2, and is converted into a binary number of 010, i.e., q5 encoding 0, q4 encoding 1, and q3 encoding 0; q7q6 is a third bit for encoding a 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 needs, here, the two decimal parts are reserved, wherein the decimal part of the operation result of the preset operation is 0, 0 is encoded according to corresponding binary numbers, namely q7 and q6, respectively, and q8 remains unchanged, so that the eigenstate after evolution is |100010100 >.
S203: outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved eigenstates.
Illustratively, according to the above description, a group of qubits input by a user are q0, q1, q2, q3, q4, q5, q6, q7, and q8, respectively, represent 0 th to 8 th qubits, and are ordered from high to low as q8q7q6q5q4q3q2q1q0, after a preset operation, an operation result of the preset operation is encoded on the group of qubits, and an evolved second quantum state is output, where the second quantum state is composed of each evolved eigenstate, that is, ψ' araa0|000000000>+a1|000000001>+…+a276|100010100>+…+a510|111111110>+a511|111111111>Wherein a is0、a1、…、a276、…、a510、a511Are all plural, and
Figure BDA0002377547500000111
Figure BDA0002377547500000112
it should be noted that the predetermined operation is taken as the log function log2a is an example, among the 512 eigenstates, the eigenstate with binary value 000 for the first bit q2q1q0 is |100101000>Wherein the decimal value corresponding to the first bit is 0 due to log function operation log20 does not exist, the eigen state is kept unchanged at the moment and output is carried out, and then the process is carried out by jumping to the next eigen state.The rest kinds of preset operations are the same.
In practical applications, all the eigenstates constituting the first quantum state may include one eigenstate with an amplitude of 1 and the remaining eigenstates with an amplitude of 0.
Continuing with the example above, the user wants to implement log24, the amplitude of the eigenstate with the first bit of 100 is set to 1, and the amplitudes of the remaining eigenstates are set to 0, assuming ψ is 1|100000100>. After the above example evolution, psi' 1|100010100 is obtained>And carries the operation object information and the operation result information. Due to the fact that only one uniquely determined eigen state exists in the evolved quantum state space, the amplitude is 1, namely the probability is 1, and the subsequent measurement of an evolution result is facilitated.
The above example completely shows 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 operation of the exponential function, and are not described herein again.
The evolution method of the quantum state when the transposed conjugate operation corresponding to the evolution operation of the quantum state is performed will be described below. In particular, when the evolution operation of the quantum state has a transposed conjugate identifier
Figure BDA0002377547500000121
When (reading as Dagger), it means that the evolution operation of the executed quantum state is in a transposed conjugate state, and at this time, the evolved second quantum state needs to be reduced to the first quantum state.
In quantum application, an Oracle can be constructed, and the internal principle of the Oracle is the method flow of the invention. Specifically, Oracle, which can be understood as a module (like a black box) that performs a specific function in a quantum algorithm, has a specific implementation manner in a specific problem.
At present, existing quantum line construction can only utilize existing single quantum logic gates, double quantum logic gates and the like, and the following problems generally exist:
for the quantum wires with complex functions, the number of quantum bits needed can be very large, huge memory space can be consumed when a classical computer is used for simulation, the number of logic gates needed can be very large, and the simulation time consumption can be very long. Also, some complex algorithms are difficult to implement using quantum lines.
Based on the method, the complex function of mutual evolution between the quantum states corresponding to the basic elementary function operation is realized by changing the Oracle simulation mode, and the controlled function is realized. The parameters of the Oracle transmitted by the user can include: the Oracle name (used for identifying the functional use of Oracle), the aforementioned group of qubits, the operand of the preset operation, and so on. Can use AyRepresenting a second quantum state after evolution of the first quantum state, setting an identifier
Figure BDA0002377547500000122
Namely, it is
Figure BDA0002377547500000123
Indicating the reduction of the evolved second quantum state to the first quantum state, wherein AyIs a representation of the simulated preset operations in Oracle.
The advantage of this approach is that overall Oracle is a known module, and its internal implementation details need not be considered, and it is very simple and clear in the context of quantum applications, such as representation of quantum wires. Because the classical simulated Oracle functional module can be equivalent to a quantum logic gate to construct a complex quantum circuit, the memory space required during the operation is saved, and the simulation verification of a quantum algorithm is accelerated.
Therefore, 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 bit positions; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits; for each eigenstate forming the first quantum state, performing an evolution operation of the quantum state to encode a value corresponding to the sub-quantum state of the first bit corresponding to the current eigenstate onto the group of quantum bits by performing the preset operation, and obtaining an evolved eigenstate; outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved eigenstates. The invention provides a technology capable of simulating the basic function operation in a quantum line, and fills the blank of the related technology.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a quantum state simulation apparatus 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 qubits; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits;
the encoding module 302: the quantum state evolution unit is used for executing the quantum state evolution operation aiming at each eigenstate forming the first quantum state so as to encode the result of the preset operation executed on the sub quantum state corresponding to the first bit position corresponding to the current eigenstate on the group of quantum bit positions to obtain the eigenstate after the evolution;
the output module 303: for outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved 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 encoding module is specifically configured to:
encoding a result of the preset operation performed on the sub-quantum state corresponding value of the first bit corresponding to the current eigenstate to 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;
performing the preset operation on the decimal value;
and encoding the operation result of the preset operation to the group of quantum bit.
Specifically, the encoding the operation result of the preset operation onto the group of qubits includes:
encoding an integer portion of the operation result to a second bit of the set of qubits and encoding a fractional portion of the operation result to a third bit of the set of qubits.
Specifically, the group of qubits further includes a fourth bit;
the method further comprises the following steps: and judging whether to execute the evolution operation of the quantum state or not according to the fourth bit.
Specifically, the determining whether to execute the evolution operation of the quantum state according to the fourth bit includes:
acquiring a sub-quantum state corresponding to the fourth bit in the current eigenstate;
performing an evolution operation of the quantum state when all bits of the sub-quantum state are 1.
Specifically, the method further comprises:
and executing transposition conjugation operation corresponding to the evolution operation of the quantum state so as to restore the evolved second quantum state to the first quantum state.
Specifically, all eigenstates that make up the stacked state include:
one eigenstate with amplitude 1 and the remaining eigenstates with amplitude 0.
Therefore, 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 bit positions; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits; for each eigenstate forming the first quantum state, performing an evolution operation of the quantum state to encode a value corresponding to the sub-quantum state of the first bit corresponding to the current eigenstate onto the group of quantum bits by performing the preset operation, and obtaining an evolved eigenstate; outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved eigenstates. The invention provides a technology capable of simulating the basic function operation in a quantum line, and fills the blank of the related technology.
Embodiments of the present invention also include a storage medium having a computer program stored therein, where the computer program is configured to perform the steps in any of the above method embodiments when the computer program runs.
Specifically, in the present embodiment, the 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 bit; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits;
s202, executing the evolution operation of the quantum state aiming at each eigenstate forming the first quantum state, so as to encode the result of the preset operation executed on the sub quantum state corresponding to the first bit position corresponding to the current eigenstate on the group of quantum bit positions, and obtaining the eigenstate after the evolution;
s203, outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved eigenstates.
Specifically, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Therefore, 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 bit positions; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits; for each eigenstate forming the first quantum state, performing an evolution operation of the quantum state to encode a value corresponding to the sub-quantum state of the first bit corresponding to the current eigenstate onto the group of quantum bits by performing the preset operation, and obtaining an evolved eigenstate; outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved eigenstates. The invention provides a technology capable of simulating the basic function operation in a quantum line, and fills the blank of the related technology.
Embodiments of the present invention also include an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the steps of any of the above method embodiments.
Specifically, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Specifically, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s201, obtaining a first quantum state of a group of quantum bit; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits;
s202, executing the evolution operation of the quantum state aiming at each eigenstate forming the first quantum state, so as to encode the result of the preset operation executed on the sub quantum state corresponding to the first bit position corresponding to the current eigenstate on the group of quantum bit positions, and obtaining the eigenstate after the evolution;
s203, outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved eigenstates.
Therefore, 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 bit positions; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits; for each eigenstate forming the first quantum state, performing an evolution operation of the quantum state to encode a value corresponding to the sub-quantum state of the first bit corresponding to the current eigenstate onto the group of quantum bits by performing the preset operation, and obtaining an evolved eigenstate; outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved eigenstates. The invention provides a technology capable of simulating the basic function operation in a quantum line, and fills the blank of the related technology.
The construction, features and functions of the present invention are described in detail in the embodiments illustrated in the drawings, which are only preferred embodiments of the present invention, but the present invention is not limited by the drawings, and all equivalent embodiments modified or changed according to the idea of the present invention should fall within the protection scope of the present invention without departing from the spirit of the present invention covered by the description and the drawings.

Claims (11)

1. A method of simulating a quantum state, comprising:
obtaining a first quantum state of a set of qubits; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits;
for each eigenstate forming the first quantum state, performing an evolution operation of the quantum state to encode a value corresponding to the sub-quantum state of the first bit corresponding to the current eigenstate onto the group of quantum bits by performing the preset operation, and obtaining an evolved eigenstate;
outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved eigenstates.
2. A method of modelling a quantum state according to claim 1, wherein: the preset operation comprises one of exponential function operation, logarithmic function operation, trigonometric function operation, inverse trigonometric function operation and power function operation.
3. A method of modelling a quantum state according to claim 1, wherein: the encoding, to the group of qubits, a result of the preset operation performed on the sub-quantum state corresponding to the first bit corresponding to the current eigenstate 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;
performing the preset operation on the decimal value;
and encoding the operation result of the preset operation to the group of quantum bit.
4. A method of modelling a quantum state according to claim 3, wherein: the encoding of the operation result of the preset operation onto the set of qubits comprises:
encoding an integer portion of the operation result to a second bit of the set of qubits and encoding a fractional portion of the operation result to a third bit of the set of qubits.
5. A method of modelling a quantum state according to claim 1, wherein: the set of qubits further comprises a fourth bit;
the method further comprises the following steps: and judging whether to execute the evolution operation of the quantum state or not according to the fourth bit.
6. A method of modelling a quantum state according to claim 5, wherein: the determining whether to perform the evolution operation of the quantum state according to the fourth bit includes:
acquiring a sub-quantum state corresponding to the fourth bit in the current eigenstate;
performing an evolution operation of the quantum state when all bits of the sub-quantum state are 1.
7. A method of modelling a quantum state according to claim 1, wherein: the method further comprises the following steps:
and executing transposition conjugation operation corresponding to the evolution operation of the quantum state so as to restore the evolved second quantum state to the first quantum state.
8. A method of modelling a quantum state according to claim 1, wherein: all eigenstates that make up the stacked state include:
one eigenstate with amplitude 1 and the remaining eigenstates with amplitude 0.
9. An apparatus for simulating quantum states, comprising:
an obtaining module for obtaining a first quantum state of a set of qubits; wherein the set of qubits comprises: a first bit representing an operand of a predetermined operation, the first quantum state being: a superposition of all eigenstates of the set of qubits;
the encoding module is used for executing the evolution operation of the quantum state aiming at each eigenstate forming the first quantum state so as to encode the result of the preset operation executed on the sub quantum state corresponding to the first bit position corresponding to the current eigenstate onto the group of quantum bit positions to obtain the eigenstate after the evolution;
an output module for outputting the evolved second quantum state; wherein the second quantum state is comprised of each of the evolved eigenstates.
10. A storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 8 when executed.
11. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 8.
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 true CN113222153A (en) 2021-08-06
CN113222153B 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)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160328253A1 (en) * 2015-05-05 2016-11-10 Kyndi, Inc. Quanton representation for emulating quantum-like computation on classical processors
US20170286858A1 (en) * 2016-03-31 2017-10-05 Board Of Regents, The University Of Texas System System and method for emulation of a quantum computer
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160328253A1 (en) * 2015-05-05 2016-11-10 Kyndi, Inc. Quanton representation for emulating quantum-like computation on classical processors
US20170286858A1 (en) * 2016-03-31 2017-10-05 Board Of Regents, The University Of Texas System System and method for emulation of a quantum computer
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
郭光灿等: ""量子信息技术发展概况"", 《南京邮电大学学报(自然科学版)》, vol. 37, no. 3, pages 1 - 14 *

Also Published As

Publication number Publication date
CN113222153B (en) 2023-08-08

Similar Documents

Publication Publication Date Title
CN111582491A (en) Construction method and device of quantum line
CN112232513A (en) Quantum state preparation method and device
CN112633507B (en) Method and device for encoding complex vector to quantum circuit
CN113222150B (en) Quantum state transformation method and device
CN112114776B (en) Quantum multiplication method, device, electronic device and storage medium
CN114358319B (en) Machine learning framework-based classification method and related device
CN113222151B (en) Quantum state transformation method and device
CN113222159B (en) Quantum state determination method and device
CN113222160B (en) Quantum state conversion method and device
CN114358318B (en) Machine learning framework-based classification method and related device
CN115293254A (en) Quantum multilayer perceptron-based classification method and related equipment
CN113222153B (en) Quantum state simulation method and device, storage medium and electronic device
CN115983392A (en) Method, device, medium and electronic device for determining quantum program mapping relation
CN114372582B (en) Quantum automatic coding method based on machine learning framework and related device
CN114764618B (en) Quantum preprocessing method and device for linear system
CN114372584B (en) Transfer learning method based on machine learning framework and related device
CN113222157B (en) Quantum simulation method, quantum simulation device, electronic device and storage medium
CN113222156B (en) Quantum simulation method and device for operation to be executed
CN116933879A (en) Quantum state determination method and device
CN116822643A (en) Quantum state preparation method and device
CN114881238A (en) Method and apparatus for constructing quantum discriminator, medium, and electronic apparatus
CN115879559A (en) Method and device for judging equivalence relation among multiple quantum states and quantum computer
CN117852665A (en) Quantum circuit-based physical system state prediction method and related device
CN114881239A (en) Method and apparatus for constructing quantum generator, medium, and electronic apparatus
CN115879560A (en) Method and device for judging equivalence relation between quantum data and classical data

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

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

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant