HOME

TheInfoList



OR:

QuTiP, short for the Quantum Toolbox in Python, is an
open-source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
computational physics Computational physics is the study and implementation of numerical analysis to solve problems in physics for which a quantitative theory already exists. Historically, computational physics was the first application of modern computers in scienc ...
software library for simulating quantum systems, particularly
open quantum system In physics, an open quantum system is a quantum-mechanical system that interacts with an external quantum system, which is known as the ''environment'' or a ''bath''. In general, these interactions significantly change the dynamics of the system an ...
s. QuTiP allows simulation of Hamiltonians with arbitrary time-dependence, allowing simulation of situations of interest in
quantum optics Quantum optics is a branch of atomic, molecular, and optical physics dealing with how individual quanta of light, known as photons, interact with atoms and molecules. It includes the study of the particle-like properties of photons. Photons have ...
,
ion trap An ion trap is a combination of electric and/or magnetic fields used to capture charged particles — known as ions — often in a system isolated from an external environment. Atomic and molecular ion traps have a number of applications in ph ...
ping, superconducting circuits and quantum nanomechanical
resonator A resonator is a device or system that exhibits resonance or resonant behavior. That is, it naturally oscillates with greater amplitude at some frequencies, called resonant frequencies, than at other frequencies. The oscillations in a reson ...
s. The library includes extensive
visualization Visualization or visualisation may refer to: * Visualization (graphics), the physical or imagining creation of images, diagrams, or animations to communicate a message * Data visualization, the graphic representation of data * Information visualiz ...
facilities for content under simulations. QuTiP's API provides a Python interface and uses
Cython Cython () is a programming language that aims to be a superset of the Python programming language, designed to give C-like performance with code that is written mostly in Python with optional additional C-inspired syntax. Cython is a compil ...
to allow run-time compilation and extensions via C and C++. QuTiP is built to work well with popular Python packages NumPy,
SciPy SciPy (pronounced "sigh pie") is a free and open-source Python library used for scientific computing and technical computing. SciPy contains modules for optimization, linear algebra, integration, interpolation, special functions, FFT, signal ...
,
Matplotlib Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy. It provides an object-oriented API for embedding plots into applications using general-purpose GUI toolkits like Tkinter, wx ...
and
IPython IPython (Interactive Python) is a command shell for interactive computing in multiple programming languages, originally developed for the Python programming language, that offers introspection, rich media, shell syntax, tab completion, and his ...
.


History

The idea for the QuTip project was conceived in 2010 by PhD student Paul Nation, who was using the quantum optics toolbox for
MATLAB MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementa ...
in his research. According to Paul Nation, he wanted to create a python package similar to qotoolbox because he "was not a big fan of MATLAB" and then decided to "just write it imelf". As a postdoctoral fellow, at the RIKEN Institute in Japan, he met Robert Johansson and the two worked together on the package. In contrast to its predecessor qotoolbox, which relies on the proprietary MATLAB environment, it was published in 2012 under an open source license. The Version created by Nation and Johansson already contained the most important features of the package, but QuTips scope and features are constantly being extended by a large community of contributors. It has grown in popularity amongst physicists, with over 250.000 downloads in the year 2021.


Examples


Creating quantum objects

>>> import qutip >>> import numpy as np >>> psi = qutip.Qobj( 0.6 .8) # create quantum state from a list >>> psi Quantum object: dims = 2 , shape = (2, 1), type = ket Qobj data = 0.6 .8 >>> phi=qutip.Qobj(np.array( .8, -0.6) # create quantum state from a numpy-array >>> phi Quantum object: dims = 2 , shape = (2, 1), type = ket Qobj data = 0.8 0.6 >>> e0=qutip.basis(2, 0) # create a basis vector >>> e0 Quantum object: dims = 2 , shape = (2, 1), type = ket Qobj data = 1. . >>> A=qutip.Qobj(np.array(
1,2j Onekama ( ) is a village in Manistee County in the U.S. state of Michigan. The population was 411 at the 2010 census. The village is located on the shores of Portage Lake and is surrounded by Onekama Township. The town's name is derived from " ...
2j,1)) # create quantum operator from numpy array >>> A Quantum object: dims = 2 , shape = (2, 2), type = oper, isherm = True Qobj data = 1.+0.j 0.+2.j .-2.j 1.+0.j >>> qutip.sigmay() # some common quantum objects, like pauli matrices, are predefined in the qutip package Quantum object: dims = 2 , shape = (2, 2), type = oper, isherm = True Qobj data = 0.+0.j 0.-1.j .+1.j 0.+0.j


Basic operations

>>> A*qutip.sigmax()+qutip.sigmay() # we can add and multiply quantum objects of compatible shape and dimension Quantum object: dims = 2 , shape = (2, 2), type = oper, isherm = False Qobj data = 0.+2.j 1.-1.j .+1.j 0.-2.j >>> psi.dag() # hermitian conjugate Quantum object: dims = 1 , shape = (1, 2), type = bra Qobj data = 0.6 0.8 >>> psi.proj() # projector onto a quantum state Quantum object: dims = 2 , shape = (2, 2), type = oper, isherm = True Qobj data =
0.36 0.48 This is a list of firearm cartridges that have bullets in the to caliber range. *''Case length'' refers to the round case length. *''OAL'' refers to the overall length of the loaded round. All measurements are given in millimeters, follow ...
.48 0.64 >>> A.tr() # trace of operator 2.0 >>> A.eigenstates() # diagonalize an operator (array( 1., 3., array([Quantum object: dims = 2 , shape = (2, 1), type = ket Qobj data = -0.70710678+0.j [ 0. -0.70710678j , Quantum object: dims = 2 , shape = (2, 1), type = ket Qobj data = -0.70710678+0.j 0. +0.70710678j ], dtype=object)) >>> (1j * A).expm() # matrix exponential of an operator Quantum object: dims = 2 , shape = (2, 2), type = oper, isherm = False Qobj data =
-0.2248451-0.35017549j -0.4912955-0.7651474j The hyphen-minus is the most commonly used type of hyphen, widely used in digital documents. It is the only character that looks like a minus sign or a dash in many character sets such as ASCII or on most keyboards, so it is also used as such ...
0.4912955+0.7651474j -0.2248451-0.35017549j >>> qutip.tensor(qutip.sigmaz(), qutip.sigmay()) # tensor product Quantum object: dims =
2, 2 The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline o ...
, 2 The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline o ...
, shape = (4, 4), type = oper, isherm = True Qobj data = 0.+0.j 0.-1.j 0.+0.j 0.+0.j .+1.j 0.+0.j 0.+0.j 0.+0.j .+0.j 0.+0.j 0.+0.j 0.+1.j .+0.j 0.+0.j 0.-1.j 0.+0.j


Time evolution

>>> Hamiltonian = qutip.sigmay() >>> times = np.linspace(0, 2, 10) >>> result = qutip.sesolve(Hamiltonian, psi, times, si.proj(), phi.proj() # unitary time evolution of a system according to schroedinger equation >>> expectpsi, expectphi = result.expect # expectation values of projectors onto psi and phi >>> plt.figure(dpi=200) >>> plt.plot(times, expectpsi) >>> plt.plot(times, expectphi) >>> plt.legend( "$\psi$",r"$\phi$" >>> plt.show() Simulating a non-unitary time evolution according to the Lindblad Master Equation is possible with the qutip.mesolve function {{Cite web , url = https://qutip.org/docs/latest/guide/dynamics/dynamics-master.html , title = Lindblad Master Equation Solver , author = ((QuTiP developers and contributors)) , access-date = 2022-07-24


References

Articles with example Python (programming language) code Quantum Monte Carlo Computational physics Simulation software