Add diamagnetic and magnetization current densities
Description
The code now computes the diamagnetic and magnetization current densities, for the cases where there is a non-zero, non-uniform vector potential and when spin-polarization is considered, respectively. Unit tests against analytical expressions for complex LCAO of hydrogen orbitals were added.
Checklist
-
Add test for magnetization current -
Rebase on main -
I have checked that my code follows the Octopus coding standards -
I have added tests for all the new features added in this request.
Closes #584 (closed)
Merge request reports
Activity
changed milestone to %13.0
added Feature Multisystem Regression Tests labels
@fbonafe I know that this is still a draft merge request, but I would like to draw your attention on the following points:
-
If one uses the 'Hamiltonian' option for the current density, the full diamagnetic term is already included, as
<[r, A.p]>
is nothing but the diamagnetic term. Note that this options does not seem to give correct results for periodic systems due to the nonlocal part of the pseudopotential, and we should revisit it, as this is much faster and more robust than other options. -
In the other cases, the diamagnetic term is also included, at least for uniform vector potentials. The new proposed names will be confusing.
-
For performance reasons, we should not compute the magnetization current in all cases. Its average value is zero, and most of the time we won't use it.
For performance reason, debugging and also ease of output, it would be probably better to keep the current code and have the magnetization current as a separate routine.
-
- Resolved by Martin Lueders
Thanks Nicolas, including @heiko.appel in the loop as we did the implementation together. Two things then:
-
Would it be OK if we call it current_diamagnetic_non_unif_vec_pot? As you see, we only compute anything if the non-uniform vector potential in hm_base is allocated, so it makes sense to call it like that.
-
We can leave the magnetization current out of the total current by default, and if needed, we call it later. This will make the new subroutine unused code, however we'd like for it to enter the code base now, and not save it for later when we have to use it, please.
-
added 744 commits
-
5cba1261...8b001f7f - 732 commits from branch
main
- 8b001f7f...fc45854c - 2 earlier commits
- 3316c2b1 - Only compute current contributions if the vector potential is allocated
- 87fca642 - Define LC of hydrogen states in the test mode and create input file for test
- e1047396 - Encapsulate definition of superposition state in function
- c884e76b - Call calculate_current from unit test, print paramagnetic current and define...
- f1147def - Add analytical paramagnetic current density calcuation and spin polarized...
- f3d80490 - Fix normalization factor, now paramagnetic currents matches analytical expression
- 75a36d09 - Add comparison between diamagnetic current calculated analytically and by the...
- 5a2f8142 - Add test file with matches
- 7c52a134 - Minor fix after rebase
- 950983c5 - Address review comments and add magnetization current test
Toggle commit list-
5cba1261...8b001f7f - 732 commits from branch
added 1 commit
- 430622cd - Fix indentation and add comment about magnetization current
added 1 commit
- 8aca397e - Fix indentation, integer division and add comment about magnetization current
requested review from @martin.lueders
- Resolved by Martin Lueders
requested review from @heiko.appel