Skip to content

Conversation

@SolariSystems
Copy link

Summary

I've implemented vectorial electromagnetic field representation with full polarization support for diffractsim, addressing Issue #69.

Features Added

  1. VectorialField class - Extends scalar field handling to support vectorial (Ex, Ey) components
  2. Jones calculus:
    • JonesVector - Polarization state representation (horizontal, vertical, diagonal, circular)
    • JonesMatrix - Optical elements (polarizers, half-wave plates, quarter-wave plates, general waveplates)
  3. Stokes parameters - Full S0, S1, S2, S3 computation at each spatial point
  4. Propagation - Angular spectrum method applied independently to both polarization components
  5. Helper functions - create_polarized_beam(), apply_polarization_element()

Files

  • diffractsim/vectorial_simulator.py (NEW) - Core implementation (~500 lines)
  • diffractsim/__init__.py (MODIFIED) - Exports new classes
  • examples/vectorial_polarization_example.py (NEW) - Usage demonstrations

Usage Example

from diffractsim import VectorialField, create_polarized_beam, apply_polarization_element
from diffractsim import mm, nm, cm

# Create circularly polarized beam
field = create_polarized_beam(632.8*nm, 10*mm, 10*mm, 256, 256, 
                              polarization='right_circular')

# Apply quarter-wave plate
apply_polarization_element(field, 'quarter_wave', angle=0)

# Get Stokes parameters
S0, S1, S2, S3 = field.get_stokes_parameters()

# Propagate
field.propagate(10*cm)

References

  • Jones, R. C. (1941). A new calculus for the treatment of optical systems. JOSA, 31(7), 488-493.
  • Born, M., & Wolf, E. (1999). Principles of optics. Cambridge University Press.

/claim 69

This implements the vectorial electromagnetic field representation requested
in issue rafael-fuente#69, enabling polarization-aware optical simulations.

New features:
- VectorialField class with Ex, Ey components
- JonesVector for polarization state representation
- JonesMatrix for polarization optical elements
- Support for common polarization states (H, V, D, A, RCP, LCP)
- Optical elements: linear polarizers, wave plates (λ/2, λ/4)
- Stokes parameter computation
- Compatible with existing diffractsim propagation methods

Example usage included demonstrating:
- Basic polarization states
- Polarizer effects
- Quarter-wave plate converting linear to circular
- Polarization preservation during propagation
- Direct Jones calculus

/claim 69
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant