Skip to content

Fixes the magnetic field term

Nicolas Tancogne-Dejean requested to merge fix_magnetic_field into main

Description

The non-uniform magnetic field was wrongly replaced by the uniform one, instead of been combined too. This leads to no effect from non-uniform B fields on the Zeeman part.

The Zeeman term was added to the potential before been actually been computed. This caused a wrong energy shift, even for propagation with only a static B field

The non-uniform magnetic field and the zeeman terms was not set to zero. This was silenced because of the above bug for the Zeeman term.

I took the opportunity of this commit to simply the logic of the update of the potential.

News snippet

Bugfix for the Zeeman term.

Checklist

  • I have checked that my code follows the Octopus coding standards
  • I have added tests for all the new features added in this request.

Merge request reports