Aligning Quantum Operators with Large Language Models

Rogerio Feris, Yunchao Liu, Pengyuan Li, Hang Hua, David KremerarXiv 2026

TL;DR

This paper introduces a novel multimodal framework that maps quantum unitary operators directly into the latent space of a Large Language Model (LLM). By treating quantum matrices as visual tokens, the model achieves state-of-the-art results in quantum circuit synthesis and enables natural language instructions to steer hardware-constrained compilation.

What Problem Does This Paper Address?

While Large Language Models (LLMs) excel at symbolic reasoning and code generation, they are fundamentally "blind" to the continuous mathematical objects of quantum mechanics, such as complex-valued unitary matrices. Existing quantum LLM tools rely entirely on textual proxies like Qiskit or OpenQASM code.

However, core tasks in quantum compilation, verification, and algorithm design require direct interaction with the operator itself, not just a human-readable label. This paper bridges the gap, allowing an LLM to natively ingest, interpret, and reason over exact mathematical representations of quantum operations.

Methods

The authors represent quantum unitaries using real-valued Pauli Transfer Matrices (PTMs). Inspired by Vision-Language Models (VLMs), they treat the PTM as a single-channel image, slice it into non-overlapping patches, and pass them through a lightweight encoder and a multi-layer perceptron (MLP) projector. This maps the quantum operator directly into the word embedding space of a pretrained LLM (IBM's Granite 4.0 Micro).

Circuit synthesis is framed as a stepwise autoregressive process. Instead of predicting an entire circuit sequence at once, the model predicts one gate at a time in reverse execution order. After each gate prediction, the residual PTM (the remaining part of the unitary to be compiled) is updated externally. This external update acts as a physical "scratchpad," meaning the model does not need to maintain complex synthesis states internally; it simply re-encodes the remaining PTM at every step.

Overview of the PTM-Language alignment and stepwise synthesis approach.

Datasets

The model is trained and evaluated on synthetically generated datasets:

  • Clifford+T Circuits: Synthesized random circuits on 4 qubits, with training data scaled from 145K to 9.2M circuits. Circuit lengths spanned 1–15 gates (and up to 30 gates for advanced scaling tests).
  • Held-out Evaluation Set: 2,000 circuits with verified zero overlap against the training data.
  • Haar-Random Unitaries: 200 purely random unitaries used as a stress test for approximate synthesis.
  • Constraint Test Set: 250 circuits paired with five unseen natural language gate-set constraint configurations to test instruction-following generalization.

Key Insights and Ideas

  • Quantum Operators as Vision Tokens: Slicing mathematical matrices into patches allows standard transformer architectures to process continuous quantum data without structural modifications.
  • No Saturation in Scaling: Performance scales predictably and consistently with both data volume and gate counts. Exposure to longer circuits significantly improves the model's ability to synthesize shorter ones.
  • Language-Steered Compilation: Grounding quantum data in an LLM unlocks language-conditioned synthesis. At inference time, users can use natural language prompts to enforce hardware topology constraints (e.g., specifying which qubits can interact), a flexibility completely unavailable to traditional specialized solvers.

Key Results

  • State-of-the-Art Synthesis: On 4-qubit Clifford+T synthesis, greedy decoding success rate improved more than 3$\times$ (from 23.4% to 71.0%) as training data scaled to 9.2M circuits. Expanding training to 1–30 gate circuits boosted greedy success to 87.9%.
  • Inference-Time Compute Scaling: Utilizing Best-of-N sampling ($N=80$) raised the overall success rate to 99.4%, outperforming established baselines like SynthetiQ (62.7%), reinforcement learning (84.0%), and MDL Beam Search (70.8%).
  • Effective Constraint Following: For text-conditioned synthesis on unseen constraint configurations, the model achieved 91% constraint compliance. When the constraint text was removed, compliance dropped to 53%, proving that the model actively conditions its mathematical synthesis on natural language instructions.
Fig. 2. Per-gate success rate on 2,000 held-out circuits (1–15 gates, fidelity threshold τ = 0.999). RL and MDL beam search results are taken from their respective publications as approximate comparisons (see text). Overall weighted success rates shown in the legend.

Limitations and Future Work

The primary limitation of this work is scalability. The PTM representation scales exponentially ($4^n \times 4^n$), which restricts this specific implementation to small qubit counts (demonstrated here on 4 qubits).

However, the underlying multimodal framework is representation-agnostic. The authors note that more scalable quantum descriptions—such as Clifford tableaux, Pauli operator lists, or tensor networks—can be integrated into the same LLM embedding space using modality-specific encoders. Future directions also include augmenting training with reinforcement learning methods (like GRPO) and latent chain-of-thought reasoning to further optimize circuit depth.

Summary updated

BibTeX
@misc{feris2026aligning,
  author = {Rogerio Feris and Yunchao Liu and Pengyuan Li and Hang Hua and David Kremer},
  title = {{Aligning Quantum Operators with Large Language Models}},
  year = {2026},
  eprint = {2606.13811},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.13811},
}
Figure