3 #ifndef CPPQEDCORE_COMPOSITES_BINARYSYSTEM_H_INCLUDED
4 #define CPPQEDCORE_COMPOSITES_BINARYSYSTEM_H_INCLUDED
6 #include "BinarySystemFwd.h"
17 typedef boost::shared_ptr<const Base>
Ptr;
27 const Ptr
doMake(Interaction::Ptr);
31 const Ptr
make(
const IA& ia)
42 template<structure::LiouvilleanAveragedTag>
43 std::ostream&
displayKey(std::ostream&,
size_t&,
const SSF& free0,
const SSF& free1,
const SSI& ia);
46 template<structure::LiouvilleanAveragedTag>
47 size_t nAvr(
const SSF& free0,
const SSF& free1,
const SSI& ia);
50 template<structure::LiouvilleanAveragedTag>
79 explicit Base(Interaction::Ptr);
83 const SSF& getFree0()
const {
return free0_;}
84 const SSF& getFree1()
const {
return free1_;}
85 const SSI& getIA ()
const {
return ia_;}
89 double highestFrequency_v( )
const;
90 std::ostream& displayParameters_v(std::ostream&)
const;
92 size_t nAvr_v()
const {
return binary::nAvr <structure::LA_Av>( free0_,free1_,ia_ );}
93 const Averages average_v(
double t,
const LazyDensityOperator& ldo)
const {
return binary::average <structure::LA_Av>(t,ldo,free0_,free1_,ia_,
nAvr());}
94 void process_v(Averages&)
const;
95 std::ostream& display_v(
const Averages&, std::ostream&,
int)
const;
96 std::ostream& displayKey_v(std::ostream& os,
size_t& i)
const {
return binary::displayKey<structure::LA_Av>(os,i, free0_,free1_,ia_ );}
98 const SSF free0_, free1_;
105 #define CLASS_HEADER(Class) class Class : public structure::Class<2>
107 #define CLASS_BODY_PART(Class,Aux) public: \
108 typedef structure::Class<1> Aux##1; \
109 typedef structure::Class<2> Aux##2; \
111 Class(const SSF& free0, const SSF& free1, const SSI& ia) : free0_(free0), free1_(free1), ia_(ia) {} \
114 const SSF &free0_, &free1_; \
121 CLASS_BODY_PART(
Exact,Ex)
123 bool applicableInMaster_v()
const;
125 void actWithU_v(
double, StateVectorLow&,
double)
const;
135 void addContribution_v(
double,
const StateVectorLow&, StateVectorLow&,
double)
const;
145 void actWithJ_v(
double, StateVectorLow&,
size_t)
const;
147 std::ostream& displayKey_v(std::ostream& os,
size_t& i )
const {
return binary::displayKey<structure::LA_Li>(os,i, free0_,free1_,ia_);}
148 size_t nAvr_v( )
const {
return binary::nAvr <structure::LA_Li>( free0_,free1_,ia_);}
149 const Rates average_v(
double t,
const LazyDensityOperator& ldo)
const {
return binary::average <structure::LA_Li>(t,ldo,free0_,free1_,ia_,
nAvr());}
154 #undef CLASS_BODY_PART
162 EmptyBase(
const SSF&,
const SSF&,
const SSI&) {}
169 #define BASE_class(Aux,Class) mpl::if_c<IS_##Aux,binary::Class,binary::EmptyBase<binary::Class> >::type
186 template<
bool IS_EX,
bool IS_HA,
bool IS_LI>
189 public BASE_class(EX,Exact),
190 public BASE_class(HA,Hamiltonian),
191 public BASE_class(LI,Liouvillean)
194 typedef typename BASE_class(EX,Exact) ExactBase;
195 typedef typename BASE_class(HA,Hamiltonian) HamiltonianBase;
196 typedef typename BASE_class(LI,Liouvillean) LiouvilleanBase;
208 #endif // CPPQEDCORE_COMPOSITES_BINARYSYSTEM_H_INCLUDED
Defines class of the same name.
boost::shared_ptr< const Base > Ptr
Convenience typedef.
quantumdata::LazyDensityOperator< 1 > LazyDensityOperator
unary LazyDensityOperator
Describes interaction of Free elements.
DArray< 1 > DArray1D
A 1D real array storing the quantum averages – even if they are complex, their real & imaginary part...
Implements the structure::Liouvillean interface for a BinarySystem.
Helper for class composition of BinarySystem.
const boost::shared_ptr< T > sharedPointerize(boost::shared_ptr< T > t)
Part of a bundle of functions providing a unified interface to wrap objects into the shared-pointer i...
const Ptr doMake(Interaction::Ptr)
Maker function for BinarySystem.
Implements the simplest composite system: a binary where a single binary::Interaction couples two fre...
const structure::LiouvilleanAveragedCommon::DArray1D average(double t, const quantumdata::LazyDensityOperator< 2 > &ldo, const SSF &free0, const SSF &free1, const SSI &ia, size_t numberAvr)
Outfactored common functionality of Liouvillean and Averaged.
std::ostream & displayKey(std::ostream &, size_t &, const SSF &free0, const SSF &free1, const SSI &ia)
Outfactored common functionality of Liouvillean and Averaged.
Implements the structure::Exact interface for a BinarySystem along the same lines as Base implements ...
size_t nAvr(const SSF &free0, const SSF &free1, const SSI &ia)
Outfactored common functionality of Liouvillean and Averaged.
Auxiliary tools for BinarySystem.
The interface every system that calculates and displays quantum averages must present towards the tra...
composite::SubSystemFree SSF
Convenience typedef.
composite::SubSystemsInteraction< 2 > SSI
Convenience typedef.
structure::Interaction< 2 > Interaction
Binary interaction.
Common interface for calculating quantum averages.
Implements the structure::Hamiltonian interface for a BinarySystem.
Tools for creating non-owning shared pointers.
The abstract interface every system has to present towards the quantum trajectory drivers quantumtraj...
Base(Interaction::Ptr)
Constructor from an Interaction instant.
Defines composite::SubSystemFree and composite::SubSystemsInteraction.
Common base for all class-composed BinarySystems.
const Ptr make(const IA &ia)
Templatized maker function relying on cpputils::sharedPointerize to delegate to make() ...
Base::DArray1D Rates
The 1D real array for storing the jump rates.