Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] more printout #1035

Merged
merged 5 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/core/acc/acc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
25 changes: 23 additions & 2 deletions src/hubbard/hubbard_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double> eigenvals(mmax);
la::dmatrix<double> eigenvecs(mmax, mmax);
la::dmatrix<double> 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++) {
Expand Down
Loading