adda
adda copied to clipboard
new cmdline argument "-beam_center"
For beams that have a definition of the center of the beam, it could be more convenient to exclude the coordinates of beam's center from the "-beam" argument and make it a separate argument "-beam_center". For example, in EELS for an electron of 100 keV energy moving through (50,0,0) in the default propagation direction (0,0,1) instead of writing adda -beam electron 100 50 0 0, one would write adda -beam electron 100 -beam_center 50 0 0. This would be easier to parse, especially when beam center is optional, or if we introduce units support (#275).
Overall, this feature should be easy to implement. But here are a few things to consider:
- For new beam options (bessel, electron) we can exclusively use -beam_center from the start (i.e.
-beam bessel...
won't support coordinates at all). - For existing Gaussian beams we should keep backward compatibility (until v. 2.0). For example, both
-beam davis3 5 1 2 3
and-beam davis3 5 -beam_center 1 2 3
should work, but the former will produce a warning about being deprecated. Moreover,-beam davis3 5 1 2 3 -beam_center 1 2 3
should produce an error. When we reach v. 2.0 the deprecated warning will be changed to informative error message (or the Gaussian beams will be rewritten completely - #89). - For plane waves,
-beam_center ...
should also work similar to all other beams. It will have no effect on the Mueller matrix and cross sections, but will change (by constant phase factor) the internal fields (both incident and total) and polarizations and, hence, the amplitude matrix. - Accurate description of new/changed command line options in internal help system (
-h
) and in the manual are important.
/cc @stefaniagl
Implemented -beam_center option in my fork https://github.com/alkichigin/adda according to the above guidelines
After the pull request (#304) will be merged we still need the following to finalize this issue (to be submitted as the new pull request):
- new tests in
tests/2exec
(new command lines in suites, and potentially ignores for comparison with previous versions, or ignoring deprecated warnings). - new tests in
tests/2equiv
(specification of-beam_center
vs. an argument to-beam
, independence of plane-wave results of beam_center). - description of new option in the manual (and changes to other -beam options, including deprecated warnings), also mention that unit amplitude of incident beam is now assumed at beam center rather than at particle center.