Paper The following article is Open access

Quantum model learning agent: characterisation of quantum systems through machine learning

, , , and

Published 14 June 2022 © 2022 The Author(s). Published by IOP Publishing Ltd on behalf of the Institute of Physics and Deutsche Physikalische Gesellschaft
, , Citation Brian Flynn et al 2022 New J. Phys. 24 053034 DOI 10.1088/1367-2630/ac68ff

1367-2630/24/5/053034

Abstract

Accurate models of real quantum systems are important for investigating their behaviour, yet are difficult to distil empirically. Here, we report an algorithm—the quantum model learning agent (QMLA)—to reverse engineer Hamiltonian descriptions of a target system. We test the performance of QMLA on a number of simulated experiments, demonstrating several mechanisms for the design of candidate Hamiltonian models and simultaneously entertaining numerous hypotheses about the nature of the physical interactions governing the system under study. QMLA is shown to identify the true model in the majority of instances, when provided with limited a priori information, and control of the experimental setup. Our protocol can explore Ising, Heisenberg and Hubbard families of models in parallel, reliably identifying the family which best describes the system dynamics. We demonstrate QMLA operating on large model spaces by incorporating a genetic algorithm to formulate new hypothetical models. The selection of models whose features propagate to the next generation is based upon an objective function inspired by the Elo rating scheme, typically used to rate competitors in games such as chess and football. In all instances, our protocol finds models that exhibit F1  score ⩾ 0.88 when compared with the true model, and it precisely identifies the true model in 72% of cases, whilst exploring a space of over 250 000 potential models. By testing which interactions actually occur in the target system, QMLA is a viable tool for both the exploration of fundamental physics and the characterisation and calibration of quantum devices.

Export citation and abstract BibTeX RIS

Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.

1. Introduction

Efforts in the domain of quantum system characterisation and validation have encompassed machine learning (ML) techniques [1]. ML methodologies and statistical inference have found broad application in the wider development of quantum technologies, from error correction [2, 3] to nuclear magnetic resonance spectroscopy [4], and device calibration [5, 6]. Here we introduce an ML algorithm which infers a model for quantum systems, allowing for automatic characterisation of such systems and devices.

For a given black box quantum system, Q, its model is the generator of its dynamics, e.g. its Hamiltonian ${\hat{H}}_{0}$, consisting of a sum of independent terms, each of which correspond to a unique physical interaction contributing to Q's dynamics. A growing set of quantum parameter estimation algorithms—such as quantum Hamiltonian learning (QHL) [711] among others [1221]—characterise quantum systems whose model is known in advance, by inferring an optimal parameterisation.

Leveraging parameter-learning as a subroutine, we introduce the quantum model learning agent (QMLA), which aims to compose an approximate model ${\hat{H}}^{\prime }$, by testing and comparing a series of candidate models against data drawn from Q. QMLA differs from quantum parameter estimation algorithms by removing the assumption of the precise form of ${\hat{H}}_{0}$; instead we use an optimisation routine to determine which terms ought to be included in ${\hat{H}}^{\prime }$, thereby determining which interactions Q is subject to.

QMLA was introduced in [22], where an electron spin in a nitrogen-vacancy centre was characterised through its experimental measurements. This work builds on the foundation of [22] but is distinct in several significant respects: here we generalise and extend QMLA, studying a wide class of theoretical systems to demonstrate the capability of the framework. Firstly, we show that QMLA most often selects the best model, when presented with a pre-determined set of models, characterised by Ising, Heisenberg or Hubbard interactions, i.e. a number of distinct families. From a different perspective, we test QMLA's ability to classify the family of model most appropriate to the target system. This illustrates a crucial application of QMLA, i.e. that it can be used to inspect the physical regime underlying a system of interest. To the best of our knowledge, this is the first time that an automated system has been used to compare alternative hypotheses regarding the nature of interactions within a quantum system of interest. Finally we design a genetic algorithm within QMLA to explore a large model space. The genetic algorithm is mediated by an objective function based upon the Elo rating system, which is usually deployed for ranking players/teams in games such as chess and football [23]. This is novel both within the realm of genetic algorithms, and the space of quantum characterisation; the results presented suggest promise for further applications of Elo ratings in both domains.

The paper is organised as follows: in section 2 we describe the QMLA protocol in detail; in section 3 we describe several test cases for QMLA along with their results, finishing with a discussion in section 4.

2. Quantum model learning agent

For a black-box quantum system, Q, whose Hamiltonian is given by ${\hat{H}}_{0}$, QMLA distills a model ${\hat{H}}^{\prime }\approx {\hat{H}}_{0}$. Models are characterised by their parameterisation and their constituent operators, or terms. For example, a model consisting of the sum of one-qubit Pauli terms,

Equation (1)

is characterised by its parameters $\vec{\alpha }$ and terms $\vec{T}$. QMLA aims primarily to find ${\vec{T}}^{\prime }$, secondarily to find ${\vec{\alpha }}^{\prime }$, such that ${\hat{H}}^{\prime }={\vec{\alpha }}^{\prime }\cdot {\vec{T}}^{\prime }\approx {\hat{H}}_{0}$. In doing so, Q can be completely characterised.

QMLA considers several branches of candidate models, μ: we can envision individual models as leaves on a branch. Candidate models ${\hat{H}}_{i}$ are trained independently: ${\hat{H}}_{i}$ undergoes a parameter learning subroutine to optimise ${\vec{\alpha }}_{i}$, under the assumption that ${\hat{H}}_{i}={\hat{H}}_{0}$. In this work we use QHL as the parameter learning subroutine [9]. While alternative parameter-learning methods can be used in principle, such as tomography [14], we focus on QHL as it requires exponentially fewer samples than typical tomographic approaches. Branches are consolidated, meaning that models are evaluated relative to each other, and ordered according to their strength. Models favoured by the consolidation are then used to spawn a new set of models, which are placed on the next branch; the average approximation of ${\hat{H}}_{0}$ should thus improve with each new branch.

Exploration strategies (ES) are the mechanism through which a user can specify the goals of QMLA. In addition to setting the target system, ESs define the process by which QMLA will spwan new models throughout its exploration phase, and the criteria by which to determine one model is preferred over another. Many possible heuristics can be proposed to explore the model space; however, usually such methods choose the next branch of models by exploiting the knowledge gained during the previous branch. For example, the single strongest model found in μ can be used as a basis for new models by adding a single further term from a prescribed set, i.e. greedy spawning. The structure of ESs can be tuned to address systems' unique requirements; in later sections we outline the logic of ESs underlying the cases studied in this work. All aspects of ESs are explained in detail in appendix D (https://stacks.iop.org/NJP/24/053034/ mmedia).

The QMLA procedure is depicted for an exemplary ES in figures 1(a)–(d), centred on an iterative model search phase as follows:

  • (a)  
    A set of models ${\mathbb{H}}^{\mu }$ are proposed (or spawned from a previous branch), and placed as leaves on branch μ.
  • (b)  
    Train ${\hat{H}}_{i}\in {\mathbb{H}}^{\mu }$.
    • 1.  
      i.e. assuming ${\hat{H}}_{0}={\hat{H}}_{i}={\vec{\alpha }}_{i}\cdot {\vec{T}}_{i}$, optimise ${\vec{\alpha }}_{i}$.
  • (c)  
    Consolidate μ
    • 1.  
      Evaluate and rank all ${\hat{H}}_{i}\in {\mathbb{H}}^{\mu }$.
    • 2.  
      Nominate the strongest model as the branch champion, ${\hat{H}}_{C}^{\mu }$.
  • (d)  
    μμ + 1

Figure 1.

Figure 1. Schematic of QMLA. (a)–(d) Model search phase within an exploration strategy. (a) Models are placed as (empty, purple) nodes on the active branch μ, where each model is a sum of terms ${\hat{t}}_{k}$ multiplied by a scalar parameter αk . (b) Each active model is trained according to a subroutine, such as QHL, to optimise ${\vec{\alpha }}_{i}$, resulting in the trained (filled, purple) node $\hat{H}({\vec{\alpha }}_{i}^{\prime })$. (c) μ is consolidated, i.e. models are evaluated relative to other models on μ, according to the consolidation mechanism specified by the ES. In this example, pairwise Bayes factors (BFs) Bij between ${\hat{H}}_{i},{\hat{H}}_{j}$ are computed, resulting in the election of a single branch champion ${\hat{H}}_{C}^{\mu }$ (bronze). (d) A new set of models are spawned according to the chosen ES's model generation strategy. In this example, models are spawned from a single parent. (e)–(f) Higher level of entire QMLA procedure. (e) The model search phase is presented on ETs. Multiple ESs can operate in parallel, e.g. assuming different underlying physics. Each ES nominates a champion, ${\hat{H}}_{S}^{\prime }$ (silver), after consolidating its branch champions (bronze). (f) ${\hat{H}}_{S}^{\prime }$ from each of the above ETs are gathered on a single branch, which is consolidated to give the final champion model, ${\hat{H}}^{\prime }$ (gold).

Standard image High-resolution image

The model search phase is subject to termination criteria set by the ES, e.g. to terminate when a set number of branches is reached. QMLA next consolidates the set of branch champions, $\left\{{\hat{H}}_{C}^{\mu }\right\}$, to declare the strongest model as the tree champion, ${\hat{H}}_{S}^{\prime }$. Finally, QMLA can concurrently run multiple ESs, so the final step of QMLA is to consolidate the set $\left\{{\hat{H}}_{S}^{\prime }\right\}$, in order to declare a global champion, ${\hat{H}}^{\prime }$. Each ES is assigned an independent exploration tree (ET), consisting of as many branches as the ES requires. Together, then, we can think that the ETs constitute a forest, such that QMLA can be described as a forest search for the single leaf (model) on any branch, which best captures Q's dynamics, see figures 1(e) and (f).

3. Case studies

3.1. Model selection

The simplest application of QMLA is to propose a fixed set of candidate models in advance: the ET is a single branch of prescribed models, with no further model spawning. The branch is consolidated as follows. Models are compared pairwise through BFs, which provide statistical evidence of one model's superiority over the other [24]. Each comparison gains a single point for the superior model; after all comparisons on the branch are complete, the model with most points is declared ${\hat{H}}^{\prime }$. To demonstrate the reliability of QMLA, we begin with this case under three physical families, described by (i) Ising; (ii) Heisenberg and (iii) Hubbard models.

Candidate models differ in the number of lattice sites and the configuration of pairwise couplings, $\mathcal{C}=\left\{\langle k,l\rangle \right\}$. (i) Is characterised by equations (2a) to (2b), likewise (ii) is given by equations (2c) to (2d), and (iii) by equations (2e) to (2f)

Equation (2a)

Equation (2b)

Equation (2c)

Equation (2d)

Equation (2e)

Equation (2f)

where ${\hat{\sigma }}_{k}^{p}{\hat{\sigma }}_{l}^{p}$ is the coupling term between sites k, l along axis p (e.g. ${\hat{\sigma }}_{k}^{x}{\hat{\sigma }}_{l}^{x}$); N is the total number of sites in the system; ${\hat{c}}_{l,s}^{{\dagger}}\ ({\hat{c}}_{l,s})$ is the fermionic creation (annihilation) operator for spin s ∈ {↑, ↓} on site l, and ${\hat{n}}_{ks}$ is the on-site term for the number of spins of type s on site k. In order to simulate Hubbard Hamiltonians, we invoke a Jordan–Wigner transformation, resulting in a two-qubit-per-site overhead, which renders simulations of this latter case more computationally demanding.

For each of (i)–(iii), we cycle through a set of lattice configurations $\mathbb{C}=\left\{{\mathcal{C}}_{i}\right\}$, including 1D chains and 2D lattices with varying connectivity. ${\Vert}\mathbb{C}{\Vert}=10$ for (i) and (ii), and ${\Vert}\mathbb{C}{\Vert}=5$ for (iii) due to said simulation constraints. The entertained lattices are shown in figure 2, along with the success rate with which QMLA finds precisely ${\hat{H}}^{\prime }={\hat{H}}_{0}$ in instances where that lattice was set as ${\hat{H}}_{0}$. For every lattice type in each physical scenario, QMLA successfully identifies ${\hat{H}}_{0}$ in $\geqslant 60\%$ of instances, proving the viability of BF as a mechanism to distinguish models.

Figure 2.

Figure 2. Rates of success for the QMLA in identifying the underlying lattice of the target model ${\hat{H}}_{0}$. Each lattice (a)–(e) is set as the true model, ${\hat{H}}_{0}$, for ten independent QMLA instances. In each instance, QMLA considers the available lattices ((a)–(j) for Ising and Heisenberg cases and (a)–(e) for the Hubbard case), and selects a champion model, ${\hat{H}}^{\prime }$, as the model most consistent with data generated by ${\hat{H}}_{0}$. The bars in each case show the percentage of instances for which QMLA identified ${\hat{H}}^{\prime }={\hat{H}}_{0}$ when the corresponding lattice configuration gave ${\hat{H}}_{0}$.

Standard image High-resolution image

Beyond identifying ${\hat{H}}_{0}$ precisely, QMLA can distinguish which family of model is most suitable for describing the target system, e.g. whether Q is given by an Ising, Heisenberg or Hubbard model. We run an ET for the three named families in parallel; each nominates its tree champion ${\hat{H}}_{S}^{\prime }$, allowing QMLA to consolidate $\left\{{\hat{H}}_{S}^{\prime }\right\}$ to determine the champion model, ${\hat{H}}^{\prime }$, and simultaneously the family to which ${\hat{H}}^{\prime }$ belongs. Each model entertained by QMLA undergoes a training regime, the efficacy of which depends on the resources afforded, i.e. the number of experimental outcomes against which ${\hat{H}}_{i}$ is trained, NE , and the number of particles used to approximate the parameters' probability distribution during Bayesian inference, NP . The concepts of experiments and particles are explained in appendix C1. The rate with which QMLA succeeds in identifying both ${\hat{H}}_{0}$ and the family of Q depends on these training resources, figure 3.

Figure 3.

Figure 3. Rates of identification of the exact target model and its family with increasing training resources. The target model in each QMLA instance varies between Ising, Heisenberg and Hubbard families, set by lattices as in figure 2. Each family is explored and nominates a ${\hat{H}}_{S}^{\prime }$; ${\hat{H}}^{\prime }$ is the champion of $\left\{{\hat{H}}_{S}^{\prime }\right\}$, as in figure 1. Each lattice per family is run as ${\hat{H}}_{0}$ in five independent QMLA instances; the success rate shows how often ${\hat{H}}_{0}$ is identified (blue) and the family to which ${\hat{H}}_{0}$ belongs is identified (orange) for increasing training resources NE , NP .

Standard image High-resolution image

3.2. Wider model search

In general, the model space grows combinatorially with the dimension of Q, and it is not feasible to prescribe a deterministic ES as above, without an excellent guess of which subspace to entertain, or exploring a large fraction of the large space. An adaptive ES is warranted to explore this model space without relying on prior knowledge: in order to approximate ${\hat{H}}_{0}$ we devise a genetic algorithm (GA) to perform the search. In this study we employ interactive quantum likelihood estimation within the model training subroutine (i.e. QHL), rendering the procedure applicable only in cases where we have control on Q, such as where Q is an untrusted quantum simulator [25]. GAs are combinatorial optimisation techniques, applicable to problems where a large number of configurations are possible, where it is infeasible to test every candidate: their outcome is not guaranteed to be optimal, but is likely to be near-optimal [26]. Such configurations are called chromosomes, whose suitability can be quantified through calculation of some objective function (OF). OFs are not necessarily absolute, i.e. it is not always guaranteed that the optimal chromosome should achieve a certain value of the OF, but rather the chromosome with highest (lowest) observed value is deemed the strongest candidate. Nm models are proposed in a single generation of the GA, which runs for Ng generations, in clear analogy with the branches of an ET. We outline the usual process of GAs, along with our choice of selection, cross-over and mutation mechanisms, in appendix B.

First we define the set of terms, $\mathcal{T}=\left\{{\hat{t}}_{i}\right\}$, which may occur in ${\hat{H}}_{0}$, e.g. by listing the available couplings between lattice sites in our target system, Q. ${\hat{t}}_{i}$ are mapped to binary genes such that chromosomes—written as binary strings where each bit is a single gene—can be interpreted as models: an example of this mapping is shown in table 1. We study a four-site lattice with arbitrary connectivity under a Heisenberg-XYZ model, omitting the transverse field for simplicity, i.e. any two sites i, j can be coupled by ${\hat{\sigma }}_{i}^{x}{\hat{\sigma }}_{j}^{x},\ {\hat{\sigma }}_{i}^{y}{\hat{\sigma }}_{j}^{y}\ $ or $\ {\hat{\sigma }}_{i}^{z}{\hat{\sigma }}_{j}^{z}$. There are therefore $\vert \mathcal{T}\vert =3\times \left(\genfrac{}{}{0.0pt}{}{4}{2}\right)=18$ binary genes. For brevity we introduce the compact notation ${\hat{\sigma }}_{(i,j)}^{ab}={\hat{\sigma }}_{i}^{a}{\hat{\sigma }}_{j}^{a}+{\hat{\sigma }}_{i}^{b}{\hat{\sigma }}_{j}^{b}$. We compose the true model of half the available terms, chosen randomly from $\mathcal{T}$,

Equation (3)

We can view QMLA as a binary classification routine, i.e. it attempts to classify whether each ${\hat{t}}_{i}\in \mathcal{T}$ is present in ${\mathcal{T}}_{0}$; equivalently, whether each available interaction occurs in Q. It is therefore appropriate to adopt metrics from the ML literature regarding classification. Our primary figure of merit, against which candidate models are assessed, is F1 score: the harmonic mean of precision (fraction of terms in ${\mathcal{T}}_{i}$ which are in ${\mathcal{T}}_{0}$) and sensitivity (fraction of terms in ${\mathcal{T}}_{0}$ which are in ${\mathcal{T}}_{i}$), described in full in appendix E1. In practice, the F1 score f ∈ (0, 1) indicates the degree to which a model captures the physics of Q: models with f = 0 share no terms with ${\hat{H}}_{0}$, while f = 1 is found uniquely for ${\hat{H}}_{0}$. Importantly, the F1 score is a measure of the overlap of terms between the true and candidate models: it is not guaranteed that models of higher f out-perform the predictive ability of those with lower f. However we conjecture that predictive power—i.e. predicting the true system's dynamics as captured by log likelihoods—improves with f, discussed in appendix E10.

Table 1. Mapping between QMLA's models and chromosomes used by a GA. Example shown for a three-qubit system with six possible terms, ${\hat{\sigma }}_{i,j}^{w}={\hat{\sigma }}_{i}^{w}{\hat{\sigma }}_{j}^{w}$. Model terms are mapped to binary genes: if the gene registers 0 then the corresponding term is not present in the model, and if it registers 1 the term is included. The top two chromosomes are parents, ${\gamma }_{{p}_{1}}=101\,010$ (blue) and ${\gamma }_{{p}_{2}}=001\,011$ (green): they are mixed to spawn new models. We use a one-point cross over about the midpoint: the first half of ${\gamma }_{{p}_{1}}$ is mixed with the second half of ${\gamma }_{{p}_{2}}$ to produce two new children chromosomes, ${\gamma }_{{c}_{1}},{\gamma }_{{c}_{2}}$. Mutation occurs probabilistically: each gene has a 25% chance of being mutated, e.g. a single gene (red) flipping from 0 → 1 to mutate ${\gamma }_{{c}_{2}}$ to ${\gamma }_{{c}_{2}}^{\prime }$. The next generation of the GA will then include ${\gamma }_{{c}_{1}},{\gamma }_{{c}_{2}}^{\prime }$ (assuming ${\gamma }_{{c}_{1}}$ does not mutate). To generate Nm models for each generation, Nm /2 parent couples are sampled from the previous generation and crossed over.

QMLA should not presume knowledge of ${\hat{H}}_{0}$: the model search cannot verify the presence of any $\hat{t}\in {\mathcal{T}}_{0}$ definitively, although the demonstrations in this work rely on simulated ${\hat{H}}_{0}$, so we can assess the performance of QMLA with respect to F1 score. Without assuming knowledge of ${\hat{H}}_{0}$ while performing the model search, we do not have a natural OF. By first simulating ${\hat{H}}_{0}$, however, we can design OFs which iteratively improve f on successive generations of the GA. We perform this analysis in appendix E, and hence favour an approach inspired by Elo ratings [23], which is the system used in competitions including chess and football to rate individual competitors, detailed in appendix E8. The Bayes factor enhanced Elo ratings give a nonlinear points transfer scheme:

  • All models on μ, $\left\{{\hat{H}}_{i}\right\}$ are assigned the same initial rating, {Ri };
  • Models on μ are mapped to vertices of a regular graph with partial connectivity;
  • Pairs of models connected by an edge, $({\hat{H}}_{i},{\hat{H}}_{j})$, are compared through BF, giving Bij ;
  • The model indicated as inferior by Bij transfers some of its rating to the superior model: the quantity transferred, ΔRij , reflects
    • The statistical evidence given by Bij ;
    • The initial ratings of both models, {Ri , Rj }.

The ratings of models on μ therefore increase or decrease depending on their relative performance, shown for an exemplary generation in figure 4(a).

Figure 4.

Figure 4. Genetic exploration strategy within QMLA. (a)–(b) Single instance of QMLA. The GA runs for Ng = 15 generations, where each generation tests Nm = 60 models. (a) Ratings of all models in a single GA generation. Each line represents a unique model and is coloured by the F1  score of that model. Inset, the selection probabilities resulting from the final ratings of this generation, i.e. the models' chances of being chosen as a parent to a new model. Only a fraction of models are assigned selection probability, while the remaining poorer-performing models are truncated. (b) Gene pool progression for Nm = 60, Ng = 15. Each tile at each generation represents a model by its F1  score. (c)–(d) Results of 100 QMLA instances using the GA exploration strategy. (c) The model space in which QMLA searches. (Left) The total model space contains 218 ≈ 250 000 candidate models; normally distributed around $\bar{f}=0.5\pm 0.14$. (Centre) The models explored during the model search of all instances combined, $\left\{{\hat{H}}_{i}\right\}$, show that QMLA tends towards stronger models overall, with models considered having $\bar{f}=0.76\pm 0.15$ from ∼43 000 chromosomes across the instances, i.e. each instance trains ∼430 distinct models. (Right) Champion models from each instance, showing QMLA finds strong models in general, and in particular finds the true model ${\hat{H}}_{0}$ (with f = 1) in 72% of cases, and f ⩾ 0.88 in all instances. (d) Hinton diagram showing the rate at which each term is found within the winning model, ${\hat{H}}^{\prime }$. The size of the blocks show the frequency with which they are found, while the colour indicates whether that term was in the true model (blue) or not (red). Terms represent the coupling between two qubits, e.g. ${\hat{\sigma }}_{(1,3)}^{x}$ couples the first and third qubits along the x-axis. We test four qubits with full connectivity, resulting in 18 unique terms (terms with black rectangles are not considered by the GA).

Standard image High-resolution image

We use a roulette selection for the design of new candidate models: two models are selected from μ to become parents and spawn offspring. The selection probability for each model ${\hat{H}}_{i}\in \mu $ is proportional to Ri after all comparisons on μ; the strongest Nm /3 models on μ are available for selection as parents while evidently weaker models are discarded, see figure 4(a—inset). This procedure is repeated until Nm models are proposed; these do not have to be new—QMLA may have considered any given model previously—but all models within a generation should be distinct. We show the progression of chromosomes for a QMLA instance in figure 4(b), with Ng = 15, Nm = 60.

The genetic exploration strategy employs elitism rules, whereby the two models on μ with highest R are automatically considered on μ + 1. If a single model is observed as the highest-fitness candidate for five successive generations, the model search terminates. Finally, the global champion model is set as the highest-fitness model from the final generation, ${\hat{H}}^{\prime }={\hat{H}}_{C}^{{N}_{g}}$.

In figure 4(c) we show three different samplings of the model space: (left) considering a random sample of 106 models from all possible models; (centre) restricting to models entertained for at least one generation by QMLA; and (right) restricting to those models alone, that were found as global champions. The data in $\left\{{\hat{H}}_{i}\right\}$ and $\left\{{\hat{H}}^{\prime }\right\}$ are from 100 independent instances of QMLA. Typical instances of QMLA train ∼400 models before declaring ${\hat{H}}^{\prime }$, representing 0.16% of the total model space, finding ${\hat{H}}^{\prime }={\hat{H}}_{0}$ precisely in 72% of instances. Moreover, all instances find ${\hat{H}}^{\prime }$ with f ⩾ 0.88. Finally, by considering the Hinton diagram, figure 4(d), we see in combining the instances' results that, while some terms are erroneously included in ${\hat{H}}^{\prime }$, the identification rate of terms ${\hat{t}}_{i}\in {\mathcal{T}}_{0}$ $(\geqslant 95\%)$ is significantly higher than ${\hat{t}}_{i}\notin {\mathcal{T}}_{0}$ $(\leqslant 10\%)$.

Taken together, the win rates for the most popular models and the rates with which each term is identified allow for post-hoc determination of a single model with high confidence, corresponding to complete characterisation of Q. We suggest a cutoff rate for which each ${\hat{h}}_{i}$ must be found in ${\hat{H}}^{\prime }$ in order to be deemed a significant contributor to the system's dynamics. That is, if $\hat{h}$ is included in only a relatively small number of $\left\{{\hat{H}}^{\prime }\right\}$, it is more likely to represent a small error in QMLA's model search and training phases, than it is to represent a genuine interaction. Precisely quantifying such a cutoff rate is a subject for future work, but here for example we can see that a rate of 25% would comfortably allow us to derive ${\hat{H}}^{\prime }={\hat{H}}_{0}$ exactly.

4. Discussion

We have shown how QMLA can serve the purpose of characterising a given black box quantum system Q in several scenarios, identifying the most appropriate (Hamiltonian) model to describe the outcomes of experiments performed on states evolved via Q. The capabilities of QMLA were showcased in two different contexts: (i) the selection of the most suitable model, given a prescribed list of options; (ii) the design of an approximate model, starting from a list of simple primitive terms to combine. In case (i) we tested how QMLA is highly effective at discriminating between wrong and accurate models, with success rates exceeding 60% in all circumstances, which can be improved upon given access to additional computational resources. Whereas in (ii), designing a model ab initio for the targeted system, we studied how a genetic strategy, combined with an appropriate OF, can deliver a model embedding all the correct Hamiltonian terms in $\geqslant 95\%$ of independent instances, whilst exploring a negligible portion $(< 0.2\%)$ of a model space including hundreds of thousands of possible models. We emphasise the combinatorial growth in the number of models to entertain with the size of Q: the model space grows exponentially when searching for an optimal model via brute-force, whereas the adaptive search can quickly find an approximate—if not exact—model.

We stress how QMLA has a crucial competitive advantage over techniques which perform a complete set of experiments, to cope with no prior information concerning the target system, such as quantum process tomography (QPT) [27]. Indeed, such methods suffer exponential scalings in the number of measurements required with the system's dimension, and have only been demonstrated up to three qubits, if no additional assumptions on the system are introduced. Moreover, QPT methods typically learn a map for the system, whereas QMLA targets a more insightful reconstruction of all and only the relevant terms within the system's Hamiltonian. Naïvely performing a parameter estimation method, e.g. QHL, against the most complex credible Hamiltonian model, ${\hat{H}}_{\text{full}}$, does not exhaust the capabilities of QMLA. First, let us assume the case where ${\hat{H}}_{0}$ is considerably simpler than ${\hat{H}}_{\text{full}}$ (i.e. ${\hat{H}}_{\text{full}}$ is described by many more parameters than ${\hat{H}}_{0}$). In such a case, QHL will waste resources on learning parameters that play no role in the dynamics. Moreover, a crucial feature of QMLA is to provide a statistically motivated choice of which terms should be included in the Hamiltonian, allowing for physical insight into the system. This feature would be absent from a naive 'over-fitting': merely dropping terms according to their relative magnitude does not take into account the possibilities of different interactions in the system exhibiting very different strengths, where nevertheless all are relevant to the observed dynamics, as observed in some parameter learning instances [28, 29]. Finally, merely attempting parameter estimation against an overfitting model cannot perform comparisons across models belonging to different families, such as those exemplified for QMLA in figure 3.

In summary, QMLA provides the infrastructure which facilitates the formulation of candidate models in attempt to explain observations yielded from the quantum system of interest. The learning procedure is enabled by informative experiments—designed by QMLA to optimally exploit results from the setup, in an adaptive fashion similar to [30]—whose outcomes provide the feedback upon which the agent is trained. In order to do so, QMLA always assumes access to the same small set of facilities/subroutines: (i) the ability to prepare Q in a set of fiducial probe input states; (ii) the ability to perform projective measurements on the quantum states evolved by Q; (iii) the availability of a trusted simulator—either a classical computer or quantum simulator—capable of reproducing the same dynamics as Q and (iv) a subroutine for the training of model parameters, e.g. QHL. We stress how these requirements are readily verified in a wide class of experimental setups. The only challenging requirement is (iii), due to the well-known inefficiency of classical devices at simulating generic quantum systems. Nevertheless, we argue how the development of quantum technologies might provide reliable quantum simulators, which could then be deployed to characterise batches of equivalent devices. In this context, we envisage how our protocol might be readily applied in circumstances of crucial interest. One such example is offered by the identification of spurious interactions in an experimental quantum device. In prototyping many quantum devices, it is likely to observe unwanted terms, e.g. cross-talk among qubits, or artifacts arising from workarounds in devices with limited connectivity [3135]. In this scenario, the user might wish to test whether interactions among Q's components occur which were not designed on-purpose: this should allow for the calibration or redesign of the device to account for such defects.

One of the most promising applications of QMLA is the identification of the class of models which most closely represents Q's interactions. We envision future work combining the breadth of such a 'family'-search, with the depth of the genetic exploration strategy, allowing for rapid classification of black-box quantum systems and devices. This would be similar in spirit to recently demonstrated machine-learning of the different phases of matter and their transitions [3638], and classification of vector vortex beams [39]. For instance, considering Q as an untrusted quantum simulator, whose operation the user wishes to verify, QMLA can assess whether the device faithfully dials an encoded ${\hat{H}}_{0}$, and if not, what is the actual ${\hat{H}}^{\prime }$ implemented. Moreover, connected to an online device such as a trusted simulator, QMLA could monitor whether the device has transitioned to an undesired regime. Overall, we expect this functionality to prove helpful beyond the cases shown in this paper, serving as a robust tool in the development of near-term quantum technologies.

Author contribution

BF, AAG, RS and NW conceived the project. BF developed software and performed simulations. AAG, RS and AL supervised the project. All authors contributed to the manuscript.

Competing financial interests

The authors declare no competing financial interests

Code availability

The source code is available within the QMLA framework, an open source Python project [40].

Acknowledgments

The authors thank Stefano Paesani, Cassandra Granade and Sebastian Knauer for helpful discussions. BF acknowledges support from Airbus and EPSRC Grant code EP/P510427/1. This work was carried out using the computational facilities of the Advanced Computing Research Centre, University of Bristol—http://bristol.ac.uk/acrc/. The authors also acknowledge support from the EPSRC Hub in Quantum Computing and Simulation (EP/T001062/1). AL acknowledges fellowship support from EPSRC (EP/N003470/1). NW was funded by a grant from Google Quantum AI, the NQI center for Quantum Co-Design, the Pacific Northwest National Laboratory LDRD programme and the 'Embedding Quantum Computing into Many-Body Frameworks for Strongly Correlated Molecular and Materials Systems' project, funded by the US Department of Energy (DOE).

Data availability statement

The data that support the findings of this study are openly available at the following URL/DOI: https://zenodo.org/badge/latestdoi/95233038.

Please wait… references are loading.
10.1088/1367-2630/ac68ff