4 #ifndef CPPQEDELEMENTS_FREES_MULTILEVEL__H_INCLUDED
5 #define CPPQEDELEMENTS_FREES_MULTILEVEL__H_INCLUDED
7 #include "MultiLevel_Fwd.h"
9 #include "ParsMultiLevel.h"
11 #include "AveragingUtils.tcc"
19 #include <boost/fusion/mpl/size.hpp>
21 #include <boost/shared_ptr.hpp>
28 const std::string keyTitle=
"MultiLevel";
34 template<
int NL>
using Levels = blitz::TinyVector<dcomp,NL>;
37 template<
int NL>
using RealLevels = blitz::TinyVector<double,NL>;
56 Exact(
const L& zIs) : FreeExact<false>(NL), zIs_(zIs) {}
58 const L& get_zIs()
const {
return zIs_;}
61 void updateU(
double)
const;
63 bool applicableInMaster_v()
const;
82 Storage(
const T& value) : value_(value) {}
85 const T&
get()
const {
return value_;}
86 void set(
const T& value) {value_=value;}
98 Storage(
double value) : value_(value) {}
101 double get()
const {
return value_;}
102 void set(
double value) {value_=value;}
113 std::ostream& operator<<(std::ostream& os, const Storage<T>& s)
121 std::istream&
operator>>(std::istream& is, Storage<T>& s)
130 template<
int I,
int J>
139 template<
int NL,
typename VP>
145 static const int NPT=mpl::size<VP>::value;
147 typedef typename Exact<NL>::L L;
150 :
Exact<NL>(zIs), zSchs_(zSchs), etas_(etas) {}
163 template<
int NL,
typename VP>
168 static const int NPT=mpl::size<VP>::value;
172 HamiltonianSch(
const L& zSchs,
const VP& etas) : zSchs_(zSchs), etas_(etas) {}
174 const L& get_zSchs()
const {
return zSchs_;}
195 template<
int I,
int J>
204 template<
int NL,
typename VL>
209 static const int NLT=mpl::size<VL>::value;
218 typedef typename Base::KeyLabels KeyLabels;
220 Liouvillean(
const VL& gammas,
double gamma_parallel) : Base(Liouvillean::fillJS(),Liouvillean::fillJRS(),keyTitle,fillKeyLabels()), gammas_(gammas), gamma_parallel_(gamma_parallel) {}
222 const JumpStrategies fillJS ()
const;
223 const JumpRateStrategies fillJRS()
const;
225 static const KeyLabels fillKeyLabels();
236 void flipStrategy(
StateVectorLow& psi,
size_t i)
const {psi*=sqrt(2.*gamma_parallel_); psi(i)*=-1.;}
246 const double gamma_parallel_;
266 typedef boost::shared_ptr<const MultiLevelBase>
Ptr;
273 getParsStream()<<
"# "<<multilevel::keyTitle<<std::endl;
289 template<
int NL,
typename VP,
typename VL,
typename AveragingType>
305 typedef typename Base::Ptr
Ptr;
307 template<
typename... AveragingConstructorParameters>
308 PumpedLossyMultiLevelSch(
const RealLevels&,
const VP&,
const VL&,
double gamma_parallel, AveragingConstructorParameters&&...);
316 #define RETURN_type typename MultiLevelBase<NL>::Ptr
319 template<
typename AveragingType,
int NL,
typename VP,
typename VL,
typename... AveragingConstructorParameters>
323 const VP& etas,
const VL& gammas,
double gamma_parallel,
324 AveragingConstructorParameters&&... a)
326 return boost::make_shared<PumpedLossyMultiLevelSch<NL,VP,VL,AveragingType> >(deltas,etas,gammas,gamma_parallel,a...);
330 template<
typename AveragingType,
int NL,
typename VP,
typename VL,
typename... AveragingConstructorParameters>
333 makePumpedLossySch(
const multilevel::ParsPumpedLossy<NL,VP,VL>& p, AveragingConstructorParameters&&... a)
335 return makePumpedLossySch<AveragingType>(p.deltas,p.etas,p.gammas,p.gamma_parallel,a...);
339 template<
int NL,
typename VP,
typename VL>
342 makePumpedLossySch(
const RealLevels<NL>& deltas,
const VP& etas,
const VL& gammas,
double gamma_parallel,
const std::string& keyTitle=
"PumpedLossyMultiLevelSch",
bool offDiagonals=
false)
344 return makePumpedLossySch<ReducedDensityOperator<1> >(deltas,etas,gammas,gamma_parallel,keyTitle,NL,offDiagonals);
348 template<
int NL,
typename VP,
typename VL>
351 makePumpedLossySch(
const multilevel::ParsPumpedLossy<NL,VP,VL>& p,
const std::string& keyTitle=
"PumpedLossyMultiLevelSch",
bool offDiagonals=
false)
353 return makePumpedLossySch<ReducedDensityOperator<1> >(p,keyTitle,NL,offDiagonals);
362 #endif // CPPQEDELEMENTS_FREES_MULTILEVEL__H_INCLUDED
Contains helpers for the MultiLevel bundle.
boost::shared_ptr< const QuantumSystem > Ptr
quantumdata::Types< 1 >::StateVectorLow StateVectorLow
std::list< CF > ComplexFreqs
blitz::TinyVector< JumpStrategy, NLINDBLADS > JumpStrategies
blitz::TinyVector< JumpRateStrategy, NLINDBLADS > JumpRateStrategies
std::istream & operator>>(std::istream &, Method &)
blitz::TinyVector< double, NL > RealLevels
Type for storing level energies (the s here)
std::list< RF > RealFreqs
Class representing an elementary pump term (an here) with a compile-time pair and a runtime complex...
Implements a free multi-level system with driving and loss.
Class representing an elementary decay term (a here) with a compile-time pair and a runtime real va...
std::ostringstream & getParsStream()
RETURN_type makePumpedLossySch(const RealLevels< NL > &deltas, const VP &etas, const VL &gammas, double gamma_parallel, AveragingConstructorParameters &&...a)
Maker function for PumpedLossyMultiLevelSch.
blitz::TinyVector< dcomp, NL > Levels
Type for storing complex level energies (the s here)