Update docs and examples - #91
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #91 +/- ##
=======================================
Coverage 99.92% 99.92%
=======================================
Files 38 38
Lines 1304 1304
=======================================
Hits 1303 1303
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refreshes TorchOptics documentation and expands the Sphinx-gallery example set, aiming to provide clearer user guides and richer end-to-end demonstrations (propagation, systems, coherence/polarization, optimization, and quantum).
Changes:
- Reworked multiple user-guide pages and quickstart content for clearer explanations and more complete runnable snippets.
- Added/organized many new Sphinx-gallery examples across optical phenomena, optical systems, aberrations, coherence/polarization, optimization, and quantum.
- Updated lint configuration and minor code/test cleanups around Laguerre–Gaussian notation.
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/profiles/test_laguerre_gaussian_profile.py | Removes inline Ruff suppression tied to ambiguous l variable. |
| src/torchoptics/profiles/laguerre_gaussian.py | Removes inline Ruff suppression for Laguerre–Gaussian l parameter and helper. |
| README.md | Updates feature bullets and links README snippets to full docs examples. |
| pyproject.toml | Updates Ruff ignore list (adds E741). |
| examples/README.rst | Rewords examples landing page text. |
| examples/quantum/README.rst | Adds a quantum examples subsection landing page. |
| examples/quantum/quantum_state_discrimination.py | Adds a quantum state discrimination example using HG modes and Helstrom bound. |
| examples/optimization/training_petal_beam.py | Adds an optimization/inverse-design example (petal beam training + animation). |
| examples/optimization/training_multi_plane_focusing.py | Adds an optimization example for multi-plane focusing. |
| examples/optimization/README.rst | Adds optimization subsection landing page. |
| examples/optical_systems/README.rst | Adds optical systems subsection landing page. |
| examples/optical_systems/phase_only_modulators.py | Adds a phase-only hologram example for beam shaping. |
| examples/optical_systems/mach_zehnder_interferometer.py | Adds a Mach–Zehnder interferometer example using beam splitters. |
| examples/optical_systems/lens_focusing.py | Adds a lens focusing and beam waist evolution example. |
| examples/optical_systems/4f_system.py | Adds a 4f system example demonstrating spatial filtering. |
| examples/optical_phenomena/youngs_double_slit.py | Adds a Young’s double slit interference example. |
| examples/optical_phenomena/talbot_effect.py | Adds a Talbot effect (self-imaging) example and carpet visualization. |
| examples/optical_phenomena/README.rst | Adds optical phenomena subsection landing page. |
| examples/optical_phenomena/polychromatic_light_with_grating.py | Adds a polychromatic dispersion example with RGB visualization. |
| examples/optical_phenomena/gaussian_beam_propagation.py | Adds a Gaussian beam propagation + theory comparison example. |
| examples/optical_phenomena/fresnel_zone_plate.py | Adds a Fresnel zone plate construction and focusing example. |
| examples/optical_phenomena/aperture_limited_psf.py | Adds an aperture-limited PSF gallery example. |
| examples/optical_phenomena/animate_propagation.py | Adds a propagation animation example using animate_tensor. |
| examples/coherence_and_polarization/spatial_coherence.py | Adds a spatial coherence propagation comparison example. |
| examples/coherence_and_polarization/README.rst | Adds coherence/polarization subsection landing page. |
| examples/coherence_and_polarization/polarized_field.py | Adds a polarized field walkthrough (polarizers/waveplates, Stokes parameters). |
| examples/coherence_and_polarization/laser_speckle_patterns.py | Adds laser speckle simulation + statistics example. |
| examples/aberrations/zernike_aberrations.py | Adds Zernike aberration gallery + PSF degradation example. |
| examples/aberrations/README.rst | Adds aberrations subsection landing page. |
| examples/aberrations/chromatic_aberration.py | Adds chromatic aberration example using polychromatic phase modulation. |
| docs/source/user-guide/systems.rst | Clarifies System.forward element skipping behavior at field z. |
| docs/source/user-guide/spatial_coherence.rst | Expands mutual coherence explanation, memory note, and plotting examples. |
| docs/source/user-guide/propagation.rst | Adds guidance on Fresnel-variant propagation methods. |
| docs/source/user-guide/profiles.rst | Reorganizes and expands profile documentation; adds mode galleries and Zernike section. |
| docs/source/user-guide/polarization.rst | Rewrites polarized-field intro and points to elements guide for details. |
| docs/source/user-guide/inverse_design.rst | Refines inverse-design narrative and updates training loop example to use overlap loss. |
| docs/source/user-guide/fields.rst | Adds sample Field.__repr__ output and clarifies geometry requirements for overlap. |
| docs/source/user-guide/elements.rst | Major expansion: modulators, polychromatic modulators, lenses, detectors, beam splitters, polarization elements, visualization. |
| docs/source/user-guide/configuration.rst | Clarifies defaults usage and adds explicit torch import in dtype example. |
| docs/source/quickstart/index.rst | Updates quickstart narrative and parameters; points to new optimization examples. |
| docs/source/conf.py | Reorders Sphinx-gallery sections to match new examples directory layout. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…uerre_gaussian files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.