#include <mps_initializers.h>
template<class Matrix, class SymmGroup>
class coherent_mps_init< Matrix, SymmGroup >
Definition at line 276 of file mps_initializers.h.
template<class Matrix , class SymmGroup >
Definition at line 279 of file mps_initializers.h.
282 : coeff(params[
"init_coeff"].as<std::vector<double> >())
283 , phys_dims(phys_dims_)
284 , site_type(site_type_)
template<class Matrix , class SymmGroup >
Implements mps_initializer< Matrix, SymmGroup >.
Definition at line 287 of file mps_initializers.h.
289 assert(coeff.size() == mps.
length());
290 if (phys_dims[0].size() != 1)
throw std::runtime_error(
"coherent_mps_init only for TrivialGroup.");
292 typedef typename SymmGroup::charge charge;
294 using std::exp;
using std::sqrt;
using std::pow;
295 using boost::math::factorial;
297 size_t L = coeff.size();
300 trivial_i.
insert(std::make_pair(SymmGroup::IdentityCharge, 1));
302 for (
int p=0; p<L; ++p) {
304 Matrix m(phys_dims[site_type[p]][s].second, 1, 0.);
305 for (
int ss=0; ss<phys_dims[site_type[p]][s].second; ++ss) {
306 m(ss, 0) = pow(coeff[p], ss) *
sqrt(factorial<double>(ss)) / factorial<double>(ss);
309 block.
insert_block(m, SymmGroup::IdentityCharge, SymmGroup::IdentityCharge);
void swap(MPSTensor< Matrix, SymmGroup > &x, MPSTensor< Matrix, SymmGroup > &y)
size_type insert_block(Matrix const &, charge, charge)
block_matrix< Matrix, SymmGroup > sqrt(block_matrix< Matrix, SymmGroup > m)
std::size_t insert(std::pair< charge, std::size_t > const &x)
The documentation for this class was generated from the following file: