8namespace triqs::experimental::lattice {
10 void tb_hk::check_hoppings() {
14 for (
int i = 0; i <
n_R(); ++i) {
23 for (
int j = 0; j <
n_R(); ++j) {
28 <<
"\nis not the hermitian conjugate of matrix for displacement " <<
get_R_list()[j] <<
hoppings()[j] <<
"\n";
38 long nk = k.shape()[0];
39 auto energies = nda::matrix<double>(nk,
n_orbitals());
41 auto Ek_orbital = nda::array<dcomplex, 3>{this->
operator()(k)};
42 for (
auto ik : nda::range(nk)) { energies(ik, r_all) = nda::linalg::eigvalsh(Ek_orbital(ik, nda::ellipsis())); }
46 std::pair<nda::array<double, 2>, nda::array<dcomplex, 3>>
tb_hk::eigenvectors(nda::array_view<double, 2> k)
const {
48 long nk = k.shape()[0];
49 auto energies = nda::matrix<double>(nk,
n_orbitals());
53 auto Ek_orbital = nda::array<dcomplex, 3>{this->
operator()(k)};
54 for (
auto ik : nda::range(nk)) {
55 auto [en, eigvec] = nda::linalg::eigh(Ek_orbital(ik, nda::ellipsis()));
56 energies(ik, r_all) = en;
const_view_type operator()() const
Make a const view of *this.
int size() const
Get the total number of blocks.
auto hoppings()
Get a lazy range over the hopping matrices, one per R-vector.
std::vector< std::array< long, 3 > > get_R_list() const
Get the list of real-space lattice vectors.
eigenvectors_t eigenvectors(nda::array_view< double, 2 > k) const
Compute the band-basis energies and eigenvectors of for a list of k-points.
nda::array< double, 2 > eigenvalues(nda::array_view< double, 2 > k) const
Compute the band-basis energies of for a list of k-points.
long n_orbitals() const
Get the number of orbitals, i.e. the dimension of the Hamiltonian matrices.
TRIQS exception hierarchy and related macros.
#define TRIQS_RUNTIME_ERROR
Throw a triqs::runtime_error with the current source location.