Unleashing the Potential of LLMs for Quantum Computing: A Study in Quantum Architecture Design

Zhiding Liang, Jinglei Cheng, Rui Yang, Hang Ren, Zhixin Song, Di Wu, Tongyang Li, Yiyu ShiSubmission to ICLR 2024 · Withdrawn

TL;DR

The authors introduce QGAS (Quantum GPT-Guided Architecture Search), a human-in-the-loop framework that leverages GPT-4 to design and optimize ansatz circuits for Variational Quantum Algorithms (VQAs). Across benchmark tasks in quantum chemistry, portfolio optimization, and graph problems, QGAS discovers compact, high-performing quantum circuits in just a few prompt iterations—approaching or matching state-of-the-art architecture search frameworks in noiseless settings.

What Problem Does This Paper Address?

Variational Quantum Algorithms (VQAs) are the primary workhorses of the current Noisy Intermediate-Scale Quantum (NISQ) era. In a VQA, the choice of the ansatz—the parameterized quantum circuit that prepares candidate quantum states—determines whether the algorithm converges to the correct ground-state energy or optimization target.

Designing an effective ansatz is challenging:

  • Handcrafted circuits (e.g., UCCSD in quantum chemistry) are domain-specific and often too deep for noisy hardware.
  • Automated Quantum Architecture Search (QAS) methods (like QuantumNAS) search vast combinatorial spaces, treating candidate subcircuits uniformly without domain intuition, which requires expensive evaluations.

This paper asks whether modern Large Language Models (LLMs) can act as intelligent search controllers, using conversational reasoning and human feedback to propose and refine quantum circuit structures rapidly.

Methods

The authors implement QGAS, an iterative loop combining GPT-4, GPT-3.5, and classical simulation backends (TorchQuantum and Qiskit Runtime):

  1. Problem Formulation & Prompting: The quantum problem (Hamiltonian, qubit count, block constraints) is encoded in natural language. GPT-4 is restricted to select two-qubit blocks from six predefined design spaces (e.g., $U3+CU3$, $ZZ+RY$, $RXYZ$, IBMQ basis sets).
  2. Translation via GPT-3.5: To preserve GPT-4 query budgets, GPT-4 outputs symbolic block and qubit assignments, which GPT-3.5 translates into standard OpenQASM format.
  3. Training & Evaluation: The generated ansatz is simulated and optimized using gradient-based parameter updates.
  4. Iterative Human-in-the-Loop Feedback: Performance metrics (gate count, optimization epochs, energy value) are formatted into text prompts. Human experts provide sanity checks—filtering out unphysical suggestions or invalid operations—and prompt GPT-4 with diagnostic feedback to propose updated architectures.
[ Problem Description ] ──> [ GPT-4 (Architecture Selection) ]
                                    │
                                    ▼
[ Simulator / Hardware ] <── [ GPT-3.5 (QASM Translation) ]
        │
        ▼ (Loss, Gate Count, Epochs)
[ Human-in-the-Loop Feedback & Prompt Tuning ] ──> (Iterate with GPT-4)

Datasets

The authors evaluate QGAS across three application domains:

  • Quantum Chemistry: Ground-state energy estimation for Lithium Hydride ($\text{LiH}$) and Water ($\text{H}_2\text{O}$) under STO-3G basis sets using fermionic mapping.
  • Quantum Finance: A 4-asset portfolio optimization problem (4 qubits) mapped to an Ising Hamiltonian.
  • Combinatorial Optimization: 5-node Max-Cut (5 qubits) and a 3-destination Traveling Salesman Problem (TSP, requiring 8 qubits).
  • Quantum Machine Learning: MNIST-2 and MNIST-4 classification benchmark tasks (evaluated in noisy simulation environments).

Key Insights and Ideas

  • Conversational Architecture Search: GPT-4 can effectively reason over discrete circuit building blocks, pruning the search space much faster than purely random or brute-force search.
  • Domain-Specific "Warm Starts": When prompted about slow convergence in chemistry tasks, GPT-4 suggested initializing rotation angles based on molecular symmetries (reducing $\text{H}_2\text{O}$ training by 4 epochs). For $\text{LiH}$, it suggested prepending a layer of $\sqrt{H}$ gates (termed "VQE with Initial Guess"), slashing training time by 47 epochs while preserving accuracy.
  • Human Oversight is Mandatory: Without explicit structural constraints, GPT-4 frequently hallucinates gates outside the designated hardware set. Human experts are essential to detect when GPT-4 increases circuit depth counterproductively.

Key Results

  • Portfolio Optimization (4 qubits): QGAS achieved an objective value of -0.01347 (31 gates), outperforming standard TwoLocal (-0.01303 at 34 gates) and RealAmplitudes (-0.00217 at 39 gates) relative to the -0.0149 reference.
  • Traveling Salesman Problem (8 qubits): QGAS achieved a value of -7376.639 (58 gates), outperforming TwoLocal (-7327.370 at 70 gates) and RealAmplitudes (-7309.703 at 109 gates).
  • Max-Cut (5 qubits): QGAS achieved -1.99837 with only 33 gates, closely matching RealAmplitudes (-1.99890) while requiring 8 fewer gates.
  • Chemistry Benchmarks: In noise-free settings, QGAS found circuits achieving ground-state energy estimates competitive with QuantumNAS and slightly outperforming the standard UCCSD ansatz.

Limitations and Future Work

  • Blindness to Hardware Noise: Under realistic noise models (e.g., IBMQ Quito simulation on $\text{LiH}$ and noisy MNIST classification), QGAS performance degraded severely. GPT-4 cannot natively parse or model physical noise characteristics without explicit prompting strategies.
  • Reliability & Hallucination: Current LLMs possess internet-sourced biases, sometimes generating physically ungrounded recommendations.
  • Future Directions: The authors propose developing quantum-specific pretraining datasets, integrating LLMs directly into low-level pulse calibration routines (e.g., estimating Hamiltonian parameter drift), and exploring LLM-assisted code generation for fault-tolerant quantum error correction.

Summary updated

Abstract

Large Language Models (LLMs) contribute significantly to the development of conversational AI and has great potentials to assist the scientific research in various areas. This paper attempts to address the following questions: What opportunities do the current generation of generative pre-trained transformers (GPTs) offer for the developments of noisy intermediate-scale quantum (NISQ) technologies? Additionally, what potentials does the forthcoming generation of GPTs possess to push the frontier of research in fault-tolerant quantum computing (FTQC)? In this paper, we implement a QGAS model, which can rapidly propose promising ansatz architectures and evaluate them with application benchmarks including quantum chemistry and quantum finance tasks. Our results demonstrate that after a limited number of prompt guidelines and iterations, we can obtain a high-performance ansatz which is able to produce comparable results that are achieved by state-of-the-art quantum architecture search methods. This study provides a simple overview of GPT’s capabilities in supporting quantum computing research while highlighting the limitations of the current GPT at the same time. Additionally, we discuss futuristic applications for LLM in quantum research.
BibTeX
@misc{liang2023unleashing,
  author = {Zhiding Liang and Jinglei Cheng and Rui Yang and Hang Ren and Zhixin Song and Di Wu and Tongyang Li and Yiyu Shi},
  title = {{Unleashing the Potential of LLMs for Quantum Computing: A Study in Quantum Architecture Design}},
  year = {2023},
  eprint = {2307.08191},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.08191},
}
Figure