C++QEDCore  v2 Milestone 10
a framework for simulating open quantum dynamics – core
FreeExact.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)
2 // -*- C++ -*-
4 #ifndef CPPQEDCORE_STRUCTURE_FREEEXACT_H_INCLUDED
5 #define CPPQEDCORE_STRUCTURE_FREEEXACT_H_INCLUDED
6 
7 #include "Exact.h"
8 
9 #include <boost/utility/enable_if.hpp>
10 
11 
12 namespace structure {
13 
15 
21 template<bool IS_TWO_TIME>
22 class FreeExact : public ExactTimeDependenceDispatched<1,IS_TWO_TIME>
23 {
24 public:
25  typedef CArray<1> Diagonal;
26 
28 
30 
31 protected:
32  explicit FreeExact(size_t dim) : diagonal_(int(dim)), t_(0,0) {}
33 
34  Diagonal& getDiagonal() const {return diagonal_;}
35 
36 private:
37  virtual void actWithU_v(Time t, StateVectorLow& psi) const final {if (t!=t_) {updateU(t_=t);} psi*=getDiagonal();}
38 
39  virtual void updateU(Time) const = 0;
40 
41 private:
42  mutable Diagonal diagonal_;
43  mutable Time t_;
44 
45 };
46 
47 
48 } // structure
49 
50 
51 #endif // CPPQEDCORE_STRUCTURE_FREEEXACT_H_INCLUDED
Implements the general Exact interface by dispatching the two possible time-dependence levels...
Definition: Exact.h:85
blitz::Array< dcomp,RANK > CArray
A complex array of arbitrary arity.
Definition: BlitzArray.h:16
A unary implementation of Exact assuming that the operator that transforms between the pictures is di...
Definition: FreeExact.h:22
Defines class of the same name.
Comprises modules for describing quantum systems.
Definition: Averaged.h:17