Skip to content
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

[mini] Fix the bug in Issue #377: Add original duration into the argument of get_phi2 #381

Closed
wants to merge 7 commits into from

Conversation

huixingjian
Copy link
Contributor

@huixingjian huixingjian commented Mar 24, 2025

When introducing STC, the laser duration may be changed by both spatial and angular chirp.

The spatial chirp $\zeta$ will stretch a Gaussian pulse as $\tau' = (\tau_0^2+\frac{4\zeta^2}{w_0^2})^{1/2}$.

The temporal chirp, i.e GDD, will stretch a Gaussian pulse as $\tau= [\tau'^2+\frac{4(\varphi^{(2)})^2}{\tau'^2}]^{1/2}$.

Previously, the function get_phi2 assumes that $\tau'\approx \tau_0$. It's true when the pulse is based on a Gaussian shape longitudinally(The influence on Gaussian laser duration from spatial chirp is always minor). However, as pointed out in Issue #377, when implement PolynomialSpectralPhase on the laser, the pulse may be drastically stretched by both spatial and temporal chirps. This causes an error.

I tried to calculate the GDD in spectrum field as $\langle \frac{\partial^2 \varphi}{\partial \omega^2} \rangle$, but in this way turns out to be really sensitive to the box size and resolution, which originated from two times of derivative in the same direction plus numerical FFT. Considering $\tau'$ is also not a trivial to calculate, currently the solution is to add one argument to input the original value of $\tau_0$ for user to use.

The final optimal solution remains to be discussed...

@huixingjian huixingjian marked this pull request as draft March 25, 2025 10:38
Nt = laser_3d.grid.shape[-1]
omega = 2 * np.pi * np.fft.fftfreq(Nt, dt)+2*scc.pi*scc.c/wavelength
env_spec = laser_3d.grid.get_spectral_field()*np.exp(-1j*omega*laser_3d.grid.lo[-1]
env_spec_abs2 = np.abs(env_spec**2)

Check failure

Code scanning / CodeQL

Syntax error Error

Syntax Error (in Python 3).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant