cpypyqed Reference

Namespaces

class cpypyqed.binary((object)arg1)

The binary namespace

class Base

Wrapper of binary::Base

binary.make((object)arg1) → Base :

Wrapper of binary::make

C++ signature :
boost::shared_ptr<binary::Base const> make(boost::shared_ptr<structure::Interaction<2> const>)
class cpypyqed.evolution((object)arg1)

The evolution namespace

class Method

Wrapper of evolution::Method

ENSEMBLE = cpypyqed.Method.ENSEMBLE
MASTER = cpypyqed.Method.MASTER
MASTER_FAST = cpypyqed.Method.MASTER_FAST
SINGLE = cpypyqed.Method.SINGLE
names = {'MASTER_FAST': cpypyqed.Method.MASTER_FAST, 'SINGLE': cpypyqed.Method.SINGLE, 'MASTER': cpypyqed.Method.MASTER, 'ENSEMBLE': cpypyqed.Method.ENSEMBLE}
values = {0: cpypyqed.Method.SINGLE, 1: cpypyqed.Method.ENSEMBLE, 2: cpypyqed.Method.MASTER, 3: cpypyqed.Method.MASTER_FAST}
class evolution.Pars((object)arg1, (ParameterTable)arg2[, (str)arg3])

Wrapper of evolution::Pars

evol
negativity
class cpypyqed.evolved((object)arg1)

The evolved namespace

class SF

Wrapper of evolved::SteppingFunction

RK8PD = cpypyqed.SF.RK8PD
RKCK = cpypyqed.SF.RKCK
names = {'RKCK': cpypyqed.SF.RKCK, 'RK8PD': cpypyqed.SF.RK8PD}
values = {0: cpypyqed.SF.RKCK, 1: cpypyqed.SF.RK8PD}
class cpypyqed.jaynescummings((object)arg1)
class Pars((object)arg1, (ParameterTable)arg2[, (str)arg3])
g
jaynescummings.make((QbitBase)arg1, (ModeBase)arg2, (object)arg3) → JaynesCummingsBase :
C++ signature :
boost::shared_ptr<jaynescummings::Base<false> const> make(boost::shared_ptr<QbitBase const>,boost::shared_ptr<ModeBase const>,std::complex<double>)
class cpypyqed.mode((object)arg1)
class Pars((object)arg1, (ParameterTable)arg2[, (str)arg3])
cutoff
delta
displayLevel
minit
minitFock
class mode.ParsLossy((object)arg1, (ParameterTable)arg2[, (str)arg3])
kappa
nTh
class mode.ParsPumped((object)arg1, (ParameterTable)arg2[, (str)arg3])
eta
class mode.ParsPumpedLossy((object)arg1, (ParameterTable)arg2[, (str)arg3])
mode.coherent((object)arg1, (int)arg2) → object :
C++ signature :
quantumdata::StateVector<1> coherent(std::complex<double>,unsigned long)
mode.fock((int)arg1, (int)arg2, (float)arg3) → object :
C++ signature :
quantumdata::StateVector<1> fock(unsigned long,unsigned long,double)
mode.init((Pars)arg1) → object :
C++ signature :
quantumdata::StateVector<1> init(mode::Pars)
mode.make((Pars)arg1, (QMP)arg2) → ModeBase :
C++ signature :
boost::shared_ptr<ModeBase const> make(mode::Pars,QM_Picture)

make( (ParsPumped)arg1, (QMP)arg2) -> ModeBase :

C++ signature :
boost::shared_ptr<ModeBase const> make(mode::ParsPumped,QM_Picture)

make( (ParsLossy)arg1, (QMP)arg2) -> ModeBase :

C++ signature :
boost::shared_ptr<ModeBase const> make(mode::ParsLossy,QM_Picture)

make( (ParsPumpedLossy)arg1, (QMP)arg2) -> ModeBase :

C++ signature :
boost::shared_ptr<ModeBase const> make(mode::ParsPumpedLossy,QM_Picture)
class cpypyqed.parameters((object)arg1)

The parameters namespace

class ParameterTable((object)arg1)

Wrapper of parameters::ParameterTable

printList((ParameterTable)arg1) → None :
C++ signature :
void printList(parameters::ParameterTable {lvalue})
parameters.update((ParameterTable)p, (list)argv[, (str)prefix='--']) → None :

Wrapper of parameters::update. Note that the signature differs a little bit compared to the C++ version, it is not necessary to pass in the argument list length.

Parameters:
class cpypyqed.particle((object)arg1)
class InitialCondition((object)arg1, (float)arg2, (float)arg3, (float)arg4[, (bool)arg5])
getK0((InitialCondition)arg1) → float :
C++ signature :
double getK0(particle::InitialCondition {lvalue})
getSig((InitialCondition)arg1) → float :
C++ signature :
double getSig(particle::InitialCondition {lvalue})
getX0((InitialCondition)arg1) → float :
C++ signature :
double getX0(particle::InitialCondition {lvalue})
isInK((InitialCondition)arg1) → bool :
C++ signature :
bool isInK(particle::InitialCondition {lvalue})
class particle.Pars((object)arg1, (ParameterTable)arg2[, (str)arg3])
fin
hoInitn
init
omrec
class particle.ParsPumped((object)arg1, (ParameterTable)arg2[, (str)arg3])
kPart
modePart
vClass
particle.hoState((Pars)arg1[, (bool)arg2]) → object :
C++ signature :
quantumdata::StateVector<1> hoState(particle::Pars [,bool])

hoState( (ParsPumped)arg1 [, (bool)arg2]) -> object :

C++ signature :
quantumdata::StateVector<1> hoState(particle::ParsPumped [,bool])
particle.init((Pars)arg1) → object :
C++ signature :
quantumdata::StateVector<1> init(particle::Pars)
particle.make((Pars)arg1, (QMP)arg2) → ParticleBase :
C++ signature :
boost::shared_ptr<ParticleBase const> make(particle::Pars,QM_Picture)
particle.makePumped((ParsPumped)arg1, (QMP)arg2) → PumpedParticleBase :
C++ signature :
boost::shared_ptr<PumpedParticleBase const> makePumped(particle::ParsPumped,QM_Picture)
particle.wavePacket((Pars)arg1[, (bool)arg2]) → object :
C++ signature :
quantumdata::StateVector<1> wavePacket(particle::Pars [,bool])

wavePacket( (ParsPumped)arg1 [, (bool)arg2]) -> object :

C++ signature :
quantumdata::StateVector<1> wavePacket(particle::ParsPumped [,bool])
class cpypyqed.particlecavity((object)arg1)
class ParsAlong((object)arg1, (ParameterTable)arg2[, (str)arg3])
kCav
modeCav
class particlecavity.ParsOrthogonal((object)arg1, (ParameterTable)arg2[, (str)arg3])
uNot
class cpypyqed.qbit((object)arg1)
class Pars((object)arg1, (ParameterTable)arg2, (str)arg3)
delta
qbitInit
class qbit.ParsLossy((object)arg1, (ParameterTable)arg2[, (str)arg3])
gamma
class qbit.ParsPumped((object)arg1, (ParameterTable)arg2[, (str)arg3])
eta
class qbit.ParsPumpedLossy((object)arg1, (ParameterTable)arg2[, (str)arg3])
qbit.init((object)arg1) → object :
C++ signature :
quantumdata::StateVector<1> init(std::complex<double>)

init( (Pars)arg1) -> object :

C++ signature :
quantumdata::StateVector<1> init(qbit::Pars)
qbit.make((ParsPumpedLossy)arg1, (QMP)arg2) → QbitBase :
C++ signature :
boost::shared_ptr<QbitBase const> make(qbit::ParsPumpedLossy,QM_Picture)
qbit.state0() → object :
C++ signature :
quantumdata::StateVector<1> state0()
qbit.state1() → object :
C++ signature :
quantumdata::StateVector<1> state1()
class cpypyqed.quantumdata((object)arg1)

The quantumdata namespace

class cpypyqed.quantumtrajectory((object)arg1)

The quantumtrajectory namespace

class ParsMCWF((object)arg1, (ParameterTable)arg2[, (str)arg3])

Wrapper of quantumtrajectory::mcwf::Pars

dpLimit
logLevel
overshootTolerance
class cpypyqed.structure((object)arg1)

The structure namespace

class Interaction2

Instantiation of structure::Interaction with RANK=2

class structure.Interaction3

Instantiation of structure::Interaction with RANK=3

class structure.QuantumSystem1

Instantiation of structure::QuantumSystem with RANK=1

highestFrequency((QuantumSystem1)arg1) → float :
C++ signature :
double highestFrequency(structure::QuantumSystem<1> {lvalue})
class structure.QuantumSystem2

Instantiation of structure::QuantumSystem with RANK=2

highestFrequency((QuantumSystem2)arg1) → float :
C++ signature :
double highestFrequency(structure::QuantumSystem<2> {lvalue})
class structure.QuantumSystem3

Instantiation of structure::QuantumSystem with RANK=3

highestFrequency((QuantumSystem3)arg1) → float :
C++ signature :
double highestFrequency(structure::QuantumSystem<3> {lvalue})
class structure.QuantumSystem4

Instantiation of structure::QuantumSystem with RANK=4

highestFrequency((QuantumSystem4)arg1) → float :
C++ signature :
double highestFrequency(structure::QuantumSystem<4> {lvalue})
class cpypyqed.trajectory((object)arg1)

The trajectory namespace

class ParsEvolved((object)arg1, (ParameterTable)arg2[, (str)arg3])

Wrapper of trajectory::ParsEvolved

epsAbs
epsRel
nextDtTryCorrectionFactor
sf
class trajectory.ParsRun((object)arg1, (ParameterTable)arg2[, (str)arg3])

Wrapper of trajectory::ParsRun

Dt
NDt
T
dc
displayInfo
initialFileName
ofn
precision
sdf
class trajectory.ParsStochastic((object)arg1, (ParameterTable)arg2[, (str)arg3])

Wrapper of trajectory::ParsStochastic

nTraj
noise
seed

core

class cpypyqed.core.BinarySystem_false_false_false

Instantiation of BinarySystem with template parameters false,false,false

class cpypyqed.core.BinarySystem_false_false_true

Instantiation of BinarySystem with template parameters false,false,true

class cpypyqed.core.BinarySystem_false_true_false

Instantiation of BinarySystem with template parameters false,true,false

class cpypyqed.core.BinarySystem_false_true_true

Instantiation of BinarySystem with template parameters false,true,true

class cpypyqed.core.BinarySystem_true_false_false

Instantiation of BinarySystem with template parameters true,false,false

class cpypyqed.core.BinarySystem_true_false_true

Instantiation of BinarySystem with template parameters true,false,true

class cpypyqed.core.BinarySystem_true_true_false

Instantiation of BinarySystem with template parameters true,true,false

class cpypyqed.core.BinarySystem_true_true_true

Instantiation of BinarySystem with template parameters true,true,true

cpypyqed.core.evolve((object)arg1, (QuantumSystem1)arg2, (Pars)arg3) → object :

Wrapper of evolve with RANK=1.

C++ signature :
boost::python::api::object evolve(boost::python::numeric::array,boost::shared_ptr<structure::QuantumSystem<1> const>,evolution::Pars)
evolve( (object)arg1, (QuantumSystem2)arg2, (Pars)arg3) -> object :

Wrapper of evolve with RANK=2.

C++ signature :
boost::python::api::object evolve(boost::python::numeric::array,boost::shared_ptr<structure::QuantumSystem<2> const>,evolution::Pars)
evolve( (object)arg1, (QuantumSystem3)arg2, (Pars)arg3) -> object :

Wrapper of evolve with RANK=3.

C++ signature :
boost::python::api::object evolve(boost::python::numeric::array,boost::shared_ptr<structure::QuantumSystem<3> const>,evolution::Pars)
evolve( (object)arg1, (QuantumSystem4)arg2, (Pars)arg3) -> object :

Wrapper of evolve with RANK=4.

C++ signature :
boost::python::api::object evolve(boost::python::numeric::array,boost::shared_ptr<structure::QuantumSystem<4> const>,evolution::Pars)

elements

class cpypyqed.elements.JaynesCummingsBase
class cpypyqed.elements.ModeBase
class cpypyqed.elements.ModeFunctionType
COS = cpypyqed.elements.ModeFunctionType.COS
MINUS = cpypyqed.elements.ModeFunctionType.MINUS
PLUS = cpypyqed.elements.ModeFunctionType.PLUS
SIN = cpypyqed.elements.ModeFunctionType.SIN
names = {'COS': cpypyqed.elements.ModeFunctionType.COS, 'PLUS': cpypyqed.elements.ModeFunctionType.PLUS, 'SIN': cpypyqed.elements.ModeFunctionType.SIN, 'MINUS': cpypyqed.elements.ModeFunctionType.MINUS}
values = {0: cpypyqed.elements.ModeFunctionType.SIN, 1: cpypyqed.elements.ModeFunctionType.COS, 2: cpypyqed.elements.ModeFunctionType.PLUS, 3: cpypyqed.elements.ModeFunctionType.MINUS}
class cpypyqed.elements.ParticleAlongCavity((object)arg1, (ModeBase)arg2, (ParticleBase)arg3, (ParsAlong)arg4)
class cpypyqed.elements.ParticleBase
class cpypyqed.elements.ParticleOrthogonalToCavity((object)arg1, (ModeBase)arg2, (PumpedParticleBase)arg3, (ParsOrthogonal)arg4)
class cpypyqed.elements.ParticleTwoModes((object)arg1, (ModeBase)arg2, (ModeBase)arg3, (ParticleBase)arg4, (ParsAlong)arg5, (ParsAlong)arg6)
class cpypyqed.elements.PumpedParticleBase
class cpypyqed.elements.QMP
IP = cpypyqed.elements.QMP.IP
SCH = cpypyqed.elements.QMP.SCH
UIP = cpypyqed.elements.QMP.UIP
names = {'IP': cpypyqed.elements.QMP.IP, 'SCH': cpypyqed.elements.QMP.SCH, 'UIP': cpypyqed.elements.QMP.UIP}
values = {0: cpypyqed.elements.QMP.IP, 1: cpypyqed.elements.QMP.UIP, 2: cpypyqed.elements.QMP.SCH}
class cpypyqed.elements.QbitBase
cpypyqed.elements.isComplex((ModeFunctionType)arg1) → bool :
C++ signature :
bool isComplex(ModeFunctionType)
cpypyqed.elements.updateWithPicture((ParameterTable)arg1, (list)arg2, (str)arg3) → QMP
updateWithPicture( (ParameterTable)p, (list)argv [, (str)prefix=’–’]) -> QMP :

Wrapper of :elements:`picture::updateWithPicture`. Note that the signature differs a little bit compared to the C++ version, it is not necessary to pass in the argument list length.

param p:The ParameterTable
type p:ParameterTable
param list argv:
 The argument list
param str prefix:
 The prefix (default “--”)
returns qmp:The quantum mechanical picture to use

compilation.ondemand

This module provides the infrastructure to instantiate and build C++QED wrapper classes on demand. The main class to implementing this functionality is OnDemand.

class cpypyqed.compilation.ondemand.OnDemand(basename, classid, makerfunction=None)

This class serves as a base to classes which need to be compiled on the fly in cpypyqed.

This is needed for class templates which cannot be pre-instantiated at cpypyqed compile time because there are too many possibilities of template parameters. A typical example is the class Composite.

Classes deriving from OnDemand need to implement generate_source.

Parameters:
  • basename (str) – The descriptive name of the underlying class
  • classid (str) – An id which encodes the template parameters needed to instantiate the C++ class
  • makerfunction (function or None) – Use this makerfunction instead of the class constructor to create an instances of the underlying class (default None)
cpypyqeddir = None

This will be set to the directory where the C++ source templates are found, typically used in the implementation of generate_source.

generate_source(builddir)

This creates the C++ source file of the python module. It is a stub and has to be implmented by deriving classes.

Implementations have to save the result to builddir. They can access template files in the directory cpypyqeddir.

Parameters:builddir (str) – The directory where the module is going to be built. The result has to be saved here.
maker(*args, **kwargs)

Returns an instance of the underlying class represented by this OnDemand object. The arguments of this function are passed through to the constructor of the underlying class. If the on-demand module holding the class has not been built yet or the C++QED library version does not fit, the module is compiled on the fly.

cpypyqed.compilation.ondemand.mkdir_p(path)

Equivalent of mkdir -p.

http://stackoverflow.com/questions/600268/mkdir-p-functionality-in-python

Parameters:path (str) – The directory to create.
OnDemand.cpypyqeddir = None

This will be set to the directory where the C++ source templates are found, typically used in the implementation of generate_source.

compilation.composite

This module is the wrapper for the C++QED composite bundle.

Typically the enduser only has to call the convenience maker function makeComposite.

cpypyqed.compilation.composite.makeComposite(acts) → Composite<VA> :

Wrapper of the C++QED function composite::make with a modified signature better suited for Python.

This function takes a dictionary where the keys describe an Act object and values are InteractionN-objects (with N the rank of the interaction). The key has to be a N-tuple of integers corresponding to the involved subsystems. For example, the key value pair (0,2):poc will be a Act<0,2>(poc), where poc could be an instance of ParticleOrthogonalToCavity and the interaction acts on the subsystems 0 and 2.

Example usage (where poc is a ParticleOrthogonalToCavity-object, subsytem 0 is a mode and subsystems 1 and 2 are particles):

>>> c = makeComposite({(0,2):poc,(0,1):poc})
Parameters:acts (dict) – A dictionary holding the subsystem tuples as keys and the interaction objects as values.
Returns:A wrapped C++QED Composite-object, compiled on demand if necessary.
Return type:Composite<VA>
class cpypyqed.compilation.composite.Composite(acts)

A OnDemand-class wrapping the C++QED class Composite.

The constructor takes a dictionary where the keys describe an Act object and values are InteractionN-objects (with N the rank of the interaction). The key has to be a N-tuple of integers corresponding to the involved subsystems. For example, the key value pair {(0,2):poc} will be a Act<0,2>(poc), where poc could be an instance of ParticleOrthogonalToCavity and the interaction acts on the subsystems 0 and 2.

Note that the constructor will only yield an OnDemand-object, not a real C++QED composite object. However, calling the OnDemand.maker-method on the resulting object will return a true composite object, while instantiating and compiling the class template as needed. The convinience maker function makeComposite has the same signature as the constructor here and automatically calls the underlying OnDemand.maker function, thus returning a true composite object which can be passed to evolve.

Parameters:acts (dict) – A dictionary holding the subsystem tuples as keys and the interaction objects as values.
generate_source(builddir)

Overriding OnDemand.generate_source

This takes care of creating the proper source file to compile a boost.Python module, which holds the correct C++QED Composite class.

maker()

Overriding OnDemand.maker

This function compiles and creates the needed C++QED Act-objects on demand and passes them to OnDemand.maker, where they are passed into composite::make to create the right Composite object.

class cpypyqed.compilation.composite.Act(int[, int, ...])

A OnDemand-class wrapping the C++QED class Act.

The template parameters denoting the involved subsystems are given as constructor arguments to this class. The interaction which this object should hold has to be passed in as an argument to OnDemand.maker.

io

class cpypyqed.io.SerializationMetadata((object)arg1)
protocolVersion
rank
trajectoryID
cpypyqed.io.read((str)fname) → object :

Read in a state vector file.

Parameters:fname (str) – The input filename.
Returns:A tuple of the form (meta, states, times).
C++ signature :
boost::python::api::object read(boost::python::str)
cpypyqed.io.write((str)fname, (object)a, (float)t) → None :

Write a state vector file.

Parameters:
  • fname (str) – The output filename.
  • a (ndarray) – The array to write.
  • t (double) – The time.
C++ signature :
void write(boost::python::str,boost::python::numeric::array,double)

Table Of Contents

Previous topic

cpypyqed Tools

This Page