Skip to content

feat: Implement speckled driver - #168

Merged
johnbcoughlin merged 17 commits into
mainfrom
jack-speckles
Jan 22, 2026
Merged

feat: Implement speckled driver#168
johnbcoughlin merged 17 commits into
mainfrom
jack-speckles

Conversation

@johnbcoughlin

@johnbcoughlin johnbcoughlin commented Jan 12, 2026

Copy link
Copy Markdown
Collaborator

Implements the LASY speckling envelope.

  • RPP and CPP (random phase plate) static speckling
  • FM SSD (frequency-modulated spectral dispersion dynamic speckling

@joglekara

Copy link
Copy Markdown
Member

the calc_ey_at_one_point method is used downstream in ml-for-lpi when calculating the coherence time. Probably best to leave it but it is unfortunate that it looks unused...

@joglekara

Copy link
Copy Markdown
Member

How are we going to have the speckles be differentiable if the pattern is loaded? Is this a bridge PR before we implement the differentiable speckles?

@johnbcoughlin

Copy link
Copy Markdown
Collaborator Author

How are we going to have the speckles be differentiable if the pattern is loaded? Is this a bridge PR before we implement the differentiable speckles?

yeah, I wanted to avoid having to define a whole family of arbitrary function definitions in yaml like we have for the driver and laser pulse stuff sometimes, so went with this just for testing it out. I imagine we'll want to do the more flexible problem definition pattern and connect it up directly to a LASY simulation, right?

@johnbcoughlin
johnbcoughlin force-pushed the jack-speckles branch 2 times, most recently from 18791bb to ca7539a Compare January 15, 2026 22:58
@johnbcoughlin

Copy link
Copy Markdown
Collaborator Author

Example run here: https://continuum.ergodic.io/experiments/#/experiments/188384/runs/d09b9af0a83d41c2ac1b9a2c808ceaf2/artifacts

The speckle pattern passes a sanity check for me. For this config we have f_num = 10 and lambda_0 = 351nm, so we should have speckle features on the order of 3.5um.

Jack Coughlin added 16 commits January 21, 2026 12:57
This is apparently required to enable building in a jj workspace (which
doesn't have a .git folder)
… speckle patterns

- Add adept/_lpse2d/core/speckle.py: JAX port of LASY SpeckleProfile
  - Supports RPP, CPP, FM SSD, GP RPM SSD, GP ISI smoothing types
  - evaluate() takes JAX PRNGKey for random number generation
- Add tests/test_lpse2d/test_speckle.py: Ported LASY speckle tests
- Add SpeckledDriver: loads y-dependent intensity/phase from .npz file
- Add speckle_file field to E0DriverModel configuration
- Add generate_speckle.py utility script and example config
- Remove x_si_zeros instance variable (unused outside __init__)
- Remove speckle envelope caching, always compute dynamically
- Rename t to t_ps in laser_update for clarity on units
- Rename config files: tpd-lasy-speckle-ssd.yaml -> tpd-dynamic-ssd-speckle.yaml, tpd-lasy-speckle.yaml -> tpd-static-cpp-speckle.yaml
- Change focal_length and beam_aperture config to use strings with units (e.g. '3.5m')
- Update mlflow run names to match file names
- Remove SpeckledDriver class, generate_speckle.py, tpd-speckled.yaml, and speckle.npz
- Remove CODE_REVIEW.md
@johnbcoughlin johnbcoughlin changed the title Implement speckled driver feat: Implement speckled driver Jan 21, 2026

@joglekara joglekara left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine but probably need to remove the npz stuff?

Comment thread adept/_lpse2d/modules/driver.py Outdated

@joglekara joglekara left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, awesome work

@johnbcoughlin
johnbcoughlin merged commit 69c306b into main Jan 22, 2026
5 checks passed
@johnbcoughlin
johnbcoughlin deleted the jack-speckles branch January 22, 2026 23:29
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.

2 participants