On your wavelength

The rise of open source in quantum physics research

Post by Nathan Shammah and Shahnawaz Ahmed.

Open-source scientific computing is empowering research and reproducibility. It forms one of the principles of the ‘open science’ movement, which aims to promote the spread of scientific knowledge without barriers. Open-source software refers to code which can be read, modified and distributed by anyone and for any purpose under the various open-source compliant licenses. This ‘open source way’ could extend beyond just software and is impacting quantum physics research in radically different ways.

Quantum-tech open source

Quantum computing represents a different computational paradigm from conventional computing: it exploits quantum mechanics at the algorithmic level. As quantum algorithms need to be run on quantum devices, advances in hardware development, currently underway, are crucial. At the same time also software for quantum computing needs to be developed for various purposes – compilation, control, noise modeling, simulation and verification. Open source is driving the development of the quantum computing software ecosystem [Fingerhuth18].

To some extent, the very structure of research in quantum technology is being reshaped by open-source projects to a new degree, for example allowing theorists to run quantum physics experiments from the cloud, without ever entering the lab (to the relief of experimentalists) [Zeng17]. In most cases, the tools are open source in a bid to involve the community of researchers and software developers to come together to build the next generation of software for quantum computing.

Beyond quantum computing there is also a broader area of quantum physics research that is being driven by open source. Some projects aim to provide a broad set of tools which can be used for quantum physics research, such as QuTiP, a Python toolbox for open quantum system simulations, which was started as early as 2011 [Johannson12]. Recently tools such as QuantumOptics.jl (a Julia package for quantum optics simulations) or Google-backed Open Fermion (simulating fermionic interactions and other chemistry problems) have been released for tackling different types of research problems. Other projects are purpose-specific, such as Pennylane (focussing on machine learning and quantum physics), ProjectQ (translating quantum programs to “any back-end”), and NetKet (Neural Network Quantum states for solving quantum many body problems). A community-maintained list of software can be found here.

 Factors contributing to the rise of scientific research with open-source software

Scientific progress is fueled by collaborations and development of ideas from others. In the same spirit, open-source is built upon the contributions of the community and there are several factors that are leading to its adoption beyond quantum physics research.

Firstly, open-source libraries allow fast reproducibility of results. By preventing the reinventing of the wheel and the need to start projects from scratch, they allow for a rapid development, testing and prototyping of ideas and extending previous work. This accelerates the rate of discovery, as new results can be investigated by other researchers tinkering with existing code.

Secondly, there are a variety of tools that increase productivity and collaboration. There is a general trend in scientific research in working in larger teams [Fortunato18] and open-source tools are helping in that. Github or Gitlab are websites that coordinate delocalized teams to work on the same coding project (similarly to Dropbox for file syncing and Overleaf for typewriting). One can also work interactively on code with solutions such as the Jupyter Lab computational environment, Google Colaboratory or CoCalc.

Then, there are well established tools for open-source software development from start to finish:  Travis CI, Anaconda, and the community-managed ‘conda-forge’ channel, can all be set-up easily to take care of testing, continuous integration and software packaging and distribution.

Finally, there are tools specifically crafted to better adapt to the modern characteristics of research publication, in which papers in journals have a background of data or software. Zenodo for example allows the publication of open-source software together with published papers and instantly attributes to it a DOI reference, without waiting for the (sometime lengthy) peer-review process. The crystallization of software is also a guarantee for reviewers and other researchers who might want to use the same code.

Python and machine learning as success stories for open source

 The benefits of the open-source approach can be clearly seen in machine learning, especially deep neural networks. Suddenly, it has become very easy to tinker and use even the most advanced methods in machine learning thanks to the availability of code and tools to modify and run them. With Google’s TensorFlow or Facebook-backed PyTorch, the power of deep neural networks reached the masses, leading to very creative applications.

As a result, we are also witnessing the impact of machine learning to all areas of natural sciences and tasks, from designing quantum experiments [Melnikov18] to detecting gravitational waves [Gabbard18].

An important factor for the wide adoption and use of machine learning tools is Python. It is an interpreted programming language that has seen a steady growth in adoption, based on a wide environment of modular independent software packages (libraries) that can be used together for numerics (SciPy), generating visualizations (Matplotlib), sharing code (Jupyter notebooks) and much more.

For some applications, Python’s limited computational performance (generally lower than C, C++ or FORTRAN) can be overcome by writing parts of the code in other languages and calling them from Python or using targeted solutions such as Numba or Cython to compile parts of the code into fast machine code.

But what really sets it apart its intrinsic code-writing efficiency and speed of developing prototypes, as one can more easily debug software on the go. As pointed out by Guido Van Rossum, the creator of Python, in a recent video interview for the MIT AI lecture series, scientific research through numerical means is usually a trial-and error creative approach, where the very investigative process benefits from an interactive feedback loop. The faster the loop, the faster the distillation of code.

Can quantum physics and quantum computing follow in this path by going the open-source way, accelerating the discovery of physical phenomena? Below we provide an example drawn from our recent experience.

PIQS: an example of open source package for physics research

 A major drawback in the development of quantum technology is the emergence of stronger noise as the system size grows, a process generally referred to as decoherence. The quantum system is never completely isolated, like Schrödinger’s cat inside the box, but is ‘open’ to interactions with the environments. The theoretical description of such coherence-averse processes in many-body quantum physics dynamics is itself problematic. This is because the very computational space grows exponentially with the number of qubits N, faster than 2^N (actually a daunting 4^N even if major assumptions simplifying the possible correlations of the open system are made).

We have recently released an open-source library, the permutational invariant quantum solver (PIQS) [Shammah18], to simulate a broad range of effects with an exponential advantage over the straightforward simulation of the open quantum dynamics. With PIQS, it is possible to include local effects in the noisy dynamics and energy dissipation, as well as the incoherent influx of energy from an external source, such as that mediated by a pumped cavity field by intermediate Raman processes in clouds of atoms illuminated by laser light [Baumann10,Bohnet12].

PIQS is quite versatile and addresses a series of open questions in the thermodynamics of quantum systems. This library can describe a broad range non-equilibrium effects in large systems of qubits, or ensembles of two-level systems, such as Dicke superradiance, which is the cooperative emission of light from an ensemble of identical two-level systems, in presence of sub-optimal experimental conditions, such as in solid-state devices, in which inhomogeneous broadening and local dephasing spoil the simple textbook picture of coherent light-matter interaction [Shammah17].

Due to the universality of the mathematical language in which quantum mechanics speaks, this tool can also describe spins in solid state materials and more generally, qubits engineered on a broad variety of platforms, from lattices of atoms to defects in diamond [Bradac17,Angerer18,Rainò18]. The use of permutational invariance has been crucial for the exponential reduction of the system space. The PIQS library joins other numerical investigations and libraries leveraging on symmetries in Lie algebras in tensor spaces [Kirton17,Gegg17].

By integrating the PIQS library into QuTiP, the quantum optics software in Python first released in 2011, this purpose-specific tool is now accessible to a wide community of users already familiar with this other well-established open-source software. This agility is another example of the modularity not only of the Python ecosystem, but of modular libraries themselves.

QuTiP itself is the example of a flexible library, which is used by theorists to test ideas or explore new physics, but also by experimentalists, who might want to analyze data or obtain predictions for how to tune the knobs of their experiments, including those involving the first error-prone quantum computers.

The future of quantum open source

 Open-source libraries like PIQS and QuTiP and the community of developers-researchers seem a key drive to the development of quantum technologies, as they offer the opportunity for creative interactions and novel solutions, as well as the capability to tinker with open problems.

Training more theoretical physicists and experimentalists on how to code collaboratively and develop open-source tools is another important aspect to train the next generation of future quantum programmers. At the same time, making this process easy and efficient, so that it can complement fundamental research, is paramount.

Involving the wider open-source community to use the knowledge and skills of expert software developers can also help to develop better simulation techniques or tools, for example for running simulations on GPUs or clusters. The two communities can learn from each other: one can help to adopt the best software development techniques and the other can demystify quantum quirkiness to facilitate the search for new and creative applications.

Finally, we look forward toward the development of institutional avenues to open-source quantum computing. Currently, only private ventures offer researchers cloud access to quantum machines [Zeng17], due to the costs of hardware development and software engineering infrastructure. As the community and tools of open-source software develop, we can envision in the future of quantum computing — and broader quantum technology research — also a network of scientific and institutional laboratories providing cloud access to experiments. This would contribute to reshape and possibly accelerate the rate of discovery in basic quantum physics research.

References

[Fingerhuth18] Mark Fingerhuth, Tomáš Babej, and Peter Wittek, Open source software in quantum computing, PLoS ONE 13 (12): e0208561 (2018).

[Zeng17] Will Zeng, et al. “First quantum computers need smart software.” Nature News 549.7671 (2017): 149.

[Johansson12] J. R. Johansson, P. D. Nation, and F. Nori: “QuTiP 2: A Python framework for the dynamics of open quantum systems.”, Comp. Phys. Comm. 184, 1234 (2013); J. R. Johansson, P. D. Nation, and F. Nori: “QuTiP: An open-source Python framework for the dynamics of open quantum systems.”, Comp. Phys. Comm. 183, 1760–1772 (2012)

[Fortunato18] Fortunato, S., Bergstrom, C. T., Börner, K., Evans, J. A., Helbing, D., Milojević, S., … and Vespignani, A. Science of science. Science, 359, 6379, eaao0185 (2018).

[Melnikov18] Alexey A. Melnikov, Hendrik Poulsen Nautrup, Mario Krenn, Vedran Dunjko, Markus Tiersch, Anton Zeilinger, and Hans J. Briegel, Active learning machine learns to create new quantum experiments, PNAS 115 (6) 1221 (2018)

[Gabbard18] Hunter Gabbard, Michael Williams, Fergus Hayes, and Chris Messenger, Matching Matched Filtering with Deep Networks for Gravitational-Wave Astronomy. Phys. Rev. Lett. 120, 141103 (2018)

[Shammah18] Shammah, N., Ahmed, S., Lambert, N., De Liberato, S., and Nori, F, Open quantum systems with local and collective incoherent processes: Efficient numerical simulation using permutational invariance. Phys. Rev. A 98, 063815 (2018)

[Baumann10] Kristian Baumann, Christine Guerlin, Ferdinand Brennecke and Tilman Esslinger, The Dicke Quantum Phase Transition with a Superfluid Gas in an Optical Cavity. Nature 464, 1301 (2010)

[Bohnet12] Justin G. Bohnet, Zilong Chen, Joshua M. Weiner, Dominic Meiser, Murray J. Holland and James K. Thompson, A steady-state superradiant laser with less than one intracavity photonNature 484, 78 (2012)

[Shammah17] Nathan Shammah, Neill Lambert, Franco Nori and Simone De Liberato, Superradiance with local phase-breaking effects. Phys. Rev. A 96, 023863 (2017)

[Bradac17] Carlo Bradac et al, Room-temperature spontaneous superradiance from single diamond nanocrystals. Nat. Commun. 8 1205 (2017).

[Angerer18] Andreas Angerer et al. Superradiant emission from colour centres in diamond. Nature Physics 14, 1168–1172 (2018)

[Rainò18] Gabriele Rainò, Michael A. Becker, Maryna I. Bodnarchuk, Rainer F. Mahrt, Maksym V. Kovalenko and Thilo Stöferle, Superfluorescence from lead halide perovskite quantum dot superlattices. Nature 563, 671 (2018)

 [Kirton17] Peter Kirton, and Jonathan Keeling, Suppressing and restoring the Dicke superradiance transition by dephasing and decay. Physical review letters 118, 123602 (2017).

[Gegg17] Michael, Gegg, and Marten Richter, PsiQuaSP–A library for efficient computation of symmetric open quantum systems. Scientific Reports 7, 16304 (2017).

 

Comments

There are currently no comments.