3 #ifndef CPPQEDCORE_QUANTUMTRAJECTORY_ENSEMBLEMCWF_H_INCLUDED
4 #define CPPQEDCORE_QUANTUMTRAJECTORY_ENSEMBLEMCWF_H_INCLUDED
6 #include "EnsembleMCWFFwd.h"
23 #define STATE_VECTORS(r) boost::ptr_vector<quantumdata::StateVector<r> >
25 #define BASE_class trajectory::Ensemble< quantumdata::DensityOperator<RANK>&, const quantumdata::StateVector<RANK>& >
30 :
private boost::base_from_member<STATE_VECTORS(RANK) >,
34 typedef STATE_VECTORS(RANK) StateVectors;
46 typedef boost::base_from_member<StateVectors> StateVectorsBase;
59 const StateVector& psi,
65 const QuantumSystemPtr getQS()
const {
return qs_;}
68 virtual std::ostream& logOnEnd_v(std::ostream& os)
const final;
71 static std::auto_ptr<StateVectors> stateVectors(
const StateVector& psi,
size_t nTraj);
72 static std::auto_ptr<Trajectories> trajectories(StateVectors& psis, QuantumSystemPtr qs,
const Pars& p,
const StateVectorLow& scaleAbs);
79 const QuantumSystemPtr qs_;
81 const size_t nBins_, nJumpsPerBin_;
108 template<
int RANK,
typename V>
126 template<
typename SYS>
128 const StateVector& psi,
137 virtual std::ostream& display_v (std::ostream& os,
int precision)
const final {
return doDisplay_.display (this->getTime(),this->toBeAveraged(),os,precision);}
138 virtual std::ostream& displayKey_v(std::ostream& os,
size_t& i )
const final {
return doDisplay_.displayKey(os,i);}
140 const DO_Display doDisplay_;
170 typedef typename EnsembleType::Elem Elem ;
171 typedef typename EnsembleType::Impl Impl ;
172 typedef typename EnsembleType::ToBeAveragedType ToBeAveragedType;
175 static const ToBeAveragedType averageInRange(
typename Impl::const_iterator begin,
typename Impl::const_iterator end,
const EnsembleType& et)
177 ToBeAveragedType res(et.getInitializedDensityOperator());
179 for (
auto i=begin; i!=end; i++) i->toBeAveraged().
addTo(res);
181 return res/=size2Double(end-begin);
193 #endif // CPPQEDCORE_QUANTUMTRAJECTORY_ENSEMBLEMCWF_H_INCLUDED
Defines display_densityoperator::_.
EnsembleMCWF(const StateVector &psi, const SYS &sys, const mcwf::Pars &p, bool negativity, const StateVectorLow &scaleAbs=StateVectorLow())
Templated constructor with the same idea as Master::Master.
Comprises classes representing the state of composite quantum systems and providing various interface...
Namespace comprising otherwise hard-to-classify generic utilities.
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 ...
quantumdata::Types< 1 >::StateVectorLow StateVectorLow
unary StateVectorLow
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...
quantumdata::StateVector< 1 > StateVector
unary StateVector
State vector of arbitrary arity.
Comprises modules representing trajectory drivers for simulating quantum systems. ...
Defines class of the same name.
Comprises modules for describing quantum systems.
Some converters along the lines of Boost.NumericConversion
Less templatized base for EnsembleMCWF.
Implements a single Monte Carlo wave-function trajectory.
Wraps common functionality of Master & EnsembleMCWF concerning display of quantum averages on the bas...
Tools for creating non-owning shared pointers.
quantumdata::DensityOperator< 1 > DensityOperator
unary DensityOperator
Derived from trajectory::Ensemble < quantumdata::DensityOperator <RANK>& , const quantumdata::StateVe...
Defines class of the same name.
void addTo(DensityOperator< RANK > &densityOperator) const
Adds a dyad of the present object to densityOperator
Aggregate of parameters pertaining to MCWF simulations.
boost::ptr_vector< Elem > Impl
The storage of the element trajectories is through a pointer-vector