A quantum state preparation method and system based on local unitary standard form and shortest path search, a terminal and a storage medium
By using the local unitary canonical form and shortest path search method, the problem of the lack of separation between local degrees of freedom and entangled structures in the prior art is solved, generating a low-cost, hardware-adaptable quantum state preparation circuit, which improves the execution fidelity and hardware adaptability of quantum computing.
Patent Information
- Application Number
- CN202611111901.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-11-03
AI Technical Summary
Existing quantum state preparation methods fail to adequately separate local degrees of freedom and entanglement structures, resulting in a lack of structured explanation at the orbital level for the selection of CNOT gates. This increases the cost of quantum state preparation and reduces hardware adaptability and execution fidelity.
By employing the local unitary canonical form and shortest path search method, the target quantum state is converted into tensor form, the local unitary canonical form is extracted, an allowed set of candidate two-qubit entangled gates is generated, and a reverse shortest path search is performed to generate a low-cost quantum state preparation circuit, reducing the number of CNOT gates and improving hardware adaptability.
This reduces the cost of quantum state preparation, improves hardware execution fidelity, and makes the fabrication circuitry more adaptable to the physical characteristics of specific quantum chips, while reducing noise accumulation.
Smart Images

Figure CN123031899A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quantum state preparation, and in particular to a method, system, terminal, and computer-readable storage medium for quantum state preparation based on local unitary canonical form and shortest path search. Background Technology
[0002] Quantum state preparation is a fundamental step in quantum computing, aiming to construct a quantum circuit on a quantum chip or quantum simulator to transform the system from an initial state to a target state. This capability is widely used for quantum algorithm input, quantum machine learning data loading, initial state preparation in quantum chemistry and quantum simulation, initial state preparation for quantum optimization constraints, and generation of entangled resource states.
[0003] In the current stage of medium-scale quantum computing with high noise levels, two-qubit entangled gates are typically slower, have higher error rates, and are more susceptible to crosstalk and decoherence than single-qubit gates. Therefore, reducing the number of two-qubit entangled gates, such as CNOT (Controlled-NOT), while maintaining the accuracy of target state preparation is key to improving the fidelity of real hardware execution and reducing experimental costs.
[0004] Most existing quantum state preparation methods directly construct the target state based on its amplitude, without fully separating the local degrees of freedom and entanglement structure. The changes that can be accomplished by a single qubit gate are mixed with the changes that must be accomplished by an entanglement gate, resulting in high quantum state preparation costs and low hardware adaptability.
[0005] Therefore, existing technologies still need to be improved and developed. Summary of the Invention
[0006] The main objective of this invention is to provide a quantum state preparation method, system, terminal, and computer-readable storage medium based on local unitary canonical form and shortest path search. This aims to solve the problems in the prior art where the local degrees of freedom and entanglement structure are not sufficiently separated, and the selection of CNOT lacks a structured explanation at the orbital level, resulting in high quantum state preparation costs and low hardware adaptability and execution fidelity.
[0007] To achieve the above objectives, this invention provides a quantum state preparation method based on local unitary canonical form and shortest path search. The method includes the following steps: Obtain descriptive data of the target quantum state, preprocess the descriptive data, and generate tensor quantization data; The tensor data is locally unitary normalized to extract the local degrees of freedom on each qubit, resulting in the local unitary canonical form. The single-bit unitary transformation information used to eliminate the local degrees of freedom is also recorded. The local unitary canonical form is processed to generate an initial orbital node identifier corresponding to the target quantum state, and the initial orbital node identifier is used as the starting node in the search process; A set of allowed candidate two-bit entangled gates is generated based on hardware constraints, and the candidate two-bit entangled gates in the set are defined as transition edges. Starting from the starting node, a reverse shortest path search is performed along the transition edge. During the search process, the local unitary normalization process and orbit node identifier generation process are re-performed on the new quantum state obtained after each transition along the transition edge to obtain a new orbit node identifier. The starting node and the new track node identifier are used as a node set, and the transition edge is used as an edge set to construct the track graph; Traverse along the transition edge in the orbit graph until the all-zero product state orbit is reached, output the reverse shortest path from the starting node to the all-zero product state orbit, and record the candidate two-bit entanglement gate and the single-bit unitary transform information corresponding to each step in the reverse shortest path; Based on the candidate two-bit entangled gates corresponding to each step in the reverse shortest path, the reverse shortest path is arranged in reverse order to obtain a forward entangled gate sequence starting from the all-zero initial state; Based on the single-bit unitary transformation information corresponding to each step in the forward entanglement gate sequence, the local unitary recovery gate is decomposed into a hardware-supported single-bit gate sequence, and the forward entanglement gate sequence and the single-bit gate sequence are combined to generate the target quantum state preparation circuit.
[0008] Optionally, in the quantum state preparation method based on local unitary canonical form and shortest path search, the description data is an explicit amplitude list, a sparse amplitude list, a structured target state description, or a target state generation rule given by an upper-level quantum algorithm. When the description data is the sparse amplitude list or the structured target state description, a compact representation is generated after the preprocessing, and before the local unitary normalization process, the compact representation is expanded into a complete tensor to obtain the tensorized data. When the preparation of the target quantum state is an approximate preparation task, a fidelity threshold and a maximum path cost are set, and the fidelity threshold and the maximum path cost are used as early termination conditions for the reverse shortest path search.
[0009] Optionally, the quantum state preparation method based on local unitary canonical form and shortest path search, wherein the step of performing local unitary normalization on the tensor data, extracting the local degrees of freedom on each qubit to obtain the local unitary canonical form, and recording the single-bit unitary transformation information used to eliminate the local degrees of freedom, specifically includes: The tensor data is rearranged into a multi-bit tensor, with each qubit representing a local mode. Based on the multi-bit tensor, extract the local information of each local pattern, and calculate the single-bit unitary transform used to fix the local degrees of freedom corresponding to the local information. The inverse transformation of the single-bit unitary transform is applied to the multi-bit tensor to obtain the core representation after eliminating local degrees of freedom. The core representation is then subjected to phase normalization and tolerance processing to generate a stable local unitary canonical form. The local unitary canonical form is saved as an orbital node, and the calculated single-bit unitary transform is saved as the single-bit unitary transform information.
[0010] Optionally, the quantum state preparation method based on local unitary canonical form and shortest path search, wherein generating a set of permissible candidate two-bit entangled gates according to hardware constraints, and defining the candidate two-bit entangled gates in the set as transition edges, specifically includes: Based on the coupling topology, routing constraints, gate error rate, and gate time of the quantum chip, the candidate two-bit entangled gate set is generated, wherein the candidate two-bit entangled gate set includes two-bit entangled gates that are natively supported by the hardware or can be implemented after routing in the coupling topology; All candidate two-bit entangled gates in the candidate two-bit entangled gate set are defined as transition edges. Search weights are assigned to each transition edge according to the gate error rate or the gate time, and the search weights are used as the basis for calculating the edge cost of the reverse shortest path search.
[0011] Optionally, in the quantum state preparation method based on local unitary canonical form and shortest path search, the reverse shortest path search includes equal-weighted mode and weighted mode; When the reverse shortest path search adopts the equal weight mode, according to the setting that the cost of each candidate two-bit entangled gate corresponding to the transition edge is 1, the breadth-first search or depth-first search is used to traverse along the transition edge to obtain the reverse shortest path so that the number of two-bit entangled gates in the forward entangled gate sequence is minimized. When the reverse shortest path search adopts a weighted mode, a weighted cost is assigned to each hop edge based on the gate error rate, gate time, crosstalk risk, direction conversion cost, and routing cost in the hardware coupled topology, and a heuristic search algorithm is used to traverse along the hop edge to obtain the reverse shortest path.
[0012] Optionally, in the quantum state preparation method based on local unitary canonical form and shortest path search, the following pruning strategy is adopted when traversing the transition edges in the orbit graph: The transition edges are restricted according to the hardware allowable edges to reduce the number of branches traversed; Alternatively, based on the sparsity or symmetry of the target quantum state, equivalent or redundant orbital nodes can be excluded; Alternatively, prioritize expanding orbital nodes whose metric distance to the all-zero product state orbit is less than a preset threshold; Alternatively, tolerance hashing can be applied to the local unitary canonical form to merge different representations within the numerical error range into the same orbital node identifier; Alternatively, a maximum search depth, time limit, and memory limit can be set. When the search exceeds the maximum search depth, the time limit, or the memory limit, the search stops and the current optimal reverse shortest path is output.
[0013] Optionally, the quantum state preparation method based on local unitary canonical form and shortest path search, wherein the step of decomposing the local unitary recovery gate into a hardware-supported single-bit gate sequence according to the single-bit unitary transformation information corresponding to each step in the forward entanglement gate sequence, and combining the forward entanglement gate sequence and the single-bit gate sequence to generate the target quantum state preparation circuit, specifically includes: The corresponding decomposition method is selected according to the target quantum computing platform. When the target quantum computing platform is a superconducting platform, the local unitary recovery gate is decomposed into a combination of a rotation gate and a virtual Z gate according to the single-bit unitary transformation information to obtain the single-bit gate sequence. When the target quantum computing platform is an ion trap platform, the local unitary recovery gate is decomposed into a combination of a global rotation gate and a local rotation gate according to the single-bit unitary transformation information to obtain the single-bit gate sequence. When the target quantum computing platform is an optical quantum platform, the local unitary recovery gate is decomposed into a combination of phase shift operation and beam splitting operation according to the single-bit unitary transformation information to obtain the single-bit gate sequence; The single-bit gate sequence is merged with the forward entanglement gate sequence, and the output is a quantum state preparation circuit description format available to QASM, Qiskit, Cirq, or a hardware control system.
[0014] Furthermore, to achieve the above objectives, the present invention also provides a quantum state preparation system based on local unitary canonical form and shortest path search, wherein the quantum state preparation system based on local unitary canonical form and shortest path search includes: The target state input module is used to acquire the description data of the target quantum state, preprocess the description data, and generate tensor quantization data. The local unitary normalization module is used to perform local unitary normalization on the tensor data, extract the local degrees of freedom on each qubit, obtain the local unitary canonical form, and record the single-bit unitary transformation information used to eliminate the local degrees of freedom. The orbit identification module is used to process the local unitary canonical form, generate the initial orbit node identifier corresponding to the target quantum state, and use the initial orbit node identifier as the starting node in the search process; The entanglement gate candidate module is used to generate a set of allowed candidate two-bit entanglement gates according to hardware constraints, and to define the candidate two-bit entanglement gates in the set of candidate two-bit entanglement gates as transition edges; The shortest path search module is used to perform a reverse shortest path search along the transition edge, starting from the starting node. During the search process, the local unitary normalization process and orbit node identifier generation process are re-executed for each new quantum state obtained after each transition along the transition edge to obtain a new orbit node identifier. The trajectory graph construction module is used to construct a trajectory graph by using the starting node and the new trajectory node identifier as a node set and the transition edge as an edge set. The transition traversal module is used to traverse along the transition edge in the orbit graph until the all-zero product state orbit is reached, output the reverse shortest path from the starting node to the all-zero product state orbit, and record the candidate two-bit entanglement gate and the single-bit unitary transform information corresponding to each step in the reverse shortest path. The route reconstruction module is used to reverse the order of the shortest path based on the candidate two-bit entanglement gates corresponding to each step in the shortest path, so as to obtain a forward entanglement gate sequence starting from the initial state of all zeros. The circuit output module is used to decompose the local unitary recovery gate into a hardware-supported single-bit gate sequence based on the single-bit unitary transformation information corresponding to each step in the forward entanglement gate sequence, and combine the forward entanglement gate sequence and the single-bit gate sequence to generate the target quantum state preparation circuit.
[0015] Furthermore, to achieve the above objectives, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a quantum state preparation program based on local unitary canonical form and shortest path search stored in the memory and executable on the processor, wherein when the quantum state preparation program based on local unitary canonical form and shortest path search is executed by the processor, the steps of the quantum state preparation method based on local unitary canonical form and shortest path search as described above are implemented.
[0016] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a quantum state preparation program based on local unitary canonical form and shortest path search, and when the quantum state preparation program based on local unitary canonical form and shortest path search is executed by a processor, it implements the steps of the quantum state preparation method based on local unitary canonical form and shortest path search as described above.
[0017] In this invention, after converting the target quantum state into tensor form, a standard form representing its entanglement structure is first obtained through local unitary normalization. Then, quantum states within the same local unitary equivalence class are considered as the same orbital node, and two-qubit entanglement gates such as CNOT are considered as transitions between orbital nodes. Subsequently, a low-cost path is searched from the target state orbit back to the all-zero initial state orbit. Finally, this path is reconstructed in reverse to form the quantum state preparation circuit, and corresponding single-qubit local gates are added to recover the target state. This invention extracts the entanglement structure using the LU standard form, reducing redundant searches caused by local degrees of freedom. Interpreting CNOT as entanglement transitions between orbits provides a structured basis for the selection of two-qubit gates. The reverse search avoids the problem of ineffective CNOT application from the all-zero state, improving search efficiency and reducing the number of CNOTs and circuit depth, thereby reducing noise accumulation and improving the fidelity of real hardware execution. It can be extended to hardware-aware search, incorporating topology, error rate, gate time, and routing cost into the overall objective. It can be used in combination with sparse state preparation, divide-and-conquer preparation, quantum architecture search, placement routing, and error mitigation. Attached Figure Description
[0018] Figure 1 This is a flowchart of a preferred embodiment of the quantum state preparation method based on local unitary canonical form and shortest path search of the present invention; Figure 2 This is a schematic diagram of the principle architecture of the quantum state preparation method based on local unitary canonical form and shortest path search of the present invention; Figure 3 This is a schematic diagram of the local unitary normalization process in the quantum state preparation method based on local unitary canonical form and shortest path search of the present invention; Figure 4 This is a schematic diagram of the reverse shortest path search based on orbits in the quantum state preparation method based on local unitary canonical form and shortest path search of the present invention; Figure 5 This is a schematic diagram of an exemplary three-qubit quantum state preparation circuit in the quantum state preparation method based on local unitary canonical form and shortest path search of the present invention. Figure 6 This is a structural diagram of a preferred embodiment of the quantum state preparation system based on local unitary canonical form and shortest path search of the present invention; Figure 7 This is a structural diagram of a preferred embodiment of the terminal of the present invention. Detailed Implementation
[0019] This application provides a method, system, and terminal for preparing quantum states based on local unitary canonical form and shortest path search. To make the objectives, technical solutions, and effects of this application clearer and more explicit, the following detailed description is provided with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining this application and are not intended to limit this application.
[0020] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0021] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0022] It should be noted that existing quantum state preparation methods do not adequately separate "local degrees of freedom" and "entanglement structure," resulting in a mixed treatment of changes that can be accomplished by a single-qubit gate and changes that must be accomplished by an entanglement gate. The selection of CNOTs lacks a structured explanation at the orbital level, making it difficult to systematically determine whether a particular CNOT truly advances the target entanglement structure. Traditional optimization methods that "only count the number of CNOTs" cannot directly address issues such as hardware coupling topology, gate error rate, gate time, and routing cost. To address these shortcomings, the core problem this invention aims to solve is how to extract the entanglement structure of the target state using the local unitary standard form, under given conditions of target quantum state, preparation accuracy, and hardware constraints. This involves modeling CNOTs or other two-qubit entanglement gates as transitions between local unitary orbits, and generating quantum state preparation lines with fewer CNOTs and better hardware adaptability through low-cost path search.
[0023] The preferred embodiment of the present invention describes a quantum state preparation method based on local unitary canonical form and shortest path search, such as... Figure 1 and Figure 2As shown, the quantum state preparation method based on local unitary canonical form and shortest path search includes the following steps: Step S10: Obtain the description data of the target quantum state, preprocess the description data, and generate tensor quantization data.
[0024] Specifically, the descriptive data is an explicit amplitude list, a sparse amplitude list, a structured target state description, or a target state generation rule given by an upper-level quantum algorithm.
[0025] It is understood that the input to this invention can be explicit amplitude, sparse amplitude, structured target state description, or target state generation rules given by an upper-level quantum algorithm. When preprocessing the description data, the preprocessing mainly includes: checking the number of qubits and amplitude dimension, performing normalization, removing physically meaningless global phase, thresholding numerical noise, and reading hardware topology and search depth configurations.
[0026] Furthermore, when the description data is the sparse amplitude list or the structured target state description, a compact representation is generated after the preprocessing, and before the local unitary normalization process, the compact representation is expanded into a complete tensor to obtain the tensorized data.
[0027] In this embodiment, for sparse or structured states, a compact representation can be generated first, and then expanded into a tensor when needed; for tasks that only require approximate preparation, a fidelity threshold and a maximum circuit cost can be set simultaneously to terminate the search early.
[0028] Understandably, the sparse amplitude list only records non-zero amplitudes and their corresponding ground states, while the structured target state description uses rules (such as tensor networks, matrix product states, etc.) to compress and represent high-dimensional quantum states. The data volume of these two input formats is much smaller than that of a complete tensor. Directly expanding them before subsequent processing would significantly increase memory usage and computational overhead. Therefore, this invention preferably maintains its compact form initially. After normalization, global phase removal, and zero-threshold processing in step S10, it is still stored in a compact representation until the local unitary normalization processing in step S20 is executed, at which point it is expanded into a complete tensor. This reduces storage pressure and resource consumption during the preprocessing stage.
[0029] Furthermore, when the preparation of the target quantum state is an approximate preparation task, a fidelity threshold and a maximum path cost are set, and the fidelity threshold and the maximum path cost are used as early termination conditions for the reverse shortest path search.
[0030] Understandably, in practical quantum computing applications, not all scenarios require precise preparation of the target state. For example, in algorithms such as variable quantum eigenvalue solvers, a preparation fidelity reaching a certain threshold is sufficient. The fidelity threshold is used to determine whether the preparation path corresponding to the current search path has reached an acceptable approximate accuracy; the maximum path cost is used to limit the search depth, preventing the search process from falling into exponential expansion due to the pursuit of excessively high fidelity. When the path cost of a certain path exceeds the maximum path cost, or the fidelity of the current optimal path reaches the fidelity threshold, the search terminates early, and the current optimal path is output, thereby achieving a balance between preparation accuracy and computational resources.
[0031] Step S20: Perform local unitary normalization on the tensor quantized data, extract the local degrees of freedom on each qubit, obtain the local unitary canonical form, and record the single-bit unitary transformation information used to eliminate the local degrees of freedom.
[0032] Specifically, the tensor data is rearranged into a multi-bit tensor, with each qubit representing a local mode. Based on the multi-bit tensor, local information for each local mode is extracted, and a single-bit unitary transform is calculated to fix the local degrees of freedom corresponding to the local information. The inverse of the single-bit unitary transform is applied to the multi-bit tensor to obtain a core representation after eliminating local degrees of freedom. Phase normalization and tolerance processing are performed on the core representation to generate a stable local unitary canonical form. The local unitary canonical form is stored as an orbital node, and the calculated single-bit unitary transform is also stored as the single-bit unitary transform information.
[0033] Understandably, local unitary normalization is used to separate the "locally variable part" from the "entangled structure part" in the target state. Intuitively, a single-qubit gate only changes the local coordinates of each qubit, without changing the type of entanglement; the normalization step fixes these local coordinates as much as possible, thus obtaining a more suitable representative state as a search node.
[0034] like Figure 3 As shown, an optimal process for local unitary normalization includes the following steps: rearranging the target state into a multi-bit tensor, with each qubit as a local mode; extracting local information bit by bit and calculating a single-bit unitary transform that can fix the local degree of freedom; applying the corresponding inverse transform to the target state to obtain the core representation after eliminating the local degree of freedom. Phase normalization and tolerance processing are applied to the core representation to form a stable local unitary canonical form. The canonical form is saved as orbital nodes, along with local sector information for the final recovery of the target state. If the target state is completely separable, its canonical form is reduced to a zero-product state or its equivalent representation; if two target states differ only in local sectors, they are mapped to the same or approximately the same orbital nodes.
[0035] In addition to local unitary normalization, local unitary representatives can be generated using HOSVD (Higher-Order Singular Value Decomposition), Schmidt decomposition, local density matrix diagonalization, tensor network canonical form, local invariants, or iterative optimization methods. Different deterministic gauge rules or multi-gauge sampling strategies can be employed for cases with eigenvalue degeneracy, zero amplitude, and phase uncertainty. Different normalization and hashing rules can be designed for complex amplitude states, real amplitude states, sparse states, symmetric states, and graphical states. The system can be extended from two-level qudits to qudit systems, multi-level quantum systems, photonic quantum Fock states, or continuous variable truncation spaces.
[0036] Step S30: Process the local unitary canonical form to generate the initial orbit node identifier corresponding to the target quantum state, and use the initial orbit node identifier as the starting node in the search process.
[0037] In this embodiment, after obtaining the local unitary canonical form, it is necessary to perform phase normalization and tolerance hashing on the canonical form so that it can be used as an identifiable node in the orbital graph for subsequent searches.
[0038] Specifically, since different quantum states within the same entangled structure may differ by only a global phase factor, and the global phase does not alter any physical observations, without processing, quantum states with different phase versions within the same orbit would be misclassified as different nodes, leading to unnecessary expansion of the search space. Therefore, this invention first performs phase normalization on the local unitary canonical form, unifying the global phase of all amplitudes in the canonical form to a certain standard value (e.g., reducing the phase of the first non-zero amplitude to zero), thereby eliminating redundant identifiers introduced by the global phase degrees of freedom. Subsequently, considering that floating-point operations introduce numerical errors in actual calculations, two mathematically equivalent quantum states may produce slightly different numerical representations due to rounding errors.
[0039] Furthermore, tolerance hashing is employed to merge the same orbital nodes that were separated due to numerical errors into a single identifier. After the phase normalization and tolerance hashing processes described above, an initial orbital node identifier corresponding to the target quantum state is generated. Finally, this initial orbital node identifier is used as the starting node in the search process, i.e., the starting point of the reverse shortest path search. Subsequent steps will start from this starting node and search hop-by-hop along the transition edges until the all-zero product state orbit is reached.
[0040] Step S40: Generate a set of allowed candidate two-bit entangled gates according to hardware constraints, and define the candidate two-bit entangled gates in the set as transition edges.
[0041] Specifically, the candidate two-bit entangled gate set is generated based on the coupling topology, routing constraints, gate error rate, and gate time of the quantum chip. The candidate two-bit entangled gate set includes two-bit entangled gates that are natively supported by the hardware or can be implemented after routing in the coupling topology.
[0042] In this embodiment, the coupling topology and routing constraints of the target quantum chip are first read, and hardware characteristic parameters such as gate error rate and gate time for each available two-bit gate are obtained. Based on these hardware constraints, physically executable candidates are selected from all possible two-bit entangled gates. These include directly entangled two-bit gates natively supported by the hardware in the coupling topology, as well as two-bit entangled gates that, although not directly adjacent, can be implemented within a finite number of steps after routing. All selected candidate gates constitute a candidate two-bit entangled gate set, ensuring that the fabrication circuitry obtained from subsequent searches is physically executable on the target hardware.
[0043] Furthermore, all candidate two-bit entangled gates in the candidate two-bit entangled gate set are defined as transition edges. Search weights are assigned to each transition edge according to the gate error rate or the gate time, and the search weights are used as the basis for calculating the edge cost of the reverse shortest path search.
[0044] Understandably, after obtaining the candidate set, this invention defines each candidate two-bit entangled gate in the set as a transition edge in the orbit graph. A transition edge signifies that after applying the entanglement gate from the current orbit node, the quantum state transitions to an adjacent orbit node. A search weight is assigned to each transition edge based on the gate error rate or gate time; the higher the error rate or the longer the execution time, the greater the weight, indicating that the search should avoid that gate as much as possible. This search weight serves as the basis for calculating the edge cost of the reverse shortest path search, enabling the search not only to reduce the number of entangled gates but also to actively avoid gate operations with high error rates and long execution times.
[0045] Step S50: Starting from the starting node, perform a reverse shortest path search along the transition edge. During the search, perform local unitary normalization and orbit node identifier generation processing on the new quantum state obtained after each transition along the transition edge to obtain a new orbit node identifier.
[0046] Specifically, such as Figure 4As shown, the reverse shortest path search includes an equal-weight mode and a weighted mode. When the reverse shortest path search adopts the equal-weight mode, according to the setting that the cost of each candidate two-bit entangled gate corresponding to the transition edge is 1, breadth-first search or depth-first search is used to traverse along the transition edge to obtain the reverse shortest path, so as to minimize the number of two-bit entangled gates in the forward entangled gate sequence.
[0047] When the reverse shortest path search adopts a weighted mode, a weighted cost is assigned to each hop edge based on the gate error rate, gate time, crosstalk risk, direction conversion cost, and routing cost in the hardware coupled topology, and a heuristic search algorithm is used to traverse along the hop edge to obtain the reverse shortest path.
[0048] It is understandable that equal weighting means that the cost weight of all transition edges in the trajectory graph is equal, all being 1. In equal weighting mode, the objective of reverse shortest path search is equivalent to minimizing the number of transition edges in the path, i.e., minimizing the number of two-bit entangled gates. Breadth-first search expands layer by layer from the starting node. Since each edge has the same cost, the path taken to first reach the all-zero product state trajectory is the path with the fewest CNOTs. For scenarios with a large number of bits, depth-first search can be used instead of breadth-first search to reduce the memory footprint of the runtime medium. The search traverses backward from the trajectory nodes of the target state, accumulating a cost of 1 for each step forward along a transition edge until the all-zero product state trajectory is reached, outputting the reverse shortest path with the lowest cumulative cost. Reversing the reverse paths yields the forward entangled gate sequence with the fewest CNOTs required to prepare the target state from the all-zero initial state. In the equal-weighted mode, BFS (Breadth-First Search) can be used to ensure the minimum number of CNOT layers; for scenarios with a large number of bits, in order to reduce the memory usage of the runtime medium, Depth-First Search (DFS) can be used instead of BFS.
[0049] Weighted routing refers to each transition edge in the trajectory graph carrying a different weight value, which is assigned edge-by-edge based on the hardware characteristics of the specific quantum chip. In weighted routing, the goal of reverse shortest path search is to minimize the cumulative weight cost of the path, rather than minimizing the number of transition edges. The cost of each transition edge is determined by the gate error rate, gate time, crosstalk risk, direction conversion cost, and routing cost, enabling the algorithm to find not only paths with fewer gates but also paths more suitable for a specific quantum chip. Dijkstra's algorithm or A... Heuristic search algorithms traverse along the transition edges, while Dijkstra's algorithm guarantees finding the globally optimal path with the lowest cumulative cost when the edge weights are non-negative; A The heuristic search algorithm introduces a heuristic function to prioritize expanding nodes closer to the target to accelerate the search. The reverse shortest path output in this mode is the path with the lowest total hardware execution cost. It can actively avoid entanglement gates with high error rates and long execution times, making the fabricated circuitry more adaptable to the physical characteristics of specific quantum chips.
[0050] Step S60: Construct a track graph by using the starting node and the new track node identifier as a node set and the transition edge as an edge set.
[0051] In this embodiment, the quantum state space is divided into multiple orbits according to local unitary equivalence relations, and each orbit node represents a class of quantum states with the same entanglement structure. After obtaining the starting node (i.e., the orbit node identifier corresponding to the target quantum state) and all the new orbit node identifiers generated after each transition along the transition edge during the search process, these discrete nodes and transition edges need to be organized into a graph structure that can be traversed by the search algorithm.
[0052] Specifically, the starting node and all the new orbit node identifiers generated during the search process are combined into a node set, and the previously defined transition edges are combined into an edge set, together forming an orbit graph. In this orbit graph, nodes represent local unitary equivalence classes, and edges represent transitions between orbits caused by CNOT gates or equivalent entanglement gates. CNOT or other platform-native two-bit entanglement gates are used to transform the current orbit to an adjacent orbit. After construction, the subsequent reverse shortest path search traverses along the transition edges on this orbit graph, searching hop-by-hop from the target state orbit to the all-zero product state orbit.
[0053] Step S70: Traverse along the transition edge in the orbit graph until the all-zero product state orbit is reached, output the reverse shortest path from the starting node to the all-zero product state orbit, and record the candidate two-bit entanglement gate and the single-bit unitary transform information corresponding to each step in the reverse shortest path.
[0054] After the orbital graph is constructed, a traversal search can be performed on the orbital graph. Since applying a CNOT gate directly from an all-zero initial state in the physical implementation of quantum computing does not change the quantum state, and searching directly from the initial state to the target state lacks effective guiding information, this invention adopts a reverse search strategy, starting from the orbital node of the target state and gradually searching towards the all-zero product state orbit.
[0055] Specifically, starting from the initial node, the traversal is performed along the transition edges in the orbit graph. Each transition from the current node to an adjacent node along a transition edge is equivalent to applying the candidate two-bit entanglement gate corresponding to that transition edge to the current quantum state, transforming the current orbit into an adjacent orbit. After each transition to a new quantum state, the local unitary normalization process and orbit node identifier generation process are re-executed to obtain a new orbit node identifier, and the process continues to expand from that node. The traversal continues until the orbit node identifier corresponding to the current node is a zero-product state orbit, at which point the search stops.
[0056] To improve search efficiency and reduce computational resource consumption, this invention employs multiple pruning strategies during the traversal process, including: limiting the transition edges based on hardware-allowed edges, enumerating only hardware-executable entanglement gate branches starting from the current node to reduce the number of search branches; excluding equivalent or redundant orbital nodes based on the sparsity or symmetry of the target quantum state to avoid repeated expansion; prioritizing the expansion of orbital nodes with smaller metric distances to all-zero product state orbitals to allow the search to approach the target faster; using tolerance hashing for the local unitary canonical form to merge different representations within the numerical error range into the same orbital node identifier to avoid repeated expansion of the same node due to numerical fluctuations; and setting maximum search depth, time limits, and memory limits, stopping the search promptly and outputting the current optimal path when the limits are exceeded. Through these pruning strategies, this invention can effectively control the computational scale while ensuring search quality, thus improving the scalability of the method.
[0057] Step S80: Based on the candidate two-bit entanglement gates corresponding to each step in the reverse shortest path, arrange the reverse shortest path in reverse order to obtain a forward entanglement gate sequence starting from the all-zero initial state.
[0058] It is understandable that during the reverse shortest path search, each transition edge is assigned a direction, pointing from the current orbit node to the adjacent orbit node reached after applying the corresponding entanglement gate. Therefore, the reverse shortest path records the sequence of directions that trace back layer by layer from the target state orbit to the all-zero product state orbit. By reversing the reverse paths obtained from the search, and utilizing the invertibility of CNOT, the sequence of entanglement gates starting from the all-zero initial state can be obtained.
[0059] Specifically, the candidate two-bit entangled gates corresponding to each step in the reverse shortest path are taken and rearranged in the opposite order to the search direction. The entangled gate used in the last step of the original path becomes the first step of the forward sequence, and the entangled gate used in the first step of the original path becomes the last step of the forward sequence. After the reverse order is completed, a forward entangled gate sequence is obtained that starts from an all-zero initial state and gradually prepares the entangled structure of the target quantum state.
[0060] Step S90: Based on the single-bit unitary transformation information corresponding to each step in the forward entanglement gate sequence, decompose the local unitary recovery gate into a hardware-supported single-bit gate sequence, and combine the forward entanglement gate sequence and the single-bit gate sequence to generate the target quantum state preparation circuit.
[0061] Specifically, the decomposition method is selected according to the target quantum computing platform. When the target quantum computing platform is a superconducting platform, the local unitary recovery gate is decomposed into a combination of a rotation gate and a virtual Z gate according to the single-bit unitary transformation information to obtain the single-bit gate sequence. When the target quantum computing platform is an ion trap platform, the local unitary recovery gate is decomposed into a combination of a global rotation gate and a local rotation gate according to the single-bit unitary transformation information to obtain the single-bit gate sequence. When the target quantum computing platform is an optical quantum platform, the local unitary recovery gate is decomposed into a combination of phase shift operation and beam splitting operation according to the single-bit unitary transformation information to obtain the single-bit gate sequence; The single-bit gate sequence is merged with the forward entanglement gate sequence, and the output is a quantum state preparation circuit description format available to QASM, Qiskit, Cirq, or a hardware control system.
[0062] Understandably, once the reverse path from the target orbit to the all-zero orbit is found, the reversibility of CNOT (CN-Operated Transient Oscillator) allows for the reverse arrangement of this path, yielding an entangled gate sequence starting from the all-zero initial state. Subsequently, the local gates recorded during each normalization step are inserted into their corresponding positions, enabling the final circuit to accurately or approximately prepare the target state. These local gates can be decomposed into native single-qubit gates depending on the hardware platform, such as rotation gates and virtual Z-gates in superconducting platforms, global or local rotations in ion trap platforms, and phase shifts and beam splitting operations in quantum optical platforms. The output circuit can then be further processed by a placement router and a pulse compiler.
[0063] When merging the single-bit gate sequence with the forward entanglement gate sequence, the corresponding single-bit gate needs to be inserted into the corresponding step position in the forward entanglement gate sequence according to the recording order of each step in the path search process. Since each transition in the search process records the single-bit unitary transform information corresponding to that step, after obtaining the forward entanglement gate sequence in reverse order, the correspondence between the single-bit unitary transform information and the entanglement gate remains unchanged. The stripped local degree of freedom information can be recovered simply by inserting the single-bit gate sequence obtained from the local unitary recovery gate decomposition after or before the corresponding entanglement gate. After merging, the output is in a circuit description format usable by QASM, Qiskit, Cirq, or a hardware control system.
[0064] Furthermore, after the output circuit of this invention, the consistency between the prepared state and the target state can be verified using a classical simulator or real quantum hardware. Verification metrics may include quantum state fidelity, amplitude error, circuit depth, number of CNOTs, total number of gates, and expected execution error rate.
[0065] To improve scalability, the following engineering strategies can be adopted: restrict candidate CNOTs to hardware-allowed edges; prune according to the sparsity and symmetry of the target state; prioritize expanding orbits that are closer to the product state; use tolerance hashing for the canonical form; compute different candidate entanglement gates in parallel; and reduce the problem size first, and then apply the present invention to the smaller subproblems if necessary.
[0066] This invention uses a three-bit single-excited Dicke state For example, existing AP (Affinity Propagation) methods can already obtain routes with fewer CNOTs, but this invention extracts the entanglement structure using local unitary canonical form and performs reverse trajectory search based on the BFS algorithm (LU-BFS) to obtain example routes containing only three CNOTs, such as... Figure 5 As shown, Figure 5 The example illustrates that the standard form search may take an intermediate path that differs from the amplitude distribution of the target state surface, but it can more directly construct the target entangled structure.
[0067] The beneficial effects of this invention are as follows: (1) Extract the entangled structure by using the LU canonical form to reduce redundant search caused by local degrees of freedom.
[0068] (2) Interpreting CNOT as entangled transitions between orbits provides a structured basis for the selection of two-bit gates.
[0069] (3) Reverse search avoids the problem of CNOT being invalid when applied directly from the all-zero state, thus improving search efficiency.
[0070] (4) Reduce the number of CNOTs and the line depth, thereby reducing noise accumulation and improving the fidelity of real hardware execution.
[0071] (5) It can be extended to hardware-aware search, incorporating topology, error rate, gate time and routing cost into the overall objective.
[0072] (6) It can be used in combination with sparse state preparation, divide-and-conquer preparation, quantum architecture search, layout routing and error mitigation.
[0073] Furthermore, such as Figure 6As shown, based on the above-described quantum state preparation method based on local unitary canonical form and shortest path search, this invention also provides a quantum state preparation system based on local unitary canonical form and shortest path search, wherein the quantum state preparation system based on local unitary canonical form and shortest path search includes: The target state input module 51 is used to acquire the description data of the target quantum state, preprocess the description data, and generate tensor quantization data. The local unitary normalization module 52 is used to perform local unitary normalization on the tensor data, extract the local degrees of freedom on each qubit, obtain the local unitary canonical form, and record the single-bit unitary transformation information used to eliminate the local degrees of freedom. The orbit identification module 53 is used to process the local unitary canonical form, generate the initial orbit node identifier corresponding to the target quantum state, and use the initial orbit node identifier as the starting node in the search process; Entanglement gate candidate module 54 is used to generate an allowed set of candidate two-bit entanglement gates according to hardware constraints, and to define the candidate two-bit entanglement gates in the set of candidate two-bit entanglement gates as transition edges; The shortest path search module 55 is used to perform a reverse shortest path search along the transition edge starting from the starting node. During the search process, the local unitary normalization process and orbit node identifier generation process are re-executed for each new quantum state obtained after each transition along the transition edge to obtain a new orbit node identifier. The trajectory graph construction module 56 is used to construct a trajectory graph by using the starting node and the new trajectory node identifier as a node set and the transition edge as an edge set. The transition traversal module 57 is used to traverse along the transition edge in the orbit graph until the all-zero product state orbit is reached, output the reverse shortest path from the starting node to the all-zero product state orbit, and record the candidate two-bit entanglement gate and the single-bit unitary transform information corresponding to each step in the reverse shortest path. The route reconstruction module 58 is used to reverse the order of the shortest path according to the candidate two-bit entanglement gates corresponding to each step in the shortest path, so as to obtain the forward entanglement gate sequence starting from the all-zero initial state. The circuit output module 59 is used to decompose the local unitary recovery gate into a hardware-supported single-bit gate sequence according to the single-bit unitary transformation information corresponding to each step in the forward entanglement gate sequence, and combine the forward entanglement gate sequence and the single-bit gate sequence to generate the target quantum state preparation circuit.
[0074] Furthermore, such as Figure 7As shown, based on the above-mentioned quantum state preparation method and system based on local unitary canonical form and shortest path search, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 7 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0075] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the terminal. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as the program code installed on the terminal. The memory 20 can also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a quantum state preparation program 40 based on local unitary canonical form and shortest path search. This quantum state preparation program 40 based on local unitary canonical form and shortest path search can be executed by the processor 10, thereby realizing the quantum state preparation method based on local unitary canonical form and shortest path search in this application.
[0076] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the quantum state preparation method based on local unitary canonical form and shortest path search.
[0077] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The components of the terminal communicate with each other via a system bus.
[0078] In one embodiment, when processor 10 executes quantum state preparation program 40 based on local unitary canonical form and shortest path search in memory 20, the following steps are performed: Obtain descriptive data of the target quantum state, preprocess the descriptive data, and generate tensor quantization data; The tensor data is locally unitary normalized to extract the local degrees of freedom on each qubit, resulting in the local unitary canonical form. The single-bit unitary transformation information used to eliminate the local degrees of freedom is also recorded. The local unitary canonical form is processed to generate an initial orbital node identifier corresponding to the target quantum state, and the initial orbital node identifier is used as the starting node in the search process; A set of allowed candidate two-bit entangled gates is generated based on hardware constraints, and the candidate two-bit entangled gates in the set are defined as transition edges. Starting from the starting node, a reverse shortest path search is performed along the transition edge. During the search process, the local unitary normalization process and orbit node identifier generation process are re-performed on the new quantum state obtained after each transition along the transition edge to obtain a new orbit node identifier. The starting node and the new track node identifier are used as a node set, and the transition edge is used as an edge set to construct the track graph; Traverse along the transition edge in the orbit graph until the all-zero product state orbit is reached, output the reverse shortest path from the starting node to the all-zero product state orbit, and record the candidate two-bit entanglement gate and the single-bit unitary transform information corresponding to each step in the reverse shortest path; Based on the candidate two-bit entangled gates corresponding to each step in the reverse shortest path, the reverse shortest path is arranged in reverse order to obtain a forward entangled gate sequence starting from the all-zero initial state; Based on the single-bit unitary transformation information corresponding to each step in the forward entanglement gate sequence, the local unitary recovery gate is decomposed into a hardware-supported single-bit gate sequence, and the forward entanglement gate sequence and the single-bit gate sequence are combined to generate the target quantum state preparation circuit.
[0079] The description data can be an explicit amplitude list, a sparse amplitude list, a structured target state description, or a target state generation rule given by an upper-level quantum algorithm. When the description data is the sparse amplitude list or the structured target state description, a compact representation is generated after the preprocessing, and before the local unitary normalization process, the compact representation is expanded into a complete tensor to obtain the tensorized data. When the preparation of the target quantum state is an approximate preparation task, a fidelity threshold and a maximum path cost are set, and the fidelity threshold and the maximum path cost are used as early termination conditions for the reverse shortest path search.
[0080] Specifically, the process of performing local unitary normalization on the tensor data, extracting the local degrees of freedom on each qubit to obtain the local unitary canonical form, and recording the single-bit unitary transformation information used to eliminate the local degrees of freedom includes: The tensor data is rearranged into a multi-bit tensor, with each qubit representing a local mode. Based on the multi-bit tensor, extract the local information of each local pattern, and calculate the single-bit unitary transform used to fix the local degrees of freedom corresponding to the local information. The inverse transformation of the single-bit unitary transform is applied to the multi-bit tensor to obtain the core representation after eliminating local degrees of freedom. The core representation is then subjected to phase normalization and tolerance processing to generate a stable local unitary canonical form. The local unitary canonical form is saved as an orbital node, and the calculated single-bit unitary transform is saved as the single-bit unitary transform information.
[0081] Specifically, the step of generating a set of permissible candidate two-bit entangled gates based on hardware constraints, and defining the candidate two-bit entangled gates in the set as transition edges, includes: Based on the coupling topology, routing constraints, gate error rate, and gate time of the quantum chip, the candidate two-bit entangled gate set is generated, wherein the candidate two-bit entangled gate set includes two-bit entangled gates that are natively supported by the hardware or can be implemented after routing in the coupling topology; All candidate two-bit entangled gates in the candidate two-bit entangled gate set are defined as transition edges. Search weights are assigned to each transition edge according to the gate error rate or the gate time, and the search weights are used as the basis for calculating the edge cost of the reverse shortest path search.
[0082] The reverse shortest path search includes equal-weight mode and weighted mode; When the reverse shortest path search adopts the equal weight mode, according to the setting that the cost of each candidate two-bit entangled gate corresponding to the transition edge is 1, the breadth-first search or depth-first search is used to traverse along the transition edge to obtain the reverse shortest path so that the number of two-bit entangled gates in the forward entangled gate sequence is minimized. When the reverse shortest path search adopts a weighted mode, a weighted cost is assigned to each hop edge based on the gate error rate, gate time, crosstalk risk, direction conversion cost, and routing cost in the hardware coupled topology, and a heuristic search algorithm is used to traverse along the hop edge to obtain the reverse shortest path.
[0083] When traversing along the transition edges in the orbit graph, the following pruning strategy is adopted: The transition edges are restricted according to the hardware allowable edges to reduce the number of branches traversed; Alternatively, based on the sparsity or symmetry of the target quantum state, equivalent or redundant orbital nodes can be excluded; Alternatively, prioritize expanding orbital nodes whose metric distance to the all-zero product state orbit is less than a preset threshold; Alternatively, tolerance hashing can be applied to the local unitary canonical form to merge different representations within the numerical error range into the same orbital node identifier; Alternatively, a maximum search depth, time limit, and memory limit can be set. When the search exceeds the maximum search depth, the time limit, or the memory limit, the search stops and the current optimal reverse shortest path is output.
[0084] Specifically, the step of decomposing the local unitary recovery gate into a hardware-supported single-bit gate sequence based on the single-bit unitary transformation information corresponding to each step in the forward entanglement gate sequence, and combining the forward entanglement gate sequence and the single-bit gate sequence to generate the target quantum state preparation circuit includes: The corresponding decomposition method is selected according to the target quantum computing platform. When the target quantum computing platform is a superconducting platform, the local unitary recovery gate is decomposed into a combination of a rotation gate and a virtual Z gate according to the single-bit unitary transformation information to obtain the single-bit gate sequence. When the target quantum computing platform is an ion trap platform, the local unitary recovery gate is decomposed into a combination of a global rotation gate and a local rotation gate according to the single-bit unitary transformation information to obtain the single-bit gate sequence. When the target quantum computing platform is an optical quantum platform, the local unitary recovery gate is decomposed into a combination of phase shift operation and beam splitting operation according to the single-bit unitary transformation information to obtain the single-bit gate sequence; The single-bit gate sequence is merged with the forward entanglement gate sequence, and the output is a quantum state preparation circuit description format available to QASM, Qiskit, Cirq, or a hardware control system.
[0085] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a quantum state preparation program based on local unitary canonical form and shortest path search, and the quantum state preparation program based on local unitary canonical form and shortest path search, when executed by a processor, implements the steps of the quantum state preparation method based on local unitary canonical form and shortest path search as described above.
[0086] In summary, this invention provides a quantum state preparation method, system, terminal, and storage medium based on local unitary canonical form and shortest path search. The method includes: converting the target quantum state into tensor form; first, obtaining the canonical form representing its entanglement structure through local unitary normalization; then, treating quantum states in the same local unitary equivalence class as the same orbital node, and treating two-qubit entanglement gates such as CNOT as transitions between orbital nodes; subsequently, searching in reverse from the target state orbit to a low-cost path to the all-zero initial state orbit; finally, reconstructing the path in reverse to form the quantum state preparation circuit, and supplementing the corresponding single-qubit local gates to recover the target state. This invention reduces the number of high-noise two-qubit gates in quantum state preparation, reduces circuit depth and noise accumulation, and improves execution fidelity in hardware; the selection of entanglement gates has a clear meaning of entanglement structure, which can be further extended to hardware-aware weighted search, and can be combined with sparse state preparation, divide-and-conquer preparation, and quantum compilation processes.
[0087] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.
[0088] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0089] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. A method for preparing quantum states based on local unitary canonical form and shortest path search, characterized in that, The quantum state preparation method based on local unitary canonical form and shortest path search includes: Obtain descriptive data of the target quantum state, preprocess the descriptive data, and generate tensor quantization data; The tensor data is locally unitary normalized to extract the local degrees of freedom on each qubit, resulting in the local unitary canonical form. The single-bit unitary transformation information used to eliminate the local degrees of freedom is also recorded. The local unitary canonical form is processed to generate an initial orbital node identifier corresponding to the target quantum state, and the initial orbital node identifier is used as the starting node in the search process; A set of allowed candidate two-bit entangled gates is generated based on hardware constraints, and the candidate two-bit entangled gates in the set are defined as transition edges. Starting from the starting node, a reverse shortest path search is performed along the transition edge. During the search process, the local unitary normalization process and orbit node identifier generation process are re-performed on the new quantum state obtained after each transition along the transition edge to obtain a new orbit node identifier. The starting node and the new track node identifier are used as a node set, and the transition edge is used as an edge set to construct the track graph; Traverse along the transition edge in the orbit graph until the all-zero product state orbit is reached, output the reverse shortest path from the starting node to the all-zero product state orbit, and record the candidate two-bit entanglement gate and the single-bit unitary transform information corresponding to each step in the reverse shortest path; Based on the candidate two-bit entangled gates corresponding to each step in the reverse shortest path, the reverse shortest path is arranged in reverse order to obtain a forward entangled gate sequence starting from the all-zero initial state; Based on the single-bit unitary transformation information corresponding to each step in the forward entanglement gate sequence, the local unitary recovery gate is decomposed into a hardware-supported single-bit gate sequence, and the forward entanglement gate sequence and the single-bit gate sequence are combined to generate the target quantum state preparation circuit.
2. The quantum state preparation method based on local unitary canonical form and shortest path search according to claim 1, characterized in that, The description data is an explicit amplitude list, a sparse amplitude list, a structured target state description, or a target state generation rule given by an upper-level quantum algorithm; When the description data is the sparse amplitude list or the structured target state description, a compact representation is generated after the preprocessing, and before the local unitary normalization process, the compact representation is expanded into a complete tensor to obtain the tensorized data. When the preparation of the target quantum state is an approximate preparation task, a fidelity threshold and a maximum path cost are set, and the fidelity threshold and the maximum path cost are used as early termination conditions for the reverse shortest path search.
3. The quantum state preparation method based on local unitary canonical form and shortest path search according to claim 1, characterized in that, The process of performing local unitary normalization on the tensor data, extracting the local degrees of freedom on each qubit to obtain the local unitary canonical form, and recording the single-bit unitary transform information used to eliminate the local degrees of freedom specifically includes: The tensor data is rearranged into a multi-bit tensor, with each qubit representing a local mode. Based on the multi-bit tensor, extract the local information of each local pattern, and calculate the single-bit unitary transform used to fix the local degrees of freedom corresponding to the local information. The inverse transformation of the single-bit unitary transform is applied to the multi-bit tensor to obtain the core representation after eliminating local degrees of freedom. The core representation is then subjected to phase normalization and tolerance processing to generate a stable local unitary canonical form. The local unitary canonical form is saved as an orbital node, and the calculated single-bit unitary transform is saved as the single-bit unitary transform information.
4. The quantum state preparation method based on local unitary canonical form and shortest path search according to claim 1, characterized in that, The step of generating a set of allowed candidate two-bit entangled gates based on hardware constraints, and defining the candidate two-bit entangled gates in the set as transition edges, specifically includes: Based on the coupling topology, routing constraints, gate error rate, and gate time of the quantum chip, the candidate two-bit entangled gate set is generated, wherein the candidate two-bit entangled gate set includes two-bit entangled gates that are natively supported by the hardware or can be implemented after routing in the coupling topology; All candidate two-bit entangled gates in the candidate two-bit entangled gate set are defined as transition edges. Search weights are assigned to each transition edge according to the gate error rate or the gate time, and the search weights are used as the basis for calculating the edge cost of the reverse shortest path search.
5. The quantum state preparation method based on local unitary canonical form and shortest path search according to claim 1, characterized in that, The reverse shortest path search includes equal-weighted mode and weighted mode; When the reverse shortest path search adopts the equal weight mode, according to the setting that the cost of each candidate two-bit entangled gate corresponding to the transition edge is 1, the breadth-first search or depth-first search is used to traverse along the transition edge to obtain the reverse shortest path so that the number of two-bit entangled gates in the forward entangled gate sequence is minimized. When the reverse shortest path search adopts a weighted mode, a weighted cost is assigned to each hop edge based on the gate error rate, gate time, crosstalk risk, direction conversion cost, and routing cost in the hardware coupled topology, and a heuristic search algorithm is used to traverse along the hop edge to obtain the reverse shortest path.
6. The quantum state preparation method based on local unitary canonical form and shortest path search according to claim 1, characterized in that, When traversing along the transition edges in the orbit graph, the following pruning strategy is adopted: The transition edges are restricted according to the hardware allowable edges to reduce the number of branches traversed; Alternatively, based on the sparsity or symmetry of the target quantum state, equivalent or redundant orbital nodes can be excluded; Alternatively, prioritize expanding orbital nodes whose metric distance to the all-zero product state orbit is less than a preset threshold; Alternatively, tolerance hashing can be applied to the local unitary canonical form to merge different representations within the numerical error range into the same orbital node identifier; Alternatively, a maximum search depth, time limit, and memory limit can be set. When the search exceeds the maximum search depth, the time limit, or the memory limit, the search stops and the current optimal reverse shortest path is output.
7. The quantum state preparation method based on local unitary canonical form and shortest path search according to claim 1, characterized in that, The step of decomposing the local unitary recovery gate into a hardware-supported single-bit gate sequence based on the single-bit unitary transform information corresponding to each step in the forward entanglement gate sequence, and combining the forward entanglement gate sequence and the single-bit gate sequence to generate the target quantum state preparation circuit, specifically includes: The corresponding decomposition method is selected according to the target quantum computing platform. When the target quantum computing platform is a superconducting platform, the local unitary recovery gate is decomposed into a combination of a rotation gate and a virtual Z gate according to the single-bit unitary transformation information to obtain the single-bit gate sequence. When the target quantum computing platform is an ion trap platform, the local unitary recovery gate is decomposed into a combination of a global rotation gate and a local rotation gate according to the single-bit unitary transformation information to obtain the single-bit gate sequence. When the target quantum computing platform is an optical quantum platform, the local unitary recovery gate is decomposed into a combination of phase shift operation and beam splitting operation according to the single-bit unitary transformation information to obtain the single-bit gate sequence; The single-bit gate sequence is merged with the forward entanglement gate sequence, and the output is a quantum state preparation circuit description format available to QASM, Qiskit, Cirq, or a hardware control system.
8. A quantum state preparation system based on local unitary canonical form and shortest path search, characterized in that, The quantum state preparation system based on local unitary canonical form and shortest path search includes: The target state input module is used to acquire the description data of the target quantum state, preprocess the description data, and generate tensor quantization data. The local unitary normalization module is used to perform local unitary normalization on the tensor data, extract the local degrees of freedom on each qubit, obtain the local unitary canonical form, and record the single-bit unitary transformation information used to eliminate the local degrees of freedom. The orbit identification module is used to process the local unitary canonical form, generate the initial orbit node identifier corresponding to the target quantum state, and use the initial orbit node identifier as the starting node in the search process; The entanglement gate candidate module is used to generate a set of allowed candidate two-bit entanglement gates according to hardware constraints, and to define the candidate two-bit entanglement gates in the set of candidate two-bit entanglement gates as transition edges; The shortest path search module is used to perform a reverse shortest path search along the transition edge, starting from the starting node. During the search process, the local unitary normalization process and orbit node identifier generation process are re-executed for each new quantum state obtained after each transition along the transition edge to obtain a new orbit node identifier. The trajectory graph construction module is used to construct a trajectory graph by using the starting node and the new trajectory node identifier as a node set and the transition edge as an edge set. The transition traversal module is used to traverse along the transition edge in the orbit graph until the all-zero product state orbit is reached, output the reverse shortest path from the starting node to the all-zero product state orbit, and record the candidate two-bit entanglement gate and the single-bit unitary transform information corresponding to each step in the reverse shortest path. The route reconstruction module is used to reverse the order of the shortest path based on the candidate two-bit entanglement gates corresponding to each step in the shortest path, so as to obtain a forward entanglement gate sequence starting from the initial state of all zeros. The circuit output module is used to decompose the local unitary recovery gate into a hardware-supported single-bit gate sequence based on the single-bit unitary transformation information corresponding to each step in the forward entanglement gate sequence, and combine the forward entanglement gate sequence and the single-bit gate sequence to generate the target quantum state preparation circuit.
9. A terminal, characterized in that, The terminal includes: a memory, a processor, and a quantum state preparation program based on local unitary canonical form and shortest path search, stored in the memory and executable on the processor. When the quantum state preparation program based on local unitary canonical form and shortest path search is executed by the processor, it implements the steps of the quantum state preparation method based on local unitary canonical form and shortest path search as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a quantum state preparation program based on local unitary canonical form and shortest path search, which, when executed by a processor, implements the steps of the quantum state preparation method based on local unitary canonical form and shortest path search as described in any one of claims 1-7.
