C++QEDCore  2.100.2 (v2 Milestone 10 Development branch)
a framework for simulating open quantum dynamics – core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Free.h
Go to the documentation of this file.
1 // Copyright András Vukics 2006–2014. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt)
2 // -*- C++ -*-
4 #ifndef CPPQEDCORE_STRUCTURE_FREE_H_INCLUDED
5 #define CPPQEDCORE_STRUCTURE_FREE_H_INCLUDED
6 
7 #include "FreeFwd.h"
8 
9 #include "DensityOperatorFwd.h"
10 #include "StateVectorFwd.h"
11 
12 #ifndef FLAT_INCLUDE
13 #include "../quantumoperator/TridiagonalFwd.h"
14 #else //FLAT_INCLUDE
15 #include "TridiagonalFwd.h"
16 #endif //FLAT_INCLUDE
17 // Normally, structure is not allowed to depend on quantumoperator, here we make a small exception
18 
19 #include "DynamicsBase.h"
20 #include "QuantumSystem.h"
21 #include "Types.h"
22 
23 #include <boost/shared_ptr.hpp>
24 
25 namespace structure {
26 
27 
29 
30 namespace freesystem {
31 
33 
35 typedef quantumdata::Types<1>::DensityOperatorLow DensityOperatorLow;
36 
38 
41 
42 } // freesystem
43 
44 
46 class Free : public QuantumSystem<1>, public DynamicsBase
47 {
48 public:
49  typedef boost::shared_ptr<const Free> Ptr;
50 
52  explicit Free(size_t dim, const RealFreqs& realFreqs=emptyRF, const ComplexFreqs& complexFreqs=emptyCF) : QuantumSystem<1>(dim), DynamicsBase(realFreqs,complexFreqs) {}
53 
54  Free(size_t dim, const ComplexFreqs& complexFreqs) : Free(dim,emptyRF,complexFreqs) {}
55  Free(size_t dim, RealFreqsInitializer rf, ComplexFreqsInitializer cf={}) : Free(dim,RealFreqs(rf),ComplexFreqs(cf)) {}
56  Free(size_t dim, ComplexFreqsInitializer cf) : Free(dim,RealFreqsInitializer(),cf) {}
57  Free(size_t dim, RF rf, CF cf=CF()) : QuantumSystem<1>(dim), DynamicsBase(rf,cf) {}
58  Free(size_t dim, CF cf) : QuantumSystem<1>(dim), DynamicsBase(cf) {}
59  Free(size_t dim, RealFreqsInitializer rf, CF cf) : Free(dim,rf,{cf}) {}
60  Free(size_t dim, RF rf, ComplexFreqsInitializer cf) : Free(dim,{rf},cf) {}
61 
63 
64 
70  std::ostream& displayParameters(std::ostream& os) const {return QuantumSystem<1>::displayParameters(os);}
71 
72 
73 private:
74  double highestFrequency_v( ) const final {return DynamicsBase::highestFrequency ( );}
75  std::ostream& displayParameters_v(std::ostream& os) const final {return DynamicsBase::displayParameters(os);}
76 
77  std::ostream& displayMoreParameters(std::ostream& os) const final {return DynamicsBase::displayMoreParameters(os<<"# Dimension: "<<getDimension()<<std::endl);}
78 
79 };
80 
81 
82 } // structure
83 
84 #endif // CPPQEDCORE_STRUCTURE_FREE_H_INCLUDED
QuantumSystem(const Dimensions &dimensions)
Construction from a set of Dimensions.
Definition: QuantumSystem.h:38
Defines class of the same name.
Defines class of the same name.
Basically only a metafunction defining types for higher-level constructs of arity RANK ...
Definition: Types.h:23
quantumdata::LazyDensityOperator< 1 > LazyDensityOperator
unary LazyDensityOperator
Definition: Free.h:37
std::tuple< std::string, dcomp,double > CF
same for complex
Definition: DynamicsBase.h:53
Density operator of arbitrary arity.
quantumdata::Types< 1 >::StateVectorLow StateVectorLow
unary StateVectorLow
Definition: Free.h:34
quantumdata::StateVector< 1 > StateVector
unary StateVector
Definition: Free.h:39
State vector of arbitrary arity.
Definition: StateVector.h:58
In the language of the framework, a free system is a unary system (arity 1, RANK=1) ...
Definition: Free.h:46
std::ostream & displayParameters(std::ostream &os) const
Definition: Free.h:70
quantumoperator::Tridiagonal< 1 > Tridiagonal
unary Tridiagonal
Definition: Free.h:32
quantumdata::Types< 1 >::DensityOperatorLow DensityOperatorLow
unary DensityOperatorFwd
Definition: Free.h:35
std::list< CF > ComplexFreqs
same for complex
Definition: DynamicsBase.h:56
std::ostream & displayParameters(std::ostream &) const
Displays the content of the stored ostringstream followed by a call to displayMoreParameters.
Comprises modules for describing quantum systems.
Definition: Averaged.h:17
size_t getDimension(mpl::int_< RANK >=mpl::int_< 1 >()) const
Get the (single) dimension for a unary system.
Provides services for dealing with frequency-like parameters, both real and complex, for all elements, frees and interactions alike, which are hence all derived from this class.
Definition: DynamicsBase.h:47
Defines class of the same name.
std::ostream & displayParameters(std::ostream &os) const
Communicating system parameters towards the user.
Definition: QuantumSystem.h:43
std::list< RF > RealFreqs
list of real frequency-like parameters
Definition: DynamicsBase.h:55
Common interface for calculating quantum averages.
double highestFrequency() const
Calculates the fastest timescale of the system from the frequencies stored in the lists...
The abstract interface every system has to present towards the quantum trajectory drivers quantumtraj...
Definition: QuantumSystem.h:25
quantumdata::DensityOperator< 1 > DensityOperator
unary DensityOperator
Definition: Free.h:40
double highestFrequency() const
Simply connects the pure virtual QuantumSystem::highestFrequency to the implementation DynamicsBase::...
Definition: Free.h:69
Free(size_t dim, const RealFreqs &realFreqs=emptyRF, const ComplexFreqs &complexFreqs=emptyCF)
A single dimension to initialise QuantumSystem<1> and the lists of real and complex name-frequency-mu...
Definition: Free.h:52
DynamicsBase(const RealFreqs &=emptyRF, const ComplexFreqs &=emptyCF)
Straightforward constructor.
std::tuple< std::string, double, double > RF
name-value-multiplier tuple for a real frequency-like parameter
Definition: DynamicsBase.h:52
Class representing a (unary) tridiagonal matrix or direct product of such matrices.
Definition: Tridiagonal.h:103
virtual std::ostream & displayMoreParameters(std::ostream &) const
In its default implementation, displayes the frequency-like parameters of the system in a nice format...
double highestFrequency() const
The fastest timescale of the system for ODE stepping.
Definition: QuantumSystem.h:42