Skip to main content

Thank you for visiting You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

Quantum approximate Bayesian computation for NMR model inference


Recent technological advances may lead to the development of small-scale quantum computers that are capable of solving problems that cannot be tackled with classical computers. A limited number of algorithms have been proposed and their relevance to real-world problems is a subject of active investigation. Analysis of many-body quantum systems is particularly challenging for classical computers due to the exponential scaling of the Hilbert space dimension with the number of particles. Hence, solving the problems relevant to chemistry and condensed-matter physics is expected to be the first successful application of quantum computers. In this Article, we propose another class of problems from the quantum realm that can be solved efficiently on quantum computers: model inference for nuclear magnetic resonance (NMR) spectroscopy, which is important for biological and medical research. Our results are based on three interconnected studies. First, we use methods from classical machine learning to analyse a dataset of NMR spectra of small molecules. We perform stochastic neighbourhood embedding and identify clusters of spectra, and demonstrate that these clusters are correlated with the covalent structure of the molecules. Second, we propose a simple and efficient method, aided by a quantum simulator, to extract the NMR spectrum of any hypothetical molecule described by a parametric Heisenberg model. Third, we propose a simple variational Bayesian inference procedure for estimating the Hamiltonian parameters of experimentally relevant NMR spectra.

This is a preview of subscription content, access via your institution

Access options

Buy article

Get time limited or full article access on ReadCube.


All prices are NET prices.

Fig. 1: Clustering analysis to identify whether naturally occurring molecules have an atypical NMR spectrum.
Fig. 2: NMR spectra.
Fig. 3: Method overview.
Fig. 4: Inference.

Data availability

The data and code to numerically generate the NMR data sets used in this manuscript can be found at


  1. Preskill, J. Quantum computing in the NISQ era and beyond. Quantum 2, 79–98 (2018).

    Google Scholar 

  2. Bernien, H. et al. Probing many-body dynamics on a 51-atom quantum simulator. Nature 551, 579–584 (2017).

    Google Scholar 

  3. Friis, N. et al. Observation of entangled states of a fully controlled 20-qubit system. Phys. Rev. X 8, 021012 (2018).

    Google Scholar 

  4. Farhi, E., Goldstone, J. & Gutmann, S. A quantum approximate optimization algorithm. Preprint at (2014).

  5. Peruzzo, A. et al. A variational eigenvalue solver on a photonic quantum processor. Nat. Commun. 5, 4213 (2014).

    Google Scholar 

  6. Kokail, C. et al. Self-verifying variational quantum simulation of lattice models. Nature 569, 355–360 (2019).

    Google Scholar 

  7. Kandala, A. et al. Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets. Nature 549, 242–246 (2017).

    Google Scholar 

  8. Colless, J. I. et al. Computation of molecular spectra on a quantum processor with an error-resilient algorithm. Phys. Rev. X 8, 011021 (2018).

    Google Scholar 

  9. Diggle, P. J. & Gratton, R. J. Monte Carlo methods of inference for implicit statistical models. J. R. Stat. Soc. B 46, 193–227 (1984).

    MathSciNet  MATH  Google Scholar 

  10. Beaumont, M. A., Zhang, W. & Balding, D. J. Approximate Bayesian computation in population genetics. Genetics 162, 2025–2035 (2002).

    Google Scholar 

  11. Gershenfeld, N. A. & Chuang, I. L. Bulk spin-resonance quantum computation. Science 275, 350–356 (1997).

    MathSciNet  MATH  Google Scholar 

  12. Braunstein, S. L. et al. Separability of very noisy mixed states and implications for NMR quantum computing. Phys. Rev. Lett. 83, 1054–1057 (1999).

    Google Scholar 

  13. Menicucci, N. C. & Caves, C. M. Local realistic model for the dynamics of bulk-ensemble NMR information processing. Phys. Rev. Lett. 88, 167901 (2002).

    Google Scholar 

  14. Datta, A. & Vidal, G. Role of entanglement and correlations in mixed-state quantum computation. Phys. Rev. A 75, 042310 (2007).

    MathSciNet  Google Scholar 

  15. Knill, E. & Laflamme, R. Power of one bit of quantum information. Phys. Rev. Lett. 81, 5672–5675 (1998).

    Google Scholar 

  16. Biamonte, J. et al. Quantum machine learning. Nature 549, 195–202 (2017).

    Google Scholar 

  17. Brassard, G. & Hoyer, P. An exact quantum polynomial-time algorithm for Simon’s problem. In Proceedings of the Fifth Israeli Symposium on Theory of Computing and Systems 12–23 (IEEE, 1997).<q>

  18. Grover, L. K. Quantum computers can search rapidly by using almost any transformation. Phys. Rev. Lett. 80, 4329–4332 (1998).

    Google Scholar 

  19. Harrow, A. W., Hassidim, A. & Lloyd, S. Quantum algorithm for linear systems of equations. Phys. Rev. Lett. 103, 150502 (2009).

    MathSciNet  Google Scholar 

  20. Bothwell, J. H. F. & Griffin, J. L. An introduction to biological nuclear magnetic resonance spectroscopy. Biol. Rev. 86, 493–510 (2011).

    Google Scholar 

  21. Hwang, J.-H. & Choi, C. S. Use of in vivo magnetic resonance spectroscopy for studying metabolic diseases. Exp. Mol. Med. 47, e139 (2015).

    Google Scholar 

  22. Beckonert, O. et al. Metabolic profiling, metabolomic and metabonomic procedures for NMR spectroscopy of urine, plasma, serum and tissue extracts. Nat. Protoc. 2, 2692–2703 (2007).

    Google Scholar 

  23. Larive, C. K., Barding, G. A. & Dinges, M. M. NMR spectroscopy for metabolomics and metabolic profiling. Anal. Chem. 87, 133–146 (2015).

    Google Scholar 

  24. Napolitano, J. et al. Proton fingerprints portray molecular structures: enhanced description of the 1H NMR spectra of small molecules. J. Org. Chem. 78, 9963–9968 (2013).

    Google Scholar 

  25. Ravanbakhsh, S. et al. Accurate, fully-automated NMR spectral profiling for metabolomics. PLoS ONE 10, e0124219 (2015).

    Google Scholar 

  26. De Graaf, A. A. & Boveé, W. M. M. J. Improved quantification of in vivo 1H NMR spectra by optimization of signal acquisition and processing and by incorporation of prior knowledge into the spectral fitting. Magn. Reson. Med. 15, 305–319 (1990).

    Google Scholar 

  27. Wevers, R. A., Engelke, U. & Heerschap, A. High-resolution 1H-NMR spectroscopy of blood plasma for metabolic studies. Clin. Chem. 40, 1245–1250 (1994).

    Google Scholar 

  28. Wevers, R. A. et al. Standardized method for high-resolution 1H-NMR of cerebrospinal fluid. Clin. Chem. 41, 744–751 (1995).

    Google Scholar 

  29. Govindaraju, V., Young, K. & Maudsley, A. A. Proton NMR chemical shifts and coupling constants for brain metabolites. NMR Biomed. 13, 129–153 (2000).

    Google Scholar 

  30. Dashti, H. et al. Applications of parametrized NMR spin systems of small molecules. Anal. Chem. 90, 10646–10649 (2018).

    Google Scholar 

  31. Dashti, H. et al. Spin system modeling of nuclear magnetic resonance spectra for applications in metabolomics and small molecule screening. Anal. Chem. 89, 12201–12208 (2017).

    Google Scholar 

  32. Pickard, C. J. & Mauri, F. All-electron magnetic response with pseudopotentials: NMR chemical shifts. Phys. Rev. B 63, 245101 (2001).

    Google Scholar 

  33. Paruzzo, F. M. et al. Chemical shifts in molecular solids by machine learning. Nat. Commun. 9, 4501 (2018).

    Google Scholar 

  34. Levitt, M. H. Spin Dynamics: Basics of Nuclear Magnetic Resonance (Wiley, 2008).

  35. Dashti, H. Guided Ideographic Spin System Model Optimization (GISSMO)<q> (2019);

  36. van der Maaten, L. & Hinton, G. Visualizing data using t-SNE. J. Mach. Learn. Res. 9, 2579–2605 (2008).

    MATH  Google Scholar 

  37. van der Maaten, L. (2019).

  38. Ester, M., Kriegel, H.-P., Sander, J. & Xu, X. A density-based algorithm for discovering clusters in large spatial databases with noise. In Proceedings of the Second International Conference on Knowledge, Discovery and Data Mining 226–231 (AAAI Press, 1996).

  39. Ulrich, E. L. et al. Biomagresbank. Nucleic Acids Res. 36, D402–D408 (2008).

    Google Scholar 

  40. Sokolenko, S. et al. Robust 1D NMR lineshape fitting using real and imaginary data in the frequency domain. J. Magn. Reson. 298, 91–100 (2019).

    Google Scholar 

  41. Xu, K., Marrelec, G., Bernard, S. & Grimal, Q. Lorentzian-model-based Bayesian analysis for automated estimation of attenuated resonance spectrum. IEEE Trans. Signal Process. 67, 4–16 (2019).

    MathSciNet  MATH  Google Scholar 

  42. Arute, F. et al. Quantum supremacy using a programmable superconducting processor. Nature 574, 505–510 (2019).

    Google Scholar 

  43. McClean, J. R., Boixo, S., Smelyanskiy, V. N., Babbush, R. & Neven, H. Barren plateaus in quantum neural network training landscapes. Nat. Commun. 9, 4812 (2018).

    Google Scholar 

  44. Kokail, C. et al. Self-verifying variational quantum simulation of lattice models. Nature 569, 355–360 (2019).

    Google Scholar 

  45. Kieferová, M. & Wiebe, N. Tomography and generative training with quantum Boltzmann machines. Phys. Rev. A 96, 062327 (2017).

    Google Scholar 

  46. Amin, M. H., Andriyash, E., Rolfe, J., Kulchytskyy, B. & Melko, R. Quantum Boltzmann machine. Phys. Rev. X 8, 021050 (2018).

    Google Scholar 

  47. Zhou, L., Wang, S.-T., Choi, S., Pichler, H. & Lukin, M. D. Quantum approximate optimization algorithm: performance, mechanism and implementation on near-term devices. Preprint at (2018).

  48. Radford, N. in Handbook of Markov Chain Monte Carlo (eds Brooks, S. et al.) 116–162 (CRC, 2011).

  49. Murakami, Y. & Ishihara, S. (eds) Resonant X-ray Scattering in Correlated Systems (Springer, 2017).

  50. Hofstetter, W., Cirac, J. I., Zoller, P., Demler, E. & Lukin, M. D. High-temperature superfluidity of fermionic atoms in optical lattices. Phys. Rev. Lett. 89, 220407 (2002).

    Google Scholar 

  51. Bloch, I., Dalibard, J. & Zwerger, W. Many-body physics with ultracold gases. Rev. Mod. Phys. 80, 885–964 (2008).

    Google Scholar 

  52. Ament, L. J. P., van Veenendaal, M., Devereaux, T. P., Hill, J. P. & van den Brink, J. Resonant inelastic X-ray scattering studies of elementary excitations. Rev. Mod. Phys. 83, 705–767 (2011).

    Google Scholar 

  53. Kreula, J. M. et al. Few-qubit quantum-classical simulation of strongly correlated lattice fermions. EPJ Quantum Technol. 3, 11 (2016).

    Google Scholar 

Download references


D.S. acknowledges support from the FWO as post-doctoral fellow of the Research Foundation—Flanders and from a 2019 grant from the Harvard Quantum Initiative Seed Funding programme. S.M. is supported by a research grant from the National Heart, Lung, and Blood Institute (K24 HL136852). O.D. and H.D. are supported by a research award from the National Heart, Lung, and Blood Institute, (5K01HL135342) and (T32 HL007575) respectively. E.D. acknowledges support from the Harvard–MIT CUA, ARO grant number W911NF-20-1-0163, the National Science Foundation through grant number OAC-1934714, AFOSR Quantum Simulation MURI.The authors acknowledge useful discussions with P. Mehta and M. Lukin.

Author information

Authors and Affiliations



D.S. and E.D. conceived the presented idea in consultation with H.D., S.M. and O.D. D.S. developed the theoretical formalism, performed the analytic calculations and performed the numerical simulations. H.D. compiled the NMR data used in the manuscript. All authors provided critical feedback and helped shape the manuscript.

Corresponding author

Correspondence to Dries Sels.

Ethics declarations

Competing interests

The authors declare no competing interests.

Additional information

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

Supplementary Information

Supplementary Discussion and Figs. 1–5.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Sels, D., Dashti, H., Mora, S. et al. Quantum approximate Bayesian computation for NMR model inference. Nat Mach Intell 2, 396–402 (2020).

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI:


Quick links

Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing