Skip to content

Conversation

@maki49
Copy link
Collaborator

@maki49 maki49 commented Oct 13, 2024

The map {global nspin -> dm nspin} is not always {1->1, 2->2, 4->1}. I will use 2->1 in openshell-LR-TDDFT, where kv->get_nks()/nspin is not equal to the real number of k-points. I renamed the latter (_nks) as _nk in class DensityMatrix and decouple it from kv, leaving the flexibility to the user to set nspin and nk independently.

Copy link
Collaborator

@WHUweiqingzhou WHUweiqingzhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My current opinion is that, at least in the cases without nk input, namely default nk=-1., please do not disrupt the existing code logic.

@maki49
Copy link
Collaborator Author

maki49 commented Oct 15, 2024

My current opinion is that, at least in the cases without nk input, namely default nk=-1., please do not disrupt the existing code logic.

OK. To take your point in a clearer way, I will make nk a non-optional parameter.

Copy link
Collaborator

@WHUweiqingzhou WHUweiqingzhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@mohanchen mohanchen added the Refactor Refactor ABACUS codes label Oct 17, 2024
@mohanchen mohanchen merged commit 6d4e946 into deepmodeling:develop Oct 17, 2024
14 checks passed
@maki49 maki49 deleted the dm_construct branch October 22, 2024 08:38
Fisherd99 pushed a commit to Fisherd99/abacus-BSE that referenced this pull request Mar 31, 2025
…and the ambiguity of `_nks` (deepmodeling#5224)

* remove dependence of DensityMatrix on K_Vectors

* rename _nks as _nk to avoid ambiguity

* [pre-commit.ci lite] apply automatic fixes

* remove map

* make nk non-optional

* fix after rebase

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants