ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Functions
measurements.h File Reference
#include "dmrg/models/measurements/average.h"
#include "dmrg/models/measurements/local.h"
#include "dmrg/models/measurements/local_at.h"
#include "dmrg/models/measurements/correlations.h"
#include "dmrg/models/measurements/custom.h"
#include "dmrg/models/measurements/overlap.h"
#include "dmrg/models/measurements/entanglement.h"

Go to the source code of this file.

Classes

class  measure_and_save< Matrix, SymmGroup >
 
class  detail::name_not_in_list
 

Namespaces

 detail
 

Functions

template<class Matrix , class SymmGroup >
boost::ptr_vector< measurement
< Matrix, SymmGroup > > & 
operator<< (boost::ptr_vector< measurement< Matrix, SymmGroup > > &lhs, boost::ptr_vector< measurement< Matrix, SymmGroup > > const &rhs)
 
template<class Matrix , class SymmGroup >
boost::ptr_vector< measurement
< Matrix, SymmGroup > > 
meas_sublist (boost::ptr_vector< measurement< Matrix, SymmGroup > > const &m, std::vector< std::string > const &meas_list)
 
template<class Matrix , class SymmGroup >
boost::ptr_vector< measurement
< Matrix, SymmGroup > > 
overlap_measurements (BaseParameters const &parms, boost::optional< size_t > sweep=boost::none)
 

Function Documentation

template<class Matrix , class SymmGroup >
boost::ptr_vector<measurement<Matrix, SymmGroup> > meas_sublist ( boost::ptr_vector< measurement< Matrix, SymmGroup > > const &  m,
std::vector< std::string > const &  meas_list 
)

Definition at line 97 of file measurements.h.

99 {
100  boost::ptr_vector<measurement<Matrix, SymmGroup> > sublist(m.clone());
101  sublist.erase_if( ::detail::name_not_in_list(meas_list) );
102  return sublist;
103 }
template<class Matrix , class SymmGroup >
boost::ptr_vector<measurement<Matrix, SymmGroup> >& operator<< ( boost::ptr_vector< measurement< Matrix, SymmGroup > > &  lhs,
boost::ptr_vector< measurement< Matrix, SymmGroup > > const &  rhs 
)

Definition at line 88 of file measurements.h.

90 {
91  lhs.insert(lhs.end(), rhs.begin(), rhs.end());
92  return lhs;
93 }
template<class Matrix , class SymmGroup >
boost::ptr_vector<measurement<Matrix, SymmGroup> > overlap_measurements ( BaseParameters const &  parms,
boost::optional< size_t >  sweep = boost::none 
)

Definition at line 124 of file measurements.h.

125 {
126  /* Syntax for MEASURE_OVERLAP:
127  * (1) MEASURE_OVERLAP[obsname] = "/path/to/ckp.h5"
128  * (2) MEASURE_OVERLAP[obsname(sweep)] = "/path/to/ckp.h5"
129  *
130  * `obsname` is the name that will be given in archive output.
131  * if `sweep` is prensent, the overlap will only be computed when the sweep number
132  * matches the given one.
133  */
134  boost::ptr_vector<measurement<Matrix, SymmGroup> > meas;
135  boost::regex expression("^MEASURE_OVERLAP\\[([a-zA-Z]+)(\\(([0-9]+)\\))?\\]$");
136  boost::smatch what;
137  for (BaseParameters::const_iterator it=parms.begin();it != parms.end();++it) {
138  std::string lhs = it->key();
139  if (boost::regex_match(lhs, what, expression)) {
140  if (sweep && !what[3].matched) continue;
141  if (sweep && what[3].matched && boost::lexical_cast<long>(what.str(3)) != sweep.get()) continue;
142 
143  std::string name = what.str(1), bra_chkp = it->value();
144  meas.push_back( new measurements::overlap<Matrix, SymmGroup>(name, bra_chkp) );
145  }
146  }
147  return meas;
148 }