QuTiP: An open-source Python framework for the dynamics of open quantum systems J. R. Johanssona,1,∗, P. D. Nationa,b,1,∗, Franco Noria,b aAdvanced Science Institute, RIKEN, Wako-shi, Saitama 351-0198, Japan bDepartment of Physics, University of Michigan, Ann Arbor, Michigan 48109-1040, USA Abstract We present an object-oriented open-source framework for solving the dynamics of open quantum systems written in Python. Arbitrary Hamiltonians, including time-dependent systems, may be built up from operators and states defined by a quantum object class, and then passed on to a choice of master equation or Monte-Carlo solvers. We give an overview of the basic structure for the framework before detailing the numerical simulation of open system dynamics. Several examples are given to illustrate the build up to a complete calculation. Finally, we measure the performance of our library against that of current implementations. The framework described here is particularly well-suited to the fields of quantum optics, superconducting circuit devices, nanomechanics, and trapped ions, while also being ideal for use in classroom instruction. Keywords: Open quantum systems, Lindblad master equation, Quantum Monte-Carlo, Python PACS: 03.65.Yz, 07.05.Tp, 01.50.hv PROGRAM SUMMARY 1. Introduction Manuscript Title: QuTiP: An open-source Python framework for the dynamics of open quantum systems Every quantum system encountered in the real world is Authors: J. R. Johansson, P. D. Nation an open quantum system [1]. For although much care is Program Title: QuTiP: The Quantum Toolbox in Python taken experimentally to eliminate the unwanted influence Journal Reference: of external interactions, there remains, if ever so slight, Catalogue identifier: a coupling between the system of interest and the exter- Licensing provisions: GPLv3 nal world. In addition, any measurement performed on Programming language: Python the system necessarily involves coupling to the measuring Computer: i386, x86-64 device, therefore introducing an additional source of ex- Operating system: Linux, Mac OSX, Windows ternal influence. Consequently, developing the necessary RAM: 2+ Gigabytes tools, both theoretical and numerical, to account for the Number of processors used: 1+ interactions between a system and its environment is an Keywords: Open quantum systems, Lindblad master equation, essential step in understanding the dynamics of quantum Quantum Monte-Carlo, Python systems. Classification: 7 Condensed Matter and Surface Science By definition, an open quantum system is coupled to External routines/libraries: NumPy, SciPy, Matplotlib an environment, also called a reservoir or bath, where Nature of problem: Dynamics of open quantum systems the complexity of the environmental dynamics renders the Solution method: Numerical solutions to Lindblad master combined evolution of system plus reservoir intractable. arXiv:1110.0573v2 [quant-ph] 22 Nov 2011 equation or Monte-Carlo wave function method. However, for a system weakly coupled to its surroundings, Restrictions: Problems must meet the criteria for using the there is a clear distinction between the system and its en- master equation in Lindblad form. vironment, allowing for the dynamics of the environment Running time: A few seconds up to several tens of minutes, to be traced over, resulting in a reduced density matrix depending on size of underlying Hilbert space. describing the system alone. The most general dynamical equation governing this reduced system density matrix is given by the Lindblad master equation [2] describing the evolution of an ensemble average of a large (formally in- finite) number of identical system realizations. Although ∗ Corresponding authors the density operator formalism sufficed for the first half- Email addresses: [email protected] (J. R. Johansson), [email protected] (P. D. Nation) century of quantum mechanics, the advent of single-ion 1These authors contributed equally to this work. traps in the 1980's [3] motivated the study of the quantum Preprint submitted to Computer Physics Communications November 23, 2011 trajectories, or Monte-Carlo, description for the evolution relies heavily on the sparse matrix and dense array func- of a single realization of a dissipative quantum system [4]. tionality provided by the SciPy [25] and NumPy [24] pack- In general, for all but the most basic of Hamiltonians, an ages, respectively. Since the bulk of a typical calculation analytical description of the system dynamics is not pos- is spent in these libraries, a QuTiP simulation can achieve sible, and one must resort to numerical simulations of the nearly the same performance as compiled code. The ad- equations of motion. In absence of a quantum computer vantage of using the Python programming language over a [5], these simulations must be carried out using classical compiled programming language is a greatly simplified de- computing techniques, where the exponentially increas- velopment process, and more transparent, less bug-prone ing dimensionality of the underlying Hilbert space severely code. For data visualization QuTiP uses the matplotlib limits the size of system that can be efficiently simulated package [26], which is capable of producing publication- [6, 7]. However, in many fields such as quantum optics quality 2D and 3D figures in a wide range of styles and [8, 9], trapped ions [3, 10], superconducting circuit devices formats. [11, 12, 13], and most recently nanomechanical systems Given the success of the qotoolbox, the development of [14, 15, 16, 17], it is possible to design systems using a QuTiP has in part been directed toward providing a re- small number of effective oscillator and spin components, placement for this excellent, yet aging software. In the excited by a small number of quanta, that are amenable spirit of open-source development, we have strived to use to classical simulation in a truncated Hilbert space. the best parts of the qotoolbox in QuTiP, while improving, Of the freely available quantum evolution software pack- replacing, or complementing the parts that were in need ages [18, 19, 20], the Quantum Optics Toolbox (qotoolbox) of modernization. The result is a framework for simulat- [19] has by far been the most successful. Although orig- ing quantum system dynamics that is in many ways more inally geared toward quantum optics, the qotoolbox has efficient and better suited for modern computers, as well gained popularity in a variety of disciplines, driven in part as better positioned for further development and adoption by its rapid modeling capabilities and easy to read code to new computer architecture advances. Given the size of syntax. Yet, at the same time, the qotoolbox has not been the QuTiP framework, we do not hope to cover all of its updated in nearly a decade, leaving researchers to rely on functionality here. Instead, we will focus on the key data an outdated numerical platform. Moreover, while the code structures, and numerical routines underlying the major- underlying the qotoolbox is open-sourced, it does rely on ity of calculations. In addition, we will highlight a variety the proprietary Matlab [21] computing environment mak- of example calculations that we hope will give the reader ing it an impractical solution for many research groups, as a flavor of the capabilities of QuTiP, and highlight what well as for use as an educational tool inside the classroom. is possible using this framework. A complete overview of In this paper, we describe a fully open-source imple- QuTiP is given on its website [23]. mentation of a framework designed for simulating open This paper is organized as follows. In Sec. 2 we in- quantum dynamics written in the Python programming troduce the main QuTiP class, representing a quantum language [22] called the Quantum Toolbox in Python or operator or state vector, and its associated data struc- QuTiP [23]. This framework distinguishes itself from the tures and methods. In Sec. 3 we give a brief overview of other available software solutions by providing the follow- the density matrix formalism before discussing the master ing advantages: equation and Monte-Carlo methods used in QuTiP. Sec- tion 4 presents a selection of examples meant to illustrate • Based entirely on open-source software. how calculations are performed using the QuTiP frame- work. Section 5 compares the performance of the QuTiP • Easy to read, rapid code development using the master equation and Monte-Carlo solvers to those in the Python programming language. qotoolbox. Finally, Sec. 6 briefly concludes, while a list of user accessible functions built into QuTiP, as well as • Support for arbitrary, time dependent Hamiltonians. example codes, are relegated to the appendix. • Makes use of the multiple processing cores found in modern computers. 2. The QuTiP framework • Community based infrastructure, allowing for user QuTiP provides an object-oriented framework for rep- contributions to the code base. resenting generic quantum systems, and for performing calculations and simulations on such systems. In order Although Python is an interpreted programming lan- to simulate a quantum system, one must first construct guage, it is well suited for scientific computations as a an object that encapsulates the properties of an arbitrary result of its large collection of high-performance low-level state vector or operator. A unified representation of quan- numerical libraries [24], mathematical functions [25], and tum operators and state vectors is implemented in QuTiP data visualization capabilities
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages16 Page
-
File Size-