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
TimeAveragingMCWF_Trajectory.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)
3 #ifndef CPPQEDCORE_QUANTUMTRAJECTORY_TIMEAVERAGINGMCWF_TRAJECTORY_H_INCLUDED
4 #define CPPQEDCORE_QUANTUMTRAJECTORY_TIMEAVERAGINGMCWF_TRAJECTORY_H_INCLUDED
5 
6 #include "TimeAveragingMCWF_TrajectoryFwd.h"
7 
8 #include "MCWF_Trajectory.h"
9 
10 
11 namespace quantumtrajectory {
12 
13 
15 
37 template<int RANK>
39 {
40 private:
42 
43 public:
44  typedef typename Base::StateVector StateVector ;
45  typedef typename Base::StateVectorLow StateVectorLow;
46 
47  typedef typename Base::Averaged Averaged;
48 
49  typedef typename Averaged::Averages Averages;
50 
52  template<typename SYS>
54  StateVector& psi,
55  const SYS& sys,
56  const mcwf::Pars& p,
57  double relaxationTime,
58  const StateVectorLow& scaleAbs=StateVectorLow()
59  )
60  : Base(psi,sys,p,scaleAbs), relaxationTime_(relaxationTime), averages_(this->getQSW().template nAvr<structure::LA_Av>()), sum_(0), av_(this->getQSW().getAv())
61  {
62  averages_=0.;
63  }
64 
65  const Averages getAverages() const {return averages_;}
66 
67 private:
68  std::ostream& display_v(std::ostream&, int) const override;
69 
70  std::ostream& logOnEnd_v(std::ostream& os) const override;
71 
72  cpputils::iarchive& readStateMore_v(cpputils::iarchive& iar) override {return Base:: readStateMore_v(iar) & averages_ & sum_;}
73  cpputils::oarchive& writeStateMore_v(cpputils::oarchive& oar) const override {return Base::writeStateMore_v(oar) & averages_ & sum_;}
74 
75  const std::string trajectoryID_v() const override {return "TimeAveragingMCWF_Trajectory";}
76 
77  const double relaxationTime_;
78 
79  mutable Averages averages_;
80  mutable long sum_;
81 
82  const typename Averaged::Ptr av_;
83 
84 };
85 
86 
87 } // quantumtrajectory
88 
89 
90 #endif // CPPQEDCORE_QUANTUMTRAJECTORY_TIMEAVERAGINGMCWF_TRAJECTORY_H_INCLUDED
boost::shared_ptr< const Base > Ptr
Convenience typedef.
Definition: BinarySystem.h:17
Represents a trajectory that has both adaptive ODE evolution and noise.
State vector of arbitrary arity.
Definition: StateVector.h:58
Comprises modules representing trajectory drivers for simulating quantum systems. ...
Definition: DO_Display.h:12
Defines class of the same name.
boost::archive::binary_oarchive oarchive
delegated to Boost.Serialization
Definition: Archive.h:74
Comprises modules for describing quantum systems.
Definition: Averaged.h:17
size_t nAvr(const SSF &free0, const SSF &free1, const SSI &ia)
Outfactored common functionality of Liouvillean and Averaged.
Implements a single Monte Carlo wave-function trajectory.
The interface every system that calculates and displays quantum averages must present towards the tra...
Definition: Averaged.h:84
boost::archive::binary_iarchive iarchive
delegated to Boost.Serialization
Definition: Archive.h:73
Derived from MCWF_Trajectory, this class in addition performs time averaging of the columns during tr...
cpputils::iarchive & readStateMore_v(cpputils::iarchive &iar) override
Forwards to QuantumTrajectory::readStateMore_v (that involves setting t0) + serializes mcwf::Logger s...
cpputils::oarchive & writeStateMore_v(cpputils::oarchive &oar) const override
Forwards to Base::writeStateMore_v + serializes mcwf::Logger state.
Aggregate of parameters pertaining to MCWF simulations.
TimeAveragingMCWF_Trajectory(StateVector &psi, const SYS &sys, const mcwf::Pars &p, double relaxationTime, const StateVectorLow &scaleAbs=StateVectorLow())
The signature is identical to MCWF_Trajectory::MCWF_Trajectory, but the relaxation time must be suppl...