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
QuantumTrajectory.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 // -*- C++ -*-
4 #ifndef CPPQEDCORE_QUANTUMTRAJECTORY_QUANTUMTRAJECTORY_H_INCLUDED
5 #define CPPQEDCORE_QUANTUMTRAJECTORY_QUANTUMTRAJECTORY_H_INCLUDED
6 
7 #include "QuantumSystem.h"
8 #include "Structure.h"
9 
10 #include "Trajectory.h"
11 
12 
14 namespace quantumtrajectory {
15 
16 
18 template<int RANK>
20 {
22 }
23 
25 
33 template<int RANK, typename BASE>
34 class QuantumTrajectory : public BASE
35 {
36 protected:
38 
40  template<typename... ArgumentPack>
41  QuantumTrajectory(typename structure::QuantumSystem<RANK>::Ptr qs, bool isNoisy, ArgumentPack&&... argumentPack)
42  : BASE(std::forward<ArgumentPack>(argumentPack)...), t0_(0), qs_(qs, isNoisy) {};
43 
44  const QuantumSystemWrapper getQSW() const {return qs_;}
45 
48  { BASE::readStateMore_v(iar); if (getQSW().getEx()) setT0(); return iar; }
49 
51 
60  double getT0() const {return t0_;}
61 
63  void setT0(double t0) const {t0_=t0;}
64 
66  void setT0() const {t0_=BASE::getTime();}
67 
69  template<typename CONSTRUCT>
70  void checkDimension(const CONSTRUCT& construct) const {if (construct!=*qs_.getQS()) throw DimensionalityMismatchException();}
71 
72 private:
73  mutable double t0_;
74  const QuantumSystemWrapper qs_;
75 
76 };
77 
78 
79 
80 } // quantumtrajectory
81 
82 #endif // CPPQEDCORE_QUANTUMTRAJECTORY_QUANTUMTRAJECTORY_H_INCLUDED
Defines the basic classes of the trajectory-bundle.
Defines class of the same name.
Class hosting common code of MCWF_Trajectory and Master.
A wrapper for Exact, Hamiltonian, Liouvillean, and Averaged.
Definition: Structure.h:134
boost::shared_ptr< const QuantumSystem > Ptr
Many of the basic template classes in the framework act as template metafunctions returning a shared ...
Definition: QuantumSystem.h:30
Defines structur::QuantumSystemWrapper.
Comprises modules representing trajectory drivers for simulating quantum systems. ...
Definition: DO_Display.h:12
void setT0(double t0) const
The time instant of the beginning of the current time step.
Thrown in the case of dimensionality mismatch of constructs over the same Hilbert space...
cpputils::iarchive & readStateMore_v(cpputils::iarchive &iar) override
Forwards to BASE, but also sets t0.
double getT0() const
The time instant of the beginning of the current time step.
double initialTimeStep(double highestFrequency)
A heuristic determination of the inital timestep from the highest frequency of a physical system...
Definition: Trajectory.h:183
boost::archive::binary_iarchive iarchive
delegated to Boost.Serialization
Definition: Archive.h:73
QuantumTrajectory(typename structure::QuantumSystem< RANK >::Ptr qs, bool isNoisy, ArgumentPack &&...argumentPack)
Constructor forwarding to BASE and QuantumSystemWrapper.
void setT0() const
The time instant of the beginning of the current time step. Sets to the current time.
double initialTimeStep(typename structure::QuantumSystem< RANK >::Ptr qs)
Forwards to trajectory::initialTimeStep, with the highest frequency of the system taken as structure:...
void checkDimension(const CONSTRUCT &construct) const
Check the dimensions of the stored quantum system against construct
double highestFrequency() const
The fastest timescale of the system for ODE stepping.
Definition: QuantumSystem.h:42