A method and device for determining a quantum state
By specifying quantum logic gates, the problem of complex quantum circuit construction in quantum computing is solved, and efficient quantum state preparation is achieved, which is suitable for quantum computing simulation of sparse data.
Patent Information
- Application Number
- CN202210354058.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-02
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-04-02
AI Technical Summary
In the prior art, due to the development of quantum chip hardware, the number of bits that quantum computers can control is limited, which makes it difficult to simulate quantum algorithms, especially the high cost of building and coding complex quantum lines, making it difficult to effectively utilize NISQ equipment.
By obtaining specific elements and position information in the target data, the target data is classified and encoded using specified quantum logic gates such as Pauli-X gate, NATO gate and U3 quantum logic gate, and outputting the final quantum state containing the encoded qubits.
It realizes efficient encoding of target data information into quantum bits, solves the problem of complex quantum circuit construction in quantum computing simulation, reduces the computational cost, and is suitable for the preparation of quantum states of sparse data.
Smart Images

Figure CN116933879B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of quantum computing technology, and in particular to a method and device for determining a quantum state. Background Art
[0002] Quantum computers exploit the superposition of quantum states, theoretically enabling exponential acceleration in certain scenarios. For example, cracking an RSA key would take hundreds of years on a classical computer, while executing a quantum algorithm on a quantum computer would take only hours. However, current quantum computers are limited in their computing power due to the limited number of bits they can manipulate, resulting in limitations on the development of quantum chip hardware. This limits their ability to universally run quantum algorithms.
[0003] The simulation and implementation of quantum algorithms often requires the use of various quantum logic gates to construct them. For example, in solving scientific computing problems, it is necessary to encode relevant information about the target data into the quantum state of the qubit. However, when relying on various quantum logic gates to construct quantum circuits to achieve this requirement, the number of quantum logic gates required and the depth of the constructed quantum circuits are very large, which seriously hinders the research of quantum computing and is a problem that needs to be solved urgently. Summary of the Invention
[0004] The purpose of the present invention is to provide a method and device for determining quantum states to address the deficiencies in the prior art. It can utilize several designated quantum logic gates to encode specific element information and position information in target data into quantum bits for the preparation of quantum states and to solve the simulation problem of quantum computing.
[0005] One embodiment of the present application provides a method for determining a quantum state, the method comprising:
[0006] Obtaining a specific element in target data and position information corresponding to the specific element and a group of quantum bits;
[0007] Classifying specific elements in the target data and location information corresponding to the specific elements;
[0008] For each specific element and the position information corresponding to the specific element after classification is completed, a quantum state evolution operation is performed using a specified quantum logic gate to encode the position information corresponding to the specific element onto the quantum bit, and a final quantum state containing the encoded quantum bit is output, wherein the amplitude value of the final quantum state is the element value of the specific element in the target data.
[0009] Optionally, the target data includes: sparse data, and the specific elements include: non-zero elements.
[0010] Optionally, obtaining a specific element in the target data includes:
[0011] Obtain non-zero elements in the target data and determine whether the sum of the squares of the non-zero elements is 1;
[0012] If not, the non-zero elements are normalized to obtain the non-zero elements satisfying the square sum of 1.
[0013] Optionally, the position information corresponding to the specific element includes: binary subscript information of the non-zero element in the sparse data.
[0014] Optionally, the designated quantum logic gate includes: a Pauli-X gate, a controlled NOT gate, and a U3 quantum logic gate.
[0015] Optionally, the classifying the specific elements in the target data and the location information corresponding to the specific elements includes:
[0016] Constructing a set of binary elements including a preset number of binary elements according to the position information corresponding to the specific element in the target data, wherein the preset number is the number of the specific elements;
[0017] Traversing each digit of each binary element in the set in turn;
[0018] The specific elements in the target data and the position information corresponding to the specific elements are classified according to the respective digits of the binary elements and a preset classification rule.
[0019] Optionally, classifying the specific elements in the target data and the position information corresponding to the specific elements according to the digits of the binary elements and a preset classification rule includes:
[0020] Number the different bits in each binary element from left to right in the order of natural numbers;
[0021] In combination with the numbering, the preset classification rules and according to the binary digit 0 and the binary digit 1, the specific elements in the target data and the position information corresponding to the specific elements are classified in turn.
[0022] Optionally, the final quantum state of the quantum bit includes:
[0023] The final quantum state of the quantum bit is determined by the following formula:
[0024]
[0025] Wherein, M is the number of non-zero elements, and x k is the amplitude value of the final quantum state, the p kis the binary subscript information of the non-zero element in the sparse data and p k ∈{0,1} n , where n is the number of quantum bits in a group.
[0026] Yet another embodiment of the present application provides a device for determining a quantum state, the device comprising:
[0027] An acquisition module, configured to acquire a specific element in the target data and position information corresponding to the specific element and a group of quantum bits;
[0028] A classification module, configured to classify specific elements in the target data and location information corresponding to the specific elements;
[0029] The encoding module is used to sequentially execute quantum state evolution operations on the specific element and the position information corresponding to each specific element after each classification is completed, using a specified quantum logic gate to encode the position information corresponding to the specific element onto the quantum bit, and output a final quantum state containing the encoded quantum bit, wherein the amplitude value of the final quantum state is the element value of the specific element in the target data.
[0030] Optionally, the acquisition module includes:
[0031] an acquisition unit, configured to acquire non-zero elements in the target data and determine whether the sum of squares of the non-zero elements is 1;
[0032] A normalization unit is used to normalize the non-zero elements if no, to obtain the non-zero elements that satisfy the square sum of 1.
[0033] Optionally, the classification module includes:
[0034] a construction unit, configured to construct a set of binary elements including a preset number of binary elements according to position information corresponding to the specific elements in the target data, wherein the preset number is the number of the specific elements;
[0035] A traversal unit, used for sequentially traversing each digit of each binary element in the set;
[0036] The classification unit is used to classify the specific elements in the target data and the position information corresponding to the specific elements according to the respective digits of the binary elements and a preset classification rule.
[0037] Optionally, the classification unit includes:
[0038] A numbering subunit, for numbering different bits in each binary element from left to right according to the order of natural numbers;
[0039] The classification subunit is used to classify the specific elements in the target data and the position information corresponding to the specific elements in sequence according to the binary digits 0 and 1 in combination with the numbering, the preset classification rules.
[0040] Yet another embodiment of the present application provides a storage medium, wherein the storage medium stores a computer program, wherein the computer program is configured to execute any of the above methods when run.
[0041] Yet another embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute any of the above methods.
[0042] Compared with the existing technology, the present application first obtains the specific elements in the target data and the position information corresponding to the specific elements and a group of quantum bits, classifies the specific elements in the target data and the position information corresponding to the specific elements, and sequentially uses the specified quantum logic gate to perform quantum state evolution operations for each specific element and the position information corresponding to the specific element after classification, so as to encode the position information corresponding to the specific element into the quantum bit, and output the final quantum state containing the encoded quantum bit. It can use several specified quantum logic gates, and classify the specific element information and position information in the target data and encode them into the quantum bit for the preparation of quantum state, so as to solve the simulation problem of quantum computing. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a hardware structure block diagram of a computer terminal for a method for determining a quantum state provided by an embodiment of the present invention;
[0044] Figure 2 1 is a flow chart of a method for determining a quantum state provided by an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of a quantum circuit provided by an embodiment of the present invention;
[0046] Figure 4 A schematic diagram of another quantum circuit provided by an embodiment of the present invention;
[0047] Figure 5 It is a structural diagram of a quantum state determination device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limiting the present invention.
[0049] The embodiment of the present invention first provides a method for determining a quantum state, which can be applied to electronic devices such as computer terminals, specifically ordinary computers, quantum computers, etc.
[0050] The following describes it in detail by taking running on a computer terminal as an example. Figure 1 The hardware structure block diagram of a computer terminal for a method for determining a quantum state provided by an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data. Optionally, the computer terminal may also include a transmission device 106 for communication functions and an input and output device 108. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. For example, the computer terminal may also include Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0051] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the method for determining a quantum state in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory and may also include a 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 a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0052] The transmission device 106 is used to receive or send data via a network. A specific example of the aforementioned network may include a wireless network provided by a communications provider of a computer terminal. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0053] It's important to note that a true quantum computer has a hybrid architecture, consisting of two main components: a classical computer, responsible for performing classical computations and control, and a quantum device, responsible for running quantum programs and thus achieving quantum computations. A quantum program is a sequence of instructions written in a quantum language, such as QRunes, that can be executed on a quantum computer. This supports quantum logic gate operations and ultimately enables quantum computations. Specifically, a quantum program is a sequence of instructions that operate quantum logic gates in a specific time sequence.
[0054] In practical applications, due to the limitations of the development of quantum device hardware, quantum computing simulations are usually required to verify quantum algorithms, quantum applications, and the like. Quantum computing simulation is the process of simulating the operation of quantum programs corresponding to specific problems using a virtual architecture (i.e., a quantum virtual machine) built with the resources of an ordinary computer. Generally, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program referred to in the embodiments of the present invention is a program written in a classical language to characterize quantum bits and their evolution, in which quantum bits, quantum logic gates, and the like related to quantum computing are represented by corresponding classical codes.
[0055] Quantum circuits, as a manifestation of quantum programs, also known as quantum logic circuits, are the most commonly used general quantum computing model. They represent circuits that operate on quantum bits in an abstract concept. They are composed of quantum bits, circuits (timelines), and various quantum logic gates. Finally, the results often need to be read out through quantum measurement operations.
[0056] Unlike traditional circuits, which are connected by metal wires to transmit voltage or current signals, in quantum circuits, the circuits can be seen as connected by time. In other words, the state of the quantum bit naturally evolves over time, following the instructions of the Hamiltonian operator until it encounters a logic gate and is operated.
[0057] A quantum program as a whole corresponds to a single quantum circuit. The quantum program described in this disclosure refers to this quantum circuit, where the total number of qubits in this quantum circuit is the same as the total number of qubits in the quantum program. A quantum program can be understood as consisting of a quantum circuit, measurement operations on the qubits in the quantum circuit, registers storing the measurement results, and control flow nodes (jump instructions). A quantum circuit can contain tens, hundreds, or even thousands of quantum logic gate operations. The execution of a quantum program is the process of executing all quantum logic gates in a specific time sequence. It should be noted that the time sequence refers to the chronological order in which individual quantum logic gates are executed.
[0058] It's important to note that in classical computing, the most basic unit is the bit, and the most fundamental control mode is the logic gate. Circuit control can be achieved through combinations of logic gates. Similarly, quantum logic gates are used to manipulate qubits. Quantum logic gates enable quantum states to evolve. They form the basis of quantum circuits. Quantum logic gates include single-bit quantum logic gates such as the Hadamard gate (H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate), Pauli-Z gate (Z gate), RX gate, RY gate, and RZ gate; and multi-bit quantum logic gates such as the CNOT gate, CR gate, iSWAP gate, and Toffoli gate. Quantum logic gates are generally represented using unitary matrices. Unitary matrices are not only a matrix form but also a type of operation and transformation. The effect of a quantum logic gate on a quantum state is typically calculated by multiplying the unitary matrix on the left by the matrix corresponding to the quantum state's right vector.
[0059] Those skilled in the art will understand that in classical computers, the basic unit of information is a bit, which has two states, 0 and 1. The most common physical implementation method is to represent these two states by the level of the voltage. In quantum computing, the basic unit of information is the quantum bit, which also has two states, 0 and 1, denoted as |0> and |1>. However, it can be in a superposition of the two states, which can be represented as Here, a and b are complex numbers representing the amplitudes (probability amplitudes) of the |0> and |1> states, which are not present in classical bits. After measurement, the state of the qubit collapses to a certain state (eigenstate, here |0> and |1> states), where the probability of collapsing to |0> is |a| 2 , the probability of collapsing to |1> is |b| 2 ,|a| 2 +|b| 2 =1, |> is the Dirac symbol.
[0060] Quantum state refers to the state of quantum bits. Its eigenstate is represented by binary in quantum algorithms (or quantum programs). For example, a group of quantum bits is q0, q1, q2, which represent the 0th, 1st, and 2nd quantum bits. The order from high to low is q2q1q0. The quantum state of this group of quantum bits is 2 3 The eight eigenstates (defined states) are: |000>, |001>, |010>, |011>, |100>, |101>, |110>, and |111>. Each eigenstate corresponds to a qubit. For example, in the |000> state, 000 corresponds to q2q1q0 from the highest bit to the lowest bit. In short, a quantum state is a superposition of eigenstates. When the probability amplitude of other states is 0, it is in one of the defined eigenstates.
[0061] At present, the construction of existing quantum circuits can often only utilize existing single quantum logic gates, double quantum logic gates, etc., and usually have the following problems: First, for quantum circuits with more complex functions, the number of quantum bits required will be very large. When using classical computers for simulation, it will consume huge memory space and the simulation time will be very long. In addition, some complex algorithms are difficult to implement using quantum circuits; secondly, the current encoding technology is to prepare the basic state of classical data, mainly loading each data one by one into the superposition quantum state. Its computational cost is related to the data scale and the number of quantum bits, and the algorithm with exponential cost related to the number of quantum bits and input mode is too expensive and can only be used to generate quantum states with a small number of quantum bits. At the same time, a large number of CNOT gates are required, which is not suitable for NISQ devices.
[0062] See also Figure 2 , Figure 2 A schematic flow chart of a method for determining a quantum state provided in an embodiment of the present invention may include the following steps:
[0063] S201: Obtain a specific element in target data and position information corresponding to the specific element and a group of quantum bits.
[0064] Specifically, users can input preset target data and obtain specific elements within the target data, their corresponding locations, and a set of qubits representing quantum bits. The number of qubits can be set by the user based on the size of the preset target data. If computing resources are sufficient, a large number of qubits can be set to meet the quantum bit requirements in most cases.
[0065] The target data can be determined by, but not limited to, the following methods: the user can input the data information to be encoded on a computer terminal. Preferably, the target data can be sparse data, and the specific elements in the target data can be non-zero elements. Sparse data refers to data in which the vast majority of values in the data set are missing or zero. In modern society, with the explosive growth of information, the amount of data has also shown explosive growth, and the data forms are becoming more and more diverse. In the field of data mining, we often have to face massive amounts of complex data. Among them, sparse data, a special form of data, is attracting more and more attention. Sparse data is not useless data, but incomplete information, which needs to be mined and utilized through appropriate means.
[0066] However, in some cases, the sparsity of the data can reach half or even higher, which makes traditional encoding methods, such as the quantum circuit constructed by using RY quantum logic gates for quantum state encoding, very complex, with high simulation costs, and it is difficult to effectively use NISQ equipment for actual simulation. Therefore, traditional quantum state encoding methods are not suitable for processing such data.
[0067] The position information corresponding to the specific element may include: binary subscript information of the non-zero element in the sparse data.
[0068] For example, for a set of target sparse data The subscript is represented by a binary string, which is: Therefore, the binary string representation of the subscripts of the three non-zero elements is:
[0069] For another set of target sparse data Using binary strings to represent subscripts, the binary strings of the subscripts of the four non-zero elements can be represented as:
[0070]
[0071] Among them, obtaining specific elements in the target data includes:
[0072] Step 1: Obtain the non-zero elements in the target data and determine whether the sum of the squares of the non-zero elements is 1.
[0073] For example, for a set of target sparse data The sum of the squares of its non-zero elements is 1, so no further processing is required; for another set of target sparse data {1,0,2,0,3,4,0,5,0,0,0,0}, the sum of the squares of its non-zero elements is not 1, so the following steps need to be performed.
[0074] Step 2: If not, normalize the non-zero elements to obtain the non-zero elements that satisfy the square sum of 1.
[0075] Specifically, normalization involves limiting the target data to a preset value after processing. For example, normalizing the target data elements so that the sum of the squares of all element values is 1. This is done to facilitate subsequent data processing and, secondly, to ensure efficient data encoding.
[0076] For example, for another set of target sparse data {1, 0, 2, 0, 3, 4, 0, 5, 0, 0, 0, 0}, it can be seen that the sum of the squares of the 5 non-zero elements in the sparse data is not 1. Then, the values of the elements in the sparse data need to be normalized. The target sparse data after processing is:
[0077] S202: Classify specific elements in the target data and location information corresponding to the specific elements.
[0078] Specifically, classifying specific elements in the target data and the location information corresponding to the specific elements may include:
[0079] Step 1: Construct a set of binary elements containing a preset number of binary elements according to the position information corresponding to the specific elements in the target data, wherein the preset number is the number of the specific elements.
[0080] For non-zero elements in sparse data and binary subscript information corresponding to the non-zero elements, a set of binary subscript information corresponding to the non-zero elements can be first constructed, where the number of elements in the set is the same as the number of non-zero elements.
[0081] For example, for a set of target sparse data The first set of binary elements constructed is {001,010,111}; for another set of target sparse data The second set of binary elements constructed is {0001, 0101, 1101, 1110}.
[0082] Step 2: Traverse each digit of each binary element in the set in turn.
[0083] Specifically, each digit of each binary element in the set is traversed in sequence, that is, each binary element in the set is traversed in order from left to right, and the digit of the binary element on each binary bit is identified as digit 0 or digit 1.
[0084] For example, for the first set {001, 010, 111}, each digit of each binary element in the first set is traversed in turn, that is, the result of the first traversal is {0, 0, 1}, the result of the second traversal is {0, 1, 1}, and the result of the third traversal is {1, 0, 1}.
[0085] For the above-mentioned second set {0001, 0101, 1101, 1110}, each digit of each binary element in the second set is traversed in turn, that is, the result of the first traversal is {0, 0, 1, 1}, the result of the second traversal is {0, 1, 1, 1}, the result of the third traversal is {0, 0, 0, 1}, and the result of the fourth traversal is {1, 1, 1, 0}.
[0086] Step 3: Classify the specific elements in the target data and the position information corresponding to the specific elements according to the respective digits of the binary elements and the preset classification rules.
[0087] Specifically, classifying the specific elements in the target data and the location information corresponding to the specific elements may include:
[0088] Step a: Number the different bits in each binary element from left to right in the order of natural numbers.
[0089] Step b: combining the numbering, the preset classification rules and classifying the specific elements in the target data and the position information corresponding to the specific elements in turn according to the binary digits 0 and 1.
[0090] For example, for the first set {001, 010, 111} mentioned above, since the result of the first traversal is {0, 0, 1}, the first set can be classified for the first time according to the preset classification rules and divided into {001, 010} and {111}; the set {001, 010} after the first classification can be classified again according to the preset classification rules, that is, {001} and {010}.
[0091] For the above-mentioned second set {0001, 0101, 1101, 1110}, since the result of the first traversal is {0, 0, 1, 1}, the second set can be classified for the first time according to the preset classification rules and divided into {0001, 0101} and {1101, 1110}; the set {0001, 0101} after the first classification can be classified again according to the preset classification rules, that is, {0001} and {0101}.
[0092] S203: For each specific element and the position information corresponding to the specific element after classification is completed, use the specified quantum logic gate to perform a quantum state evolution operation to encode the position information corresponding to the specific element onto the quantum bit, and output a final quantum state containing the encoded quantum bit, wherein the amplitude value of the final quantum state is the element value of the specific element in the target data.
[0093] Specifically, the idea of encoding quantum circuits is to use a recursive method and implement it with a series of specified quantum logic gates, specifically a series of Pauli-X gates, controlled NOT gates (CNOT gates) and U3 quantum logic gates to prepare data into corresponding quantum states.
[0094] For the technical solution in this application, its principle formula is as follows:
[0095]
[0096] Wherein, M is the number of non-zero elements, and x k is the amplitude value of the final quantum state, the p kis the binary subscript information of the non-zero element in the sparse data and p k ∈{0,1} n , where n is the number of quantum bits in a group.
[0097] The specified quantum logic gate used is preferably a Pauli-X gate, and its matrix form is:
[0098]
[0099] The Pauli-X gate operates on a quantum bit, which is equivalent to a classical logical NOT gate. When expressed on the Bloch sphere, it will rotate the target quantum bit 180° around the x-axis. If the quantum bit is |1> before the operation, it will be changed to |0> after the Pauli-X gate operation, and vice versa.
[0100] Another designated quantum logic gate used is preferably a controlled NOT gate (CNOT gate), whose matrix form is:
[0101]
[0102] A controlled-NOT gate operates on two qubits: a controlled qubit and a target qubit. The target qubit performs the NOT operation only when the controlled qubit is |1>; otherwise, it remains unchanged. In practice, a CNOT gate is commonly used to entangle two quantum states. Because it is a controlled-NOT gate, it can control the logical state of the controlled qubit.
[0103] The further designated quantum logic gate used is preferably a U3 quantum logic gate, and its matrix form is:
[0104]
[0105] The step of sequentially executing the quantum state evolution operation on each of the specific elements and the position information corresponding to the specific elements after each classification is completed using a specified quantum logic gate may include:
[0106] Initialize a quantum circuit C, a quantum bit set dif-qubits, and a binary digital value set dif-values. The quantum bit set can be used to store the quantum bits controlled by the quantum state merging step in the encoding process, and the binary digital value set can be used to store binary values.
[0107] By initializing the set T = S, where When |T|>1, the sizes of the sets T0:={x∈T|x[q]==0} and T1:={x∈T|x[q]==1} after classification according to the preset rules are as unequal as possible, but both sets are not empty; secondly, if the classified set |T0|<|T1|, then set T=T0; if the classified set |T0|>|T1|, then set T=T1, according to the above classification method, until a set after a certain classification contains only one element.
[0108] For example, for the above set of target sparse data Each non-zero element of and its corresponding binary subscript information, namely: The Pauli-X gate, controlled NOT gate, and U3 quantum logic gate are used to perform quantum state evolution operations to encode the binary subscript position information corresponding to the non-zero elements onto the quantum bits, and the final quantum state containing the encoded quantum bits is output. The specific evolution process is as follows:
[0109] First, obtain a set of quantum circuits containing 3 qubits and numbered q[2]q[1]q[0] from high to low, and set its initial state to |0>|0>|0>. Using the set T={001,010,111} and |T|>1, determine the set T0={001,010} and T1={111} after the first classification. Since |T0|>|T1|, set T=T1. Since the set T1={111} contains only one element, no further classification is performed. For the set T0={001,010} after the first classification, it is necessary to continue classification in the above manner, that is, the set T′0={001} and T′1={010} after the second classification. Since the sets T′0 and T′1 contain only one element, the classification is complete.
[0110] In order to more conveniently understand the technical solution of this application, the Pauli-X gate, the controlled NOT gate and the U3 quantum logic gate are used to illustrate the transposition conjugation operation corresponding to the evolution of the quantum state. Specifically, the evolution operation of the quantum state executed by the quantum circuit is transposed on the whole, and the transposition conjugation identifier " "(pronounced Dagger) indicates that the operation representing the evolution of the quantum state is in a transposed conjugate state, at which time the final quantum state after evolution is restored to the initial quantum state.
[0111] Specifically, since the output contains the final quantum state of the encoded quantum bits, According to the classification results, we first need to use a CNOT quantum logic gate with a control bit of q[2] and a target quantum bit of q[0] to evolve the quantum state into Then, a U3 quantum logic gate with a control bit of q[1] and a target quantum bit of q[2] is used to merge the quantum states and obtain Then use a CNOT quantum logic gate with a control bit of q[2] and a target quantum bit of q[1] to evolve the quantum state into Again, a CNOT quantum logic gate with a control bit of q[2] and a target quantum bit of q[0] is used to evolve the quantum state into Then, we merge the quantum states through a U3 quantum logic gate with the target quantum bit q[2] to obtain |1>|0>|1>. Finally, we add Pauli-X gates to the quantum bits q[0] and q[2] respectively to restore the quantum state |1>|0>|1> to the initial state |0>|0>|0>. Therefore, we can perform a transpose conjugation operation on the above evolution process to obtain the following: Figure 3 Schematic diagram of the quantum circuit shown.
[0112] It should be noted that in order to vividly demonstrate the control status of a specified quantum logic gate, the solid brown dots in the diagram of this application represent 1 control, indicating that when the quantum state of the quantum bit is 1, the corresponding quantum logic gate will be executed, and the lines between the dots represent control. The angle on the U3 gate in the figure is not shown, and can be calculated and determined according to the non-zero element value that needs to be encoded.
[0113] It can be seen that for the target data before encoding and the final quantum state evolved Among them, the amplitude of the final quantum state obtained by evolving the zero element in the target data is zero, so it is omitted and not shown; the amplitude value of the final quantum state obtained by evolving the non-zero element in the target data corresponds one-to-one to the element value of the non-zero element in the target data.
[0114] For example, for the above-mentioned other set of target sparse data Each non-zero element of and its corresponding binary subscript information, namely: The Pauli-X gate, controlled NOT gate, and U3 quantum logic gate are used to perform quantum state evolution operations to encode the binary subscript position information corresponding to the non-zero elements onto the quantum bits, and the final quantum state containing the encoded quantum bits is output. The specific evolution process is as follows:
[0115] First, obtain a quantum circuit containing 4 quantum bits and numbered q[3]q[2]q[1]q[0] from high to low, and set its initial state to |0>|0>|0>|0>. Through the set T={0001,0101,1101,1110} and |T|>1, determine the set after the first classification T0={0001,0101}, T1={1101,1110}. Since |T0|=|T1|, T=T1 can be set. For the set after the first classification, continue to classify according to the same method and principle as above until the set after classification contains only one element.
[0116] Similarly, since the output contains the final quantum state of the encoded quantum bits According to the classification results, we first need to add Pauli-X gates to the quantum bits q[2] and q[3] to evolve the quantum state into Then, a quantum state is merged through a U3 quantum logic gate with a control bit of q[3] and a target quantum bit of q[2] to obtain Then, through a CNOT gate with a control bit of q[3] and a target quantum bit of q[2], the quantum state is evolved into Then, through a CNOT gate with a control bit of q[3] and a target quantum bit of q[1], the quantum state is evolved into Then, through a CNOT gate with a control bit of q[3] and a target quantum bit of q[0], the quantum state is evolved into Then, the quantum states are merged through a U3 quantum logic gate with a control bit of q[1] and a target quantum bit of q[3], and we get Then, through a CNOT gate with a control bit of q[3] and a target quantum bit of q[1], the quantum state is evolved into Then, through a CNOT gate with a control bit of q[3] and a target quantum bit of q[0], the quantum state is evolved into Then, a U3 quantum logic gate with a target quantum bit q[3] is used to merge the quantum states and obtain |1>|0>|0>|1>. Finally, by adding Pauli-X gates to the quantum bits q[0] and q[3] respectively, the quantum state |1>|0>|0>|1> is restored to the initial state |0>|0>|0>|0>|0>. Therefore, the above evolution process is subjected to the transpose conjugation operation to obtain the following: Figure 4 Another schematic diagram of a quantum circuit is shown.
[0117] By specifying quantum logic gates to encode relevant information of the target data into quantum states, the classical data structure is linked with the state of quantum bits in the quantum field, namely the quantum state. This can be used for the simulation of quantum computing and further expand the research on quantum algorithms and quantum computers.
[0118] It can be seen that the present application first obtains the specific elements in the target data and the position information corresponding to the specific elements and a group of quantum bits, classifies the specific elements in the target data and the position information corresponding to the specific elements, and sequentially uses the specified quantum logic gate to perform quantum state evolution operations for each specific element and the position information corresponding to the specific element after each classification is completed, so as to encode the position information corresponding to the specific element into the quantum bit, and output the final quantum state containing the encoded quantum bit. It can use several specified quantum logic gates, and classify the specific element information and position information in the target data and encode them into the quantum bit for the preparation of the quantum state to solve the simulation problem of quantum computing.
[0119] See also Figure 5 , Figure 5 A schematic diagram of a quantum state preparation device provided by an embodiment of the present invention, and Figure 2 The process shown in the figure may include:
[0120] An acquisition module 501 is configured to acquire a specific element in target data and position information and a set of quantum bits corresponding to the specific element;
[0121] A classification module 502 is configured to classify specific elements in the target data and location information corresponding to the specific elements;
[0122] The encoding module 503 is used to perform quantum state evolution operations on the specific element and the position information corresponding to each specific element after each classification is completed, using a specified quantum logic gate to encode the position information corresponding to the specific element onto the quantum bit, and output a final quantum state containing the encoded quantum bit, wherein the amplitude value of the final quantum state is the element value of the specific element in the target data.
[0123] Specifically, the acquisition module includes:
[0124] an acquisition unit, configured to acquire non-zero elements in the target data and determine whether the sum of squares of the non-zero elements is 1;
[0125] A normalization unit is used to normalize the non-zero elements if no, to obtain the non-zero elements that satisfy the square sum of 1.
[0126] Specifically, the classification module includes:
[0127] a construction unit, configured to construct a set of binary elements including a preset number of binary elements according to position information corresponding to the specific elements in the target data, wherein the preset number is the number of the specific elements;
[0128] A traversal unit, used for sequentially traversing each digit of each binary element in the set;
[0129] The classification unit is used to classify the specific elements in the target data and the position information corresponding to the specific elements according to the respective digits of the binary elements and a preset classification rule.
[0130] Specifically, the classification unit includes:
[0131] A numbering subunit, for numbering different bits in each binary element from left to right according to the order of natural numbers;
[0132] The classification subunit is used to classify the specific elements in the target data and the position information corresponding to the specific elements in sequence according to the binary digits 0 and 1 in combination with the numbering, the preset classification rules.
[0133] Compared with the existing technology, the present application first obtains the specific elements in the target data and the position information corresponding to the specific elements and a group of quantum bits, classifies the specific elements in the target data and the position information corresponding to the specific elements, and sequentially uses the specified quantum logic gate to perform quantum state evolution operations for each specific element and the position information corresponding to the specific element after classification, so as to encode the position information corresponding to the specific element into the quantum bit, and output the final quantum state containing the encoded quantum bit. It can use several specified quantum logic gates, and classify the specific element information and position information in the target data and encode them into the quantum bit for the preparation of quantum state, so as to solve the simulation problem of quantum computing.
[0134] An embodiment of the present invention further includes a storage medium storing a computer program, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
[0135] Specifically, in this embodiment, the above-mentioned storage medium may be configured to store a computer program for performing the following steps:
[0136] S201: Acquire a specific element in target data and position information corresponding to the specific element and a group of quantum bits;
[0137] S202: Classifying specific elements in the target data and location information corresponding to the specific elements;
[0138] S203: For each specific element and the position information corresponding to the specific element after classification is completed, use the specified quantum logic gate to perform a quantum state evolution operation to encode the position information corresponding to the specific element onto the quantum bit, and output a final quantum state containing the encoded quantum bit, wherein the amplitude value of the final quantum state is the element value of the specific element in the target data.
[0139] Specifically, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0140] An embodiment of the present invention further includes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any one of the above method embodiments.
[0141] Specifically, the electronic device 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.
[0142] Specifically, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0143] S201: Acquire a specific element in target data and position information corresponding to the specific element and a group of quantum bits;
[0144] S202: Classifying specific elements in the target data and location information corresponding to the specific elements;
[0145] S203: For each specific element and the position information corresponding to the specific element after classification is completed, use the specified quantum logic gate to perform a quantum state evolution operation to encode the position information corresponding to the specific element onto the quantum bit, and output a final quantum state containing the encoded quantum bit, wherein the amplitude value of the final quantum state is the element value of the specific element in the target data.
[0146] The above describes in detail the structure, features and effects of the present invention based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present invention, but the scope of implementation of the present invention is not limited to what is shown in the drawings. Any changes made in accordance with the concept of the present invention, or modifications to equivalent embodiments with equivalent changes, which do not exceed the spirit covered by the description and drawings, should be within the scope of protection of the present invention.
Claims
1. A method for determining a quantum state, characterized in that: The method comprises: Obtaining a specific element in target data and position information corresponding to the specific element and a group of quantum bits; Classifying specific elements in the target data and location information corresponding to the specific elements; For each specific element and the position information corresponding to the specific element after classification is completed, a quantum state evolution operation is performed using a specified quantum logic gate to encode the position information corresponding to the specific element onto the quantum bit, and a final quantum state containing the encoded quantum bit is output, wherein the amplitude value of the final quantum state is the element value of the specific element in the target data.
2. The method according to claim 1, characterized in that The target data includes sparse data, and the specific elements include non-zero elements.
3. The method according to claim 2, characterized in that The obtaining of specific elements in the target data includes: Obtain non-zero elements in the target data and determine whether the sum of the squares of the non-zero elements is 1; If not, the non-zero elements are normalized to obtain the non-zero elements satisfying the square sum of 1.
4. The method according to claim 3, characterized in that The position information corresponding to the specific element includes: binary subscript information of the non-zero element in the sparse data.
5. The method according to any one of claims 1 to 4, characterized in that The designated quantum logic gates include: Pauli-X gate, controlled NOT gate, and U3 quantum logic gate.
6. The method according to claim 4, characterized in that The classifying the specific elements in the target data and the location information corresponding to the specific elements includes: Constructing a set of binary elements including a preset number of binary elements according to the position information corresponding to the specific element in the target data, wherein the preset number is the number of the specific elements; Traversing each digit of each binary element in the set in turn; The specific elements in the target data and the position information corresponding to the specific elements are classified according to the respective digits of the binary elements and a preset classification rule.
7. The method according to claim 6, characterized in that The classifying of the specific elements in the target data and the position information corresponding to the specific elements according to the respective digits of the binary elements and the preset classification rules includes: Number the different bits in each binary element from left to right in the order of natural numbers; In combination with the numbering, the preset classification rules and according to the binary digit 0 and the binary digit 1, the specific elements in the target data and the position information corresponding to the specific elements are classified in turn.
8. The method according to claim 1 or 7, wherein the final quantum state of the quantum bit comprises: The final quantum state of the quantum bit is determined by the following formula: Wherein, M is the number of non-zero elements, and x k is the amplitude value of the final quantum state, the p k is the binary subscript information of the non-zero element in the sparse data and p k ∈{0,1} n , where n is the number of quantum bits in a group.
9. A device for determining a quantum state, characterized in that: The device comprises: An acquisition module, configured to acquire a specific element in the target data and position information corresponding to the specific element and a group of quantum bits; A classification module, configured to classify specific elements in the target data and location information corresponding to the specific elements; The encoding module is used to sequentially execute quantum state evolution operations on the specific element and the position information corresponding to each specific element after each classification is completed, using a specified quantum logic gate to encode the position information corresponding to the specific element onto the quantum bit, and output a final quantum state containing the encoded quantum bit, wherein the amplitude value of the final quantum state is the element value of the specific element in the target data.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 8 when executed.
11. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Quantum state determination method and device
CN113222159A
Data classification method and system, and classifier training method and system
US20220058435A1