Elsevier Science Home
Computer Physics Communications Program Library
Full text online from Science Direct
Programs in Physics & Physical Chemistry
CPC Home

[Licence| Download | New Version Template] aelu_v2_0.tar.gz(7881 Kbytes)
Manuscript Title: C++QEDv2Milestone 10: a C++/Python application-programming framework for simulating open quantum dynamics
Authors: Raimar Sandner, András Vukics
Program title: C++QED
Catalogue identifier: AELU_v2_0
Distribution format: tar.gz
Journal reference: Comput. Phys. Commun. 185(2014)2380
Programming language: C++/Python.
Computer: i386-i686, x86 64.
Operating system: In principle cross-platform, as yet tested only on UNIX-like systems (including Mac OS X).
RAM: The framework itself takes about 60MB, which is fully shared. The additional memory taken by the program which defines the actual physical system (script) is typically less than 1MB. The memory storing the actual data scales with the system dimension for state-vector manipulations, and the square of the dimension for density-operator manipulations. This might easily be GBs, and often the memory of the machine limits the size of the simulated system.
Keywords: Composite quantum systems, Open quantum systems, Quantum optics, Master equation, Quantum trajectories, Cavity quantum electrodynamics, Multi-array, Compile-time algorithms.
PACS: 03.65.Ta, 37.10.Vz, 01.50.hv, 02.70.-c.
Classification: 4.3, 4.13, 6.2.

External routines: Boost C++ libraries, GNU Scientific Library, Blitz++, FLENS, NumPy, SciPy

Does the new version supersede the previous version?: Yes

Nature of problem:
Definition of (open) composite quantum systems out of elementary building blocks [2, 3]. Manipulation of such systems, with emphasis on dynamical simulations such as Master-equation evolution [4] and Monte Carlo wave-function simulation [5].

Solution method:
Master equation, Monte Carlo wave-function method

Reasons for new version:
The new version is mainly a feature release, but it does correct some problems of the previous version, especially as regards the build system.

Summary of revisions:
We give an example for a typical Python script implementing the ring-cavity system presented in Sec. 3.3 of Ref. [2]:

C++ code Python code
invoking the framework #include "EvolutionComposite.h"
#include "ParticleTwoModes.h"
int main(int argc, char* argv[]
{
import sys
from cpypyqed import *
command-line parameters <ParameterTable p;

evolution::Pars pe(p);

particle::Pars pp(p);
mode::ParsLossy pmP(p,"P");
mode::ParsPumpedLossy pmM(p,"M");
particlecavity::ParsAlong ppcP(p,"P");
particlecavity::ParsAlong ppcM(p,"M");

ppcP.modeCav=MFT_PLUS;
ppcM.modeCav=MFT_MINUS;

auto qmp=updateWithPicture(p,argc,argv,"--");
p=parameters.ParameterTable()

pe=evolution.Pars(p)

pp=particle.Pars(p)
pmP=mode.ParsLossy(p,"P")
pmM=mode.ParsLossy(p,"M")
ppcP=particlecavity.ParsAlong(p,"P")
ppcM=particlecavity.ParsAlong(p,"M")

ppcP.modeCav=ModeFunctionType.PLUS
ppcM.modeCav=ModeFunctionType.MINUS

qmp=updateWithPicture(p,sys.argv,"--")
defining free elements particle::Ptr part (make(pp ,qmp));
mode ::Ptr plus (make(pmP,qmp));
mode ::Ptr minus(make(pmM,qmp));
part=particle.make(pp ,qmp)
plus = mode.make(pmP,qmp)
minus= mode.make(pmM,qmp)
initial conditions <auto psi(wavePacket(pp)*
init(pmP)*init(pmM));
psi=particle.wavePacket(pp)**
mode.init(pmP)**mode.init(pmM)
defining interactions & composite on the fly, and evolving the system evolve<0>(
psi,
composite::make(
_<1,0> (ParticleAlongCavity(plus ,part,ppcP)),
_<2,0> (ParticleAlongCavity(minus,part,ppcM)),
_<1,2,0>(ParticleTwoModes(plus,minus,part,
ppcP,ppcM))),
pe);
evolve(
psi,
makeComposite({
(1,0):ParticleAlongCavity(plus ,part,ppcP),
(2,0):ParticleAlongCavity(minus,part,ppcM),
(1,2,0):ParticleTwoModes(plus,minus,part,
ppcP,ppcM)}),
pe)

Restrictions:
Total dimensionality of the system. Master equation-few thousands. Monte Carlo wave-function trajectory-several millions.

Unusual features:
Because of the heavy use of compile-time algorithms, compilation of programs written in the framework may take a long time and much memory (up to several GBs).

Additional comments:
  • The framework is not a program, but provides and implements an application-programming interface for developing simulations in the indicated problem domain.
  • We use several C++11 features which limits the range of supported compilers (g++ 4.7, clang++ 3.1)
  • Documentation, http://cppqed.sourceforge.net/

Running time:
Depending on the magnitude of the problem, can vary from a few seconds to weeks.

References:
[1] Entry point: http://cppqed.sf.net
[2] A. Vukics, C++QEDv2: The multi-array concept and compile-time algorithms in the definition of composite quantum systems, Comp. Phys. Comm. 183(2012)1381.
[3] A. Vukics, H. Ritsch, C++QED: an object-oriented framework for wave-function simulations of cavity QED systems, Eur. Phys. J. D 44 (2007) 585.
[4] H. J. Carmichael, An Open Systems Approach to Quantum Optics, Springer, 1993.
[5] J. Dalibard, Y. Castin, K. Molmer, Wave-function approach to dissipative processes in quantum optics, Phys. Rev. Lett. 68 (1992) 580.