27 #ifndef MAQUIS_DMRG_MODELS_OP_HANDLER_H
28 #define MAQUIS_DMRG_MODELS_OP_HANDLER_H
35 #include <boost/shared_ptr.hpp>
42 template <
class Matrix,
class SymmGroup>
43 class OPTable :
public std::vector<block_matrix<Matrix, SymmGroup> >
50 typedef typename Matrix::value_type mvalue_type;
57 template <
class Matrix,
class SymmGroup>
71 operator_table(new
OPTable<Matrix, SymmGroup>())
81 std::pair<tag_type, value_type> ret = operator_table->checked_register(sample);
82 if (sign_table.size() < operator_table->size())
83 sign_table.push_back(kind);
85 assert(sign_table.size() == operator_table->size());
131 boost::shared_ptr<OPTable<Matrix, SymmGroup> > operator_table;
134 tag_type duplicates_(Map
const & sample);
136 std::vector<tag_detail::operator_kind> sign_table;
140 template <
class Matrix,
class SymmGroup>
151 , kronecker_table(new
OPTable<Matrix, SymmGroup>())
154 it != tbl_->end(); ++it)
172 boost::shared_ptr<OPTable<Matrix, SymmGroup> > kronecker_table;
174 std::vector<bool> uniform;
OPTable< Matrix, SymmGroup >::value_type const & get_op(tag_type i) const
tag_type total_size() const
bool is_fermionic(tag_type query_tag) const
std::pair< tag_type, mvalue_type > checked_register(op_t const &sample)
tag_type register_op(op_t const &op_)
pair_map_t::const_iterator pair_map_it_t
boost::shared_ptr< OPTable< Matrix, SymmGroup > > get_operator_table()
tag_type get_kron_tag(Index< SymmGroup > const &phys_i1, Index< SymmGroup > const &phys_i2, tag_type t1, tag_type t2)
tag_detail::tag_type tag_type
declaration of block_matrix class
boost::shared_ptr< OPTable< Matrix, SymmGroup > > get_kronecker_table()
tag_type get_num_products() const
KronHandler(boost::shared_ptr< OPTable< Matrix, SymmGroup > > tbl_)
implementation of tags to indentify operator matrices
definition of OPTable, TagHandler and KronHandler
bool is_uniform(block_matrix< Matrix, SymmGroup > const &op)
tag_type get_num_kron_products() const
OPTable< Matrix, SymmGroup >::value_type const & get_op(tag_type i) const
bool is_uniform(tag_type t)
OPTable< Matrix, SymmGroup >::op_t op_t
OPTable< Matrix, SymmGroup >::value_type & get_op(tag_type i)
OPTable< Matrix, SymmGroup >::tag_type tag_type
block_matrix< Matrix, SymmGroup > op_t
algorithms for block_matrix (gemm, svd, etc.)
std::pair< tag_type, value_type > checked_register(op_t const &sample, tag_detail::operator_kind kind)
Matrix::value_type value_type
OPTable< Matrix, SymmGroup >::value_type & get_op(tag_type i)
tag_type register_op(const op_t &op_, tag_detail::operator_kind kind)
std::pair< tag_type, value_type > get_product_tag(const tag_type t1, const tag_type t2)
std::map< std::pair< tag_type, tag_type >, std::pair< tag_type, value_type >, tag_detail::pair_cmp > pair_map_t
tag_type prod_duplicates() const
TagHandler(boost::shared_ptr< OPTable< Matrix, SymmGroup > > tbl_)