diff --git a/src/core/acc/acc.hpp b/src/core/acc/acc.hpp index a893afd8f..202add070 100644 --- a/src/core/acc/acc.hpp +++ b/src/core/acc/acc.hpp @@ -338,6 +338,10 @@ get_uuid(int device_id__) } s << std::hex << std::setw(2) << std::setfill('0') << (int)devprop.uuid.bytes[i]; } +#elif defined(SIRIUS_ROCM) + for (int i = 0; i < 16; ++i) { + s << std::hex << devprop.uuid.bytes[i]; + } #endif return s.str(); } diff --git a/src/hubbard/hubbard_matrix.cpp b/src/hubbard/hubbard_matrix.cpp index bf3a9ead1..c6d1fc0b2 100644 --- a/src/hubbard/hubbard_matrix.cpp +++ b/src/hubbard/hubbard_matrix.cpp @@ -181,14 +181,35 @@ Hubbard_matrix::print_local(int at_lvl__, std::ostream& out__) const auto print_number = [&](double x) { out__ << std::setw(width) << std::setprecision(prec) << std::fixed << x; }; auto const& atom = ctx_.unit_cell().atom(atomic_orbitals_[at_lvl__].first); + auto solver = la::Eigensolver_factory("lapack"); - out__ << "level : " << atom.type().lo_descriptor_hub(atomic_orbitals_[at_lvl__].second).n(); + out__ << "atom : " << atom.type().label(); + out__ << " level : " << atom.type().lo_descriptor_hub(atomic_orbitals_[at_lvl__].second).n(); out__ << " l: " << atom.type().lo_descriptor_hub(atomic_orbitals_[at_lvl__].second).l() << std::endl; const int l = atom.type().lo_descriptor_hub(atomic_orbitals_[at_lvl__].second).l(); if (ctx_.num_mag_dims() != 3) { int mmax = 2 * l + 1; + std::vector eigenvals(mmax); + la::dmatrix eigenvecs(mmax, mmax); + la::dmatrix A(mmax, mmax); for (int is = 0; is < ctx_.num_spins(); is++) { - out__ << hbar(width * mmax, '-') << std::endl; + for (int m = 0; m < mmax; m++) { + for (int mp = 0; mp < mmax; mp++) { + A(m, mp) = std::real(this->local(at_lvl__)(m, mp, is)); + } + } + solver->solve(mmax, A, &eigenvals[0], eigenvecs); + // don't print "SPIN: 1" for non-magnetic case + if (ctx_.num_spins() == 1) { + out__ << hbar(width * mmax, '-') << std::endl; + } else { + out__ << hbar(width * mmax, '-') << " SPIN: " << is + 1 << std::endl; + } + // print eigenvalues + for (const auto& val : eigenvals) { + print_number(val); + } + out__ << std::endl << hbar(width * mmax, '-') << std::endl; bool has_imag{false}; for (int m = 0; m < mmax; m++) { for (int mp = 0; mp < mmax; mp++) {