Skip to content

Refactor laser implementation #5318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

steindev
Copy link
Member

@steindev steindev commented Mar 18, 2025

This refactoring straightens the implementation of laser profiles and removes confusing terms being added and later subtracted.

Major changes are:

  • redefinition of the internal coordinate system: The focus becomes the actual 'origin' of the coordinate system, while the origin variable refers to the position on the Huygens surface where the field needs to be evaluated in order to feed it into the simulation
    => This allows to implement expressions for laser fields as they are printed in publications and text books w/o additional phase and envelope terms
  • the GaussianPulse can have different waist sizes along the transverse directions now
  • the pulse-front tilt feature of the GaussianPulse is removed, because it is unknown how pulse-front tilted Laguerre-Gaussian pulses propagate (our old implementation fed some field in the simulation which propagated physically toward the focus, but this (most probably) did not correspond to the expectation for the in-focus field)
    => For pulse-front tilted standard Gaussian pulses the DispersivePulse can and should be used
  • dispersions in the DispersivePulse are applied along the polarization axis, while the other transverse axis is dispersion-free

Draft status of this PR will be removed when the following action items are performed

  • GaussianPulse:
    • Compile test simulation w/ and w/o Laguerre modes and for various propagation directions and polarizations
    • Compare results of test sim to old implementation
    • resolve possible issues
  • DispersivePulse:
    • Compile test simulation for various propagation directions and dispersion values
    • Compare results of test sim to old implementation
    • resolve possible issues

Close #5269

@steindev steindev added refactoring code change to improve performance or to unify a concept but does not change public API component: user input signals changes in user API such as .param files, .cfg syntax, etc. - changelog! changelog PR's marked with this label will be added to the changelog labels Mar 18, 2025
@steindev steindev added this to the 0.9.0 / next stable milestone Mar 18, 2025
@steindev steindev force-pushed the refactor-2025-02_Laser-Impl branch 2 times, most recently from 36092a3 to 83ef24e Compare March 19, 2025 09:48
@steindev steindev linked an issue Mar 21, 2025 that may be closed by this pull request
@steindev steindev force-pushed the refactor-2025-02_Laser-Impl branch from 83ef24e to 4568194 Compare March 21, 2025 18:38
* getCurrentTime() -> getTminusXoverC() for separable profiles
* make focus the origin of internal coordinate system
* fix language typos
* rename Unitless::w -> Unitless::OMEGA0
* delete PulseFrontTilt laser
* Perform parameter range checks in ExpRampWithPrepulse
* update, expand, and fix language typos in doc-strings
* use currentTimeOrigin & evaluate for all times
* take Unitless::TIME_DELAY into account
* apply dispersions only along polarization axis
* move doubly performed computations into common place and compute only once
* rename Unitless::w -> Unitless::OMEGA0
* decrease indentation level by namespace nesting
* Add metadata
@steindev steindev force-pushed the refactor-2025-02_Laser-Impl branch from ac4d155 to b01cbd0 Compare April 23, 2025 10:09
@steindev steindev marked this pull request as ready for review April 23, 2025 10:11
@steindev
Copy link
Member Author

@psychocoderHPC @PrometheusPi @chillenzer @ikbuibui PR is ready for review now.

It is intentionally split in three commits each of which refactors a specific part of the old implementation.

Test results have been discussed offline already and are documented in #5269.
Main takeaway from the tests: Results are equal between old and refactored implementation in various cases. Additionally, stray fields are reduced in the new implementation.

* update, expand, and fix language typos in doc-strings
* allow for elliptic transverse shape by having different W0 per axis
* remove pulse-front tilt (use via DispersivePulse for TEM_00, for all other modes the propagation is not known anyways)
* adapt to new definition of internalCoordinates and time
* straighten expressions for field computation (implementation follows Pausch et al. paper now)
* rename Unitless::w -> Unitless::OMEGA0
@steindev steindev force-pushed the refactor-2025-02_Laser-Impl branch from b01cbd0 to 3e9c742 Compare April 23, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog PR's marked with this label will be added to the changelog component: user input signals changes in user API such as .param files, .cfg syntax, etc. - changelog! refactoring code change to improve performance or to unify a concept but does not change public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ToDo in laser refactoring incident laser profiles need improvements
1 participant