Skip to content

Add Angular Spectrum wave propagation module#486

Draft
gustavu92 wants to merge 1 commit intoHarrisonKramer:masterfrom
gustavu92:feature/pop-asm
Draft

Add Angular Spectrum wave propagation module#486
gustavu92 wants to merge 1 commit intoHarrisonKramer:masterfrom
gustavu92:feature/pop-asm

Conversation

@gustavu92
Copy link
Contributor

Draft – Angular Spectrum Wave Propagation (ASM)

This is an early draft PR to get feedback before continuing the implementation.

It is not the final version. I would like your suggestions on API design and tensor layout before refining and expanding the module.

What is included

  • New module: optiland.wavepropagation
    • BaseWavePropagator
    • AngularSpectrumPropagator (ASM implementation)
  • Evanescent handling modes: "clamp" and "decay"
  • Padding support for propagation
  • Backend extensions:
    • NumPy: fftfreq, fft2, ifft2, meshgrid, pad, clamp, broadcast_to, zeros
    • Torch: clamp
  • A development tutorial notebook demonstrating:
    • Field computation at multiple z planes
    • Stacked output (S, F, W, N, N)
    • Intensity visualization along propagation

The notebook is for clarity and experimentation. It can be simplified or adjusted before moving into docs/examples.


Main Design Question

I am unsure about the expected output layout of compute_field.

Currently I support:

  • (W, N, N) for a single field
  • (F, W, N, N) for multiple fields

In the tutorial, I standardize everything to (S, F, W, N, N) when stacking over propagation distance.

I am not fully convinced this is the best convention.

Questions:

  • What should be the canonical field tensor layout?
  • Should field or wavelength be the leading dimension?
  • Is (F, W, N, N) aligned with the rest of Optiland design?

I would appreciate early feedback on:

  • API structure
  • Tensor layout convention
  • Integration approach with Optic
  • Any architectural concerns before I continue development

Once the structure is validated, I will clean up the implementation and prepare a final PR.

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