CN-116822643-B - Quantum state preparation method and device
Abstract
The invention discloses a preparation method and a device of a quantum state, the method comprises the steps of obtaining specific elements in target data and position information corresponding to the specific elements and a group of quantum bits, aiming at the specific elements and the position information corresponding to the specific elements, executing evolution operation of the quantum state by using a designated quantum logic gate to encode the position information corresponding to the specific elements onto the quantum bits, and outputting a final quantum state containing the encoded quantum bits, wherein the amplitude value of the final quantum state corresponds to the element value of the specific elements in the target data one by one.
Inventors
- FANG YUAN
- Zou Tianrui
- WANG JING
- Dou Menghan
Assignees
- 本源量子计算科技(合肥)股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20220322
Claims (5)
- 1. A method of preparing a quantum state, the method comprising: acquiring specific elements in target data, position information corresponding to the specific elements and a group of quantum bits, wherein the target data comprises sparse data, and the specific elements comprise non-zero elements; For each specific element and the position information corresponding to the specific element, performing evolution operation of a quantum state by using a designated quantum logic gate to encode the position information corresponding to the specific element onto the quantum bit, and outputting a final quantum state containing the encoded quantum bit, wherein the position information corresponding to the specific element is subscript information of the non-zero element represented by a binary character string in the sparse data, the designated quantum logic gate comprises a Pauloy-X gate, a control NOT gate, a U3 quantum logic gate and a Toffoli quantum logic gate, the amplitude value of the final quantum state corresponds to the element value of the specific element in the target data one by one, and the final quantum state of the quantum bit passes through an arithmetic formula Determining the said For the number of non-zero elements, the For the amplitude value of the final quantum state, the For the position information corresponding to the specific element The said Is the number of a set of qubits.
- 2. The method of claim 1, wherein the obtaining the specific element in the target data comprises: Acquiring non-zero elements in target data and judging whether the sum of squares of the non-zero elements is 1 or not; If not, carrying out normalization processing on the non-zero elements to obtain the non-zero elements meeting the square sum of 1.
- 3. A device for preparing a quantum state, the device comprising: The acquisition module is used for acquiring specific elements in target data, position information corresponding to the specific elements and a group of quantum bits, wherein the target data comprises sparse data, and the specific elements comprise non-zero elements; An encoding module for performing an evolution operation of a quantum state by using a designated quantum logic gate for each specific element and position information corresponding to the specific element 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 position information corresponding to the specific element is subscript information of the non-zero element represented by a binary string in the sparse data, the designated quantum logic gate comprises a bubble-X gate, a control NOT gate, a U3 quantum logic gate and a Toffoli quantum logic gate, the amplitude value of the final quantum state corresponds to the element value of the specific element in the target data one by one, and the final quantum state of the quantum bit passes through an arithmetic formula Determining the said For the number of non-zero elements, the For the amplitude value of the final quantum state, the Subscript and for binary string representation of the non-zero element in the sparse data The said Is the number of a set of qubits.
- 4. A storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of claims 1 to 2 when run.
- 5. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 2.
Description
Quantum state preparation method and device Technical Field The invention belongs to the technical field of quantum computing, and particularly relates to a preparation method and device of a quantum state. Background Quantum computers use the superposition of quanta and in theory have the ability to accelerate exponentially in some cases. For example, cracking RSA keys takes hundreds of years on classical computers, while executing quantum algorithms on quantum computers takes only a few hours. However, the current quantum computer is limited by the limited number of controllable bits caused by the development of quantum chip hardware, so that the computing power is limited, and the quantum algorithm cannot be universally run. In the analog implementation of quantum algorithms, it is often necessary to construct the quantum algorithm with the aid of various quantum logic gates. For example, in solving a scientific computing problem, relevant information of target data needs to be encoded on a quantum state of a quantum bit, and when a quantum circuit for realizing the requirement is constructed by means of various quantum logic gates, the number of the various quantum logic gates is huge, the depth of the constructed quantum circuit is deeper, and research on quantum computing is seriously hampered, which is a problem to be solved urgently. Disclosure of Invention The invention aims to provide a preparation method and a preparation device of a quantum state, which are used for solving the defects in the prior art, and can encode specific element information and position information in target data into quantum bits by utilizing a plurality of specified quantum logic gates for preparing the quantum state and solving the simulation problem of quantum computation. One embodiment of the present application provides a method for preparing a quantum state, the method comprising: acquiring specific elements in target data, position information corresponding to the specific elements and a group of quantum bits; And aiming at each specific element and the position information corresponding to the specific element, performing evolution operation of a quantum state by utilizing a designated quantum logic gate so as 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 corresponds to the element value of the specific element in the target data one by one. Optionally, the target data comprises sparse data. Optionally, the specific element comprises a non-zero element. Optionally, the acquiring a specific element in the target data includes: Acquiring non-zero elements in target data and judging whether the sum of squares of the non-zero elements is 1 or not; If not, carrying out normalization processing on the non-zero elements to obtain the non-zero elements meeting the square sum of 1. Optionally, the position information corresponding to the specific element comprises subscript information of the non-zero element, which is represented by a binary character string in the sparse data. Optionally, the designated quantum logic gate comprises a Brix-X gate, a control NOT gate, a U3 quantum logic gate and a Toffoli quantum logic gate. Optionally, the final quantum state of the qubit includes: Determining the final quantum state of the qubit by the following equation Wherein, M is the number of the non-zero elements, x k is the amplitude value of the final quantum state, p k is the subscript and p k∈{0,1}n of the binary string representation of the non-zero elements in the sparse data, and n is the number of a group of quantum bits. Yet another embodiment of the present application provides a quantum state preparing apparatus, the apparatus comprising: the acquisition module is used for acquiring specific elements in the target data, position information corresponding to the specific elements and a group of quantum bits; The encoding module is used for performing the evolution operation of the quantum state by utilizing a designated quantum logic gate aiming at each specific element and the position information corresponding to the specific element so as 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 corresponds to the element value of the specific element in the target data one by one. Optionally, the acquiring module includes: A judging unit, configured to acquire a non-zero element in target data and judge whether a sum of squares of the non-zero elements is 1; and if not, carrying out normalization processing on the non-zero elements to obtain the non-zero elements meeting the square sum of 1. A further embodiment of the application provides a storage medium having a computer program stored