Table of Contents
Fetching ...

Meta-Designing Quantum Experiments with Language Models

Sören Arlt, Haonan Duan, Felix Li, Sang Michael Xie, Yuhuai Wu, Mario Krenn

TL;DR

This work introduces meta-design, a transformer-based framework that generates human-readable Python code as meta-solutions to design entire classes of quantum experiments across varying system sizes. By training on synthetic A→B pairs (state sequences to experimental-code sequences) and using large-scale data generation with PyTheus, the approach yields generalizable design rules and observable patterns, including two previously unknown quantum-state generalizations. The results show that six target classes admit perfect extrapolation, with additional findings on unexpected generalizations and limitations, and demonstrate applicability to quantum circuits and graph states. The method promises substantial gains in understanding, generalization, and computational efficiency, and could extend to fields like materials science and engineering through interpretable, automated program synthesis.

Abstract

Artificial Intelligence (AI) can solve complex scientific problems beyond human capabilities, but the resulting solutions offer little insight into the underlying physical principles. One prominent example is quantum physics, where computers can discover experiments for the generation of specific quantum states, but it is unclear how finding general design concepts can be automated. Here, we address this challenge by training a transformer-based language model to create human-readable Python code, which solves an entire class of problems in a single pass. This strategy, which we call meta-design, enables scientists to gain a deeper understanding and extrapolate to larger experiments without additional optimization. To demonstrate the effectiveness of our approach, we uncover previously unknown experimental generalizations of important quantum states, e.g. from condensed matter physics. The underlying methodology of meta-design can naturally be extended to fields such as materials science or engineering.

Meta-Designing Quantum Experiments with Language Models

TL;DR

This work introduces meta-design, a transformer-based framework that generates human-readable Python code as meta-solutions to design entire classes of quantum experiments across varying system sizes. By training on synthetic A→B pairs (state sequences to experimental-code sequences) and using large-scale data generation with PyTheus, the approach yields generalizable design rules and observable patterns, including two previously unknown quantum-state generalizations. The results show that six target classes admit perfect extrapolation, with additional findings on unexpected generalizations and limitations, and demonstrate applicability to quantum circuits and graph states. The method promises substantial gains in understanding, generalization, and computational efficiency, and could extend to fields like materials science and engineering through interpretable, automated program synthesis.

Abstract

Artificial Intelligence (AI) can solve complex scientific problems beyond human capabilities, but the resulting solutions offer little insight into the underlying physical principles. One prominent example is quantum physics, where computers can discover experiments for the generation of specific quantum states, but it is unclear how finding general design concepts can be automated. Here, we address this challenge by training a transformer-based language model to create human-readable Python code, which solves an entire class of problems in a single pass. This strategy, which we call meta-design, enables scientists to gain a deeper understanding and extrapolate to larger experiments without additional optimization. To demonstrate the effectiveness of our approach, we uncover previously unknown experimental generalizations of important quantum states, e.g. from condensed matter physics. The underlying methodology of meta-design can naturally be extended to fields such as materials science or engineering.
Paper Structure (18 sections, 11 equations, 14 figures, 8 tables)

This paper contains 18 sections, 11 equations, 14 figures, 8 tables.

Figures (14)

  • Figure 1: Meta-designing a class of experiments via code generation avoids exploding computational costs for the design of larger experiments. Left side: Our process takes the first three states from a class of target quantum states and - when successful - produces a Python code which generates the correct experimental setup for arbitrary sizes. For this, a sequence-to-sequence transformer is trained purely on randomly generated pairs of sequences. Right side: Designing an experimental setup which produces a target quantum state is very fast for small particle numbers, but the computational cost explodes as the target state grows.
  • Figure 2: Exploiting asymmetric cost for data generation. A random Python program (sequence B) is generated. Executing it for the values $N=0,1,2$ produces three different experimental setup. Each setup produces a state. The three states are concatenated to make sequence A, which is the input for the model.
  • Figure 3: Our approach discovers two previously unknown and four previously known generalizations. We show the resulting fidelities of the best produced code for 14 of the 20 target classes. The fidelity ranges from $0$ (orthogonal to target) to $1$ (perfect match). The green line represents the six target classes which our approach produces codes which correctly extrapolate beyond the first three elements. The blue lines show classes for which the best generated codes have fidelity one for the first three elements of the class, but do not extrapolate beyond. These cases are interesting as the model is still successful in generating a code which matches the three states provided as an input sequence, but the output for $N\geq3$ does not match what we expect. The orange and red line are representatives of the $8$ cases, for which the model was not able to predict correct solutions up to $N=3$. The full table of target classes with their maximum correct $N$ is shown in the supplement. The supplement also contains extended version of this plot for all twenty classes and for values of $N$ up to 7 (Fig. \ref{['fig:fidsvsvert_extended']}).
  • Figure 4: Experimental setups for previously unknown solutions exhibit comprehensible patterns. In the two top rows we show two previously unknown constructions discovered by our approach. For the spin$\frac{1}{2}$ states and the Majumdar-Ghosh states (described in more detail in pytheus). For each of the two examples, the code produces the correct experimental setup for the three states used to prompt the model but also for higher particle numbers, indicating that the model was able to pick up on the pattern and write a correct code for the entire class of states. We highlight in green the 'building blocks', which are repeated multiple times as the particle number grows (stemming from lines written in the for loop). The bottom row shows a code for the Dyck 1 state. The setups generated by this code produce the correct state up to the third iteration, but are missing terms for indices $N>2$. This means that the model was able to solve the task it was trained to do (match the first three states), but failed at the meta task of picking up on the pattern we intended it to match beyond the first three examples. It is also notable that in contrast to the other two examples, all setups produced for the Dyck 1 state also contained additional crystals which did not actually contribute to the resulting quantum state. We have omitted them by covering them by a grey rounded rectangle.
  • Figure 5: Results for additional tasks (quantum circuits and quantum graph states) a) shows the output codes (blue boxes on the left) of a model trained for quantum cicuit design. We draw the circuit diagram for $N=1,2,3$. Computation of the resulting states confirms that each of the codes (GHZ, AKLT, MG) correctly produces the corresponding target states, even for $N=3$, which shows that the code extrapolates beyond the scales that are seen during training ($N=0,1,2$). b) shows the output codes (blue boxes on the left) of a model trained for quantum graph state. We draw the generated graphs for $N=1,2,3$. Computation of the resulting states confirms that each of the codes (Linear, Ring, Star) correctly produces the corresponding target states, even for $N=3$, which shows that the code extrapolates beyond the scales that are seen during training ($N=0,1,2$).
  • ...and 9 more figures