Quantum state preparation method and system based on tensor reinforcement learning and reverse disentanglement
Patent Information
- Application Number
- CN202610805906.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-05
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]然而,现有方法存在以下核心缺陷:第一,正向演化的非凸优化困境,具体地,直接从直积态向高纠缠的目标量子态进行正向演化搜索时,成本函数高度非凸,极易陷入局部最优
本发明将目标量子态转换为矩阵乘积态,通过在当前时间步根据当前矩阵乘积态与可训练张量网络参数生成低维特征向量,并利用系统全局冯·诺伊曼纠缠熵的下降量作为奖励信号,引导张量强化学习智能体选择解纠缠双比特量子门的插入位置,将正向态制备转化为逆向解纠缠任务,避免了正向搜索中成本函数高度非凸导致的局部最优问题。本发明中,离散动作空间的每个动作对应一个相邻量子比特对的位置索引,预设深度学习模型输出预测动作价值后,根据探索策略选择动作并实例化合参数的双比特量子门,独立优化其参数以最小化施加门后的系统全局冯·诺伊曼纠缠熵,使得解纠缠门序列完全由目标量子态内禀的纠缠分布驱动,自适应地生成最简电路,去除了冗余操作,降低了电路深度,减少了含噪声中等规模量子硬件上的门噪声积累。本发明使用矩阵乘积态表示量子态,并通过可训练张量网络参数与当前矩阵乘积态生成低维特征向量,代替全波函数输入,将计算复杂度从指数级降为多项式级别,使得张量强化学习智能体能够扩展到大规模量子系统。最终,通过记录解纠缠门序列并逆向编译生成量子态制备电路,实现了高保真度、低深度、高扩展性的量子态制备。
Smart Images

Figure CN122927563A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quantum computing and artificial intelligence, and in particular to a method and system for preparing quantum states based on tensor reinforcement learning and inverse deentanglement. Background Technology
[0002] In the fields of quantum computing and quantum information processing, high-fidelity preparation of target quantum states is a prerequisite for performing subsequent computational tasks. However, as the scale of quantum systems increases, the Hilbert space dimension of many-body quantum states expands exponentially with the number of qubits, making it extremely difficult to directly simulate the full-wave function and design quantum state preparation circuits on classical computers, resulting in an exponential increase in memory and computation time resource consumption.
[0003] To mitigate this curse of dimensionality, tensor networks based on matrix product states (MPS) have been introduced. These networks can efficiently represent one-dimensional quantum states that satisfy the area law with resource overhead that grows linearly with system size. Building on this, existing variable quantum state preparation circuit design methods typically employ parameterized quantum circuits with fixed templates, attempting to approximate the target quantum state from simple direct product states through forward evolution.
[0004] However, existing methods suffer from the following core drawbacks: First, the non-convex optimization dilemma of forward evolution. Specifically, when directly performing a forward evolution search from the product state to the highly entangled target quantum state, the cost function is highly non-convex, making it prone to getting trapped in local optima. Second, rigid and redundant circuit structures. Specifically, fixed circuit structures cannot adapt to the inherent non-uniform entanglement characteristics of different target quantum states, easily leading to redundant quantum gate operations and excessively high circuit depth. On noisy intermediate-scale quantum (NISQ) hardware, the fidelity will significantly decrease due to the accumulation of gate noise. Third, traditional reinforcement learning encounters dimensionality limitations. Specifically, traditional deep reinforcement learning relies on the full-wave function as the input to the neural network. As the number of qubits increases, the exponential growth of wave function components makes it impossible to extract effective features, making it difficult to scale to practical scale. Summary of the Invention
[0005] This invention aims to address the shortcomings of existing technologies, specifically providing a quantum state preparation method and system based on tensor reinforcement learning and inverse deentanglement, as detailed below: 1) In a first aspect, the present invention provides a quantum state preparation method based on tensor reinforcement learning and inverse deentanglement, the specific technical solution of which is as follows: S1. Obtain the target quantum state to be prepared, convert the target quantum state into a matrix product state, and define a discrete action space, wherein each action in the discrete action space corresponds to the position index of an adjacent pair of qubits; initialize the tensor reinforcement learning agent, wherein the tensor reinforcement learning agent includes initialized trainable tensor network parameters and initialized preset deep learning model; S2. At the current time step, generate a low-dimensional feature vector based on the current matrix product state and the parameters of the trainable tensor network; wherein, at the first time step, the current matrix product state is the matrix product state described in step S1. S3. Input the low-dimensional feature vector into the preset deep learning model, output the predicted action value of each action in the discrete action space, and select an action from the predicted action values according to the exploration strategy. The action represents inserting a deentangled two-bit quantum gate between the selected adjacent quantum bit pairs. S4. Instantiate a parameterized two-qubit quantum gate at the selected adjacent qubit pair position. With the goal of minimizing the global von Neumann entanglement entropy of the system after applying the two-qubit quantum gate, independently optimize the parameters of the two-qubit quantum gate to obtain the optimal parameters. S5. Update the current matrix product state according to the two-bit quantum gate with the optimal parameters to obtain the updated matrix product state; S6. Calculate the difference between the system-wide von Neumann entanglement entropy of the current matrix product state before applying the two-bit quantum gate and the system-wide von Neumann entanglement entropy of the updated matrix product state after applying the gate, and use it as a reward signal; S7. Store the experience tuple into the experience replay pool. The experience tuple includes the current matrix product state, the selected action, the reward signal, and the updated matrix product state. Randomly sample at least one experience tuple from the experience replay pool and use the reward signal in the sampled experience tuple to update the trainable tensor network parameters and the weights of the preset deep learning model. S8. Determine whether the system-wide von Neumann entanglement entropy of the updated matrix product state is lower than a preset threshold. If yes, proceed to step S9; otherwise, take the updated matrix product state as the current matrix product state and return to step S2. S9. Record all applied unentangled two-qubit quantum gates and their optimal parameters to form an unentangled gate sequence, and generate a quantum state preparation circuit based on the unentangled gate sequence.
[0006] The beneficial effects of the quantum state preparation method based on tensor reinforcement learning and inverse deentanglement provided by this invention are as follows: This invention transforms the target quantum state into a matrix product state. At the current time step, a low-dimensional feature vector is generated based on the current matrix product state and the parameters of the trainable tensor network. The decrease in the global von Neumann entanglement entropy of the system is used as a reward signal to guide the tensor reinforcement learning agent in selecting the insertion position of the de-entangled two-qubit quantum gate. This transforms the forward state preparation into a reverse de-entanglement task, avoiding the local optimum problem caused by the highly non-convex cost function in the forward search. In this invention, each action in the discrete action space corresponds to the position index of an adjacent pair of qubits. After the deep learning model outputs the predicted action value, an action is selected according to the exploration strategy, and a combined parameter two-qubit quantum gate is instantiated. Its parameters are independently optimized to minimize the global von Neumann entanglement entropy of the system after applying the gate. This ensures that the de-entanglement gate sequence is entirely driven by the intrinsic entanglement distribution of the target quantum state, adaptively generating the simplest circuit, eliminating redundant operations, reducing circuit depth, and minimizing gate noise accumulation on noisy medium-scale quantum hardware. This invention uses matrix product states to represent quantum states and generates low-dimensional feature vectors by combining trainable tensor network parameters with the current matrix product state, replacing the full-wave function input. This reduces computational complexity from exponential to polynomial level, enabling tensor reinforcement learning agents to scale to large-scale quantum systems. Finally, by recording the deentanglement gate sequence and reverse-compiling to generate a quantum state preparation circuit, high-fidelity, low-depth, and highly scalable quantum state preparation is achieved.
[0007] Based on the above scheme, the quantum state preparation method based on tensor reinforcement learning and inverse deentanglement of the present invention can be further improved as follows.
[0008] Furthermore, at the current time step, a low-dimensional feature vector is generated based on the current matrix product state and the trainable tensor network parameters, including: at the current time step, performing tensor shrinkage operation on the current matrix product state and the trainable tensor network parameters to extract the overlap vector, and normalizing the overlap vector to generate a low-dimensional feature vector.
[0009] The beneficial effects of adopting the above-mentioned further scheme are as follows: At the current time step, tensor contraction operation is performed on the current matrix product state and the trainable tensor network parameters to extract the overlap vector. This overlap vector is then normalized to generate a low-dimensional feature vector, achieving effective compression of high-dimensional quantum state information. This process reduces the exponentially dimensional matrix product state to a low-dimensional feature vector of constant length, completely breaking the dimensionality curse faced by traditional reinforcement learning due to its reliance on full-wave function input. Simultaneously, the overlap vector extracted through tensor contraction operation retains the key overlap information between the current matrix product state and the trainable tensor network parameters, providing stable and information-rich input features for subsequent pre-defined deep learning models. The computational complexity of the entire operation increases linearly with the number of qubits, enabling tensor reinforcement learning agents to efficiently process large-scale quantum systems and exhibiting strong scalability.
[0010] Furthermore, the current matrix product state is updated according to the two-bit quantum gate with the optimal parameters to obtain the updated matrix product state, including: applying the two-bit quantum gate with the optimal parameters to the current matrix product state, performing singular value decomposition and truncation on the applied tensor, and updating the current matrix product state to obtain the updated matrix product state.
[0011] The beneficial effects of adopting the above-mentioned further scheme are as follows: By applying a two-qubit quantum gate with optimal parameters to the current matrix product state and performing singular value decomposition and truncation on the tensor after application, accurate updates to the quantum state are achieved while maintaining the compact structure of the matrix product state. Singular value decomposition directly outputs the singular values at each slicing position, providing a physical basis for calculating the global von Neumann entanglement entropy of the system, allowing the decrease in entanglement entropy to serve as a reward signal to drive agent learning. The truncation operation retains only the largest few singular values, controlling the truncated bond dimension of the matrix product state within a preset range. This avoids the exponential computational expansion caused by the continuous growth of the bond dimension with the gate operation, ensuring that the computational complexity of the entire deentanglement cycle expands linearly with the number of qubits, enabling this method to efficiently handle large-scale quantum systems.
[0012] Furthermore, a quantum state preparation circuit is generated based on the deentanglement gate sequence, including: reversing the deentanglement gate sequence and taking the conjugate transpose of each two-qubit quantum gate after reversal to generate the quantum state preparation circuit.
[0013] The beneficial effects of adopting the above-mentioned further scheme are as follows: by reversing the unentanglement gate sequence and taking the conjugate transpose of each two-qubit quantum gate, a forward circuit for preparing the target quantum state is directly generated from the initial all-zero state. This operation utilizes the property of the quantum gate unitary matrix to completely reverse the unentanglement process without introducing any additional gates or parameters. The generated quantum state preparation circuit has the exact same number of gates and depth as the unentanglement gate sequence, preserving the simplest topology obtained by the decrease in entanglement entropy. Since the unentanglement process has adaptively selected the most efficient gate position through the reward signal, the reverse-compiled circuit naturally inherits the shallow depth and adjacency connectivity, avoiding redundant operations in fixed template circuits and reducing the fidelity loss caused by gate noise accumulation on noisy medium-scale quantum hardware.
[0014] Furthermore, after S9, the method further includes: adding two layers of parameterized single-bit quantum gates at the end of the quantum state preparation circuit. The two layers of parameterized single-bit quantum gates include a rotating gate around the Z-axis and a rotating gate around the Y-axis. The circuit with the added gates is used as the complete preparation circuit. The fidelity between the quantum state generated by the complete preparation circuit acting on the initial all-zero state and the target quantum state is used as the objective function. All parameters in the complete preparation circuit are globally jointly optimized to obtain the optimized quantum state preparation circuit.
[0015] The beneficial effects of the above-mentioned further scheme are as follows: Adding a rotation gate around the Z-axis and a rotation gate around the Y-axis to the end of the quantum state preparation circuit, and using the added circuit as the complete preparation circuit, global joint optimization is performed with the fidelity between the quantum state generated by the complete preparation circuit acting on the initial all-zero state and the target quantum state as the objective function. This effectively compensates for the residual bias introduced by the discrete action space limitation and singular value decomposition truncation during the unentanglement process. Global joint optimization simultaneously adjusts all two-qubit quantum gate parameters and the angle of the newly added single-qubit rotation gate, eliminating the errors that may accumulate from local independent optimization, thus significantly improving fidelity. This error compensation mechanism ensures that the finally prepared quantum state is highly close to the target quantum state, compensating for the accuracy loss caused by topological search and discrete action space, and further enhancing the reliability of the invention in practical quantum hardware preparation.
[0016] 2) In a second aspect, the present invention also provides a quantum state preparation system based on tensor reinforcement learning and inverse deentanglement, the specific technical solution of which is as follows: It includes a conversion definition initialization module, a first generation module, an output selection module, an optimal parameter acquisition module, an update module, a calculation module, a sampling module, a judgment and processing module, and a second generation module; The conversion definition initialization module is used to: obtain the target quantum state to be prepared, convert the target quantum state into a matrix product state, and define a discrete action space, wherein each action in the discrete action space corresponds to the position index of an adjacent pair of qubits; initialize a tensor reinforcement learning agent, wherein the tensor reinforcement learning agent includes initialized trainable tensor network parameters and initialized preset deep learning model; The first generation module is used to: at the current time step, generate a low-dimensional feature vector based on the current matrix product state and the parameters of the trainable tensor network; wherein, at the first time step, the current matrix product state is the matrix product state obtained by the transformation definition initialization module; The output selection module is used to: input the low-dimensional feature vector into the preset deep learning model, output the predicted action value of each action in the discrete action space, and select an action from the predicted action values according to the exploration strategy, wherein the action represents inserting a deentangled two-bit quantum gate between the selected adjacent quantum bit pairs; The optimal parameter acquisition module is used to: instantiate a parameterized two-qubit quantum gate at the selected adjacent qubit pair position, and independently optimize the parameters of the two-qubit quantum gate with the goal of minimizing the global von Neumann entanglement entropy of the system after applying the two-qubit quantum gate, so as to obtain the optimal parameters. The update module is used to: update the current matrix product state according to the two-bit quantum gate with the optimal parameters, so as to obtain the updated matrix product state; The computing module is used to: calculate the difference between the system-wide von Neumann entanglement entropy of the current matrix product state before applying the two-bit quantum gate and the system-wide von Neumann entanglement entropy of the updated matrix product state after applying the gate, as a reward signal; The sampling module is used to: store experience tuples into an experience replay pool, the experience tuples including the current matrix product state, the selected action, the reward signal, and the updated matrix product state; randomly sample at least one experience tuple from the experience replay pool, and use the reward signal in the sampled experience tuples to update the trainable tensor network parameters and the weights of the preset deep learning model; The judgment and processing module is used to: determine whether the system-wide von Neumann entanglement entropy of the updated matrix product state is lower than a preset threshold; if so, call the transformation definition initialization module; if not, take the updated matrix product state as the current matrix product state and call the output selection module, the optimal parameter acquisition module, the update module, the calculation module, and the sampling module. The second generation module is used to: record all applied unentangled two-qubit quantum gates and their optimal parameters to form an unentangled gate sequence, and generate a quantum state preparation circuit based on the unentangled gate sequence.
[0017] 3) In a third aspect, the present invention also provides an electronic device, the electronic device including a processor coupled to a memory, the memory storing at least one computer program, the at least one computer program being loaded and executed by the processor, so that the electronic device implements any of the above-mentioned quantum state preparation methods based on tensor reinforcement learning and inverse deentanglement.
[0018] 4) In a fourth aspect, the present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements any of the above-mentioned quantum state preparation methods based on tensor reinforcement learning and inverse deentanglement.
[0019] It should be noted that the beneficial effects of the technical solutions of the second to fourth aspects of the present invention and their corresponding possible implementations can be found in the above description of the technical effects of the first aspect and its corresponding possible implementations, and will not be repeated here. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below: Figure 1 This is a schematic flowchart of a quantum state preparation method based on tensor reinforcement learning and inverse deentanglement according to an embodiment of the present invention; Figure 2 This is an overall architecture diagram of a quantum state preparation method based on tensor reinforcement learning and inverse deentanglement according to an embodiment of the present invention; Figure 3 A network schematic diagram for dimensionality reduction feature extraction and action value evaluation of a Tensor Reinforcement Learning (TRL) agent; Figure 4 A schematic diagram illustrating the mechanism for reverse engineering the circuit from the forward unentanglement gate sequence to the final quantum state preparation circuit. Figure 5 Heatmap of fidelity test for training range of 20-bit Ising model; Figure 6 Heatmap for near-domain generalization fidelity test of 20-bit Ising model; Figure 7 Heatmap of generalization fidelity test in the critical region of the 20-bit Ising model; Figure 8 This is a schematic diagram of a quantum state preparation system based on tensor reinforcement learning and inverse deentanglement according to an embodiment of the present invention. Detailed Implementation
[0021] The principles and features of the present invention are described below. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0022] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0023] like Figure 1 As shown, an embodiment of the present invention provides a quantum state preparation method based on tensor reinforcement learning and inverse deentanglement, comprising the following steps: S1. Obtain the target quantum state to be prepared, convert the target quantum state into a matrix product state, and define a discrete action space, wherein each action in the discrete action space corresponds to the position index of an adjacent pair of qubits; initialize the tensor reinforcement learning agent, wherein the tensor reinforcement learning agent includes initialized trainable tensor network parameters and initialized preset deep learning model; The specific implementation process for obtaining the target quantum state to be prepared and converting the target quantum state into a matrix product state is as follows: S10. Obtain the target quantum state to be prepared. The target quantum state is the initial input state that needs to be prepared in subsequent quantum computing or quantum information processing tasks. In the memory of a classical computer, the target quantum state to be prepared is represented as a full-wave function, that is, a state containing... Tensor with complex components .in, Represents the total number of qubits, each subscript The value can be 0 or 1, representing the first or second. The computational basis state of each qubit For the corresponding base The probability amplitude. This tensor in the form of the full-wave function completely describes the target quantum state in... Distribution in Widhillbert space.
[0024] S11. To avoid directly storing and manipulating the full-wave function tensor, which has exponential complexity, a matrix product state representation is used to compress and encode the target quantum state. The matrix product state represents the full-wave function tensor of the target quantum state. Decomposed into The product form of local tensors is specifically transformed by continuously performing singular value decomposition, including: the first sub-step, transforming the full-wave function tensor into a product form. The first indicator Compared with all other indicators Merge the tensors to reshape them into a large matrix. Perform singular value decomposition on this matrix to obtain a left singular matrix, a singular value matrix, and a right singular matrix. Retain the largest singular value matrix from the left singular matrix. There are several singular values, and a local tensor corresponding to the first qubit is constructed based on the truncation result. The second sub-step involves merging the right singular matrix with the remaining tensor portion and continuing to separate the next index. Singular value decomposition and truncation are performed again to construct the local tensor of the second qubit. The third sub-step involves repeating the above decomposition and truncation process, processing the third to the fourth sub-steps sequentially. Each of the qubits is used to construct a corresponding local tensor. Until The fourth sub-step involves processing the last qubit, directly using the remaining tensor as the last local tensor. After the above steps, the target quantum state is precisely converted into a matrix product state form, expressed as: ,in, For the first A quantum bit in physical state The dimension of the internal connection between adjacent local matrices is the truncation key dimension. By setting a smaller truncation key dimension The matrix product state reduces the number of parameters in the target quantum state from an exponential level. Compressed to polynomial level This enables the subsequent reinforcement learning decision-making and circuit compilation processes to be executed efficiently on classical computers with linear computational complexity.
[0025] The target quantum state refers to a many-body quantum state that needs to be prepared as the initial state for subsequent algorithms or operations in practical quantum computing or quantum information processing tasks. This quantum state is composed of... Composed of 100 qubits, its entirety, under a computational basis, constitutes a dimensional 1000 qubit. The complex tensor. Before being compressed, the target quantum state is usually stored in classical computer memory as a full-wave function.
[0026] Among them, the matrix product state is a compact tensor network structure used to represent one-dimensional multi-body quantum states. It represents a quantum state with... The total wave function tensor decomposed into complex components is as follows: The product of *n* local matrices, each corresponding to a qubit and its physical state. Adjacent local matrices are connected by an internal dimension, called the truncated bond dimension, denoted as . By limiting the maximum value of the truncated bond dimension, the matrix product state reduces the number of parameters required to represent the quantum state from an exponential level. Reduced to polynomial level This enables efficient storage and computation of large-scale quantum states on classical computers. At any position between adjacent qubits, the mathematical structure of the matrix product state is equivalent to the Schmidt decomposition of the left and right subsystems at that position, where the singular values directly encode the quantum entanglement information between the left and right subsystems at that position.
[0027] Here, a discrete action space is defined, where each action corresponds to the position index of an adjacent pair of qubits. The specific implementation process is as follows: S12. The total number of qubits directly read from the data structure of the matrix product state after converting the target quantum state into a matrix product state is denoted as . Here This represents the number of qubits used to represent the target quantum state, and is also a positive integer. For... A one-dimensional quantum chain consists of qubits. Adjacent qubit pairs refer to two qubits with consecutive indices, i.e., the 1st and 2nd qubits, the 2nd and 3rd qubits, ..., the 1st and 2nd qubits. The and the first The total number of adjacent qubit pairs is equal to the total number of qubits minus 1, which is 1 / 2 qubit. .
[0028] S13. Create a set of elements in the discrete action space; specifically, establish a set containing... A set of *n* elements, where each element is a positive integer representing the starting position index of each adjacent qubit pair in the quantum chain. Specifically, the first element is assigned a value of 1, corresponding to the position formed by the first and second qubits; the second element is assigned a value of 2, corresponding to the position formed by the second and third qubits; and so on, with the first element assigned a value of 1, the second element assigned a value of 2, the third element assigned a value of 2, the fourth element assigned a value of 2, the fifth element assigned a value of 2, the sixth element assigned a value of 2, the seventh element assigned a value of 2, the eighth element assigned a value of 2, the ninth element assigned a value of 2, the eleventh ... Each element is assigned a value. , corresponding to the The and the first The location is composed of qubits. Thus, the discrete action space Defined as .
[0029] S14. Establish the mapping relationship between actions and position indices. Define each action in the discrete action space. For a specific action instruction, where the subscript Indicates the current time step. When the action... At that time, among them The value ranges from 1 to Any integer, the meaning of this action is: select the first... The nth adjacent qubit pair, that is, the nth... The qubit and the first The subsequent deentanglement operation is performed at the positions between these qubits. Through the above mapping relationship, each decision in the reinforcement learning process will be derived from this... Choose one of the discrete actions to determine which adjacent bit pair in the quantum chain to insert the next unentangled two-bit quantum gate.
[0030] The discrete action space is a finite set of all possible actions that a reinforcement learning agent can perform. In this invention, the size of this action space is determined by the total number of qubits. The decision specifically includes The action space consists of discrete actions. Each action is independent and mutually exclusive in the space, and the agent must select one and only one action from this space to execute at each time step. The discrete action space does not contain continuous values or an infinite number of options, thus allowing the action selection process to be directly evaluated and decided through the output vector of the action value network.
[0031] In this context, an adjacent qubit pair refers to two qubits with consecutive position indices in a one-dimensional qubit chain. Specifically, for the... The qubit and the first qubits, of which The value range is 1 to These two qubits constitute a pair of adjacent qubits. In the topology of a quantum circuit, a two-qubit quantum gate can be directly applied between adjacent qubit pairs without the need for a swap gate or additional routing operations. In this invention, all deentanglement operations are performed only on adjacent qubit pairs to ensure that the final generated quantum state preparation circuit fully satisfies the physical constraints of nearest-neighbor connected hardware.
[0032] Here, the position index is an integer value used to identify the specific position of adjacent qubit pairs in the quantum chain. For those... A one-dimensional chain consisting of qubits, with position indices starting from 1 and ending at 1. End. Location Index Uniquely corresponds to the first The qubit and the first A pair of adjacent qubits consists of qubits. By specifying a position index, the specific position where the unentangled two-qubit quantum gate needs to be applied can be determined unambiguously. The position index is also the numerical representation of each action in the discrete action space; the action output by the agent is directly given in the form of the position index.
[0033] The process of initializing a tensor reinforcement learning agent includes initializing trainable tensor network parameters and an initializing preset deep learning model. The specific implementation process is as follows: S15. The parameters of a trainable tensor network are constructed as a tensor in matrix product form. In the memory of a classic computer, for Allocate storage space with the same number of qubits as the target quantum state, denoted as . .right Each matrix element of each local tensor is assigned a random initial value, generated using a Gaussian distribution with a mean of 0 and a variance of 0.01. To ensure numerical stability, after initialization... Normalization is performed to obtain The internal structure of this trainable tensor network employs open boundary conditions, with row and column vectors at the two ends and a matrix in the middle. The connection dimension between all adjacent local tensors is set to a fixed truncation key dimension. ,Should The value of is consistent with the truncated bond dimension of the matrix product state representing the target quantum state.
[0034] S16. Initialize the preset deep learning model. The preset deep learning model is a multi-layer fully connected neural network, denoted as... In classical computers, the input layer dimension of this neural network is defined as equal to the length of the low-dimensional feature vector generated after feature extraction from the trainable tensor network parameters. The output layer dimension is defined as equal to the size of the discrete action space. The neural network is defined with two hidden layers. The first hidden layer has 64 neurons, and the second hidden layer has 32 neurons. A linear rectified function is used as the activation function after each layer. All weight and bias parameters in the neural network are randomly initialized using a Gaussian distribution with a mean of 0 and a variance of 0.01. The initialized neural network parameters are saved as a trainable state for subsequent updates via backpropagation.
[0035] S17. Combine the initialized trainable tensor network parameters with the initialized preset deep learning model to form a tensor reinforcement learning agent. The tensor reinforcement learning agent itself does not contain additional parameters, but is a data structure containing two members: the first member points to the trainable tensor network parameters. The second member is a reference to a preset deep learning model. The reference states that this assembly enables the subsequent reinforcement learning decision-making process to first extract features by performing tensor contraction operations using the trainable tensor network parameters and the current matrix product state, and then inputting the extracted features into a pre-defined deep learning model to output the predicted action value for each action in the discrete action space.
[0036] Tensor reinforcement learning agents are composite data structures used for reinforcement learning decision-making, consisting of trainable tensor network parameters and a pre-defined deep learning model. The tensor reinforcement learning agent receives the matrix product state of the current environment as input, compresses high-dimensional quantum state information into low-dimensional feature vectors through its internal trainable tensor network parameters, and then maps these low-dimensional feature vectors to the predicted action value of each action in the discrete action space using the pre-defined deep learning model. All parameters within the tensor reinforcement learning agent can be updated using reinforcement learning algorithms, thereby gradually learning the optimal de-entanglement gate insertion strategy.
[0037] Here, the trainable tensor network parameters refer to a tensor stored in matrix product form, denoted as... The number of qubits in this tensor is the same as the number of qubits in the target quantum state. Each local tensor element of this tensor is a learnable parameter, initially assigned a random value, and continuously updated during reinforcement learning training through temporal difference algorithms and backpropagation. The function of the trainable tensor network parameters is to multiply the matrix with the current environment. Perform tensor contraction operations to calculate the inner product between two tensors. This compresses exponentially dimensional quantum state information into a low-dimensional overlap vector, providing input features for subsequent deep learning models.
[0038] The preset deep learning model can be a multi-layer fully connected neural network, denoted as... Its input layer receives a low-dimensional feature vector obtained by shrinking the product state of the trainable tensor network parameters and the current matrix, and its output layer outputs the predicted action value for each action in the discrete action space. The number of hidden layers and neurons per layer in the preset deep learning model are predetermined during initialization. The weights and biases of all layers are trainable variables, updated during reinforcement learning by sampling empirical tuples from the empirical replay pool and using a temporal difference algorithm. The preset deep learning model does not contain convolutional or recurrent layers, but consists only of fully connected layers and nonlinear activation functions.
[0039] S2. At the current time step, a low-dimensional feature vector is generated based on the current matrix product state and the trainable tensor network parameters. Specifically, at the current time step, tensor shrinkage is performed on the current matrix product state and the trainable tensor network parameters to extract the overlap vector. The overlap vector is then normalized to generate a low-dimensional feature vector. In the first time step, the current matrix product state is the matrix product state described in step S1. The specific implementation process is as follows: S20, at each time step Read the matrix product state at the current time step from the reinforcement learning environment, denoted as For the first time step, i.e. or The initial state is the matrix product state obtained from the target quantum state in step S1, specifically denoted as... The matrix product state is stored in the memory of a classical computer in the form of a tensor network, containing... Local tensors The truncation bond dimension between adjacent local tensors is .
[0040] S21. Read the initialized trainable tensor network parameters from the tensor reinforcement learning agent. These parameters are also stored in matrix product form, denoted as... . It has the same number of qubits as the current matrix product state. and the same truncation key dimension Its local tensor elements are the trainable values at the current time.
[0041] S22, Multiply the current matrix state With trainable tensor network parameters Perform full tensor contraction and calculate the inner product between the two matrix product states. Specifically, for each qubit location... and each physical state ,Will Local tensors and The corresponding local tensor In physical indicators The key dimensions are then shrunk sequentially, resulting in a complex scalar. This operation yields the inner product value. This is a complex number containing information about the overlap between two tensor networks. Since the result of tensor shrinkage is a scalar rather than a vector, the extracted "overlap vector" is actually a vector of length 1, i.e., the complex modulus square of a single value. To facilitate subsequent normalization, the modulus square of the inner product can be directly calculated. This scalar value is used as the overlap measure.
[0042] S23. Obtain the overlap scalar Take the natural logarithm and divide by the total number of qubits. Generate a low-dimensional feature vector The formula for this calculation is as follows: ,in, Indicates at time step The generated low-dimensional feature vector, which is a scalar value in this case; The total number of qubits; Represents the natural logarithm operation; This is the squared modulus of the inner product of the current matrix multiplication state and the parameters of the trainable tensor network. Since the squared modulus of the inner product is always a non-negative real number, we take the natural logarithm and then divide by . Its value range can be mapped to a numerical range that is easy for neural networks to process. This refers to the low-dimensional feature vectors of the preset deep learning model that are subsequently input.
[0043] S24. Calculate the low-dimensional feature vector. The data is stored in floating-point form, as in classical computers, and passed to the next processing stage of the tensor reinforcement learning agent, namely, inputting it into a pre-defined deep learning model for action value prediction. This low-dimensional feature vector has a dimension far lower than the exponential dimension of the original matrix product state, thus achieving effective compression of high-dimensional quantum state information.
[0044] Tensor contraction refers to the operation of summing and shrinking two tensor networks on a common index. In this invention, the current matrix product state... With trainable tensor network parameters Both are tensor networks in the form of matrix product states, with the same number of qubits and truncated bond dimensions. Tensor contraction operations require traversing the physical indices of all qubits and all adjacent bond dimensions, shrinking and summing these common indices one by one, ultimately yielding a complex scalar. This scalar represents the inner product between the two matrix product states. This operation is implemented on a classical computer by performing local tensor multiplication and shrinking at each position sequentially, with computational complexity and the number of qubits being relatively low. and truncation key dimension It exhibits a polynomial relationship.
[0045] Here, the overlap vector refers to the numerical expression of the degree of overlap between the current matrix product state obtained through tensor contraction and the parameters of the trainable tensor network. Specifically, the overlap vector is calculated by the square of the modulus of the inner product. The value reflects the similarity between two quantum states in Hilbert space. It is 1 when the two states are identical and 0 when they are orthogonal. In this invention, the overlap vector is further processed into a low-dimensional feature vector for state perception in reinforcement learning agents.
[0046] Normalization refers to the mathematical transformation of the overlap vector to make its numerical range more suitable for the input of the deep learning model. In this invention, the natural logarithm is taken and then divided by the total number of qubits. The way, that is This transformation will reduce the minimum possible value of the inner product modulo square (e.g., ... Convert to a larger negative absolute value (e.g.) ), then divide by This decouples the numerical value from the number of qubits, thereby maintaining the stability of the eigenvectors under problems of different scales.
[0047] Here, low-dimensional eigenvectors refer to those extracted from high-dimensional matrix product states, whose dimension is much lower than that of the original wavefunction. A compact numerical vector. In this invention, low-dimensional feature vectors... It contains only a single scalar value (i.e., a single number after normalization), so its dimension is 1. This low-dimensional feature vector preserves the key overlap information between the current matrix product state and the parameters of the trainable tensor network, while compressing the amount of data input to the preset deep learning model to a constant level, thereby avoiding the curse of dimensionality caused by the full-wave function input in traditional reinforcement learning methods.
[0048] S3. Input the low-dimensional feature vector into the preset deep learning model, output the predicted action value of each action in the discrete action space, and select an action from the predicted action values according to the exploration strategy. The action represents inserting a deentangled two-qubit quantum gate between the selected adjacent qubit pairs. The specific implementation process is as follows: S30, at time step The low-dimensional feature vectors that have already been calculated As input data, it is passed to the pre-defined deep learning model in the tensor reinforcement learning agent. The default deep learning model is a multi-layer fully connected neural network, where the number of neurons in the input layer matches the dimension of the low-dimensional feature vector. (Low-dimensional feature vector) The values are sequentially filled into each neuron in the input layer. Then, the data propagates forward layer by layer in the neural network: the first hidden layer performs a linear transformation on the input and applies a linear rectified function for activation; the second hidden layer continues the transformation and activation; finally, the data reaches the output layer.
[0049] S31, The output layer of the preset deep learning model includes There are 10 neurons, each corresponding to a discrete action space. One action in the process. The output layer does not use an activation function; it directly outputs the predicted action value for each action. All output values are organized into a vector. , its first Each component Indicates the current matrix product state Below, select the location. The cumulative reward expected by inserting a deentangled two-qubit quantum gate between adjacent qubit pairs at a given point. This vector The length is Each component is a real number.
[0050] S32. Select an action from the predicted action values based on the exploration strategy. Specifically, this involves... The `-greedy` exploration strategy selects actions. First, a random floating-point number between 0 and 1 is generated. If this random number is less than the preset exploration rate... Then, an action is uniformly and randomly selected from the discrete action space, that is, the position index of a pair of adjacent qubits is randomly selected. If the random number is greater than or equal to Then select the predicted action value vector. The action with the largest median value, i.e. In this way, random exploration is performed with a high probability in the early stages of training, and the system gradually tends to utilize the currently learned strategies in the later stages of training.
[0051] S33. Interpret the selected action as a specific untangling operation position. Actions selected through the exploration strategy. It is a specific integer whose value ranges from 1 to 1. This integer directly represents the position index of the selected adjacent qubit pair: the action value is... When, it indicates that the first one has been selected. The qubit and the first One qubit is selected as the target location for inserting the de-entangled two-qubit quantum gate. This selected location is recorded for use in subsequent steps to instantiate the two-qubit quantum gate.
[0052] Here, the predicted action value refers to the estimated cumulative reward output by the pre-defined deep learning model for each possible action in the current matrix product state. For each action in the discrete action space... Predicting action value It is a real number, and the larger the value, the higher the total reward that can be obtained in the future after choosing this action. The predicted action value is calculated jointly by the trainable tensor network parameters in the tensor reinforcement learning agent and the preset deep learning model, and is continuously updated during the training process through the temporal difference algorithm to gradually approximate the true action value function.
[0053] The exploration strategy, in reinforcement learning, is a decision rule used to balance the relationship between "utilizing known optimal actions" and "exploring unknown actions." This invention employs... -greedy exploration strategy: explore with a small probability Randomly select an action from the discrete action space with a relatively high probability. The action with the highest predicted value is selected. The introduction of an exploration strategy can prevent the agent from getting trapped in local optima too early, allowing it to try different unentanglement gate insertion positions and thus discover a better circuit structure.
[0054] Among them, the unentangled two-qubit quantum gate refers to a parameterized quantum gate that operates on two adjacent qubits, denoted as... ,in For continuous parameters, subscript and This represents the position index of the adjacent qubit pair being acted upon. The matrix form of this quantum gate is a unitary matrix, and its specific structure can be any parameterized unitary operation capable of generating or changing the degree of entanglement in two-qubit pairs. In this invention, the deentanglement two-qubit quantum gate is inserted between selected adjacent qubit pairs, and its parameters are independently adjusted through subsequent nested optimization steps. The goal is to minimize the global von Neumann entanglement entropy of the system after applying the gate, thereby achieving the purpose of gradually stripping entanglement from the target quantum state.
[0055] S4. Instantiate a parameterized two-qubit quantum gate at the selected adjacent qubit pair positions. With the goal of minimizing the global von Neumann entanglement entropy of the system after applying the two-qubit quantum gate, independently optimize the parameters of the two-qubit quantum gate to obtain the optimal parameters. The specific implementation process is as follows: S40. Instantiate a parameterized two-qubit quantum gate at the selected adjacent qubit pair positions, specifically, according to the action selected in step S3. , will action value Interpreted as the position index of adjacent qubit pairs, i.e., the first... The qubit and the first The positions between these two qubits. In the memory of a classical computer, construct a two-qubit quantum gate matrix that acts on these two qubits. This two-qubit quantum gate consists of a continuous parameter. control, It can be a single angle value or a vector of multiple angles, initially assigned a random value. Specifically, it takes the form of an arbitrary parameterized unitary matrix that can generate or change the degree of entanglement. The parameterized unitary matrix can specifically be a two-bit parameterized gate, such as... This ensures that it is a unitary matrix.
[0056] S41. Define a loss function that minimizes the global von Neumann entanglement entropy of the system after applying a two-qubit quantum gate. Let the current matrix product state at the current time step be denoted as... The instantiated two-qubit quantum gate Apply to location and Above, we obtain the new matrix product state after applying the gate. Loss function Defined as the global von Neumann entanglement entropy of the system after the gate is applied, i.e.: ,in, This represents the sum of the von Neumann entanglement entropies at all adjacent cleavage points of a quantum state. The global von Neumann entanglement entropy is calculated as follows: for a gated matrix product state, the bond position between each adjacent qubit... At this point, singular value decomposition is performed on the left and right subsystems to obtain singular values. Then calculate the local von Neumann entanglement entropy. Finally, the global entropy is obtained by summing all the local entropies. The smaller the value of the loss function, the lower the overall entanglement of the system after the gate is applied.
[0057] S42. Use the gradient descent algorithm to independently optimize the parameters of a two-qubit quantum gate and find the optimal parameters. (Using the loss function...) The objective is to minimize the loss function, which is achieved by using the gradient descent optimizer on a classical computer. In each iteration, the loss function is calculated. Regarding parameters gradient Then follow the update rules Adjustment The value of , where Let be the learning rate. Repeat the above iterative process until the loss function converges or the preset maximum number of iterations is reached. During each gradient calculation, the current matrix product state needs to be... The parameterized two-qubit quantum gate is contracted, and the global entanglement entropy is calculated. This process is entirely performed on a classical computer using tensor networks, without involving the execution of actual quantum hardware. Through this nested optimization process, independent of the reinforcement learning main loop, the parameter values that minimize the global von Neumann entanglement entropy are found.
[0058] S43. When gradient descent optimization terminates, the final parameter values are recorded as follows: That is, the optimal parameters. A two-qubit quantum gate with optimal parameters... The optimal parameters are stored in the memory of a classical computer for subsequent updates and evolution of the current matrix product state. Simultaneously, these optimal parameters are also recorded in the deentanglement gate sequence for use in subsequent reverse engineering to generate the quantum state preparation circuit.
[0059] In this context, a parameterized two-qubit quantum gate is a unitary matrix acting on two adjacent qubits, denoted as... ,in It is one or more consecutive real number parameters, subscript and This represents the position of the active qubit. The specific matrix form of this quantum gate is a parameterized unitary transform, which is achieved by adjusting the parameters. The operational effect of the gate can be altered. In this invention, a parameterized two-qubit quantum gate is temporarily inserted between selected pairs of adjacent qubits. Its parameters are independently optimized using the gradient descent method, with the goal of minimizing the global von Neumann entanglement entropy of the system after applying the gate, thereby achieving the function of stripping entanglement from the current quantum state.
[0060] Independent optimization refers to optimizing the parameters of a two-qubit quantum gate. The adjustment process is separated from the policy update process of the reinforcement learning agent, forming a nested inner optimization loop. In the inner optimization, the current matrix product state is fixed. and the selected door location The goal is solely to minimize the global von Neumann entanglement entropy after applying the gate, and the gradient descent algorithm is used to iteratively update the parameters. until the optimal parameters are found. This process does not rely on reinforcement learning reward signals or policy network updates. Parameter optimization is performed independently before each gate insertion, ensuring that each unentanglement gate acts on the quantum state with its local optimum.
[0061] S5. Update the current matrix product state using a two-bit quantum gate with the optimal parameters to obtain an updated matrix product state. Specifically, apply the two-bit quantum gate with the optimal parameters to the current matrix product state, perform singular value decomposition and truncation on the applied tensor, and update the current matrix product state to obtain an updated matrix product state. The specific implementation process is as follows: S50. Apply a two-bit quantum gate with optimal parameters to the current matrix product state. Let the current matrix product state at the current time step be denoted as . , its origin Local tensors The optimal parameters obtained from step S4 are: The corresponding two-qubit quantum gate is ,in This is the position index of the adjacent qubit pair selected in step S3. In a classical computer, this... Acting on the The and the first On the local tensor of the qubit. Specifically, the operation is: extract the qubit from the current matrix product state. Tensor and the Tensor and with them Shrink along the corresponding physical indices and bond dimensions, and merge them into a temporary new tensor. This tensor It contains local information after the double-bit gate operation, and its dimension is The two 2s correspond to the physical dimensions of two qubits.
[0062] S51, Temporary tensor Perform matrix reshaping: transform the first The physical index of the qubit is combined with the left-side bond dimension to form a row index, and the qubit's physical index is then used to index the qubit. The physical properties of each qubit are combined with the right-hand bond dimension to form a column index, resulting in a two-dimensional matrix. For the matrix Perform singular value decomposition to obtain the left singular matrix. Singular value matrix And right singular matrix ,satisfy Singular value matrix It is a diagonal matrix whose diagonal elements are singular values. And sorted in descending order, among which, For matrix The rank of the singular values. These singular values directly correspond to the rank at the split point. The Schmidt coefficient between the left and right subsystems.
[0063] S52. To maintain the compactness of the matrix product representation and control computational complexity, singular values are truncated. A truncated key dimension is preset. This value is consistent with the truncated key dimension used when transforming the matrix product state in step S1. Singular value matrices are preserved. The largest front A singular value While preserving the left singular matrix The corresponding front in the middle Columns and right singular matrices The corresponding front in the middle Okay. Discard the remaining singular values smaller than the threshold and their corresponding matrix components. The truncated singular value matrix is denoted as . Its dimensions are The truncated left singular matrix is denoted as , dimension The truncated right singular matrix is denoted as , dimension The truncation process introduces a small approximation error, but it can effectively suppress the exponential growth of bond dimensions.
[0064] S53. Update the current matrix product state to obtain the updated matrix product state. This is done using the truncated left singular matrix. Singular value matrix And right singular matrix Reconstruct the first The and the first The local tensor of qubits. Specifically, and Multiply to get the updated result. Local tensors Its dimensions are ;Will and Multiply to get the updated result. Local tensors Its dimensions are For other qubit positions ( and The local tensors remain unchanged. Combining all local tensors in sequence forms a new matrix product state. .Should This is the updated matrix product state, which serves as the current state for the next time step.
[0065] Singular value decomposition (SVD) is a linear algebraic technique that decomposes any matrix into the product of three specific matrices. For a matrix of size... matrix Singular value decomposition represents it as In the form of, It is The left singular matrix satisfies ; It is The right singular matrix satisfies ; It is The diagonal matrix is composed of non-negative real numbers on its diagonal, which are called singular values and are arranged in descending order. In this invention, singular value decomposition is applied to the temporary tensor generated after applying a two-qubit quantum gate. The singular values obtained by decomposition directly correspond to the Schmidt coefficients of the quantum state at the truncation point and are the basis for calculating the von Neumann entanglement entropy and performing the truncation operation.
[0066] Truncating, in singular value decomposition, refers to the operation of retaining only the largest and a few largest singular values while discarding the remaining smaller singular values. The number of retained singular values is called the truncated key dimension, denoted as . The purpose of the truncation operation is to control the number of parameters in the matrix product state representation, ensuring that it grows linearly rather than exponentially with the number of qubits. Since the entanglement components corresponding to smaller singular values contribute very little to the overall quantum state, the error introduced by truncation can be controlled within an acceptable range. In this invention, the truncation operation is performed after each application of a de-entangled two-qubit quantum gate, ensuring that the updated matrix product state always maintains a fixed maximum bond dimension. This ensures the computational feasibility and linear complexity of the entire reinforcement learning process.
[0067] S6. Calculate the difference between the system-wide von Neumann entanglement entropy of the current matrix product state before applying the two-bit quantum gate and the system-wide von Neumann entanglement entropy of the updated matrix product state after application, and use it as a reward signal. The specific implementation process is as follows: S60. Calculate the global von Neumann entanglement entropy of the system in the current matrix product state before applying the two-qubit quantum gate. Let the matrix product state at the current time step be denoted as . For this matrix product state, the split positions between all adjacent qubits are traversed sequentially. At each splitting point At that point, perform singular value decomposition on both the left and right subsystems to obtain the singular values at that location. ,in , The truncated key dimension. Calculate the local von Neumann entanglement entropy at this location based on the singular values. The formula is: , will all The sum of the local von Neumann entanglement entropies yields the current matrix product state. System-wide von Neumann entanglement entropy ,Right now: .
[0068] S61. Calculate the global von Neumann entanglement entropy of the system after applying the updated matrix product state with the two-qubit quantum gate. The updated matrix product state is obtained from step S5 and denoted as... Using the exact same method as S60, the split positions between all adjacent qubits are traversed. Singular value decomposition is performed at each location to obtain singular values. The local von Neumann entanglement entropy is calculated, and finally, the summation is performed to obtain the updated global von Neumann entanglement entropy of the matrix product state. .
[0069] S62. Subtract the global von Neumann entanglement entropy of the system before applying the two-qubit quantum gate from the global von Neumann entanglement entropy after applying it to obtain the difference. This difference is the reward signal for the current time step. The calculation formula is as follows: .
[0070] S63. Output the calculated difference as a reward signal. Reward signal It is a real number. If the difference is positive, it indicates that the applied two-qubit quantum gate successfully reduced the global entanglement level of the system, and the reward signal is positive; if the difference is negative, it indicates that the global entanglement increased after the gate was applied, and the reward signal is negative. This reward signal will be stored and used in step S7 to update the parameters of the trainable tensor network and the weights of the preset deep learning model.
[0071] Among them, the system-wide von Neumann entanglement entropy is a scalar indicator that measures the degree of total entanglement in a many-body quantum state, denoted as . For a given The global von Neumann entanglement entropy of a one-dimensional quantum state consisting of qubits is defined as the sum of the local von Neumann entanglement entropies at the split points between all adjacent qubits, i.e. Among them, the local von Neumann entanglement entropy Based on the Schmidt coefficient at this split point The calculation formula is as follows: The greater the global von Neumann entanglement entropy of the system, the higher the overall degree of entanglement of the quantum state; the smaller the entropy value, the closer the quantum state is to the direct product state.
[0072] The reward signal is a scalar feedback value used in reinforcement learning to evaluate the quality of an agent's chosen action, denoted as . subscript The time step is indicated. In this invention, the reward signal is defined as the difference between the system-wide von Neumann entanglement entropy of the current matrix product state before applying the two-bit quantum gate and the system-wide von Neumann entanglement entropy of the updated matrix product state after the application, i.e. A positive reward signal indicates that the selected action successfully reduced system entanglement, encouraging the agent to choose similar actions in future similar states; a negative reward signal indicates that the selected action increased system entanglement, and the agent should avoid such actions. This reward signal directly drives the update of the tensor reinforcement learning agent's parameters, enabling the agent to gradually learn to select the most efficient unentanglement gate insertion position.
[0073] S7. Store the experience tuples into the experience replay pool. The experience tuples include the current matrix product state, the selected action, the reward signal, and the updated matrix product state. Randomly sample at least one experience tuple from the experience replay pool, and use the reward signal in the sampled experience tuples to update the trainable tensor network parameters and the weights of the preset deep learning model. The specific implementation process is as follows: S70, at the current time step After completing the reward signal calculation, collect the following four data points from the system: current matrix product state. The action selected in step S3 The reward signal calculated in step S6 and the updated matrix product state obtained in step S5 These four data points are combined into an empirical tuple, denoted as . .
[0074] S71. A fixed-capacity queue is pre-allocated in the memory of a classical computer as an experience replay pool, denoted as... The constructed experience tuples are pushed into the experience replay pool in chronological order. At the end of the queue. When the number of experience tuples stored in the experience replay pool reaches the preset maximum capacity, the oldest experience tuple at the head of the queue is removed every time a new experience tuple is stored, so as to keep the total amount of experience replay pool from exceeding the maximum capacity.
[0075] S72. Whenever it is necessary to update the parameters of the trainable tensor network and the weights of the preset deep learning model, retrieve the data from the experience replay pool. A small batch of empirical tuples is randomly selected uniformly from the data, and the size of the small batch is denoted as . (For example Each selected experience tuple They are drawn independently and with equal probability from the experience replay pool. The drawing process does not change the contents of the experience tuples originally stored in the experience replay pool, and the drawn experience tuples are still retained in the experience replay pool for subsequent sampling.
[0076] S73. Update the trainable tensor network parameters and the weights of the preset deep learning model using the reward signal from the sampled empirical tuples. For each empirical tuple in the sampled mini-batch, first use the current trainable tensor network parameters... and preset deep learning models Calculate the current matrix product state respectively The predicted action value for each action, and the updated matrix product state. The predicted action value for each action is calculated. Then, the target action value for each empirical tuple is calculated using a temporal difference algorithm. The temporal difference algorithm then calculates the reward signal. Add the discount factor and the maximum predicted action value in the updated matrix product state, and use it as the current action. The target action value is calculated. The difference between the target action value and the currently predicted action value is used as the temporal difference error. For all empirical tuples in a mini-batch, the sum or mean of the squares of the temporal difference errors is calculated as the loss function. Finally, the loss function with respect to the trainable tensor network parameters is calculated using the backpropagation algorithm. and preset deep learning models The gradients of all weight parameters are calculated, and the values of these parameters are updated synchronously using a gradient descent optimizer (such as Adam). This process is repeated several times until the trainable tensor network parameters and the weights of the preset deep learning model converge or the preset number of update steps are reached.
[0077] In reinforcement learning, an empirical tuple is a data structure that stores all relevant information about a single interaction. In this invention, an empirical tuple consists of four parts: the current matrix product state... The selected action Reward signals and the updated matrix product state Experience tuples record all the information about an agent receiving a reward and transitioning to a new state after performing an action in a certain environmental state, providing training samples for subsequent parameter updates.
[0078] The experience replay pool is a finite-capacity queue used to store historical experience tuples, denoted as . During reinforcement learning training, each interaction with the environment generates experience tuples that are pushed into the experience replay pool. When the experience replay pool is full, the earliest stored experience tuple is discarded. By randomly sampling small batches of experience tuples from the experience replay pool for parameter updates, the correlation between experience tuples in consecutive time steps can be broken, improving training stability and sample utilization efficiency.
[0079] Among them, the weights of the preset deep learning model refer to the weights that constitute a multi-layer fully connected neural network. All trainable parameters, including the connection weight matrix between neurons in each layer and the bias term for each neuron, are assigned random values during initialization and are subsequently updated continuously during reinforcement learning training via backpropagation and gradient descent algorithms. The values of the weights determine the specific way the pre-defined deep learning model maps the input low-dimensional feature vector to the output predicted action value, and are the core carrier of the agent's decision-making ability.
[0080] S8. Determine whether the system-wide von Neumann entanglement entropy of the updated matrix product state is lower than a preset threshold. If yes, proceed to step S9; otherwise, use the updated matrix product state as the current matrix product state and return to step S2. The specific implementation process is as follows: S80. Obtain the updated system global von Neumann entanglement entropy of the matrix product state. The updated matrix product state is obtained in step S5. Then, following the method for calculating the global von Neumann entanglement entropy of the system in step S6, the following steps are performed: Each adjacent split position Perform singular value decomposition to obtain the singular values at each position. Calculate the local von Neumann entanglement entropy at each location. Then, summing all the local entropies yields the system's global von Neumann entanglement entropy. .
[0081] S81. Read a pre-set minimum constant threshold, denoted as... This threshold is a positive real number, for example, 0.01, representing the upper limit of the allowed residual entanglement entropy. The specific value of the threshold is determined before training based on the required precision of the target quantum state preparation and computational resource constraints.
[0082] S82. Determine whether the system's global von Neumann entanglement entropy after the updated matrix product state is lower than a preset threshold. (The calculated value is missing from the original text.) With the preset threshold for reading Compare. If If the condition is met, it means that the intrinsic entanglement of the target quantum state has been basically removed, and the currently updated matrix product state has approximately degenerated into an unentangled direct product state. At this time, step S9 is executed to end the deentanglement cycle and generate the quantum state preparation circuit. If the condition is not met, it means that the system still contains non-negligible entanglement and needs to continue the de-entanglement operation.
[0083] S83. When the judgment condition is not met, return to step S2. This operation specifically includes the following sub-steps: ① Update the result using the parameters completed in step S7. In step S7, at least one empirical tuple has been randomly sampled from the empirical replay pool, and the trainable tensor network parameters have been updated using the reward signal through the temporal difference algorithm and backpropagation. and preset deep learning models weight At this point, all trainable parameters within the tensor reinforcement learning agent have been optimized. ② The updated matrix product state... Assigning the value to the current matrix product state variable, that is, letting and release the original Storage space occupied. The third sub-step: index the current time step. Increase by 1, i.e., execute. ③ Jump to the beginning of step S2 and continue execution, using the updated trainable tensor network parameters. and updated preset deep learning model weights Perform feature extraction and action decision-making in a new loop. Repeat the above process until the judgment condition in step S8 is met, then exit the loop and execute step S9.
[0084] S9. Record all applied unentangled two-qubit quantum gates and their optimal parameters to form an unentangled gate sequence, and generate a quantum state preparation circuit based on the unentangled gate sequence.
[0085] This involves recording all applied unentangled two-qubit quantum gates and their optimal parameters to form an unentangled gate sequence. The specific implementation process is as follows: After determining in step S8 that the system's global von Neumann entanglement entropy of the updated matrix product state is lower than a preset threshold, the de-entanglement loop terminates. At this point, each two-qubit quantum gate and its corresponding optimal parameters recorded throughout the entire de-entanglement process are sequentially extracted from the classical computer's memory in the order of application time. Specifically, for the time steps from the first time step to the final time step... Each unentanglement operation will have optimal parameters. Two-qubit quantum gate Arranged in chronological order, forming a sequence of unentanglement gates. subscript Indicates the order in which they are applied. The total number of unentangled two-qubit quantum gates applied.
[0086] The quantum state preparation circuit, based on the deentanglement gate sequence, includes: The unentangled gate sequence is reversed, and the conjugate transpose of each two-qubit quantum gate after reversal is taken to generate a quantum state preparation circuit. The specific implementation process is as follows: Deentanglement gate sequence The gate order is completely reversed; that is, the gate that was originally applied first becomes the last, and the gate that was originally applied last becomes the first. The gate sequence after reversing the order is represented as follows: Then, take the conjugate transpose of each two-qubit quantum gate after inversion. This process is repeated for each two-qubit quantum gate in the inverted gate sequence, performing the conjugate transpose operation on each gate matrix, denoted as... The specific calculation of the conjugate transpose is as follows: first, take the complex conjugate of each element in the matrix, and then transpose the matrix. For the nth element after reversing... Each door Its conjugate transpose is denoted as After this operation, the gate sequence after reversal becomes... The obtained conjugate transpose gate sequence is directly used as the quantum state preparation circuit. ,Right now The circuit operates in a sequence from left to right: first, it applies... Then apply And so on, finally applying The circuit output is saved and used to subsequently act on the initial all-zero state to prepare the target quantum state.
[0087] Among them, the unentangled two-qubit quantum gate refers to the adjacent two-qubit quantum gate actually applied to the current matrix product state after the tensor reinforcement learning agent selects the position and optimizes the parameters through nested optimization during the entire unentanglement process. Each unentangled two-qubit quantum gate has an optimal parameter obtained through independent optimization. Their function is to reduce the global von Neumann entanglement entropy of the system between selected pairs of adjacent qubits. These gates are recorded in the order in which they are applied, forming a sequence of unentanglement gates.
[0088] Here, the optimal parameter refers to the parameter value obtained by gradient descent optimization for each deentangled two-qubit quantum gate, with the objective of minimizing the global von Neumann entanglement entropy of the system after applying the gate, denoted as . The optimal parameters are generally different for different unentangled two-qubit quantum gates. The optimal parameters are recorded along with the corresponding gate and used as parameters of the gate matrix during reverse engineering.
[0089] The unentanglement gate sequence refers to the set of all unentangled two-qubit quantum gates and their optimal parameters, recorded sequentially according to the application time order throughout the unentanglement process, denoted as... The gates in this sequence start from the initial target quantum state, gradually strip away the entanglement, and eventually cause the quantum state to degenerate into an approximately direct product state.
[0090] Among them, the quantum state preparation circuit refers to the quantum circuit obtained by reversing and conjugate transposing the unentangled gate sequence, denoted as... Apply the circuit to the initial all-zero state. The resulting quantum state is theoretically close to the original target quantum state. The quantum state preparation circuit is the final output of this invention and can be directly deployed on quantum hardware for execution.
[0091] Following S9 are: Two parameterized single-qubit quantum gates are added to the end of the quantum state preparation circuit. These two parameterized single-qubit quantum gates include a rotation gate around the Z-axis and a rotation gate around the Y-axis. The circuit with the added gates is used as the complete preparation circuit. Using the fidelity between the quantum state generated by the complete preparation circuit acting on the initial all-zero state and the target quantum state as the objective function, all parameters in the complete preparation circuit are globally and jointly optimized to obtain the optimized quantum state preparation circuit. The specific implementation process is as follows: 1) In quantum state preparation circuit Add a parameterized single-bit quantum gate to the far right (i.e., the end of the circuit), this layer is composed of A revolving door around the Z-axis Composition, in which Index representing a qubit For the first The continuous angular parameters of a revolving door. The revolving door on this floor is represented as... The order of action is that a rotation gate around the Z-axis is applied independently to each qubit.
[0092] 2) To the right of the added Z-axis rotation gate layer, add another layer of parameterized single-qubit quantum gates, this layer consisting of... A revolving door around the Y-axis composition, For the first The continuous angular parameters of a revolving door. The revolving door on this floor is represented as... These two parameterized single-qubit quantum gates are arranged according to the following... After layer The sequential combination of layers forms the compensation operator. ,in and These represent the angular parameter vectors of all rotating doors around the Z-axis and the Y-axis, respectively.
[0093] 3) Prepare the circuit for the original quantum state. With compensation operator By connecting them in series, a complete fabrication circuit can be obtained. ,in This represents the set of all parameters in the complete fabrication circuit, including the optimal parameters of the two-qubit quantum gate in the original quantum state fabrication circuit. And the newly added single-bit rotating door angle parameter The complete fabrication circuit will serve as the target for subsequent global optimization.
[0094] 4) The objective function is the fidelity between the quantum state generated by the complete fabrication circuit acting on the initial all-zero state and the target quantum state. The complete fabrication circuit... Acting on the initial all-zero state The prepared quantum state is obtained above. The objective function is defined as fidelity. That is, the quantum state prepared With the target quantum state in step S1 The fidelity between them is calculated using the following formula: Fidelity is a real number between 0 and 1. The larger the value, the closer the prepared quantum state is to the target quantum state.
[0095] 5) Perform global joint optimization of all parameters in the complete fabrication circuit to obtain the optimized quantum state fabrication circuit, maximizing fidelity. To achieve this, variational optimization algorithms (such as the Adam optimizer) are invoked on a classical computer to optimize all parameters of the fully fabricated circuit. Perform joint iterative optimization. In each iteration, calculate the fidelity between the quantum state output by the fully fabricated circuit and the target quantum state under the current parameters, and calculate the gradient of the fidelity with respect to each parameter (using the parameter translation rule or automatic differentiation). Then, update the parameter values according to the gradient ascent direction. Repeat this iterative process until the fidelity converges to the maximum value or the preset maximum number of iterations is reached. After optimization, obtain all the final optimal parameters. Substitute into the complete fabrication circuit This means obtaining the optimized quantum state preparation circuit. This circuit is the final output quantum circuit capable of preparing the target quantum state with high fidelity.
[0096] Among them, the rotation gate around the Z-axis is a single-qubit quantum gate, denoted as Its function is to rotate the Bloch sphere about the Z-axis by an angle. The matrix form of this gate is: ,in These are continuous real-valued angle parameters. In this invention, a single-layer rotating door revolves around the Z-axis. This indicates that a rotation gate around the Z-axis is applied independently to each qubit, and the angular parameters of each qubit are... They are independent of each other.
[0097] Among them, the rotation gate around the Y-axis is a single-qubit quantum gate, denoted as Its function is to rotate the Bloch sphere about the Y-axis by an angle. The matrix form of this gate is: ,in These are continuous real-valued angular parameters. In this invention, a single-layer rotating door revolves around the Y-axis. This indicates that a rotation gate around the Y-axis is applied independently to each qubit, and the angular parameters of each qubit are... They are independent of each other.
[0098] The compensation operator refers to a parameterized single-bit gate sequence consisting of a series of rotating gates around the Z-axis and a rotating gate around the Y-axis, denoted as . The operator was added to the primordial quantum state preparation circuit. The end of the process is used to correct residual deviations caused by the discrete action space limitations and truncation approximation during the unentanglement process, thereby improving the fidelity between the final prepared quantum state and the target quantum state.
[0099] The problem of preparing the target matrix product state (i.e., MPS state) is transformed into a de-entanglement problem: starting from the target state, continuously eliminating entanglement by inserting adjacent two-bit gates with parameters layer by layer until it degenerates into a direct product state. Finally, the de-entanglement circuit is reversed, and a local phase and amplitude compensation mechanism is introduced for global parameter fine-tuning to obtain the state preparation circuit, which specifically includes: 1) Construction of environment state and action space: ① Real-time state of reinforcement learning environment It is always stored in matrix product state (MPS) with fixed truncation key dimensions. Initial state This refers to the complex target quantum state to be prepared. ② The agent's action space is a discrete action space (one-dimensional discrete position index). .action Indicates the first and Insert a parameterized adjacent two-qubit quantum gate between each qubit. .
[0100] 2) Reinforcement Learning Feature Extraction and Decision Making Based on Tensor Reinforcement Learning Architecture: ① An action value (Q-value) evaluation architecture based on tensor networks is adopted. A tensor reinforcement learning agent (TRL agent) contains a trainable tensor network parameter (trainable MPS tensor) with variational parameters. And a pre-defined deep learning model (fully connected neural network) ② For the current matrix product state (MPS state) Calculate its relationship with the parameters of the trainable tensor network. The inner product (tensor contraction) is used to extract low-dimensional feature vectors. These feature vectors are then input into a pre-defined deep learning model. The network outputs the predicted action value for each action position. The intelligent agent, according to A greedy exploration strategy, combined with Q-value distribution, selects the optimal gate insertion position. That is, to decide on the first and The next step of deentanglement is applied between the qubits.
[0101] 3) Nested parameter optimization and entangled entropy reward feedback: ① When the agent selects a position Then, before calculating the reward, the system is in position Instantiate a parameterized two-bit quantum gate (two-bit gate) The objective function is to minimize the global von Neumann entanglement entropy of the system after applying the gate. Gradient descent is then used to apply the gradient descent algorithm to continuous parameters. Perform independent optimization to find the optimal parameters that minimize entanglement. ② The optimized door Acting on The tensor network is truncated using Singular Value Decomposition (SVD) to update and obtain a new state. ③ The reward is defined as the difference in global von Neumann entanglement entropy between two adjacent steps: If the gate operation successfully reduces the overall entanglement, a positive reward is given; otherwise, a negative reward is given. This reward is used to update the network parameters of the tensor reinforcement learning agent (including the parameters of the trainable tensor network and the weights of the pre-set deep learning model).
[0102] 4) As the loop iterates, when the global von Neumann entanglement entropy of the system increases... When the value falls below a preset threshold, deentanglement terminates. At this point, the multi-body state has approximately degenerated into an unentangled direct product state. Specifically, ① the deentanglement gate sequence generated throughout the process is extracted. ② The algorithm reverses the sequence and takes the conjugate transpose of each gate to compile the final quantum state preparation circuit. ③ After completing the construction of the unentangled topology, the discrete action space cannot perfectly cover the continuous Hilbert space, resulting in residual deviations between the approximately degenerate direct product state and the ideal all-zero state. Therefore, in Based on this (usually located at the end of the circuit, i.e. the beginning of the original unentanglement process), two layers of parameterized single-qubit quantum gates are added, one of which is a rotation gate around the Z-axis. (1st floor), the first floor is a revolving door around the Y-axis ( These two layers constitute the compensation operator. This makes the evolution operator of the complete fabrication circuit become ,in It includes all two-bit gate parameters and the newly added single-bit gate angle. ④ The complete fabrication circuit is constructed as follows. Quantum states generated by acting on the initial all-zero state With the target state The fidelity between them is the objective function: Using classical variational optimization algorithms (such as Adam), all parameters in the circuit are evaluated. Global joint optimization (end-to-end global joint optimization) is performed. By maximizing fidelity, errors caused by local optimization and topological constraints are compensated, thereby making the final prepared quantum state highly close to the target state.
[0103] Figure 2 This paper illustrates the overall architecture of a quantum state preparation method based on tensor reinforcement learning and inverse deentanglement according to the present invention. It constructs a two-layer nested execution flow of "outer layer finding gate positions, inner layer optimizing gate parameters." Figure 3 and Figure 4 This invention demonstrates the network principles of Tensor Reinforcement Learning (TRL) agents for dimensionality reduction feature extraction and action value evaluation, as well as the mechanism of reverse engineering the forward deentanglement gate sequence into the final quantum state preparation circuit. The specific implementation steps of this invention are detailed below: S100, Environment State Initialization and Action Space Encoding, specifically includes: S101. Target State Data Loading and Transformation: The algorithm receives the target quantum many-body state data to be prepared and transforms it into a matrix product state (MPS) data structure, which is denoted as the initial state of the reinforcement learning environment. .
[0104] S102. Definition of Discrete Action Space: Establish a space of size... A one-dimensional discrete action space, each action instruction Corresponding to a spatial index , representing the first The and the first A deentangled two-qubit quantum gate is inserted between the local tensors corresponding to each qubit.
[0105] S200: Feature extraction and location decision-making for agents based on tensor reinforcement learning, such as Figure 3 As shown, since traditional deep neural networks cannot read high-dimensional quantum states, the algorithm triggers a tensor reinforcement learning agent (TRL agent) to perform dimensionality reduction perception and decision-making, specifically including: S201, Tensor Shrinkage Dimensionality Reduction Operation: Extracting the Current Environment State This is compared with the trainable tensor network parameters (trainable tensors) inside the tensor reinforcement learning intelligent body. Perform tensor shrinkage operation to extract the overlap vector between the two.
[0106] S202, Feature Normalization: Take the natural logarithm of the above overlap vector and divide it by... Generate low-dimensional classical feature vectors .
[0107] S203, Action Value Network Forward Propagation: Transforming Low-Dimensional Features The input is fed into the agent's pre-defined deep learning model (multi-layer fully connected neural network). ), output a list containing A score vector of elements, each element representing the expected action value of inserting a deentangled two-qubit quantum gate at the corresponding position.
[0108] S204, Door Position Action Decision: Based on - Greedy exploration strategy, selects the index of the position with the highest score from the score vector. This is the selected location for inserting the physical gate.
[0109] S300, nested low-level continuous parameter optimization and environment evolution, specifically includes: S301, Virtual Double-Bit Gate Instantiation: In position Construct a continuous parameter with initial parameters Parametric two-qubit quantum gate matrix .
[0110] S302, Classical Gradient Descent Optimization: Invoke the classical optimizer and set the objective cost function to the system-wide von Neumann entanglement entropy of the system after applying the virtual gate. Continuously fine-tuning parameters within a classic computer. The goal is to minimize the cost function until the optimal parameters are obtained.
[0111] S303, Applying a Real Physics Gate and Truncating Singular Value Decomposition: This involves applying the confirmed optimal gate. Apply to the current state On the corresponding local tensor. Then, Singular Value Decomposition (SVD) is immediately performed on the merged tensor, retaining only the first... The largest singular value. This step completes the environment state to The precise evolution of the matrix multiplication state is maintained while a strict matrix multiplication state structure is preserved.
[0112] S400: Entanglement entropy reward settlement and model training update, specifically including: S401, Physical Reward Calculation: Based on the singular values updated in S303, recalculate the full-chain entanglement entropy and calculate the entanglement decrease caused by the current step operation: This value serves as a reward signal fed back to the tensor reinforcement learning agent.
[0113] S402, Experience Replay and Network Synchronization Update: The generated experience tuples are pushed into the experience replay pool. Through random batch sampling and temporal difference algorithms, backpropagation is used to synchronously update the parameters of the trainable tensor network inside the intelligent body. With preset deep learning models Weights.
[0114] S500, termination determination and reverse compilation generation, specifically include: S501, Global Termination Condition Monitoring: System-wide Von Neumann Entanglement Entropy for Real-Time Detection of Environmental Status .when Below the threshold of the minimum constant When the threshold is reached (i.e., the intrinsic entanglement of the target state is completely stripped away), the iteration cycle of S200-S400 is terminated.
[0115] S502. Unentangled Sequence Extraction: Extract all the optimal unentangled gate sequences recorded in memory in chronological order. .
[0116] S503, Reverse Conjugate Transpose Compilation: (e.g.) Figure 4 As shown, the order of the deentanglement gate sequence is completely reversed, and the conjugate transpose operation is performed on each gate matrix in the sequence. The final quantum state preparation circuit is then compiled and output. .
[0117] The pseudocode for the execution logic of this invention demonstrates a complete deentanglement and reverse compilation training, as follows: Input: MPS representation of the target state Number of qubits Maximum circuit depth Entanglement entropy stopping threshold Network weight Output: Target state preparation circuit 1: Initialization: Tensor network parameters of the TRL agent and neural network weights 2: Initialization: Experience Replay Pool 3: for episode = do 4: 5: 6: for do 8: 9: Output vector ,use Strategy selection of insertion position action 10: Initialization is located at Adjacent two-qubit quantum gate 11: Define the loss function 12: 13: 14: 15: 16: 17: Empirical tuples deposit 18: From Randomly sample small batches of data and update and 19: if then 20: break 21: end if 22: end for twenty three: 24: for down to do 25: 26: end for 27: end for 28: return This invention employs the following ground-state model of a one-dimensional spin Hamiltonian for numerical experiments: The range of parameters used during the training phase is... , Before training begins, 2000 training samples, representing different initial matrix product states, are generated uniformly and randomly within the parameter range. After training begins, one initial matrix product state is randomly selected from the sample pool as the target state for unentanglement in this training iteration. The experiment consists of 5000 training iterations, with a maximum allowed number of steps of 80 per iteration and a preset threshold. Set to 0.01. After training, perform training range region testing, near-domain generalization testing, and critical region generalization testing on the model. The experimental results are as follows: Figures 5 to 7 As shown, specifically: Figure 5 This indicates that the model has a good fit within the training parameter range. The average fidelity across all test points is 0.9939, indicating that the model has learned the unentanglement rules within the training domain quite well. The highest value is 0.997 and the lowest is 0.983, with very small overall fluctuations and only a slight performance degradation in the lower left region.
[0118] from Figure 6 It can be seen that the model maintains strong generalization ability in the vicinity of the training interval. The average fidelity in this region is 0.9932, which is very close to 0.9939 within the training range, indicating that the model does not exhibit significant degradation during near-domain extrapolation. Of the 120 test points, approximately 85.8% have a fidelity of not less than 0.99, indicating that the overall performance remains excellent. In terms of distribution, the lower-performing points are mainly concentrated in the lower left region, while as the parameters increase, the fidelity mostly stabilizes around 0.995, demonstrating the model's good robustness to parameter perturbations near the training domain.
[0119] Figure 7 These are the results of the generalization test in the critical region. The model's performance degrades slightly near the critical point, but it still maintains a certain level of effectiveness. The average fidelity in this region is 0.9727, slightly lower than the training range and the near-field generalization region, because deentanglement is more difficult in the critical region. Nevertheless, 95% of the 100 test points still have a fidelity of not less than 0.95, indicating that the model can still achieve high-quality reconstruction on most critical region samples.
[0120] comprehensive Figures 5 to 7 The results show that the trained 20-bit Ising model has achieved high-precision and stable deentanglement within the training domain. In near-field tests adjacent to the training interval, the average fidelity hardly decreased, indicating that the model has strong local generalization ability. Near the critical region, although the overall fidelity drops to 0.9727 due to the more complex entanglement structure and greater difference from the training distribution, most test points still maintain above 0.95, indicating that the model still has good cross-region adaptability. Overall, the experimental results verify that the tensor reinforcement learning deentanglement model constructed in this invention can not only effectively fit quantum states within the training parameter range, but also generalize to a certain extent beyond the training domain, especially exhibiting strong robustness and generalization in non-critical regions.
[0121] The technical terms involved in this invention are explained as follows: 1) The specific form of the matrix product state (MPS) and its Schmidt decomposition: For a given The one-dimensional quantum many-body pure state composed of qubits can be expanded into its full-wave function under a computational basis as follows: ,in, Indicates the first The physical state of a qubit. Coefficient tensor. Include The presence of multiple complex components leads to an exponential "curse of dimensionality" when directly storing and computing on classical computers.
[0122] 2) Specific form of Matrix Product State (MPS): To solve the curse of dimensionality, Matrix Product State (MPS) transforms this massive global tensor... It is decomposed into a matrix product of a series of local tensors. Specifically, MPS re-expresses the wavefunction as: Here, for each quantum bit in the system and each of its physical states Each corresponds to a local matrix. (Under the open boundary condition, the two ends) and These are row vectors and column vectors, respectively, so that the final result of their multiplication is a scalar. The common internal dimension of these adjacent matrices when multiplying is called the bond dimension (denoted as ). By limiting the maximum key dimension MPS successfully reduced the number of system parameters from an exponential level. Significantly compressed to polynomial level .
[0123] 3) Physical connection with Schmidt decomposition: The mathematical structure of MPS, which involves the product of adjacent matrices, physically corresponds directly to the Schmidt decomposition of quantum entanglement. If we are at any adjacent qubit position... and Between (i.e., the first) The system is divided into the left half by a key. and the right half Using singular value decomposition (SVD), this global quantum state can be expanded as follows: ,in, and The orthogonal basis of the left and right subsystems are respectively The singular values (i.e., Schmidt coefficients) at this split point satisfy the normalization condition. In this image, the key dimension of MPS Physically, this represents the number of maximum Schmidt values retained during SVD truncation. These singular values... The subsystem is fully and directly coded. and The quantum entanglement information between them forms the absolute foundation for calculating the von Neumann entanglement entropy and reinforcement learning reward signal in this invention.
[0124] 4) Von Neumann entanglement entropy: at the cleavage point Location, subsystem The reduced density matrix is defined as The local von Neumann entanglement entropy here. The singular values can be calculated using the Schmidt decomposition: .
[0125] 5) Global Entanglement Entropy: To assess the global entanglement level of a many-body quantum chain, the full-chain von Neumann entanglement entropy is defined. As a core physical indicator for the growth of unentangled circuits: .
[0126] This invention provides a complete technical solution to address key challenges in quantum state preparation, and achieves the following beneficial effects: 1) This invention transforms the traditional forward state preparation process, which lacks a guiding signal, into a reverse deentanglement process that starts from the target quantum state and continuously reduces the global von Neumann entanglement entropy of the system by inserting deentangled two-qubit quantum gates layer by layer. The decrease in entanglement entropy has a clear physical gradient, providing a natural reward signal for reinforcement learning. This avoids the problem of getting trapped in local optima due to the highly non-convex cost function in forward circuit search, significantly improving the success rate and convergence speed of circuit search.
[0127] 2) The circuit structure is entirely driven by the intrinsic entanglement distribution of the target quantum state. The tensor reinforcement learning agent adaptively selects the most efficient entanglement-stripping position through the reward signal, inserting two-qubit quantum gates only at positions closely related to the entanglement structure of the target state. The generated quantum state preparation circuit consists of the simplest two-qubit quantum gates, eliminating a large number of redundant operations and resulting in an extremely shallow circuit depth. Simultaneously, all gate operations operate on adjacent qubit pairs, perfectly matching the physical constraints of qubit proximity connectivity in noisy medium-scale quantum devices, facilitating direct deployment.
[0128] 3) This invention employs matrix product states as a compact representation of the environment state and uses trainable tensor network parameters as the feature extraction front-end for the reinforcement learning agent. Through tensor contraction operations, exponentially dimensional quantum state information is compressed into low-dimensional feature vectors, avoiding the exponential dimensionality explosion caused by the reliance on full-wave function input in traditional deep reinforcement learning. The computational complexity of the entire method increases linearly with the number of qubits, enabling the design of automated quantum state preparation circuits to be directly applied to large-scale complex systems with real-world physical significance, breaking through the scalability bottleneck of existing methods in terms of the number of qubits.
[0129] 4) After the discrete deentanglement gate sequence is reverse-engineered into a quantum state preparation circuit, this invention adds two layers of parameterized single-qubit quantum gates (one rotation gate around the Z-axis and one rotation gate around the Y-axis) at the end of the circuit to form a compensation operator. Then, using the fidelity between the quantum state output by the complete preparation circuit and the target quantum state as the objective function, a global joint optimization is performed on all double-qubit gate parameters and the angle of the newly added single-qubit gates in the circuit. This error compensation mechanism effectively eliminates the residual bias accumulated during the deentanglement process due to the limitations of the discrete action space and the singular value decomposition truncation, significantly improving the fidelity between the finally prepared quantum state and the target quantum state.
[0130] In the above embodiments, although the steps are numbered S1, S2, etc., they are only specific embodiments given by the present invention. Those skilled in the art can adjust the execution order of S1, S2, etc. according to the actual situation. The scheme after adjusting the order is also within the protection scope of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.
[0131] like Figure 8 As shown, an embodiment of the present invention provides a quantum state preparation system based on tensor reinforcement learning and inverse deentanglement, comprising a conversion definition initialization module, a first generation module, an output selection module, an optimal parameter acquisition module, an update module, a calculation module, a sampling module, a judgment and processing module, and a second generation module. The conversion definition initialization module is used to: obtain the target quantum state to be prepared, convert the target quantum state into a matrix product state, and define a discrete action space, wherein each action in the discrete action space corresponds to the position index of an adjacent pair of qubits; initialize a tensor reinforcement learning agent, wherein the tensor reinforcement learning agent includes initialized trainable tensor network parameters and initialized preset deep learning model; The first generation module is used to: at the current time step, generate a low-dimensional feature vector based on the current matrix product state and the parameters of the trainable tensor network; wherein, at the first time step, the current matrix product state is the matrix product state obtained by the transformation definition initialization module; The output selection module is used to: input the low-dimensional feature vector into the preset deep learning model, output the predicted action value of each action in the discrete action space, and select an action from the predicted action values according to the exploration strategy, wherein the action represents inserting a deentangled two-bit quantum gate between the selected adjacent quantum bit pairs; The optimal parameter acquisition module is used to: instantiate a parameterized two-qubit quantum gate at the selected adjacent qubit pair position, and independently optimize the parameters of the two-qubit quantum gate with the goal of minimizing the global von Neumann entanglement entropy of the system after applying the two-qubit quantum gate, so as to obtain the optimal parameters. The update module is used to: update the current matrix product state according to the two-bit quantum gate with the optimal parameters, so as to obtain the updated matrix product state; The computing module is used to: calculate the difference between the system-wide von Neumann entanglement entropy of the current matrix product state before applying the two-bit quantum gate and the system-wide von Neumann entanglement entropy of the updated matrix product state after applying the gate, as a reward signal; The sampling module is used to: store experience tuples into an experience replay pool, the experience tuples including the current matrix product state, the selected action, the reward signal, and the updated matrix product state; randomly sample at least one experience tuple from the experience replay pool, and use the reward signal in the sampled experience tuples to update the trainable tensor network parameters and the weights of the preset deep learning model; The judgment and processing module is used to: determine whether the system-wide von Neumann entanglement entropy of the updated matrix product state is lower than a preset threshold; if so, call the transformation definition initialization module; if not, take the updated matrix product state as the current matrix product state and call the output selection module, the optimal parameter acquisition module, the update module, the calculation module, and the sampling module. The second generation module is used to: record all applied unentangled two-qubit quantum gates and their optimal parameters to form an unentangled gate sequence, and generate a quantum state preparation circuit based on the unentangled gate sequence.
[0132] Optionally, in the above technical solution, the first generation module is specifically used to: at the current time step, perform tensor shrinkage operation on the current matrix product state and the trainable tensor network parameters to extract the overlap vector, normalize the overlap vector, and generate a low-dimensional feature vector.
[0133] Optionally, in the above technical solution, the updating module is specifically used to: apply a two-bit quantum gate with the optimal parameters to the current matrix product state, perform singular value decomposition and truncation on the applied tensor, update the current matrix product state, and obtain the updated matrix product state.
[0134] Optionally, in the above technical solution, the second production module is specifically used to: reverse the order of the deentanglement gate sequence, and take the conjugate transpose of each two-qubit quantum gate after the reverse order to generate a quantum state preparation circuit.
[0135] Optionally, the above technical solution further includes an optimization module, which is used to: add two layers of parameterized single-qubit quantum gates at the end of the quantum state preparation circuit, the two layers of parameterized single-qubit quantum gates including a rotation gate around the Z-axis and a rotation gate around the Y-axis, take the added circuit as a complete preparation circuit, take the fidelity between the quantum state generated by the complete preparation circuit acting on the initial all-zero state and the target quantum state as the objective function, and perform global joint optimization on all parameters of the complete preparation circuit to obtain the optimized quantum state preparation circuit.
[0136] It should be noted that the beneficial effects of the quantum state preparation system based on tensor reinforcement learning and inverse deentanglement provided in the above embodiments are the same as those of the quantum state preparation method based on tensor reinforcement learning and inverse deentanglement described above, and will not be repeated here. Furthermore, the system provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to the actual situation to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, and will not be repeated here.
[0137] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned quantum state preparation methods based on tensor reinforcement learning and inverse deentanglement.
[0138] An embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-mentioned quantum state preparation methods based on tensor reinforcement learning and inverse deentanglement.
[0139] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.
[0140] Those skilled in the art will recognize that this invention can be implemented as a system, method, or computer program product. Therefore, this invention can be specifically implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, this invention can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.
[0141] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for preparing quantum states based on tensor reinforcement learning and inverse deentanglement, characterized in that, include: S1. Obtain the target quantum state to be prepared, convert the target quantum state into a matrix product state, and define a discrete action space, wherein each action in the discrete action space corresponds to the position index of an adjacent pair of qubits; initialize the tensor reinforcement learning agent, wherein the tensor reinforcement learning agent includes initialized trainable tensor network parameters and initialized preset deep learning model; S2. At the current time step, generate a low-dimensional feature vector based on the current matrix product state and the parameters of the trainable tensor network; wherein, at the first time step, the current matrix product state is the matrix product state described in step S1. S3. Input the low-dimensional feature vector into the preset deep learning model, output the predicted action value of each action in the discrete action space, and select an action from the predicted action values according to the exploration strategy. The action represents inserting a deentangled two-bit quantum gate between the selected adjacent quantum bit pairs. S4. Instantiate a parameterized two-qubit quantum gate at the selected adjacent qubit pair position. With the goal of minimizing the global von Neumann entanglement entropy of the system after applying the two-qubit quantum gate, independently optimize the parameters of the two-qubit quantum gate to obtain the optimal parameters. S5. Update the current matrix product state according to the two-bit quantum gate with the optimal parameters to obtain the updated matrix product state; S6. Calculate the difference between the system-wide von Neumann entanglement entropy of the current matrix product state before applying the two-bit quantum gate and the system-wide von Neumann entanglement entropy of the updated matrix product state after applying the gate, and use it as a reward signal; S7. Store the experience tuple into the experience replay pool. The experience tuple includes the current matrix product state, the selected action, the reward signal, and the updated matrix product state. Randomly sample at least one experience tuple from the experience replay pool and use the reward signal in the sampled experience tuple to update the trainable tensor network parameters and the weights of the preset deep learning model. S8. Determine whether the system-wide von Neumann entanglement entropy of the updated matrix product state is lower than a preset threshold. If yes, proceed to step S9; otherwise, take the updated matrix product state as the current matrix product state and return to step S2. S9. Record all applied unentangled two-qubit quantum gates and their optimal parameters to form an unentangled gate sequence, and generate a quantum state preparation circuit based on the unentangled gate sequence.
2. The quantum state preparation method based on tensor reinforcement learning and inverse deentanglement according to claim 1, characterized in that, At the current time step, a low-dimensional feature vector is generated based on the current matrix product state and the trainable tensor network parameters, including: at the current time step, performing tensor shrinkage operation on the current matrix product state and the trainable tensor network parameters to extract the overlap vector, normalizing the overlap vector, and generating a low-dimensional feature vector.
3. The quantum state preparation method based on tensor reinforcement learning and inverse deentanglement according to claim 1, characterized in that, The current matrix product state is updated using a two-bit quantum gate with the optimal parameters to obtain the updated matrix product state, including: A two-bit quantum gate with the optimal parameters is applied to the current matrix product state. Singular value decomposition is performed on the applied tensor and then truncated. The current matrix product state is then updated to obtain the updated matrix product state.
4. The quantum state preparation method based on tensor reinforcement learning and inverse deentanglement according to claim 1, characterized in that, The process of generating a quantum state preparation circuit based on the deentanglement gate sequence includes: reversing the deentanglement gate sequence and taking the conjugate transpose of each two-qubit quantum gate after reversal to generate the quantum state preparation circuit.
5. The quantum state preparation method based on tensor reinforcement learning and inverse deentanglement according to claim 1, characterized in that, Following S9, the method further includes: adding two layers of parameterized single-qubit quantum gates at the end of the quantum state preparation circuit. The two layers of parameterized single-qubit quantum gates include a rotating gate around the Z-axis and a rotating gate around the Y-axis. The circuit with the added gates is used as the complete preparation circuit. The fidelity between the quantum state generated by the complete preparation circuit acting on the initial all-zero state and the target quantum state is used as the objective function. All parameters in the complete preparation circuit are globally jointly optimized to obtain the optimized quantum state preparation circuit.
6. A quantum state preparation system based on tensor reinforcement learning and inverse deentanglement, characterized in that, It includes a conversion definition initialization module, a first generation module, an output selection module, an optimal parameter acquisition module, an update module, a calculation module, a sampling module, a judgment and processing module, and a second generation module; The conversion definition initialization module is used to: obtain the target quantum state to be prepared, convert the target quantum state into a matrix product state, and define a discrete action space, wherein each action in the discrete action space corresponds to the position index of an adjacent pair of qubits; initialize a tensor reinforcement learning agent, wherein the tensor reinforcement learning agent includes initialized trainable tensor network parameters and initialized preset deep learning model; The first generation module is used to: at the current time step, generate a low-dimensional feature vector based on the current matrix product state and the parameters of the trainable tensor network; wherein, at the first time step, the current matrix product state is the matrix product state obtained by the transformation definition initialization module; The output selection module is used to: input the low-dimensional feature vector into the preset deep learning model, output the predicted action value of each action in the discrete action space, and select an action from the predicted action values according to the exploration strategy, wherein the action represents inserting a deentangled two-bit quantum gate between the selected adjacent quantum bit pairs; The optimal parameter acquisition module is used to: instantiate a parameterized two-qubit quantum gate at the selected adjacent qubit pair position, and independently optimize the parameters of the two-qubit quantum gate with the goal of minimizing the global von Neumann entanglement entropy of the system after applying the two-qubit quantum gate, so as to obtain the optimal parameters. The update module is used to: update the current matrix product state according to the two-bit quantum gate with the optimal parameters, so as to obtain the updated matrix product state; The computing module is used to: calculate the difference between the system-wide von Neumann entanglement entropy of the current matrix product state before applying the two-bit quantum gate and the system-wide von Neumann entanglement entropy of the updated matrix product state after applying the gate, as a reward signal; The sampling module is used to: store experience tuples into an experience replay pool, the experience tuples including the current matrix product state, the selected action, the reward signal, and the updated matrix product state; randomly sample at least one experience tuple from the experience replay pool, and use the reward signal in the sampled experience tuples to update the trainable tensor network parameters and the weights of the preset deep learning model; The judgment and processing module is used to: determine whether the system-wide von Neumann entanglement entropy of the updated matrix product state is lower than a preset threshold; if so, call the transformation definition initialization module; if not, take the updated matrix product state as the current matrix product state and call the output selection module, the optimal parameter acquisition module, the update module, the calculation module, and the sampling module. The second generation module is used to: record all applied unentangled two-qubit quantum gates and their optimal parameters to form an unentangled gate sequence, and generate a quantum state preparation circuit based on the unentangled gate sequence.
7. The quantum state preparation system based on tensor reinforcement learning and inverse deentanglement according to claim 6, characterized in that, The first generation module is specifically used to: at the current time step, perform tensor shrinkage operation on the current matrix product state and the parameters of the trainable tensor network to extract the overlap vector, normalize the overlap vector, and generate a low-dimensional feature vector.
8. The quantum state preparation system based on tensor reinforcement learning and inverse deentanglement according to claim 6, characterized in that, The update module is specifically used to: apply a two-bit quantum gate with the optimal parameters to the current matrix product state, perform singular value decomposition and truncation on the applied tensor, update the current matrix product state, and obtain the updated matrix product state.
9. An electronic device, characterized in that, The invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the quantum state preparation method based on tensor reinforcement learning and inverse deentanglement as described in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the quantum state preparation method based on tensor reinforcement learning and inverse deentanglement as described in any one of claims 1 to 5.