40 atom_orb_name_(atom_orb_name.empty() ? std::vector<std::string>(atom_orb_pos_.
size()) : std::move(atom_orb_name)),
41 ndim_(static_cast<int>(nda::first_dim(
units))) {
43 EXPECTS(atom_orb_pos_.size() == atom_orb_name_.size());
44 if (ndim_ < 1 || ndim_ > 3)
TRIQS_RUNTIME_ERROR <<
"Error in triqs::lattice::bravais_lattice: Basis vector matrix has wrong size: " <<
units;
47 auto rg = nda::range(ndim_);
48 units_(rg, rg) =
units(rg, rg);
52 if (ndim_ == 1) units_(1, 1) = 1;
53 units_(2, nda::range::all) = nda::linalg::cross_product(units_(0, nda::range::all), units_(1, nda::range::all));
54 units_(2, nda::range::all) /= nda::linalg::norm(units_(2, nda::range::all));
58 if (std::abs(nda::linalg::det(units_)) < 1e-10)
59 TRIQS_RUNTIME_ERROR <<
"Error in triqs::lattice::bravais_lattice: Basis vectors are not linearly independent" << units_;
62 units_inv_ = nda::linalg::inv(units_);
75 h5::group gr = g.open_group(name);
76 nda::matrix<double> A_T;
77 h5::read(gr,
"units", A_T);
78 auto orb_pos = std::vector<r_t>{{0, 0, 0}};
79 h5::try_read(gr,
"atom_orb_pos", orb_pos);
80 auto orb_name = std::vector<std::string>(orb_pos.size(),
"");
81 h5::try_read(gr,
"atom_orb_name", orb_name);