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

Issue with sirius_set_atom_type_hubbard() API function #1047

Open
toxa81 opened this issue Jan 15, 2025 · 2 comments
Open

Issue with sirius_set_atom_type_hubbard() API function #1047

toxa81 opened this issue Jan 15, 2025 · 2 comments
Assignees
Labels

Comments

@toxa81
Copy link
Collaborator

toxa81 commented Jan 15, 2025

That's the call from QE:

                    CALL sirius_set_atom_type_hubbard(sctx, &
                            & TRIM(atom_type(iat)%label), &
                            & l=l_pair(1), n=n_pair(1), occ=hubbard_occ(iat, 1), &
                            & U=atom_type_U(iat) / 2.0, J=0.D0, &
                            & alpha=0.D0, beta=0.D0, J0=0.D0)

that's the API function

2228 void
2229 sirius_set_atom_type_hubbard(void* const* handler__, char const* label__, int const* l__, int const* n__,
2230                              double const* occ__, double const* U__, double const* J__, double const* alpha__,
2231                              double const* beta__, double const* J0__, int* error_code__)
2232 {

double const* J__ is under question. It is passed as a value, but used as an array later: J__[1], and J__ itselt

                    type.add_hubbard_orbital(*n__, *l__, *occ__, *U__, J__[1], J__, *alpha__, *beta__, *J0__,
                                             std::vector<double>(), true);

Finally, type.add_hubbard_orbital() function must not receve raw pointers (like J__ itself), but std::vector or strd::array object.

Proposal: pass J and hubbard_coefficients separately (or don't pass hubbard_coefficients at all).

@toxa81
Copy link
Collaborator Author

toxa81 commented Jan 15, 2025

That's the branch where I tested checkum of U matrix #1048, fix should go there

@mtaillefumier
Copy link
Collaborator

I added a commit fixing this issue yesterday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants