analyze-optical-designs
Scalar wave-optics analysis with the pinned Chromatix/Prysm runtime, covering Fresnel/Fraunhofer/angular-spectrum propagation, pupil- or Zernike-based PSF/MTF/OTF, computational imaging, and differentiable inverse design. Not for sequential lens prescriptions (use design-optical-
Install
npx skills add https://github.com/laweit-lxy/optics-agent-skills/tree/main/skills/analyze-optical-designs
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install laweit-lxy-optics-agent-skills@llmmart
git clone https://github.com/laweit-lxy/optics-agent-skills.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole laweit-lxy/optics-agent-skills collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Analyze Optical Designs
Use a dedicated Python 3.12 environment installed from this skill's requirements.txt (see references/runtime-lock.md). Below, <python> is that environment's interpreter and <skill-dir> is this skill's folder.
Workflow
- Read the optical prescription, pupil, sampling, wavelength, refractive index, focal length, detector pitch, units, and expected outputs.
- Preserve all source files. Write generated arrays, figures, and reports to a new output directory.
- Choose the numerical engine:
- Use Chromatix for JAX-based differentiable wave optics, computational imaging, PSF engineering, and inverse design.
- Use Prysm for physical-optics propagation, pupil and aberration models, PSF/MTF/OTF, detectors, interferometry, and engineering metrics.
- Use both for cross-checks when their physical assumptions overlap.
- Record sampling, normalization, propagation convention, boundary treatment, backend, package versions, and pinned Git commits.
- Qualify the runtime with
scripts/optics_regression.py --self-testbefore its first numerical use, after dependency or regression-code changes, or when numerical failures cast doubt on it. Reuse a passing result only whilerequirements.txtandscripts/optics_regression.pyare unchanged; task-specific physical checks still apply. - Validate conservation or normalization where physically applicable and report numerical tolerances.
- Mark comparisons to Zemax, CODE V, measured hardware, or published data as unverified unless the corresponding source is supplied.
Safety And Reproducibility
- Do not control cameras, SLMs, stages, lasers, or other instruments from this skill.
- Use a new path for
optics_regression.py --output: the script creates missing parent directories and overwrites an existing file at that path without a prompt. Omit--outputto read the JSON on stdout. - Never invent material constants, coating data, tolerances, or detector parameters.
- Use SI units internally unless a library API explicitly requires another unit; label every conversion.
- Fix random seeds for stochastic optimization and save the seed with results.
- Use the JAX CPU backend. GPU is not qualified; enable it only after checking JAX and driver compatibility, and record the backend.
- Pin new dependencies or upstream revisions before adding them to the workflow.
Regression Command
<python> -I <skill-dir>/scripts/optics_regression.py --self-test
The command must exit 0 with passed: true, which requires matching commit pins, an installed set identical to requirements.txt (pytest and its helpers are reported but ignored), and passing chromatix, prysm, chromatix_gradient, and prysm_analytic_mtf checks. Read references/runtime-lock.md when recreating, auditing, or updating the runtime.
Reporting
Report inputs, units, assumptions, backend, package/commit provenance, commands, numerical checks, output paths, and unresolved physical uncertainties. Separate simulated results from measured or externally validated results.
Files (optics-agent-skills)
-
agents
-
openai.yaml 256 B
Loading…
-
-
references
-
runtime-lock.md 2.5 KB
Loading…
-
-
scripts
-
optics_regression.py 8 KB
Loading…
-
-
requirements.txt 532 B
Loading… -
SKILL.md 3.4 KB
--- name: analyze-optical-designs description: Scalar wave-optics analysis with the pinned Chromatix/Prysm runtime, covering Fresnel/Fraunhofer/angular-spectrum propagation, pupil- or Zernike-based PSF/MTF/OTF, computational imaging, and differentiable inverse design. Not for sequential lens prescriptions (use design-optical-systems), ZMX cross-checks (cross-check-optical-designs), or OpticStudio (ai-zemax-optical-design). --- # Analyze Optical Designs Use a dedicated Python 3.12 environment installed from this skill's `requirements.txt` (see `references/runtime-lock.md`). Below, `<python>` is that environment's interpreter and `<skill-dir>` is this skill's folder. ## Workflow 1. Read the optical prescription, pupil, sampling, wavelength, refractive index, focal length, detector pitch, units, and expected outputs. 2. Preserve all source files. Write generated arrays, figures, and reports to a new output directory. 3. Choose the numerical engine: - Use Chromatix for JAX-based differentiable wave optics, computational imaging, PSF engineering, and inverse design. - Use Prysm for physical-optics propagation, pupil and aberration models, PSF/MTF/OTF, detectors, interferometry, and engineering metrics. - Use both for cross-checks when their physical assumptions overlap. 4. Record sampling, normalization, propagation convention, boundary treatment, backend, package versions, and pinned Git commits. 5. Qualify the runtime with `scripts/optics_regression.py --self-test` before its first numerical use, after dependency or regression-code changes, or when numerical failures cast doubt on it. Reuse a passing result only while `requirements.txt` and `scripts/optics_regression.py` are unchanged; task-specific physical checks still apply. 6. Validate conservation or normalization where physically applicable and report numerical tolerances. 7. Mark comparisons to Zemax, CODE V, measured hardware, or published data as unverified unless the corresponding source is supplied. ## Safety And Reproducibility - Do not control cameras, SLMs, stages, lasers, or other instruments from this skill. - Use a new path for `optics_regression.py --output`: the script creates missing parent directories and overwrites an existing file at that path without a prompt. Omit `--output` to read the JSON on stdout. - Never invent material constants, coating data, tolerances, or detector parameters. - Use SI units internally unless a library API explicitly requires another unit; label every conversion. - Fix random seeds for stochastic optimization and save the seed with results. - Use the JAX CPU backend. GPU is not qualified; enable it only after checking JAX and driver compatibility, and record the backend. - Pin new dependencies or upstream revisions before adding them to the workflow. ## Regression Command ```bash <python> -I <skill-dir>/scripts/optics_regression.py --self-test ``` The command must exit 0 with `passed: true`, which requires matching commit pins, an installed set identical to `requirements.txt` (pytest and its helpers are reported but ignored), and passing `chromatix`, `prysm`, `chromatix_gradient`, and `prysm_analytic_mtf` checks. Read `references/runtime-lock.md` when recreating, auditing, or updating the runtime. ## Reporting Report inputs, units, assumptions, backend, package/commit provenance, commands, numerical checks, output paths, and unresolved physical uncertainties. Separate simulated results from measured or externally validated results.
Reviews (0)
No reviews yet.
Comments
Sign in to join the conversation.
No comments yet. Start the conversation.