A quantum data update method and device

By selecting target rotating logic gates in quantum computing, the data update process is simplified, the number of rotating gates is reduced, the quantum circuit depth is decreased, and the update efficiency is improved.

CN117910586BActive Publication Date: 2026-11-17ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410101613.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-24
Publication Date
2026-11-17
Estimated Expiration
2044-01-24

AI Technical Summary

Technical Problem

In quantum computing, current techniques require a large number of rotating gates to re-prepare the amplitude of data elements, resulting in a complex and inefficient update process.

Method used

By determining the target rotation gate from 2n-1 rotation gates, the qubit is processed using only the target rotation gate, reducing the number of rotation gates required for updating and simplifying the data update process.

Benefits of technology

This reduces the number of quantum logic gates, lowers the quantum circuit depth, shortens the evolution time of qubits, and improves update efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117910586B_ABST
    Figure CN117910586B_ABST
Patent Text Reader

Abstract

This application provides a quantum data update method and apparatus, relating to the field of quantum computing technology. In the quantum data update method, data is updated from 2... n - Determine the target rotation gate corresponding to the target element from 1 rotation gate; determine the rotation angle of the target rotation gate based on the original values ​​of all elements and the new value of the target element; apply the target rotation gate to n qubits to update 2 n This scheme reduces the number of quantum logic gates required to update elements, reduces the number of quantum circuit layers, decreases the quantum circuit depth, and shortens the evolution time of qubits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of quantum computing technology, and in particular to a quantum data update method and device. Background Technology

[0002] In quantum computing, when data elements need to be updated—that is, when the original value of a data element is updated to a new value—it is necessary to re-prepare the amplitude (probability amplitude). The re-prepare amplitude represents the new value of the data element. Hereinafter, data elements will be referred to simply as "elements".

[0003] However, the method of re-generating the amplitude of the data requires a large number of revolving doors, as disclosed in patent document CN112232513A, which re-engineers 2 n To prepare the amplitude using the values ​​of each element, 2... n -1 revolving door.

[0004] In quantum computing, how to simplify the data update method based on rotating gate to prepare amplitude is the technical problem that this application aims to solve. Summary of the Invention

[0005] The purpose of this application is to provide a quantum data update method, a quantum data update device, an electronic device, a storage medium, and a quantum computer operating system to update data using old data and simplify the algorithm.

[0006] In a first aspect, embodiments of this application provide a quantum data update method, including:

[0007] Obtain n qubits, and the amplitude encoding of the n qubits has 2 n The original values ​​of the elements are normalized, and the 2... n The original value of each element, after normalization, is iterated and divided n times using 2. n -1 rotation logic gate encoded into n qubits 2 n In ...

[0008] Get for update 2 n The new value of the target element among the elements;

[0009] From 2 n -1 rotary logic gates to determine the target rotary logic gate corresponding to the target element;

[0010] Based on the original values ​​of all the elements and the new value of the target element, determine the rotation angle of the target rotation logic gate;

[0011] The target rotation logic gate is applied to n qubits to update the 2 n Each element.

[0012] Optionally, the step of determining the rotation angle of the target rotation logic gate based on the original values ​​of all the elements and the new value of the target element includes:

[0013] The original angle and the updated angle of the target rotary logic gate are determined, wherein the original angle is determined based on the original values ​​of all the elements, and the updated angle is determined based on the new value of the target element and the original value of the invariant element; the invariant element is the element other than the target element among all the elements.

[0014] The difference between the updated angle and the original angle is determined as the rotation angle of the target rotary logic gate.

[0015] Optionally, the target element is the last element, and the number of target rotation logic gates is n, wherein the i-th target rotation logic gate corresponds to 2. n The second of -1 rotary logic gates i -1.

[0016] Optionally, the rotation logic gate is RY(2θ), and the original angle and updated angle of the i-th target rotation logic gate are respectively:

[0017]

[0018] Where, θ(1) i Let θ(2) be the original angle of the i-th target rotation logic gate. i Let x(1) be the update angle of the i-th target rotation logic gate. j Let x(2) be the original value of the j-th element. j Let j be the new value of the j-th element.

[0019] Optionally, the 2 n Each element includes sequence data, the length of which is m. If m is less than 2... n The method further includes:

[0020] 2 n Of the elements, 2 excluding the sequence data n -m elements are set to 0.

[0021] Optionally, the number of new elements is p, and the method further includes:

[0022] The last p elements of the sequence data are determined as the target element; or

[0023] The 2n The last p elements of the first element are determined as the target element; or

[0024] The first p zero elements are determined as the target elements.

[0025] Secondly, embodiments of this application provide a quantum data update device, comprising:

[0026] The acquisition module is used to acquire n qubits, wherein the amplitude encoding of the n qubits has 2... n The original values ​​of the elements are normalized, and the 2... n The original value of each element, after normalization, is iterated and divided n times using 2. n -1 rotation logic gate encoded into n qubits 2 n In the quantum states, n is an integer greater than or equal to 1; the acquisition module is also used to acquire the quantum states used for updating 2 n A new element of the target element among the elements;

[0027] Gate determination module, used to determine from 2 n -1 rotary logic gates to determine the target rotary logic gate corresponding to the target element;

[0028] An angle determination module is used to determine the rotation angle of the target rotation logic gate based on the original values ​​of all the elements and the new value of the target element.

[0029] The computation module is used to apply the target rotation logic gate to the n qubits to update the 2 n Each element.

[0030] Thirdly, embodiments of this application provide 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 quantum data update method of the first aspect.

[0031] Fourthly, embodiments of this application provide a storage medium storing a computer program, wherein the computer program is configured to execute the quantum data update method of the first aspect when running.

[0032] Fifthly, embodiments of this application provide a quantum computer operating system, wherein the quantum computer operating system updates data according to the quantum data update method of the first aspect.

[0033] Compared with the prior art, this application has the following advantages:

[0034] Because it is through from 2 nIf the target element is determined from the -1 rotation logic gates, then only the target rotation logic gate needs to be used to process the qubit; it is not necessary to use all 2... n -1 rotation logic gates are used to process qubits, which reduces the number of quantum logic gates required to update elements, reduces the number of quantum circuit layers, reduces the quantum circuit depth, and shortens the evolution time of qubits. Attached Figure Description

[0035] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 This is a schematic diagram of the process of preparing amplitude using a Y-shaped rotating gate in the prior art;

[0037] Figure 2 A flowchart illustrating a quantum data update method provided in an embodiment of this application;

[0038] Figure 3 This is a schematic diagram illustrating a process of updating amplitude using a Y-shaped rotating door, as provided in an embodiment of this application.

[0039] Figure 4 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. The described embodiments are only some embodiments of this application, not all embodiments. The components of the embodiments of this application described in the accompanying drawings can generally be arranged and designed in various different configurations.

[0041] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0042] This application does not limit the implementation method of qubits; for example, ions can be used as qubits. This application also does not limit the implementation method of quantum logic gates such as rotating gates; for example, laser signals can be used as quantum logic gates.

[0043] See the method of publication of patent document CN112232513A and Figure 1 The process of generating amplitude using a rotating door will be illustrated below using an example with a number of qubits n=3 (denoted as Implementation Method A).

[0044] Each quantum bit has two possible quantum states, |0〉 and |1〉. Each quantum state has a quantum state amplitude (probability amplitude). The square of the amplitude represents the probability. The total probability of all quantum states is 1, that is, the sum of the squares of the amplitudes of all quantum states is 1.

[0045] A combination of 3 qubits has 2 n = There are 8 possible quantum states, namely |000〉, |001〉, |010〉, |011〉, |100〉, |101〉, |110〉, and |111〉. Each of the 8 quantum states has its own amplitude, for a total of 8 amplitudes. Each amplitude represents a data element, and 3 qubits can store the normalized values ​​of these 8 elements. Normalization refers to dividing the value of each element by the sum of the squares of all element values.

[0046] The 8 elements are represented as (x1, x2, x3, x4, x5, x6, x7, x8). Normalization of each element involves the following processing:

[0047]

[0048] The normalized values ​​of the 8 elements are represented as follows:

[0049] (b1,b2,b3,b4,b5,b6,b7,b8)

[0050] This satisfies the condition that the sum of squares is 1:

[0051]

[0052] The initial quantum state can be 1|0〉+0|1〉=|0〉, that is, it is 100% probable that it is |0〉. According to Bloch's sphere and Y rotation gate, this quantum state can pass through a Y rotation gate RY(2θ), which can be represented as follows:

[0053] RY(2θ)|0〉=cos(θ)|0〉+sin(θ)|1〉

[0054] At this point, the superimposed quantum state cos(θ)|0〉+sin(θ)|1〉 represents the storage of two normalized values, cos(θ) and sin(θ).

[0055] like Figure 1 The diagram contains 3 qubits and 7 Y-rotation gates. Hollow circles represent 0-control, for example, the hollow circle corresponding to RY(2θ2) means that the RY(2θ2) gate will be executed when the quantum state of the qubit is 0. Solid black circles represent 1-control, for example, the solid circle corresponding to RY(2θ3) means that the RY(2θ3) gate will be executed when the quantum state of the qubit is 1.

[0056] Figure 1 In this case, the quantum state of the initial combination of 3 qubits is |000> with a 100% probability;

[0057] First, RY(2θ1) alters the first qubit, changing its quantum state to a superposition of |0〉 and |1〉, which is represented as... (At this point, the last two qubits remain unchanged, and the quantum state of the combination of the first and second qubits is a superposition of |00〉 and |10〉, i.e. The quantum state of the combination of 3 qubits is a superposition of |000〉 and |100〉, i.e.

[0058] Then, RY(2θ2) changes the quantum state of the second qubit corresponding to the first qubit being 0, that is, it changes the quantum state of the combination of the first and second qubits. It becomes a superposition of |00〉 and |01〉, i.e.

[0059] RY(2θ3) changes the quantum state of the second qubit corresponding to the first qubit being 1, that is, it changes the quantum state of the combination of the first and second qubits. It becomes a superposition of |10〉 and |11〉, i.e. At this point, the third qubit remains unchanged and is still |0〉, meaning the quantum state of the combination of the three qubits is:

[0060] RY(2θ4) changes the quantum state of the third qubit corresponding to the first qubit being 0 and the second qubit being 0, that is, it changes the quantum state of the combination of the three qubits. It becomes a superposition of |000〉 and |001〉, i.e.

[0061] RY(2θ5) changes the quantum state of the third qubit corresponding to the first qubit being 0 and the second qubit being 1, that is, it changes the quantum state of the combination of the three qubits. It becomes a superposition of |011〉 and |010〉, i.e., b3|010>+b4|011〉;

[0062] RY(2θ6) changes the quantum state of the third qubit corresponding to the first qubit being 1 and the second qubit being 0, that is, it changes the quantum state of the combination of the three qubits. It becomes a superposition of |101〉 and |100〉, i.e., b5|100〉+b6|101〉;

[0063] RY(2θ7) changes the quantum state of the third qubit corresponding to the first qubit being 1 and the second qubit being 1, that is, it changes the quantum state of the combination of the three qubits. The state becomes a superposition of |111〉 and |110〉, i.e., b7|110〉+b8|111〉. Thus, the quantum state of the three qubits changes from the 100% probability |000〉 to |000〉, |001〉, ...

[0064] The superposition of |010〉, |011〉, |100〉, |101〉, |110〉, and |111〉:

[0065] b1|000>+b2|001>+b3|010>+b4|011>+b5|100>+b6|101>+b7|110>+b8|111>

[0066] Furthermore, the seven Y-rotation gates can be used to determine the amplitude b of these eight quantum states. i Assigning any value completes the storage of the normalized value of any 8 elements.

[0067] The normalized value of each element stored on a qubit, and the amplitude of each quantum state, are determined by exactly three Y rotation gates:

[0068] The amplitude of |000〉 is determined by RY(2θ1), RY(2θ2), and RY(2θ4);

[0069] The amplitude of |001〉 is determined by RY(2θ1), RY(2θ2), and RY(2θ4);

[0070] The amplitude of |010〉 is determined by RY(2θ1), RY(2θ2), and RY(2θ5);

[0071] The amplitude of |011〉 is determined by RY(2θ1), RY(2θ2), and RY(2θ5);

[0072] The amplitude of |100〉 is determined by RY(2θ1), RY(2θ3), and RY(2θ6);

[0073] The amplitude of |101〉 is determined by RY(2θ1), RY(2θ3), and RY(2θ6);

[0074] The amplitude of |110〉 is determined by RY(2θ1), RY(2θ3), and RY(2θ7);

[0075] The amplitude of |111〉 is determined by RY(2θ1), RY(2θ3), and RY(2θ7).

[0076] The rotation angles of the seven Y-shaped revolving doors can be obtained using the arctan function, satisfying the following formula:

[0077]

[0078]

[0079] Because of b i and x i They are directly proportional, and the formula above can be written as:

[0080]

[0081]

[0082] Implementation A uses |000> as the initial quantum state and a Y-rotation gate as the quantum logic gate. In other implementations, other states can be used as the initial quantum state, implemented using an X-rotation gate or other types of quantum logic gates.

[0083] As can be seen from the formula above, when it is necessary to change the normalized value of a certain element stored in a qubit, only its three corresponding quantum logic gates need to be changed, while the other quantum logic gates remain unchanged, thus preserving the normalized values ​​of other elements stored in the qubit. Eight cases are listed below:

[0084] If only x1 is changed, then only θ1, θ2, and θ4 need to be changed.

[0085] If only x2 is changed, then only θ1, θ2, and θ4 need to be changed.

[0086] If only x3 is changed, then only θ1, θ2, and θ5 need to be changed.

[0087] If only x4 is changed, then only θ1, θ2, and θ5 need to be changed.

[0088] If only x5 is changed, then only θ1, θ3, and θ6 need to be changed.

[0089] If only x6 is changed, then only θ1, θ3, and θ6 need to be changed.

[0090] If only x7 is changed, then only θ1, θ3, and θ7 need to be changed.

[0091] If only x8 is changed, then only θ1, θ3, and θ7 need to be changed.

[0092] Based on the aforementioned normalization formula, changing any element x... i The value of b will change all amplitudes i All amplitudes b i It still satisfies normalization:

[0093]

[0094] Only the ratio between the amplitude and the element value has changed.

[0095] See Figure 2 , Figure 2 This is a flowchart illustrating a quantum data update method provided in an embodiment of this application. The value of an element needs to be updated from its original value to a new value. The quantum data update method may include the following steps S101-S105:

[0096] S101: Obtain n qubits, the amplitude encoding of the n qubits has 2 n The normalized value of each element is 2. n The original value of each element, after normalization, is iterated and divided n times using 2. n -1 rotation logic gate encoded into n qubits 2 n There are ...

[0097] For implementation method A, n=3, the amplitude encoding of the 3 qubits consists of the normalized values ​​of 8 original elements. These normalized values ​​are iteratively divided into 3 equal parts and encoded into the 8 quantum states of the 3 qubits using 7 rotating logic gates. The amplitude of the 8 encoded quantum states is equal to the normalized values ​​of the 8 original elements.

[0098] S102: Obtain the data for updating 2 n The new value of the target element among the elements.

[0099] S103: From 2 n -1 Rotational logic gates determine the target rotational logic gate corresponding to the target element.

[0100] For implementation method A, for example, if the target element is the first element, obtain the new value of the first element and determine the target rotation logic gates as RY(2θ1), RY(2θ2), and RY(2θ4). For example, if the target elements are the first and second elements, determine the target rotation logic gates as RY(2θ1), RY(2θ2), and RY(2θ4). For example, if the target element is the third element, determine the target rotation logic gates as RY(2θ1), RY(2θ2), and RY(2θ5). For example, if the target elements are the third and eighth elements, determine the target rotation logic gates as RY(2θ1), RY(2θ2), RY(2θ5), RY(2θ3), and RY(2θ7).

[0101] If 2 n If only the last element is updated, then the number of target rotation gates is n, and the i-th target rotation gate corresponds to 2. n The second of -1 rotary logic gates i -1.

[0102] If only the last element is updated out of 8 elements, then there are 3 target rotation gates. The first target rotation gate corresponds to the first of the 8 rotation gates, the second target rotation gate corresponds to the third of the 8 rotation gates, and the third target rotation gate corresponds to the seventh of the 8 rotation gates.

[0103] S104: Determine the rotation angle of the target rotation logic gate based on the original values ​​of all elements and the new value of the target element. S104 may include S1041 and S1042:

[0104] S1041: Determine the original angle and updated angle of the target rotation logic gate; the original angle is determined based on the original values ​​of all elements, and the updated angle is determined based on the new value of the target element and the original value of the invariant element; the invariant element is the element other than the target element among all elements.

[0105] For example, the original values ​​of the 8 elements are:

[0106] (x1,x2,x3,x4,x5,x6,x7,x8)=(1,2,3,4,5,6,7,8)

[0107] The target element is the first element, which has a new value of 9. After updating, it should look like this:

[0108] (x1,x2,x3,x4,x5,x6,x7,x8)=(9,2,3,4,5,6,7,8)

[0109] The original angles, i.e., the rotation angles of RY(2θ1), RY(2θ2), and RY(2θ4) corresponding to the original values ​​of the 8 elements, are:

[0110]

[0111]

[0112] The update angles, i.e., the rotation angles of RY(2θ1), RY(2θ2), and RY(2θ4) corresponding to the new values ​​of the 8 elements, are:

[0113]

[0114]

[0115] The angles of other Y-rotating doors corresponding to the new values ​​of the 8 elements are the same as the angles of other Y-rotating doors corresponding to the original values ​​of the 8 elements.

[0116] remember The quantum states corresponding to the original values ​​of the 8 elements are:

[0117]

[0118] remember The quantum states corresponding to the new values ​​of the 8 elements are:

[0119]

[0120] S1042: Determine the difference between the updated angle and the original angle as the rotation angles Δ1, Δ2, and Δ4 of the target rotation logic gate.

[0121]

[0122]

[0123]

[0124] That is, by angle The qubit after rotation followed by a 2Δ1Y rotation is equivalent to: [the qubit being rotated by an angle...] The qubit after rotation.

[0125] That is, Figure 3 After Figure 1 After the 7 rotating gates, the qubits representing the new values ​​of 8 elements can be obtained by passing through the same rotating gates as RY(2θ1), RY(2θ2), and RY(2θ4) (only the rotation angles are different).

[0126] The second pass through RY(2θ1), RY(2θ2), RY(2θ4), i.e., S105, applies the target rotation logic gate to n qubits to update 2 nOne element. At this point, a qubit represents 2. n The updated value of each element, 2 n The updated value of each element includes the original value of the invariant element and the new value of the target element. The amplitude of the qubit is 2. n The updated value of each element is the normalized value.

[0127] The example above illustrates the case where the target element is the first element. If the target element is the last element, the original angle and updated angle of the i-th target rotation gate can be obtained as follows:

[0128]

[0129] Where, θ(1) i Let θ(2) be the original angle of the i-th target rotation logic gate. i Let x(1) be the update angle of the i-th target rotation logic gate. j Let x(2) be the original value of the j-th element. j Let j be the new value of the j-th element.

[0130] Taking implementation method A as an example, let's compare the beneficial effects of this application with the prior art:

[0131] In the existing technology, after Figure 1 After passing through 7 rotating gates, we obtain qubits representing the original values ​​of 8 elements. If we need to update the value of the first element, we need to reset the qubits to their initial state and repeat the process. Figure 1 Only after passing through 7 rotating gates can we obtain qubits representing new values ​​of 8 elements;

[0132] According to the scheme in this application, after... Figure 1 After passing through 7 rotating gates, we obtain qubits representing the original values ​​of 8 elements. If we need to update the value of the first element, we only need to pass through 3 more rotating gates, RY(2θ1), RY(2θ2), and RY(2θ4), to obtain qubits representing the new values ​​of 8 elements.

[0133] The solution in this application updates the value of an element by reducing the number of rotating doors by four compared to existing solutions. If the number of elements is greater, then the existing technology requires 2... n -1 revolving door; according to the scheme in this application, only n revolving doors are needed, saving 2 n The effect is more significant with -1 to n rotation gates. The scheme in this application reduces the number of quantum logic gates required to update elements, reduces the number of quantum circuit layers, reduces the quantum circuit depth, and shortens the evolution time of qubits.

[0134] In one implementation, 2 nEach element contains sequence data of length m. If m is less than 2... n Then 2 n Of the elements, excluding sequence data, 2 n - The values ​​of m elements are set to 0. If the denominator in the radical expression is 0 when using arctan to calculate the angle, then the angle is assigned the value π / 2.

[0135] For example, if 8 elements include a sequence of data of length 5, with the sequence data being 1,21,53,7,4, and the values ​​of the other 3 elements can be set to 0, then the value of the 8 elements is 1,21,53,7,4,0,0,0.

[0136] If the number of new elements is p, the target element can be set to update in any of the following ways:

[0137] ① Determine the last p elements of the sequence data as the target element;

[0138] ②Put 2 n The last p elements of the first element are determined as the target element;

[0139] ③The first p zero elements are determined as the target elements.

[0140] For example, if the values ​​of the 8 elements are 1,21,53,7,4,0,0,0, the number of new elements is 2:

[0141] ① The last two elements (with values ​​7 and 4) of the sequence data 1,21,53,7,4 can be identified as the target elements;

[0142] ② The last two elements (with values ​​of 0 and 0) can be selected as the target elements, thus preserving all the previous data;

[0143] ③ The first two elements (with values ​​of 1 and 21) can be identified as the target elements.

[0144] The amplitude encoding of the n qubits is 2 n The method further includes applying the target rotation logic gate to the n qubits after each element is a sequence of data. The method also includes applying the quantum logic gate corresponding to the transfer matrix to the qubits to obtain new sequence of data. The quantum logic gate may be a rotation logic gate.

[0145] Sequence data refers to data arranged in a certain order. For example, sequence data generated in chronological order.

[0146] Taking (x1,x2,x3,x4,x5,x6,x7,x8) = (1,2,3,4,5,6,7,8) as an example, x1 is the data generated at time 1, x2 is the data generated at time 2, ... x8 is the data generated at time 8.

[0147] The new data generated at time 9 is 9. After updating according to the above method, it becomes (9,2,3,4,5,6,7,8). Then, the quantum logic gate corresponding to the transfer matrix is ​​applied to the qubits, causing the elements to exchange positions, resulting in the new sequence data (2,3,4,5,6,7,8,9). Based on the above embodiments, this application also provides a quantum data update device, including:

[0148] The acquisition module is used to execute S101 and S102 to acquire n qubits. The amplitude encoding of the n qubits has 2... n The normalized value of each element is 2. n The original value of each element, after normalization, is iterated and divided n times using 2. n -1 rotation logic gate encoded into n qubits 2 n In each of the 2 quantum states, n is an integer greater than or equal to 1; obtain the information used to update 2 n A new element from the target element;

[0149] The gate determination module is used to execute S103, from 2 n -1 rotary logic gates to determine the target rotary logic gate corresponding to the target element;

[0150] The angle determination module is used to execute S104, which replaces the target element with the new element to determine the rotation angle of the target rotation logic gate;

[0151] The computation module executes S105, applying the target rotation logic gate to n qubits to update 2. n Each element.

[0152] Based on the above embodiments, this application also provides an electronic device, such as... Figure 4 The electronic device includes a memory 11 and a processor 12. The memory 11 stores a computer program, and the processor 12 is configured to run the computer program to execute the quantum data update method described above.

[0153] Based on the above embodiments, this application also provides a storage medium storing a computer program, wherein the computer program is configured to execute the above-described quantum data update method at runtime.

[0154] Based on the above embodiments, this application also provides a quantum computer operating system, which updates data according to the above-described quantum data update method.

[0155] The apparatus and system embodiments described above are merely illustrative. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement these embodiments without any creative effort.

[0156] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A quantum data update method, characterized in that, include: Obtain n qubits, and the amplitude encoding of the n qubits has 2 n The original values ​​of the elements are normalized, and the 2... n The original value of each element, after normalization, is iterated and divided into n equal parts using 2. n -1 rotation logic gate encoded into n qubits 2 n In ... Get for update 2 n The new value of the target element among the elements; From 2 n -1 rotary logic gates to determine the target rotary logic gate corresponding to the target element; Based on the original values ​​of all the elements and the new value of the target element, determine the rotation angle of the target rotation logic gate; The target rotation logic gate is applied to n qubits to update the 2 n One element; The step of determining the rotation angle of the target rotation logic gate based on the original values ​​of all the elements and the new value of the target element includes: The original angle and the updated angle of the target rotary logic gate are determined, wherein the original angle is determined based on the original values ​​of all the elements, and the updated angle is determined based on the new value of the target element and the original value of the invariant element; the invariant element is the element other than the target element among all the elements. The difference between the updated angle and the original angle is determined as the rotation angle of the target rotary logic gate.

2. The quantum data update method as described in claim 1, characterized in that, The target element is the last element, and the number of target rotary logic gates is n, where the i-th target rotary logic gate corresponds to 2. n The second of -1 rotary logic gates i -1.

3. The quantum data update method as described in claim 2, characterized in that, The rotation logic gate is RY(2) θ The original angle and updated angle of the i-th target rotation logic gate are respectively: in, θ (1) i Let be the original angle of the i-th target rotation logic gate. θ (2) i The update angle for the i-th target rotation logic gate. x (1) j Let j be the original value of the j-th element. x (2) j Let j be the new value of the j-th element.

4. The quantum data update method as described in claim 1, characterized in that, The 2 n Each element includes sequence data, the length of which is m. If m is less than 2... n The method further includes: 2 n Of the elements, 2 excluding the sequence data n -m elements are set to 0.

5. The quantum data update method as described in claim 4, characterized in that, The number of new values ​​is p, and the method further includes: The last p elements of the sequence data are determined as the target element; or The 2 n The last p elements of the first element are determined as the target element; or The first p zero elements are determined as the target elements.

6. A quantum data update device, characterized in that, include: The acquisition module is used to acquire n qubits, wherein the amplitude encoding of the n qubits has 2... n The original values ​​of the elements are normalized, and the 2... n The original value of each element, after normalization, is iterated and divided into n equal parts using 2. n -1 rotation logic gate encoded into n qubits 2 n In the quantum states, n is an integer greater than or equal to 1; the acquisition module is also used to acquire the quantum states used for updating 2 n The new value of the target element among the elements; Gate determination module, used to determine from 2 n -1 rotary logic gates to determine the target rotary logic gate corresponding to the target element; An angle determination module is used to determine the rotation angle of the target rotation logic gate based on the original values ​​of all the elements and the new value of the target element. The computation module is used to apply the target rotation logic gate to the n qubits to update the 2 n One element; The step of determining the rotation angle of the target rotation logic gate based on the original values ​​of all the elements and the new value of the target element includes: The original angle and the updated angle of the target rotary logic gate are determined, wherein the original angle is determined based on the original values ​​of all the elements, and the updated angle is determined based on the new value of the target element and the original value of the invariant element; the invariant element is the element other than the target element among all the elements. The difference between the updated angle and the original angle is determined as the rotation angle of the target rotary logic gate.

7. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the quantum data update method according to any one of claims 1 to 5.

8. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the quantum data update method according to any one of claims 1 to 6 when it runs.

9. A quantum computer operating system, characterized in that, The quantum computer operating system implements data updates according to the quantum data update method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Quantum state preparation method and device

    CN112232513A

  • Quantum program processing method and device, storage medium and electronic device

    CN110929873A

  • Method and device for realizing quantum circuit replacement, storage medium and electronic device

    CN111027702A