Skip to content

Fix bug in GaussLaser and simplify interface#9

Merged
SebastianM-C merged 7 commits intomainfrom
smc/fix
Mar 5, 2026
Merged

Fix bug in GaussLaser and simplify interface#9
SebastianM-C merged 7 commits intomainfrom
smc/fix

Conversation

@SebastianM-C
Copy link
Copy Markdown
Owner

No description provided.

SebastianM-C and others added 7 commits March 4, 2026 23:22
The longitudinal fields had two bugs:
- E[3] and B[3] multiplied by an extra exp(im*ω*t)*env, effectively
  squaring the temporal oscillation and envelope
- B[3] used real E[1], E[2] instead of complex expressions ξx*E_g, ξy*E_g

Extract E_g as a shared complex expression and use it directly in all
field components, taking real() only at the final step.

Verified against LaguerreGauss(p=0, m=0) and LaserTypes.GaussLaser.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Compare against LaserTypes.GaussLaser at random spacetime points
- Cross-validate against LaguerreGauss(p=0, m=0) with matched envelope
- Verify Gaussian radial profile exp(-r²/w₀²) at z=0
- Verify beam width scaling w₀/w(z) using LaserTypes reference
- Check paraxial relations B₁=-E₂/c, B₂=E₁/c at off-axis points
- Test circular polarization azimuthal invariance
- Validate all derived parameters (ω, k, z_R, E₀, τ0)
- Verify temporal envelope decay against LaserTypes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ChargedParticle now automatically discovers the reference frame from the
external field via _find_ref_frame, which searches subsystems for the
metric tensor and electron mass parameters. This eliminates the need to
pass ref_frame separately and removes the constraint that the reference
frame must have a specific name.

Also updates FieldEvaluator, radiation models, and all tests accordingly.
Adds ModelingToolkitBase as a direct dependency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace hardcoded t₀ and z₀ values with proper @parameters so they
are accessible via the symbolic interface. The T0 parameter is removed
in favor of n_cycles, which defines t₀ = n_cycles × 2π/ω. Add
description metadata to all parameters across GaussLaser,
LaguerreGaussLaser, PlaneWave, and UniformField. Update tests to read
t₀ directly from the system instead of computing it from T0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@SebastianM-C
Copy link
Copy Markdown
Owner Author

not sure why the runner gets killed... tests work locally and on 1.11, so it seems unrelated

@SebastianM-C SebastianM-C merged commit 4969dc1 into main Mar 5, 2026
4 of 6 checks passed
@SebastianM-C SebastianM-C deleted the smc/fix branch March 5, 2026 02:33
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