Skip to content

NEGF: New method to extract the matrix Hamiltonians for electrodes and minor changes.#4520

Merged
hfp merged 1 commit intocp2k:masterfrom
dryndyk:dev_negf
Nov 3, 2025
Merged

NEGF: New method to extract the matrix Hamiltonians for electrodes and minor changes.#4520
hfp merged 1 commit intocp2k:masterfrom
dryndyk:dev_negf

Conversation

@dryndyk
Copy link
Contributor

@dryndyk dryndyk commented Nov 1, 2025

No description provided.

@dryndyk
Copy link
Contributor Author

dryndyk commented Nov 1, 2025

Sorry, I do not understand the problem in Precommit test.
Wait for expert suggestion.

@fstein93
Copy link
Contributor

fstein93 commented Nov 1, 2025

Please run make -j pretty

Copy link
Contributor

@fstein93 fstein93 left a comment

Choose a reason for hiding this comment

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

Thank you for your contributionbut regarding the old code, I prefer adding a keyword to switch between old and new code or remove the old code entirely.

!> * 08.2017 created [Sergey Chulkov]
!> * 10.2025 Centering of contact coordinates is added in the end. It is necessary to keep the
!> right order of indices in the real space image matrices. It is made only here, because
!> the mapping is based on the comparison ot the coordinates. [Dmitry Ryndyk]
Copy link
Contributor

Choose a reason for hiding this comment

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

typo ot -> of

qs_env_contact=qs_env_contact, matrix_s_device=matrix_s_kp(1, 1)%matrix)
qs_env_contact=qs_env_contact)
! CALL negf_env_contact_init_matrices_old(contact_env=negf_env%contacts(icontact), sub_env=sub_env, &
! qs_env_contact=qs_env_contact, matrix_s_device=matrix_s_kp(1, 1)%matrix)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intended to be kept? If yes, I am in favor of wrapping this using IF (.FALSE.) THEN ... END IF

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I need it at least for some time. I did not want to make a switch, but OK, I will do it.
By the way, should I make a new pull request or edit this one somehow?
Thank you for the help.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just edit this one.
In general, a (temporary) switch is better than asking the user to recompile because there is more control from the compiler and an actual way to still test the old code using the regression tests without the inconvenient way of recompilation especially if this temporary solution persits longer. What is your timeline on replacing the old code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I did not plan to inform usual users about it; it is only for developers, e.g., only me at the moment. )
I will remove it as soon as I am sure that the new code is perfect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the old code; better to keep only in my repository.

@dryndyk
Copy link
Contributor Author

dryndyk commented Nov 1, 2025

Please run make -j pretty

I made it before and repeated it now.

make -j pretty
Discovering programs ...
/.../cp2k/tools/precommit/precommit.py --allow-modifications
Running precommit checks using 16 workers and server: https://precommit.cp2k.org
Summary: Found 8132, skipped 7910, checked 222, and failed 0 files.
Status: OK

@hfp
Copy link
Member

hfp commented Nov 1, 2025

Please run make -j pretty

I made it before and repeated it now.

make -j pretty Discovering programs ... /.../cp2k/tools/precommit/precommit.py --allow-modifications Running precommit checks using 16 workers and server: https://precommit.cp2k.org Summary: Found 8132, skipped 7910, checked 222, and failed 0 files. Status: OK

Despite of status OK, you may need to check like git diff --name-only if some files were reformatted. If so, use git add perhaps followed by git commit --amend and also git push --force. This would amend the reformatted files to your latest commit. Of course, you can also push in a separate commit.

@dryndyk dryndyk force-pushed the dev_negf branch 3 times, most recently from a057102 to 85cb861 Compare November 2, 2025 01:01
Copy link
Contributor

@fstein93 fstein93 left a comment

Choose a reason for hiding this comment

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

Thank you for considering the suggestions.

@hfp
Copy link
Member

hfp commented Nov 3, 2025

LGTM as well. I started the optional Regtest psmp (we can ignore the current breakage).

@hfp
Copy link
Member

hfp commented Nov 3, 2025

LGTM as well. I started the optional Regtest psmp (we can ignore the current breakage).

Passed, hence merging the PR.

@hfp hfp merged commit 298f7c4 into cp2k:master Nov 3, 2025
40 of 41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants