ALPS MPS Codes
Reference documentation.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
generate_mpo::Operator_Tag_Term< Matrix, SymmGroup > Struct Template Reference

#include <utils.hpp>

Public Types

typedef OPTable< Matrix,
SymmGroup >::tag_type 
tag_type
 
typedef Lattice::pos_t pos_t
 
typedef std::pair< pos_t,
tag_type
op_pair_t
 

Public Member Functions

 Operator_Tag_Term ()
 
void canonical_order ()
 
bool operator< (Operator_Tag_Term const &rhs) const
 
bool site_match (Operator_Tag_Term const &rhs) const
 
bool overlap (Operator_Tag_Term const &rhs) const
 

Public Attributes

std::vector< op_pair_toperators
 
tag_type fill_operator
 
Matrix::value_type scale
 
bool with_sign
 

Detailed Description

template<class Matrix, class SymmGroup>
struct generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >

Definition at line 45 of file utils.hpp.

Member Typedef Documentation

template<class Matrix, class SymmGroup>
typedef std::pair<pos_t, tag_type> generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >::op_pair_t

Definition at line 49 of file utils.hpp.

template<class Matrix, class SymmGroup>
typedef Lattice::pos_t generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >::pos_t

Definition at line 48 of file utils.hpp.

template<class Matrix, class SymmGroup>
typedef OPTable<Matrix, SymmGroup>::tag_type generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >::tag_type

Definition at line 47 of file utils.hpp.

Constructor & Destructor Documentation

template<class Matrix, class SymmGroup>
generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >::Operator_Tag_Term ( )
inline

Definition at line 56 of file utils.hpp.

56 : scale(1.), with_sign(false) {}
Matrix::value_type scale
Definition: utils.hpp:53

Member Function Documentation

template<class Matrix, class SymmGroup>
void generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >::canonical_order ( )
inline

Definition at line 58 of file utils.hpp.

59  {
60  std::sort(operators.begin(), operators.end(),
61  boost::bind(&op_pair_t::first, _1) <
62  boost::bind(&op_pair_t::first, _2));
63  }
std::vector< op_pair_t > operators
Definition: utils.hpp:51
template<class Matrix, class SymmGroup>
bool generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >::operator< ( Operator_Tag_Term< Matrix, SymmGroup > const &  rhs) const
inline

Definition at line 65 of file utils.hpp.

66  {
67  if (operators[0].first == rhs.operators[0].first)
68  return operators.size() >= rhs.operators.size();
69  return operators[0].first < rhs.operators[0].first;
70  }
std::vector< op_pair_t > operators
Definition: utils.hpp:51
template<class Matrix, class SymmGroup>
bool generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >::overlap ( Operator_Tag_Term< Matrix, SymmGroup > const &  rhs) const
inline

Definition at line 92 of file utils.hpp.

93  {
94  return !( (operators.rbegin()->first < rhs.operators.begin()->first) || (rhs.operators.rbegin()->first < operators.begin()->first) );
95  }
std::vector< op_pair_t > operators
Definition: utils.hpp:51
template<class Matrix, class SymmGroup>
bool generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >::site_match ( Operator_Tag_Term< Matrix, SymmGroup > const &  rhs) const
inline

Definition at line 72 of file utils.hpp.

73  {
74  if (operators.size() == rhs.operators.size())
75  {
76  bool ret = true;
77  for (std::size_t p=0; p<operators.size() && ret; ++p)
78  ret = (operators[p].first == rhs.operators[p].first);
79  return ret;
80  } else if (operators.size() == 2 && rhs.operators.size() == 1)
81  return (operators[0].first == rhs.operators[0].first || operators[1].first == rhs.operators[0].first);
82  else if (operators.size() == 1 && rhs.operators.size() == 2)
83  return (operators[0].first == rhs.operators[0].first || operators[0].first == rhs.operators[1].first);
84  else
85  {
86  throw std::runtime_error("site_match not implemented for this type of operator." );
87  return false;
88  }
89 
90  }
std::vector< op_pair_t > operators
Definition: utils.hpp:51

Member Data Documentation

template<class Matrix, class SymmGroup>
tag_type generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >::fill_operator

Definition at line 52 of file utils.hpp.

template<class Matrix, class SymmGroup>
std::vector<op_pair_t> generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >::operators

Definition at line 51 of file utils.hpp.

template<class Matrix, class SymmGroup>
Matrix::value_type generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >::scale

Definition at line 53 of file utils.hpp.

template<class Matrix, class SymmGroup>
bool generate_mpo::Operator_Tag_Term< Matrix, SymmGroup >::with_sign

Definition at line 54 of file utils.hpp.


The documentation for this struct was generated from the following file: