adda icon indicating copy to clipboard operation
adda copied to clipboard

new cmdline argument "-beam_center"

Open alkichigin opened this issue 3 years ago • 3 comments

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).

alkichigin avatar Feb 01 '21 14:02 alkichigin

Overall, this feature should be easy to implement. But here are a few things to consider:

  1. 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).
  2. 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).
  3. 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.
  4. Accurate description of new/changed command line options in internal help system (-h) and in the manual are important.

/cc @stefaniagl

myurkin avatar Feb 02 '21 04:02 myurkin

Implemented -beam_center option in my fork https://github.com/alkichigin/adda according to the above guidelines

alkichigin avatar Aug 08 '21 03:08 alkichigin

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.

myurkin avatar Dec 07 '21 06:12 myurkin