Source-linked AI summary

Out-of-distribution generalization for learning quantum dynamics

Matthias C. Caro, Hsin-Yuan Huang, Nicholas Ezzell, Joe Gibbs, Andrew T. Sornborger, Lukasz Cincio, Patrick J. Coles, Zoë Holmes

arXiv:2204.10268v3quant-phcs.LGstat.ML

TL;DR

QML generalization guarantees have mainly addressed cases where training and testing share a distribution, leaving out-of-distribution generalization for unitary learning unestablished. This paper combines analytical results on locally scrambled ensembles with in-distribution guarantees and numerical experiments. It shows that product-state training can generalize to entangled test states, while product states remain feasible to prepare in noisy settings.

  • Problem

    Prior QML guarantees address in-distribution generalization, while out-of-distribution generalization for training and testing distributions that differ has not been established in this setting.

    Source: §I · p. 1
  • Method

    The paper relates risks across locally scrambled ensembles and combines that result with in-distribution guarantees for QNNs learning an unknown unitary.

    Source: §I · pp. 1–2
  • Results

    A QNN trained on a polynomial number of random product states can generalize to fully random states, and noisy simulations find product-state training feasible where deep-circuit training fails.

    Source: §I · p. 2, C. Numerical Results · pp. 6–7
  • Takeaways & Limitations

    Product states, preparable using only single-qubit gates, support learning unitary dynamics in noisy scenarios and suggest opportunities for quantum and classical compilation.

    Source: §I · p. 2, §III · p. 7

Abstract

from arXiv · show

Generalization bounds are a critical tool to assess the training data requirements of Quantum Machine Learning (QML). Recent work has established guarantees for in-distribution generalization of quantum neural networks (QNNs), where training and testing data are drawn from the same data distribution. However, there are currently no results on out-of-distribution generalization in QML, where we require a trained model to perform well even on data drawn from a different distribution to the training distribution. Here, we prove out-of-distribution generalization for the task of learning an unknown unitary. In particular, we show that one can learn the action of a unitary on entangled states having trained only product states. Since product states can be prepared using only single-qubit gates, this advances the prospects of learning quantum dynamics on near term quantum hardware, and further opens up new methods for both the classical and quantum compilation of quantum circuits.

I. INTRODUCTION

The paper addresses out-of-distribution generalization for learning unitary dynamics, where training and testing distributions differ. It shows that training on product states can generalize to entangled states, with implications for quantum dynamics learning and circuit compilation.

I. INTRODUCTION

  • Prior QML generalization guarantees focus on training and testing data drawn from the same distribution, while limited access to preparable training states motivates studying distribution shift.The introduction highlights this constraint in the NISQ era, when deep circuits cannot be reliably executed.Source: §I · p. 1
  • A QNN trained on a polynomial number of random product states can generalize to fully random test states when learning an efficiently implementable unitary.This covers learning the unitary's action on highly entangled states after training only on product states.Source: §I · p. 2
  • Numerical experiments find that product-state training learns short-time Heisenberg-chain evolution, with Haar-random and product-state testing performance differing by only a small constant factor.Noisy simulations also find that preparing highly entangled training states can prohibit training, whereas product-state training remains feasible.Source: §I · p. 2
  • The results suggest that low-entangling unitaries can be compiled classically using low-entangled training states and tensor-network simulation.The introduction also frames unitary learning as relevant to experimental-process characterization and quantum or classical compilation.Source: §I · pp. 1–2, Figure 1 · p. 2

A. Framework

The framework treats unitary learning as fitting a QNN to training input-output pairs and evaluating its predictions on a potentially different test distribution. It focuses on locally scrambled ensembles, which include both readily prepared product states and highly entangled states.

A. Framework

  • The learning task optimizes a parameterized n-qubit unitary to predict an unknown unitary's action on previously unseen test states.Training data consist of input-output pairs drawn from a training distribution, while expected risk is evaluated over the testing distribution.Source: A. Framework · p. 2
  • Out-of-distribution generalization allows the training distribution Q to differ from the testing distribution P, unlike the usual in-distribution assumption Q = P.The framework describes this setting as dataset shift, or covariate shift.Source: A. Framework · p. 3
  • Locally scrambled state ensembles arise from locally scrambled unitary ensembles applied to |0⟩^⊗n and are invariant under local-unitary preprocessing.The results extend to ensembles whose complex second moments agree with those of a locally scrambled ensemble.Source: A. Framework · p. 3
  • The covered ensembles include product states and highly entangled states, enabling training and testing distributions to differ substantially.Examples include products of single-qubit Haar-random or stabilizer states, Haar-random n-qubit states, state 2-designs, and random-circuit outputs.Source: A. Framework · p. 3
  • Product and stabilizer states are practical training choices because they can be prepared using a single layer of single-qubit gates.The framework favors short-depth, low-entangling, or simple-gate training states, particularly in the NISQ era.Source: A. Framework · p. 3

B. Analytical Results

The analytical results first relate risks across locally scrambled ensembles, then use that relationship to extend in-distribution QNN generalization guarantees to out-of-distribution unitary learning.

B. Analytical Results

  • The paper uses the connection between locally scrambled risks to lift in-distribution generalization to out-of-distribution generalization for QNNs learning an unknown unitary.The formal proofs are given in Appendix B.Source: B. Analytical Results · pp. 3–4
  • The analysis organizes locally scrambled ensembles into training and testing ensembles, as illustrated by the locally scrambled-ensemble diagram.The diagram concerns the class locally scrambled up to the second moment.Source: B. Analytical Results · p. 4, Figure 2 · p. 4

1. Equivalence of Locally Scrambled Risks

For unitary learning, risks over locally scrambled ensembles are equivalent up to a constant multiplicative factor. Consequently, product-state and stabilizer-state ensembles can be used in place of more complex locally scrambled test ensembles.

1. Equivalence of Locally Scrambled Risks

  • The factor of 1/2 in the lower bound comes from the proof structure, and the authors expect tighter relations in typical cases.The paper explores this expectation numerically for training on random product states.Source: §1 · p. 4
  • Risks from locally scrambled ensembles are bounded in terms of Haar-distribution risk, establishing equivalence up to a constant multiplicative factor.The theorem concerns comparing the average action of an unknown unitary on state ensembles.Source: §1 · p. 4
  • Products of Haar-random single-qubit states or random single-qubit stabilizer states are effectively equivalent to random-circuit outputs and globally Haar-random states for this average-risk task.The ensembles may differ substantially in entanglement while remaining equivalent for comparing unitaries.Source: §1 · p. 4

2. Out-of-Distribution Generalization for QNNs Trained on Locally Scrambled States

The section shows how in-distribution generalization bounds can be lifted to out-of-distribution guarantees for unitary learning across locally scrambled distributions. In particular, polynomially many product-state training examples can support predictions on more complex test distributions, while local costs and shadow tomography address training and copy requirements.

2. Out-of-Distribution Generalization for QNNs Trained on Locally Scrambled States

  • Theorem 1 supplies a template for lifting in-distribution QNN generalization bounds to out-of-distribution guarantees for unitary learning.The out-of-distribution risk is controlled by the optimized training cost and in-distribution generalization error.Source: §2 · p. 4
  • If the target unitary has a polynomial-size QNN representation, polynomially many product training states suffice to learn its action on Haar-random inputs.The stated guarantee also covers more complex test distributions such as random-circuit outputs.Source: §2 · pp. 4–5
  • The prediction argument uses locally scrambled ensembles whose state decompositions are sufficiently random and spread across product states.The text motivates this with linear spanning of states by product-state projectors, while noting that exact reconstruction from all such states would require exponentially many inputs.Source: §2 · p. 5
  • Local variants of the training cost extend the generalization results and can be trainable where the corresponding global cost may not be.Product-state inputs make the local costs straightforward to generate; the paper notes this construction is unavailable in the same manner for highly entangled training data.Source: §2 · p. 5
  • Classical shadows give a copy-complexity bound independent of the number of optimization steps for polynomial-size circuit families.The stated requirement is O(T log(T/ϵ)/ϵ^2) copies of each input and output state to approximately evaluate the cost and its partial derivatives arbitrarily often.Source: §2 · p. 5

C. Numerical Results

The numerical studies examine Hamiltonian learning from product-state inputs, including under noise. They report that optimized cost tracks both in-distribution and out-of-distribution risk, and that product-state training succeeds in the noisy finite-shot simulation where deep-circuit training does not.

C. Numerical Results

  • The classical simulations train on two random product states for n = 4 to 12 qubits, with ansatz depths L = 2 to 5 and evolution time t = 0.1.The target evolution is compared with a layered ansatz built from a second-order Trotterization.Source: C. Numerical Results · p. 6
  • The optimized cost is plotted against in-distribution and out-of-distribution risks, showing their linear correlation in the Hamiltonian-learning experiment.The numerical analysis evaluates the in-distribution risk on random product states and the out-of-distribution risk on the global Haar distribution.Source: C. Numerical Results · p. 6, Figure 3 · p. 6
  • The noisy study compares product-state inputs with inputs prepared by deep circuits using a gate-set-tomography-based noise model with error rates reduced twentyfold.It uses an n = 6 system, an L = 2 ansatz, and 20 optimization runs for each training-data type.Source: C. Numerical Results · p. 6
  • Above 10^3 total shots, product-state training gradually lowers in-distribution risk to 10^-3, while out-of-distribution risk closely follows it.In contrast, deep-circuit training failed in all 20 runs, with both risks remaining large even at very high shot counts.Source: C. Numerical Results · pp. 6–7, Figure 4 · p. 7

III. DISCUSSION

The results establish out-of-distribution generalization for unitary learning across locally scrambled distributions, including training on relatively simple states and predicting outputs on highly entangled states. The discussion highlights potential applications to experimental quantum dynamics and classical compilation, while identifying other tasks and distributions as open questions.

III. DISCUSSION

  • Training on product stabilizer states can generalize to Haar-random and random-circuit output states, letting unitary action be predicted on highly entangled states from relatively few unentangled examples.The training ensemble is described as easy to prepare experimentally and easy to simulate classically; the training data size is roughly the number of trainable gates.Source: §III · p. 7
  • Products of random single-qubit states require only simple single-qubit gates, making the result relevant to characterizing unknown dynamics in experimental systems without a complete gate set.The authors discuss coherent interaction with a quantum computer or a conventional experimental setup.Source: §III · p. 7
  • Low-entangling unitaries and product states can be simulated with tensor networks, so the results imply that such unitaries may be compiled entirely classically.The authors connect this possibility to dynamical simulation and learning pulse sequences for noise-resilient gate implementations.Source: §III · p. 7
  • The paper establishes guarantees for learning quantum dynamics with locally scrambled distributions, while whether out-of-distribution generalization extends to other QML tasks or distribution classes remains open.The discussion names quantum-channel learning and classification, including phases of matter, as candidate tasks for future investigation.Source: §III · p. 7
  • The approach derives guarantees from properties of the task and distribution class rather than relying on a specific learning algorithm or transfer-learning technique.The authors distinguish the locally scrambled distribution properties they use from classical concepts of feature invariance and variation.Source: §III · pp. 7–8

IV. METHODS

The methods compare Haar-distribution risk with risk over locally scrambled training distributions using inequalities. The preliminaries define the learning setup and locally scrambled ensembles used by those arguments.

IV. METHODS

  • The proof rewrites Haar risk as an average over Pauli products, bounds it using stabilizer-state averages, and relates that bound to risk over locally scrambled training distributions.The argument uses the Pauli expansion of the swap operator, a spectral decomposition, the 2-design property of random single-qubit stabilizer states, and a local Haar average.Source: §IV · p. 8
  • For generic locally scrambled training distributions, the proof decomposes risk into locally scrambled expectations over system partitions and applies a partial-trace matrix inequality.This supplies the second inequality in Lemma 1, while the Haar-risk comparison supplies the first.Source: §IV · p. 8

Appendix A: Preliminaries

  • The learning setup trains a parameterized, possibly variable-structure k-local QNN on input-output state pairs, then evaluates average prediction error on a testing distribution that may differ from training.The circuit has tunable gates, and its parameters can include both continuous gate settings and discrete structural choices.Source: Appendix A · p. 12
  • Locally scrambled state ensembles are generated by applying locally scrambled unitary ensembles to |0⟩^⊗n; examples include Haar-random states, random-circuit outputs, and product-state ensembles.The appendix also defines locally scrambled unitary ensembles through invariance under preprocessing by tensor products of arbitrary local unitaries.Source: Appendix A · p. 13

1. Equivalence of Locally Scrambled Risks for Comparing Unitaries

This section examines out-of-distribution testing for unitary comparison, showing how equivalence of locally scrambled risks can transfer in-distribution QNN guarantees. It also explains that such generalization depends on shared properties of the training and testing ensembles, and on the training ensemble’s states.

1. Equivalence of Locally Scrambled Risks for Comparing Unitaries

  • For locally scrambled ensembles P and Q, 1/2 RQ(U, V) ≤ RP(U, V) ≤ 2RQ(U, V), with the Hilbert-Schmidt test cost providing the bridge.The Hilbert-Schmidt test cost can be expressed as an average over Pauli strings.Source: §1 · pp. 14, 18, 19

2. Out-of-Distribution Generalization for QNNs Trained on Locally Scrambled States

  • When training and testing ensembles are both locally scrambled, the post-training testing risk is controlled by the training cost and the in-distribution generalization error.This provides a general template for transferring in-distribution generalization guarantees to out-of-distribution testing.Source: §2 · p. 20
  • ~T log(T)/epsilon^2 training examples suffice to keep expected risk within epsilon above twice the training cost, with high probability.Here T is the number of parameterized local gates in the QNN.Source: §2 · p. 20
  • Training on tensor products of Haar-random single-qubit states yields an out-of-distribution bound for locally scrambled tests, and random stabilizer product states achieve the same bound.The generalization statement applies to QNNs with T parameterized local gates.Source: §2 · p. 21
  • The results extend to local risks and costs for product-structured ensembles, but this construction is unavailable when training data is highly entangled.Local costs can help avoid cost-function-dependent barren plateaus when training a shallow QNN.Source: §2 · p. 21

3. Remarks on the Role of Linearity

  • Linearity-based extrapolation from training states that span the desired space requires an exponentially large ensemble, while the number of states needed for good generalization depends on the ensemble.The random ensembles must also be well-behaved for generalization from a manageable number of training states.Source: §3 · pp. 21, 23
  • A single-qubit phase unitary can have perfect computational-basis training and testing performance yet nonzero risk on random X-basis states, because those training states do not reveal relative phase.The counterexample shows that good performance on computational-basis states does not imply good performance on X-basis or Haar-random states for the stated cost function.Source: §3 · pp. 22–23
  • Combining Theorem 1 with in-distribution generalization bounds shows that worst-case training requirements for random product states cannot be significantly worse than those for fully random states.Source: §3 · p. 23

Appendix C: Additional Numerical Results

The numerical tests support Lemma 1 for Haar-random product-state training: its cost bound holds in sampled low-depth circuits, though the upper bound is often loose. In these circuits, the locally trained cost scales empirically linearly with the global cost after sufficient training.

1. Numerical Test of Lemma 1

  • Lemma 1 bounds the Haar-random product-state cost using the n-qubit Haar-random state cost, with a factor of at most 2.The product-state ensemble is a tensor product of Haar-random single-qubit states.Source: §1 · p. 23
  • The toy ansatz uses a 21-single-qubit-gate and 4-CNOT decomposition so G(0)=I, making W(α=0)=I and the risks and costs vanish.Rescaling parameters as α=rθ lets the test sample a range of cost values from the zero-cost point.Source: §1 · pp. 23, 25
  • For low-depth variational circuits, learning a unitary on random product states is sufficient to generalize to the entire Hilbert space, and the upper bound is empirically loose.After sufficient training, the locally trained cost scales empirically linearly with the global cost.Source: §1 · p. 24
  • Across n=2–10 qubits and depths l=1–3, every sampled point satisfied Inequality (C1), whose upper bound was often loose.The test used 20 random initialization vectors and 100 values of r for each sample.Source: §1 · p. 25

2. Out-of-Distribution Generalization for Learning Fast Scramblers

The authors test out-of-distribution learning of 8-qubit fast scramblers using product-state training data and varying training-set sizes. Larger training sets improve generalization in the reported runs, while generalization error decreases faster than the theoretical bound and approaches its rate as learning difficulty increases.

2. Out-of-Distribution Generalization for Learning Fast Scramblers

  • For 8-qubit fast-scrambler unitaries with t = 3–10, learning used N = 1–15 random-product-state examples and repeated optimization 1000 times, with independently randomized unitaries, training sets, and initial parameters.Here, t is the number of time steps and controls optimization difficulty because entanglement introduced by U quickly grows with t.Source: §2 · p. 25
  • 12.5% of N=15 runs versus 7% of N=3 runs achieved almost perfect learning; larger training sets also yielded lower test risk at a given training cost.With N=3, training cost ≈0.5 could coincide with maximal test risk ≈1.Source: Figure C2 · p. 26, §2 · p. 26
  • For t=6–10, average generalization errors were almost identical, likely because few runs lowered the cost enough; the authors note this setting was not useful for learning.They suggest more refined minimization techniques might address the optimization issue, while the theoretical bounds still hold.Source: §2 · p. 26
  • Generalization error decreased faster than the N^-1/2 theoretical bound, with its rate appearing to approach that bound as t increased.This trend was reported for both all runs and successful runs with CDQ(N)(αopt) < 0.5.Source: §2 · p. 26
Loading 2204.10268v3…