WorksPhysics and Astronomy
A machine learning architecture for scaling of holographic quantum circuits
Abstract
We describe an architecture and workflow for learning and generalizing the syntax and parameters of holographic quantum circuits (HQCs), which are natural quantum circuit analogs of classical tensor networks. An HQC uses mid-circuit measurements and resets on a small subset of "physical" qubits whose measurement outcomes become correlated through coupling with a register of persistent "ancilla" qubits, analogous to the physical and bond indices of a tensor network. Hence, an HQC with fixed qubit resources can efficiently generate samples from a large quantum state, and adding qubits to the HQC ansatz has the effect of exponentially increasing the effective bond dimension. Our machine learning approach provides mechanisms for harnessing both features of HQCs by extrapolating the syntax (e.g., a sequence of gates, measurements, and resets) and parameters (e.g., the angles appearing in single-qubit rotations) from a dataset of HQCs to longer or more expressive HQCs. We demonstrate the methodology and its performance on an analytically solvable dataset formed by a vector-valued generalization of the W-state. Finally, we provide an outlook for usage of the methodology for scaling the effective bond dimensions of HQCs in quantum simulation.
Introduction
Over the past decade, quantum computing has seen a rapid surge of progress, driven by the prospect of exponential speed-ups in a variety of domains such as optimization [1], cryptography [2], and high-dimensional many-body simulations [3]. At the same time, advances in scaling of qubit resources and fidelity [4] coupled with the development of feasible quantum error correction protocols [5] have dramatically reshaped the landscape of which is experimentally feasible. Nevertheless, present-day devices remain in the noisy-intermediate-scale-quantum (NISQ) regime [6], where limited qubit connectivity, short coherent times, and imperfect gate operations impose severe constraints on algorithmic performance. A central focus in the NISQ regime has been on variational quantum circuits, in which a classical representation of the quantum circuit is optimized based on feedback from a quantum device. Within this paradigm, one means of moving towards the regime of quantum advantage is to scale the circuit to where it cannot be simulated directly using classical means. A central obstacle to reaching this scale is the lack of an efficient quantum-circuit design strategy that can autonomously learn and scale circuits for simulations with classically-intractable sizes. In this work, we develop such a pipeline utilizing techniques from tensor networks and machine learning, demonstrate its effectiveness in an analytically tractable scenario, and present an outlook for applying it to the problem of scaling variational quantum circuits.
Classical tensor networks (CTNs) describe a large-rank tensor in terms of a contracted network of small-rank tensors, and can realize exponential improvements in storage and computation time compared to a dense tensor representation when the maximum dimension of any contracted index - known as the bond dimension - remains small. CTNs, in particular the one-dimensional CTN structure known as a Matrix Product State (MPS), have had a far-ranging impact on computational quantum science. They have enabled deeper insight into the entanglement and correlation structure of many-body quantum states, as well as forming the underpinning of the most accurate numerical methods for strongly correlated low-dimensional systems, such as the density matrix renormalization group (DMRG) [7].
Beyond classical tensor representations, tensor networks also provide a robust framework for designing parameterized quantum circuits that are resource efficient and implementable with existing quantum hardware. A natural generalization of CTNs to quantum circuits is provided by holographic quantum circuits (HQCs) [8], [9]. HQCs are quantum circuits who utilize mid-circuit measurements and resets on a subset of “physical" qubits, and whose measurement outcomes are correlated through a fixed register of “ancilla" (virtual) qubits, with direct analogies to the physical and bond indices of a CTN. In its most prevalent instantiation, there is a single physical qubit that is measured and reset after each multi-qubit operation with the ancilla register, which reproduces the well-known sequential preparation scheme of an MPS [10]. In this scheme, a single physical qubit suffices to produce samples of an arbitrarily large quantum state, and adding qubits to the HQC ansatz exponentially increases its effective bond dimension.
While HQCs have a clear theoretical scaling advantage over CTNs, methods to directly optimize an HQC on quantum hardware remain much less developed than very robust classical optimization techniques for CTNs like DMRG. The naive approach of starting from a random HQC with random parameters is known to suffer from the “barren plateau" phenomenon, in which the parameter landscape becomes featureless as its dimensionality scales. However, the development of techniques to "compile" an optimized CTN into a HQC for given target hardware provides an opportunity to develop datasets of exemplar HQCs that can then potentially be reasoned over or extrapolated using machine learning (ML), generating new trial HQCs that may be much closer to optimality, and thereby mitigating the barren plateau problem.
ML, in addition to transforming many areas of modern science and industrial practice, has brought forth promising applications for efficient quantum circuit generation. Previous studies have shown that ML architectures such as Reinforcement Learning [11], [12] and Transformers [13] can efficiently design quantum circuits while preserving high state fidelity. However, these approaches don’t directly address the needs of an ML architecture for scaling up HQCs to larger numbers of qubits. Namely, as a quantum state’s dimension is increased, building out its HQC representation requires one to keep track of the following: (1) where to appropriately place each quantum gate, (2) which qubit(s) (physical and/or ancilla) each gate acts on, and (3) when and where to perform measurement and reset operations on the physical qubit all while (4) jointly optimizing the parameters of all single-qubit gates.
In Figure 1, we display our proposed hybrid ML architecture used to efficiently scale up HQCs. Our approach employs a Long Short-Term Memory (LSTM) [14] model and a fine-tuned pre-trained Large Language Model (LLM) with Chain of Thought (CoT) [15] to individually learn and extrapolate each respective feature of an HQC: (1) parameters (e.g. single qubit rotation angles) and (2) syntax (e.g. sequence of gates, measurements, and resets). Then, by inserting the predicted rotation angles into the scaled-up syntax, we obtain a final scaled-up HQC. We stress that in our hybrid ML architecture, the LSTM works strictly with numerical data and the LLM works strictly with syntax, of which we represent in open Quantum Assembly Language (openQASM) [16]. As we will demonstrate, our architecture is capable of learning from a dataset of HQCs up to qubits, then scaling up to HQCs with qubits.

Figure 1. Overview of holographic quantum circuit (HQC) generation workflow. The user supplies a parameter vector (e.g., a classical representation of the state or a collection of quantum circuit parameters ), which is fed into the LSTM model that predicts the required rotation angles for an HQC of qubits. In parallel, a Large Language Model (LLM) generates a "skeleton" of the quantum circuit syntax (e.g., in openQASM). The angle data from the LSTM and the openQASM skeleton from the LLM are merged and post-processed, yielding a complete quantum circuit that directly implements the desired W state on a quantum processor.
It may be argued that perhaps a fine-tuned, pre-trained LLM could be applied towards scaling-up HQCs by simultaneously extrapolating its rotation angle parameters and syntax. While LLMs have seen enormous success in learning natural language syntax and grammatical rules [17], they notoriously struggle with numerical data [18], [19], [20]. Numerical data is critical for defining the single qubit rotation angles in a quantum circuit and avoiding barren plateaus, and any misrepresentation of the rotation angle parameters can significantly change the final quantum state. Therefore, it is natural to decompose the challenge of scaling HQCs into the individual scaling of parameters and syntax, in which separate specialized ML models are assigned to generalize the facets individually.
We benchmark the methodology and performance of our hybrid ML architecture on an analytically solvable dataset formed by a vector-valued generalization of the W state, a well-known entangled state from quantum information theory. The W-state (and our vector-valued generalization) also has the additional property that its minimal bond dimension MPS representation is not translationally invariant even when the state itself is, in contrast to many other states with known MPS representations like the GHZ state [21]. Because of this property, the generalization of W-state HQC representations to longer circuits is non-trivial. We demonstrate that our architecture is capable of scaling up the generalized W state by learning and generalizing an -dimensional vector-to-angles mapping () and the standard W state by extending rotation angles corresponding to an -qubit state to rotation angles of qubit state ().
The paper is organized as follows. In Section 2, we present an analytical construction of the generalized W state with holographic algorithms. In Section 3, we present and justify our proposed hybrid ML architecture used to scale up HQCs. In Section 4, we benchmark our hybrid ML architecture on scaling up the HQC representation of the generalized W state and the standard W state. Finally, we conclude the paper by providing an outlook for the application of our proposed hybrid ML architecture towards achieving large scale quantum simulations.
Analytical Holographic Compilation of the generalized W state
In this section, we present our vector-valued generalization of the W state and an analytic construction of holographic algorithms for its construction on two qubits. Namely, the generalized W state on qubits is defined as
in which is a vector of positive real numbers whose elements sum to 1. Measuring in the computational basis yields the one-hot outcome with probability . When the state reduces to the standard W state. Such a state permits an MPS representation with bond dimension 2. After gauging in left canonical form, the isometries of the MPS are then:
Because each is an isometry, it can be embedded into a unitary acting on a physical qubit and an ancilla qubit:
Using these unitaries, the generalized W state can be constructed as
Consequently, this construction can be interpreted as a sequential quantum circuit acting on a single physical qubit and a single ancilla qubit. The explicit derivation and gate decomposition of for and for is given in Appendix A.
Hybrid Machine Learning Framework
In this section, we describe in detail how our hybrid machine learning framework applied towards scaling holographic quantum circuits (HQCs). Here, the task of scaling HQCs is divided into two parts: (1) scaling parameters and (2) scaling quantum circuit syntax (represented in openQASM). To tackle (1), we implemented a Long Short-Term Memory (LSTM) model [14], and to tackle (2), we implemented a fine-tuned pre-trained Large Language Model (LLM) with Chain of Thought (CoT) [15]. Below, we explain and justify the application of these models towards these scaling problems.
Parameter Generalization
The problem of parameter generalization can be decomposed into two cases.
Case 1: Suppose an -qubit quantum state is described by a classical vector that is mapped to a vector of circuit parameters (e.g., single-qubit rotation angles) . A learning model trained on the mapping for qubits should be able to extrapolate this relationship to quantum states with qubits, i.e., to produce the appropriate rotation-angle vector for any . In other words, the model learns the mapping :
Such a problem is applicable to the generalized W state, whose state is parameterized by a positive, real-valued probability vector with .
Case 2: Suppose an -qubit quantum state is parameterised solely in terms of its quantum circuit parameters within a defined circuit architecture. Then, the model’s task is to take an input that corresponds to an -qubit state and correctly extend it to a parameter vector that describes a state with a larger number of qubits (). In other words, the model learns the mapping :
This problem is applicable to the standard W state because there is an unambiguous definition of the state for any . For the general W state with arbitrary , the scaling of to a longer sequence is ambiguous, and so a direct learning of the scaling up process is ill-defined.
We treat both cases of parameter generalization as a time series forecasting problem, since the known part of the sequence (either or ) can be used to predict its continuation ( for larger qubit counts). Recurrent neural networks (RNNs) are a natural choice for such tasks because they process inputs sequentially while maintaining a hidden state that summarizes all previously seen elements. However, RNNs suffer from the vanishing/exploding-gradient problem which hampers long-range data dependencies, precisely the situation of which the rotation angle of the -th qubit influences that of the -th qubit for . The Long Short-Term Memory (LSTM) model [14] mitigates this issue by augmenting each recurrent cell with three gates (input, forget, output) and an internal memory cell, enabling robust capturing of long-term dependencies in sequential data. Therefore, an LSTM model was chosen to tackle the problem of scaling single qubit rotation angles.
Quantum circuit Syntax Generalization
Large language models (LLMs) have repeatedly shown a remarkable ability to internalize the syntactic and grammatical structure of languages [22]. Moreover, equipping LLMs with Chain-of-Thought (CoT) greatly improves reliability on complex tasks [15]. These two properties make a fine-tuned, pre-trained LLM a natural candidate for generalizing the quantum circuit syntax (i.e., the layout, ordering, and choice of quantum gates in a circuit represented in natural language through openQASM). We stress that the LLM does not interact with the rotation angle parameters; rather, the LLM will only generalize the placement and types of quantum gates and physical qubit measurements & resets. The output of the fine-tuned, pre-trained LLM is an openQASM representation of an HQC “skeleton,” without the rotation angle parameters, see Figure 1.
The prompt-to-answer pipeline is as follows. First, the LLM will be prompted to “Generate an openQASM skeleton of a holographic quantum circuit preparing the W state for Y qubits”. Next, the LLM will use CoT to enumerate the logical steps that define the holographic construction. This includes the number of sites, placement of single qubit rotations, placement of entangling gates, and reset & measurement operations. Since the model is forced to articulate these steps, it is less likely to produce incorrect openQASM code. Finally, following CoT reasoning, the LLM will output the aforementioned openQASM circuit skeleton.
Analytically Solvable Benchmark
We benchmark our hybrid machine learning framework by scaling up the HQC representation of the generalized W state described in § 2. As noted there, this family of states provides simple but non-trivial examples of non-translationally invariant quantum states, all of which can be described by an MPS with the simplest non-trivial bond dimension of 2. The benchmarking will proceed as follows. The first two subsections describe the training and validation of the LSTM towards scaling the rotation angle parameters for the generalized W state (by generalizing mapping) and the standard W state (by extending to longer sequences). The third subsection describes the fine-tuning procedure of a pre-trained LLM with Chain of Thought in producing a openQASM representation of the quantum circuit. Finally, the fourth subsection compares the shot distribution of a generated OpenQASM script for an arbitrary generalized W state against the true distribution using a noiseless quantum circuit simulator.
Scaling rotation angles for the generalized W state
In this section, we describe the application of an LSTM towards scaling up the rotation angles of the generalized W state. Here, the objective of the LSTM is to learn and generalize the mapping where the -th element of is:
which connects the parameterization of the state (through the vector ) with the parameterization of its HQC (through the rotation angles ), see § 2.
Next, we describe the procedure of curating the training and validation sets. Here, we uniformly sampled 1,000 vectors per length for , normalized each such that , then analytically computed the rotation angle vector from each . We then split the dataset into training (2 to 6 lengths) and validation (7 to 15 lengths). Padding up to length 15 was used to account for the variable length with respect to the and vectors. A 2 layer, bidirectional LSTM with hidden size of 64 was employed to learn this mapping. A full description of the model and training hyper parameters can be found in Appendix § 8. The model’s loss function, computed only on the unmasked terms, is the mean squared error (MSE):
Here, is the LSTM-generated -th rotation angle and is the true -th rotation angle.
We now describe the results following training. The top panel of Figure 2 shows the evolution of the training and validation loss over the course of training. The model converges to a final training loss on the order of and a final validation loss on the order of , indicating that the model does not over-fit despite the increase in sequence length. The bottom panel of Figure 2 shows the final per-site angle error distribution, calculated as , over the entire validation set of 7 to 15 qubits. The error mean slightly deviates from 0 as the circuit length increases, but remains on the order of . Such a result confirms that the LSTM robustly reproduces the analytical mapping for sizes never seen during training.

Figure 2. (Top) Training and validation loss plot of the LSTM model learning the generalized W state. As mentioned in the text, the model is learning a mapping from where is a vectorized representation of the generalized W state, and is a vector of single qubit rotation parameters. The model was trained on circuit lengths from 2 to 6, and validated on lengths 6 to 15. (Bottom) All angle error distributions plotted. Here, the LSTM was evaluated on the mapping for circuit lengths 7 to 15 following training of lengths 2 to 6. The mean of each error distribution slightly deviates from 0 as the circuit length increases, but remains on the order of .
The empirical results demonstrate the following: first, the LSTM has implicitly captured the function dependence encoded in Eq. (8), as evidenced in the low final validation loss. Second, despite only being trained on mappings up to 6 lengths, the LSTM provides accurate predictions up to 15 lengths without any architectural change. This key result means that the rapid scale-up of HQC parameters for much larger generalized W states can be achieved by training a model on small-sized examples.
In summary, based on the training and validation loss plots and the angle error distribution plot, we conclude that the LSTM successfully learned and generalized the mapping . This trained surrogate will provide the rotation angle parameters to be combined with an LLM-generated openQASM skeleton.
Scaling rotation angles for the standard W state
In this section, we describe the application of the LSTM towards generalizing the standard (uniform) W state. Here, the objective of the LSTM is different than that of the generalized W state, since there is no reference to the vector but only to the rotation angle vector . Now, the LSTM is tasked to extend an input rotation angle vector corresponding to an -qubit state to a new rotation angle vector for any state with qubits. Here, the -th element of is:
Next, we describe the procedure of curating the training and validation sets. The vector was computed using 1,000 uniformly spaced values of over the interval . Such a construction creates a continuous analog of and artificially produces more training examples for the LSTM. The standard W state dataset was split into training (length of 2 to 6) and validation (length of 7 to 15). In order to present the LSTM with a fixed-length input, the training dataset was broken into overlapping windows of length 60. Identical to the learning of the generalized W state, a 2 layer, bidirectional LSTM with hidden size of 64 was employed to learn this rotation angle extension problem. The model loss function was computed using MSE, shown in Eq. (9). A full description of the model and training hyper parameters can be found in Appendix B.
Finally, we describe the performance of the trained LSTM. The evolution of the training and validation loss during training can be seen in Figure 3(right), with a final training and validation loss both on the order of . The final losses indicate that the model has learned the analytical relationship shown in Eq. (10), and can extrapolate it to unseen circuit lengths. We conclude that training an LSTM on rotation angle vectors up to lengths of 6 suffices to generate correct angles for circuit lengths as large as 15. This result implies that a modestly sized training set can be leveraged to obtain HQC parameters for arbitrarily large standard W states.

Figure 3. (Left) Training and validation loss plot of LSTM model learning the single qubit rotation angles for the standard W state. The model is learning to extend a single qubit rotation angle vector . The model was trained on circuit lengths from 2 to 6, and validated on lengths of 6 to 15. (Right) Training and validation loss plot of fine-tuning the LLM towards outputting the skeleton of an openQASM script representation of a holographic quantum circuit.
In summary, we conclude that the LSTM has successfully learned to extend the rotation angle vector of a standard W state from a small system to a much larger-sized system.
OpenQASM script generation
In this section, we describe the application of a pre-trained Large Language Model towards generating skeletons of openQASM representations of holographic quantum circuits. By skeleton, we refer to an openQASM script that contains the type, position, and ordering of all quantum gates (single-qubit gates or two-qubit gates), but leaves all the rotation parameters blank. The rotation parameters will be supplemented by the previously discussed LSTM model. The hyperparameters of the model and the training procedure can be found in Appendix B.
The base model was "Llama-3.1-70B-Instruct", obtained from Hugging Face’s public repository. Prior to fine-tuning, the model was quantized using the BitsAndBytes library (4-bit, NF4 format) to reduce the memory consumption of our Graphics Processing Unit (GPU). Parameter-Efficient Fine-Tuning (PEFT) was then employed, in particular Low-Rank Adaptation (LoRA) [23], which significantly limits the number of trainable parameters while maintaining performance comparable to regular fine-tuning.
The training set consisted of openQASM scripts for W-state HQCs (see Sec. 2) of length 2 to 10. The validation scripts covered HQCs for lengths 11 to 15, ensuring that the model can extrapolate to larger systems. All scripts were tokenized with the in-house tokenization format provided by Llama-3.1. The loss function chosen was Cross Entropy, which is the negative log-likelihood of the true next-token distribution under the model’s next token prediction, calculated as:
Here, is the token at position in the target sequence and is the soft-max probability produced by the model (with parameters ).
During training, the model was allowed to use Chain-of-Thought (CoT) reasoning before producing the final skeleton. Here, the model was trained on an NVIDIA H100 GPU. The top panel of Figure 3(left) shows the evolution of the training and validation loss, with both final values on the order of . An example length-11 skeleton displayed by the model is displayed in the bottom panel of Fig. C. In this example, the identifiers "physical" and "ancilla" represent the physical qubit and the ancilla qubit, respectively. Moreover, the act of measuring the physical qubit into a specific classical register is deliberately omitted to keep the LLM focused on pure syntactic generation and added in post-processing.
The final training and validation losses are both on the order of , indicating that the LLM has learned and generalized the syntax of such openQASM scripts with low error. Moreover, the LLM respects the syntax of openQASM scripts, such as qubit ordering for CNOT gates and measuring and resetting the physical qubit. Therefore, we conclude that the fine-tuned, LoRa-adapted Llama-3.1-70B-Instruct has successfully learned and generalized the skeleton representation of HQCs.
Evaluation
In this section, we detail the end-to-end HQC scale up procedure using our hybrid machine learning model. Here, to generate HQCs for a system of qubits given training data up to qubits, we combine the outputs of a single qubit rotation angle predictor (LSTM) with the openQASM circuit-skeleton generator (LLM). The complete workflow is illustrated in Figure 1 and is as follows.
First, the user will gather either a probability vector or a single qubit rotation angle vector for the first qubits . Second, the user will input their vector ( or ) into the LSTM, and receive an output of rotation angles . Third, the LLM will receive a prompt encoding the system size of qubits, and will output a skeleton of an openQASM script of qubits. Fourth, the empty rotation angles in the skeleton are replaced with the values in the newly predicted rotation angle vector . After substitution, the script is passed through a post-processor that adds in the measurement of physical qubit values into their respective classical registers. Finally, the resulting openQASM file is loaded into Qiskit [24] and executed on the Aer Simulator to obtain a shot distribution.
We assessed the fidelity of the end-to-end pipeline with an example generalized W state with length 11. Here, is . The shot distribution of the generated versus analytical openQASM scripts is shown in Figure 4, with shots. The total-variation (TV) distance between the two distributions, defined as where is the sample space, is the predicted distribution, and is the true distribution, was . The non-zero TV value which can be attributed to statistical fluctuations of the chosen shot count. In general, the generated distribution matches the analytical one well, confirming that the hybrid LSTM and LLM architecture has successfully learned both the global structure of the W state and the local rotation parameters required for its preparation.

Figure 4. Comparison plot of the length-11 relative probability distributions (with shots) of the analytical (blue) generalized W state and the generated (orange) generalized W state produced by combining LSTM generated angles and LLM generated qasm script. Here, the vector is . We observe excellent agreement between these two distributions. The total-variation (TV) distance between the distributions is , which can be attributed to finite shot count.
Conclusion and Outlook
In this paper, we proposed a hybrid machine learning framework composed of a Long Short-Term Memory (LSTM) model and a fine-tuned Large Language Model (LLM) used for scaling up holographic quantum circuits (HQCs). Here, each HQC is decomposed into two facets: (1) parameters (e.g., single qubit rotation angles) and (2) syntax (e.g., placement, type, and number of gates). The LSTM model is employed to learn and generalize the parameters, and a fine-tuned pre-trained LLM is trained to learn and generalize the syntax. A high-level overview of our workflow is shown in Figure 1. The final openQASM script is obtained by combining the individual outputs of the LSTM and LLM. The LLM chosen for this task was the Llama-3.1-70B-Instruct model. We benchmarked this hybrid ML architecture on learning and scaling up HQC representations of a family of generalized W states. Here, the LSTM model successfully scaled up rotation-angle patterns from circuits of size 6 to circuits of length 15, while the LoRA-adapted LLM extrapolated the gate-level syntax from length 10 to 15. For an example generalized W state for length 11, the generated shot distribution (with shots) differed from the exact distribution by a total-variation (TV) distance of . Such an error can be explained by the shot noise from a finite number of samples. Consequently, the hybrid architecture can scale the full HQC (with respect to both the parameters and syntax) to system sizes that exceed the training regime by more than a factor of two.
Our results provide a proof of principle that a hybrid architecture of syntax generation and parameter extrapolation can produce scaled HQCs in the simple but non-trivial setting of the generalized W state. Looking forwards, future research will address the utilization of such architectures to scale more complex HQCs, such as those representing correlated ground states of quantum spin chains, towards the region where HQCs display a scaling advantage over classical tensor networks. This will involve more complex syntax to be learned as the number of ancilla qubits are increased, as well as the development of techniques to "gauge fix" the ancilla degrees of freedom for different quantum states so that they can be learned consistently in a unified model.
Acknowledgements
This work was supported by the Office of Naval Research under Contract No. N00024-22-D-6404. We would like to thank Matt Abernathy and William Daniels for helpful discussions.
Derivation of the holographic compilation of the generalized W state
In this appendix section, we construct analytic construction of holographic algorithms for its construction on two qubits. Namely, the generalized W state on qubits is defined as
in which is a vector of positive real numbers whose elements sum to 1. This state can be interpreted as an amplitude encoding of a probability distribution over one-hot vectors, which is to say that a measurement of in the computational basis will result in the qubit being in state 1 and all other qubits being zero with probability . The standard W state amounts to taking , which is an equal weight superposition of one-hot vectors. We note that our construction below can also be straightforwardly generalized to include an arbitrary phase factor on each one-hot state, but this is inessential for our purposes and so we don’t detail the construction here.
The generation of the generalized W state via a holographic algorithm follows from its representation as an MPS with bond dimension 2, the procedure to prepare an MPS sequentially, and an explicit embedding of the sequential preparation isometries into unitary operations [25]. To wit, the MPS representation of the generalized W state is
in which
Using the gauge freedom of MPSs, this can be expressed in left-canonical form [7] as
where
Note that each of the tensors satisfies the left-canonical constraint , which means that they can be considered as left-isometries when reshaped as matrices. This further implies that they can be embedded into unitary operations as
in which denotes a state in the Hilbert space of a physical qubit (index ) and an ancilla (i.e., bond) qubit (index ). Using these unitaries, the state can be constructed as
This should be read as a sequential preparation scheme in which each unitary is applied to a physical qubit in
the zero state and the current state of the ancilla register. At the end of these applications, the physical register holds the generalized W state and the ancilla qubit decouples, as in Eq. (19). Because of the sequential nature, we can also generate samples from using only a single physical qubit and a single ancilla qubit by measuring and resetting the physical qubit after application of each , i.e., as a holographic quantum circuit. It can be readily verified that the isometries Eq. (16) can be embedded into unitaries given by the gate sequences in Figure 5 for and Figure 6 for [25].

Figure 5. Circuit decomposition of for when preparing the generalized W state. The top line is the physical qubit and the bottom line is the ancilla qubit.

Figure 6. Circuit decomposition of when preparing the generalized W state. The top line is the physical qubit and the bottom line is the ancilla qubit.
This representation is not the shortest possible; since the state is real-valued and this sequential circuit is comprised of two-qubit operations, each of the unitary operations is in fact an element of the special orthogonal Group in four dimensions (also called ) and so can be represented with two Controlled-NOTs (CNOT), six fixed single-qubit rotations, and two parameterized special unitary of dimension two (also called ) gates [26]. However, the gates in Figure 5 and Figure 6 make explicit the relationship between the parameter and the quantum circuit, and so we use it for our analysis. Finally, as mentioned earlier, the W state is interesting among MPS representations in that the state itself is translationally invariant, but its minimal bond dimension representation is not [21]. This is ideal for our purposes, as it provides a non-trivial but still tractable learning problem for length generalization of holographic quantum circuits.
Hyperparameters
| Hyperparameter | Value |
| Learning rate | |
| Batch size | 128 |
| Number of epochs | 200 |
| Optimizer | Adam |
| Weight decay | 0 |
| Dropout rate | 0.0 |
| Hidden layer size | 64 |
| Number of layers | 2 |
| Activation function | Tanh |
Table 1. Model Hyperparameters for generalized W state
| Hyperparameter | Value |
| Learning rate | |
| Batch size | 64 |
| Number of epochs | 20 |
| Optimizer | Adam |
| Weight decay | 0 |
| Dropout rate | 0.0 |
| Hidden layer size | 64 |
| Number of layers | 2 |
| Activation function | Tanh |
Table 2. Model Hyperparameters for standard W state
| Hyperparameter | Value |
| Base model | Meta-Llama-3.1-70B-Instruct |
| Quantization | 4-bit NF4 (double quantization) |
| Fine-tuning method | QLoRA (PEFT) |
| LoRA rank () | 8 |
| LoRA alpha () | 32 |
| LoRA dropout | 0.05 |
| LoRA target modules | q_proj, k_proj, v_proj, up_proj, down_proj |
| Learning rate | |
| Optimizer | Paged AdamW (8-bit) |
| Per-device batch size | 1 |
| Warmup steps | 4 |
| Max steps | 30 |
| Max sequence length | 1024 |
Table 3. Model Hyperparameters for fine-tuning
Example generated OpenQASM script
OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
creg c[11];
// BEGIN FIRST SITE
ry() physical;
x physical;
cx physical, ancilla;
x physical;
measure physical;
reset physical;
// END FIRST SITE
// BEGIN SITE (REPEATED 10 TIMES)
cx physical, ancilla;
ry() physical;
cx physical, ancilla;
rz() physical;
rz() ancilla;
cx physical, ancilla;
ry() physical;
cx physical, ancilla;
rz() physical;
rz() ancilla;
measure physical;
reset physical;
// END SITE

Figure 7. Example output from the fine-tuned LLM for an openQASM script corresponding to a W state of length 11. The intermediate site preparation and measurement is repeated 10 times. The rotation angles are intentionally left blank to ensure that the LLM deals only with natural language and not with numerical values.
References
- [1]L. K. Grover, “Quantum mechanics helps in searching for a needle in a haystack,” Phys. Rev. Lett., vol. 79, pp. 325–328, 2 Jul. 1997.DOI
- [2]C. H. Bennett and G. Brassard, “Quantum cryptography: Public key distribution and coin tossing,” Theoretical Computer Science, vol. 560, pp. 7–11, 2014.DOI
- [3]B. Fauseweh, “Quantum many-body simulations on digital quantum computers: State-of-the-art and future challenges,” Nature Communications, vol. 15, no. 1, p. 2123, Mar. 2024.DOI
- [4]D. Lall et al., A review and collection of metrics and benchmarks for quantum computers: Definitions, methodologies and software, 2025. arXiv: 2502. 06717 [quant-ph].arxiv.org/abs/2502.06717
- [5]G. Q. A. Collaborators, “Quantum error correction below the surface code threshold,” Nature, vol. 638, no. 8052, pp. 920–926, Dec. 2024.DOI
- [6]J. Preskill, “Quantum Computing in the NISQ era and beyond,” Quantum, vol. 2, p. 79, Aug. 2018.DOI
- [7]“The density–matrix renormalization group in the age of matrix product states,” Annals of Physics, vol. 326, no. 1, pp. 96–192, 2011, January 2011 Special Issue, ISSN: 0003-4916. DOI: https://doi.org/10.1016/j.aop.2010.09.012
- [8]M. Foss-Feig et al., “Holographic quantum algorithms for simulating correlated spin systems,” Phys. Rev. Res., vol. 3, p. 033002, 3 Jul. 2021. DOI: 10.1103/PhysRevResearch.3.033002 [Online]. Available: https://link.aps.org/doi/10.1103/PhysRevResearch.3.033002
- [9]M. L. Wall, P. Titum, G. Quiroz, M. Foss-Feig, and K. R. A. Hazzard, “Tensor-network discriminator architecture for classification of quantum data on quantum computers,” Phys. Rev. A, vol. 105, p. 062439, 6 Jun. 2022. DOI: 10.1103/PhysRevA.105.062439 [Online]. Available: https://link.aps.org/doi/10.1103/PhysRevA.105.062439DOI
- [10]C. Schön, K. Hammerer, M. M. Wolf, J. I. Cirac, and E. Solano, “Sequential generation of matrix-product states in cavity qed,” Phys. Rev. A, vol. 75, p. 032 311, 3 Mar. 2007.
- [11]X. Zhu and X. Hou, “Quantum architecture search via truly proximal policy optimization,” Scientific Reports, vol. 13, no. 1, p. 5157, Mar. 2023.DOI
- [12]M. Paris and E. Prati, “Quantum compiling by deep reinforcement learning,” Archivio Istituzionale della Ricerca (Universita Degli Studi Di Milano), Jan. 2021.DOI
- [13]S. Daimon and Y.-I. Matsushita, “Quantum circuit generation for amplitude encoding using a transformer decoder,” Physical Review Applied, vol. 22, no. 4, Oct. 2024.DOI
- [14]S. Hochreiter and J. Schmidhuber, “Long Short-Term memory,” Neural Computation, vol. 9, no. 8, pp. 1735–1780, Nov. 1997.
- [15]J. Wei et al., Chain-of-thought prompting elicits reasoning in large language models, 2023. arXiv: 2201.11903 [cs.CL].arxiv.org/abs/2201.11903
- [16]A. W. Cross, L. S. Bishop, J. A. Smolin, and J. M. Gambetta, “Open quantum assembly language,” arXiv preprint arXiv:1707.03429, 2017.arxiv.org/abs/1707.03429
- [17]A. Vaswani et al., Attention is all you need, Jun. 2017.arxiv.org/abs/1706.03762
- [18]M. Zhao, Y. Du, and M. Wang, Large language models are bad dice players: Llms struggle to generate random numbers from statistical distributions, 2026. arXiv: 2601.05414 [cs.CL].DOI
- [19]H. Li et al., Exposing numeracy gaps: A benchmark to evaluate fundamental numerical abilities in large language models, 2025. arXiv: 2502.11075 [cs.CL].arxiv.org/abs/2502.11075
- [20]I. Mirzadeh, K. Alizadeh, H. Shahrokhi, O. Tuzel, S. Bengio, and M. Farajtabar, Gsm-symbolic: Understanding the limitations of mathematical reasoning in large language models, 2025. arXiv: 2410.05229 [cs.LG]. [Online]. Available: https://arxiv.org/abs/2410.05229
- [21]D. Perez-Garcia, F. Verstraete, M. M. Wolf, and J. I. Cirac, Matrix product state representations, 2007. arXiv: quant-ph/0608197 [quant-ph]. [Online]. Available: https://arxiv.org/abs/quant-ph/0608197
- [22]L. G. B. Johnsen, Grammaticality Judgments in Humans and Language Models: Revisiting Generative Grammar with LLMs, 2025. arXiv: 2512.10453 [cs.CL]. [Online]. Available: https://arxiv.org/abs/2512.10453
- [23]E. J. Hu et al., Lora: Low-rank adaptation of large language models, 2021. arXiv: 2106.09685 [cs.CL].arxiv.org/abs/2106.09685
- [24]A. Javadi-Abhari et al., Quantum computing with qiskit, 2024. arXiv: 2405.08810 [quant-ph]. [Online]. Available: https://arxiv.org/abs/2405.08810
- [25]M. L. Wall, M. R. Abernathy, and G. Quiroz, “Generative machine learning with tensor networks: Benchmarks on near-term quantum computers,” Phys. Rev. Res., vol. 3, p. 023010, 2 Apr. 2021. DOI: 10.1103/PhysRevResearch.3.023010 [Online]. Available: https://link.aps.org/doi/10.1103/PhysRevResearch.3.023010DOI
- [26]F. Vatan and C. Williams, “Optimal quantum circuits for general two-qubit gates,” Phys. Rev. A, vol. 69, p. 032315, 3 Mar. 2004. DOI: 10.1103/PhysRevA.69.032315 [Online]. Available: https://link.aps.org/doi/10.1103/PhysRevA.69.032315DOI
AI tools statement
No AI-use declaration is available for this version in Valency.
The available record does not establish whether AI systems or models contributed to this work.