-
Notifications
You must be signed in to change notification settings - Fork 12
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
Change line 235 in gaussian.rs under laser, resolve energy not conser… #93
base: master
Are you sure you want to change the base?
Change line 235 in gaussian.rs under laser, resolve energy not conser… #93
Conversation
…ve issue due to neglectance of chain rule in force gradient calculations
Thanks for the report, I'll double check this but it looks good at first glance! |
If possible, could you define a unit test that fails for the earlier broken code and passes for your correct code? That would help to improve the coverage and prevent it occuring again. |
Sounds good, I will look up what tests were there already and see what I can do. |
Hi Elliot, I have now made modification on existing unit tests (there are 3 wrong unit test when I test the clean version, all about dipole force), and I added a new one to test the ellipticity issue, now there are no error from my end, could you check and proceed to approval if good? Many thanks :) |
I just summarize the changes I made |
Hi Elliot, just a reminder about my ellipticity fix :) |
Identified an error in gaussian.rs line 235, where I found the calculation of vector there is not correct. When ellipticity is defined in gaussian.rs approach by redefining x and y the calculation of intensity gradient will have to include extra factor dx'/dx as in the attached photo.
This issue is spotted when I investigate energy dynamic of a single atom, check kinetic energy, potential energy and total energy, found out that energy is not conserved for non-zero ellipticity. After imposing the changes to line 235 I redo energy conservation check, energy are conserved, comparison are shown in the other photon.