#include <mps_initializers.h>
template<class Matrix, class SymmGroup>
class basis_mps_init< Matrix, SymmGroup >
Definition at line 380 of file mps_initializers.h.
template<class Matrix , class SymmGroup >
Definition at line 383 of file mps_initializers.h.
387 : occupation(params[
"init_basis_state"].as<std::vector<int> >())
388 , phys_dims(phys_dims_)
389 , site_type(site_type_)
template<class Matrix , class SymmGroup >
void basis_mps_init< Matrix, SymmGroup >::operator() |
( |
MPS< Matrix, SymmGroup > & |
mps | ) |
|
|
inlinevirtual |
Implements mps_initializer< Matrix, SymmGroup >.
Definition at line 392 of file mps_initializers.h.
394 assert(occupation.size() == mps.
length());
395 if (phys_dims[0].size() != 1)
throw std::runtime_error(
"basis_mps_init only for TrivialGroup.");
396 typedef typename SymmGroup::charge charge;
397 charge C = SymmGroup::IdentityCharge;
399 std::vector<boost::tuple<charge, size_t> > state(mps.
length());
400 for (
int i=0; i<mps.
length(); ++i)
401 state[i] = boost::make_tuple(C, occupation[i]);
402 mps = state_mps<Matrix>(state, phys_dims, site_type);
The documentation for this class was generated from the following file: