4 #ifndef CPPQEDCORE_QUANTUMTRAJECTORY_MASTER_H_INCLUDED
5 #define CPPQEDCORE_QUANTUMTRAJECTORY_MASTER_H_INCLUDED
19 #include <boost/function.hpp>
42 class Base :
public QuantumTrajectory<RANK, trajectory::Adaptive<typename quantumdata::Types<RANK>::DensityOperatorLow> >
46 typedef structure::Exact <RANK>
Exact ;
49 typedef structure::Averaged <RANK>
Averaged ;
51 typedef typename quantumdata::Types<RANK>::DensityOperatorLow DensityOperatorLow;
61 void derivs(
double,
const DensityOperatorLow&, DensityOperatorLow&)
const;
64 using QuantumTrajectory::getQSW;
66 Base(DensityOperator&,
typename QuantumSystem::Ptr,
const Pars&,
const DensityOperatorLow& =DensityOperatorLow());
68 typedef boost::function<void( StateVectorLow&)> UnaryFunction;
69 typedef boost::function<void(const StateVectorLow&, StateVectorLow&)> BinaryFunction;
71 DensityOperator& rho_;
73 const typename Averaged::Ptr getAv()
const {
return getQSW().getAv();}
76 virtual void step_v(
double)
final;
78 std::ostream& displayParameters_v(std::ostream&)
const override;
80 virtual void unaryIter( DensityOperatorLow&, UnaryFunction)
const;
81 virtual void binaryIter(
const DensityOperatorLow&, DensityOperatorLow&, BinaryFunction)
const;
83 virtual const std::string addToParameterDisplay()
const {
return "";}
98 typedef typename Base<RANK>::DensityOperatorLow DensityOperatorLow;
100 BaseFast(DensityOperator& rho,
typename QuantumSystem::Ptr sys,
const Pars& p,
const DensityOperatorLow& scaleAbs=DensityOperatorLow())
101 :
Base<RANK>(rho,sys,p,scaleAbs), slicesData_(rho.getArray()) {}
104 typedef typename Base<RANK>:: UnaryFunction UnaryFunction;
105 typedef typename Base<RANK>::BinaryFunction BinaryFunction;
107 virtual void unaryIter( DensityOperatorLow&, UnaryFunction)
const final;
108 virtual void binaryIter(
const DensityOperatorLow&, DensityOperatorLow&, BinaryFunction)
const final;
110 virtual const std::string addToParameterDisplay()
const final {
return " Fast Iteration.";}
122 #define BASE_class boost::mpl::if_c<IS_FAST,master::BaseFast<RANK>,master::Base<RANK> >::type
135 template<
int RANK,
typename V,
bool IS_FAST>
139 typedef typename BASE_class Base;
143 typedef typename Base::QuantumSystem QuantumSystem;
151 template<
typename SYS>
156 const DensityOperatorLow& scaleAbs=DensityOperatorLow()
161 const DensityOperator& getRho()
const {
return this->rho_;}
164 std::ostream& display_v (std::ostream& os,
int precision)
const override {
return doDisplay_.display (this->getTime(),this->rho_,os,precision);}
165 std::ostream& displayKey_v(std::ostream& os,
size_t& i )
const override {
return doDisplay_.displayKey(os,i);}
167 const std::string trajectoryID_v()
const override {
return "Master";}
169 const display_densityoperator::_<RANK,V> doDisplay_;
178 #endif // CPPQEDCORE_QUANTUMTRAJECTORY_MASTER_H_INCLUDED
An Adaptive trajectory class representing Master equation evolution from a density-operator initial c...
The class that is (meant to be, at least) the base of all exceptions in the framework.
The interface every system that needs transformation between two quantum mechanical pictures must pre...
Defines display_densityoperator::_.
Defines class of the same name.
Class hosting common code of MCWF_Trajectory and Master.
Master(DensityOperator &rho, const SYS &sys, const master::Pars &pt, bool negativity, const DensityOperatorLow &scaleAbs=DensityOperatorLow())
Templated constructor.
Namespace comprising otherwise hard-to-classify generic utilities.
The actual working base of Master in the case when blitzplusplus::basi::Iterator is used for implemen...
Density operator of arbitrary arity.
boost::shared_ptr< const QuantumSystem > Ptr
Many of the basic template classes in the framework act as template metafunctions returning a shared ...
Defines class of the same name.
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...
void derivs(double, const DensityOperatorLow &, DensityOperatorLow &) const
The actual function calculating the time derivative for ODE evolution.
Defines structur::QuantumSystemWrapper.
quantumdata::Types< 1 >::DensityOperatorLow DensityOperatorLow
unary DensityOperatorFwd
Comprises modules representing trajectory drivers for simulating quantum systems. ...
Aggregate condensing parameters concerning adaptive ODE evolution (cf. Adaptive::Adaptive()) in the s...
The interface every system having (possibly non-Hermitian) Hamiltonian time-evolution must present to...
The interface every system that calculates and displays quantum averages must present towards the tra...
Adaptive is basically an evolved::Evolved wrapped into the Trajectory interface.
Tools for adapting blitzplusplus::basi::Iterators to iteration over rows or columns of (multi)matrice...
Tools for creating non-owning shared pointers.
The abstract interface every system has to present towards the quantum trajectory drivers quantumtraj...
quantumdata::DensityOperator< 1 > DensityOperator
unary DensityOperator
Thrown if the system is not applicable in Master-equation evolution.
The interface every system having Liouvillean time-evolution must present towards the trajectory driv...
The actual working base of Master in the case when blitzplusplus::basi_fast::Iterator is used for imp...
Contains data for pre-calculated slices for basi_fast::Iterator.
Defines tentative base classes for the exception classes of the framework.