Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Every pull request into master needs the approval of a code owner of each changed file.
# The last matching line wins; any one owner listed there is enough.
* @StackEnjoyer

# SDFs
/src/SDFs/ @StackEnjoyer @TacHawkes
/ext/RenderSDF.jl @StackEnjoyer @TacHawkes
/test/Geometry/SDFs/ @StackEnjoyer @TacHawkes
/docs/src/api/sdfs.md @StackEnjoyer @TacHawkes
/docs/src/assets/api_assets/sdf_showcase.jl @StackEnjoyer @TacHawkes

# Astigmatic Gaussian beamlets
/src/AstigmaticGaussian.jl @StackEnjoyer @TacHawkes
/src/BeamGroups/Astigmatic* @StackEnjoyer @TacHawkes
/ext/RenderAstigmaticGaussian.jl @StackEnjoyer @TacHawkes
/test/TestAstigmaticGaussian* @StackEnjoyer @TacHawkes
/docs/src/basics/beams/astigmatic_beam.md @StackEnjoyer @TacHawkes
4 changes: 4 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
# The runner image ships no Julia
- uses: julia-actions/setup-julia@v3
with:
version: '1'
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

# About

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliaphysics.github.io/BeamletOptics.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliaphysics.github.io/BeamletOptics.jl/dev/)
[![Build Status](https://github.com/JuliaPhysics/BeamletOptics.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/JuliaPhysics/BeamletOptics.jl/actions/workflows/CI.yml?query=branch%3Amaster)
[![Coverage](https://codecov.io/gh/JuliaPhysics/BeamletOptics.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaPhysics/BeamletOptics.jl)
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://stackenjoyer.github.io/BeamletOptics.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://stackenjoyer.github.io/BeamletOptics.jl/dev/)
[![Build Status](https://github.com/StackEnjoyer/BeamletOptics.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/StackEnjoyer/BeamletOptics.jl/actions/workflows/CI.yml?query=branch%3Amaster)
[![Coverage](https://codecov.io/gh/StackEnjoyer/BeamletOptics.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/StackEnjoyer/BeamletOptics.jl)
[![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
[![DOI](https://zenodo.org/badge/955172301.svg)](https://doi.org/10.5281/zenodo.15090783)

**BeamletOptics.jl**, or **BMO** for short, is a 3D Gaussian beamlet tracing package mainly intended for the simulation of breadboard optical setups -- e.g. laser interferometers -- with simple components like lenses or beamsplitters. It offers a flexible kinematic API for the easy placement and movement of components.

[For more information, refer to the documentation.](https://juliaphysics.github.io/BeamletOptics.jl/stable/)
[For more information, refer to the documentation.](https://stackenjoyer.github.io/BeamletOptics.jl/stable/)

# Features

Expand Down
2 changes: 1 addition & 1 deletion docs/DocUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Documenter, DocumenterVitepress

const GLOBAL_USE_PLACEHOLDERS = true

const MILESTONES_URL = "https://api.github.com/repos/JuliaPhysics/BeamletOptics.jl/milestones?state=all&per_page=100"
const MILESTONES_URL = "https://api.github.com/repos/StackEnjoyer/BeamletOptics.jl/milestones?state=all&per_page=100"

"""
fetch_milestones(path; url = MILESTONES_URL)
Expand Down
4 changes: 2 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ makedocs(;
authors="Hugo Uittenbosch <hugo.uittenbosch@dlr.de>, Oliver Kliebisch <oliver.kliebisch@dlr.de> and contributors",
sitename="BeamletOptics.jl",
format=DocumenterVitepress.MarkdownVitepress(;
repo="github.com/JuliaPhysics/BeamletOptics.jl",
repo="github.com/StackEnjoyer/BeamletOptics.jl",
devbranch="master",
devurl="dev",
),
Expand Down Expand Up @@ -184,7 +184,7 @@ if Sys.iswindows()
end

DocumenterVitepress.deploydocs(;
repo="github.com/JuliaPhysics/BeamletOptics.jl.git",
repo="github.com/StackEnjoyer/BeamletOptics.jl.git",
target=joinpath(@__DIR__, "build"),
devbranch="master",
push_preview=false,
Expand Down
4 changes: 2 additions & 2 deletions docs/src/api/contribute.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

The code style of BMO, for human contributors and coding agents alike, is the section "Code style" of [AGENTS.md](https://github.com/JuliaPhysics/BeamletOptics.jl/blob/master/AGENTS.md) in the repository root. The [SciML Style Guide](https://github.com/SciML/SciMLStyle) is the formatting baseline. Refer to the [SciML Contributors Guide](https://github.com/SciML/ColPrac/blob/master/README.md) as well. Ideally, your contribution features:
The code style of BMO, for human contributors and coding agents alike, is the section "Code style" of [AGENTS.md](https://github.com/StackEnjoyer/BeamletOptics.jl/blob/master/AGENTS.md) in the repository root. The [SciML Style Guide](https://github.com/SciML/SciMLStyle) is the formatting baseline. Refer to the [SciML Contributors Guide](https://github.com/SciML/ColPrac/blob/master/README.md) as well. Ideally, your contribution features:

- tests for new or changed functionality
- docstrings for relevant functions
Expand All @@ -18,7 +18,7 @@ file standalone, run `julia --project=test -e 'using Pkg; Pkg.instantiate()'` on

## Developing BMO with an assistant

The agent skill of the [AI assistants](@ref "Using BMO with AI assistants") page describes how to *use* BMO. Instructions for changing the package itself (design philosophy, code conventions, tests) are in `AGENTS.md` at the root of the [repository](https://github.com/JuliaPhysics/BeamletOptics.jl). `CLAUDE.md` and `GEMINI.md` point to it.
The agent skill of the [AI assistants](@ref "Using BMO with AI assistants") page describes how to *use* BMO. Instructions for changing the package itself (design philosophy, code conventions, tests) are in `AGENTS.md` at the root of the [repository](https://github.com/StackEnjoyer/BeamletOptics.jl). `CLAUDE.md` and `GEMINI.md` point to it.

# Contributors

Expand Down
2 changes: 1 addition & 1 deletion docs/src/basics/kinematics/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ An assembly such as a telescope, a periscope or an interferometer arm can be mod
| separate, with air between them | an [`ObjectGroup`](@ref) or an own subtype of [`BeamletOptics.AbstractObjectGroup`](@ref) | none: each part is traced and interacts on its own |
| touching and interacting as one, e.g. cemented or with a shared face | an [`BeamletOptics.AbstractObject`](@ref) with the [`BeamletOptics.MultiShape`](@ref) trait, like the [`CubeBeamsplitter`](@ref) | required: the solver hands every hit to the object, which forwards it to the part that was hit |

The solver can find out by itself which of several separate parts a ray hits next. Parts that touch need a [`BeamletOptics.Hint`](@ref) across their shared face, which only the component knows. An own subtype of `AbstractObjectGroup` adds named parts and an own constructor to a group and needs no `interact3d` method; its fields are listed in the docstring of [`BeamletOptics.AbstractObjectGroup`](@ref), its constructor calls [`BeamletOptics.check_kinematic_members`](@ref) on its objects, and the agent skill has a complete example in [`templates/08_custom_group.jl`](https://github.com/JuliaPhysics/BeamletOptics.jl/blob/master/skills/beamletoptics/templates/08_custom_group.jl). A `MultiShape` object without an `interact3d` method stops every ray that hits it, with the warning `No interact3d method defined for the MultiShape object`.
The solver can find out by itself which of several separate parts a ray hits next. Parts that touch need a [`BeamletOptics.Hint`](@ref) across their shared face, which only the component knows. An own subtype of `AbstractObjectGroup` adds named parts and an own constructor to a group and needs no `interact3d` method; its fields are listed in the docstring of [`BeamletOptics.AbstractObjectGroup`](@ref), its constructor calls [`BeamletOptics.check_kinematic_members`](@ref) on its objects, and the agent skill has a complete example in [`templates/08_custom_group.jl`](https://github.com/StackEnjoyer/BeamletOptics.jl/blob/master/skills/beamletoptics/templates/08_custom_group.jl). A `MultiShape` object without an `interact3d` method stops every ray that hits it, with the warning `No interact3d method defined for the MultiShape object`.

```@docs; canonical=false
BeamletOptics.check_kinematic_members
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/RoadmapBoard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { computed } from 'vue'
// response of the GitHub API for the milestones of the repository, or `[]` if it failed.
import milestones from './milestones.json'

const MILESTONES_URL = 'https://github.com/JuliaPhysics/BeamletOptics.jl/milestones'
const MILESTONES_URL = 'https://github.com/StackEnjoyer/BeamletOptics.jl/milestones'

// Status glyphs double as the accessible label so progress never depends on
// colour alone (some readers are colour-blind, and dark/light themes shift
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ hero:
link: /basics/intro
- theme: alt
text: View on Github
link: https://github.com/JuliaPhysics/BeamletOptics.jl
link: https://github.com/StackEnjoyer/BeamletOptics.jl

features:
- icon: "🔦"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/roadmap.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Development roadmap

Each planned release is a [milestone on GitHub](https://github.com/JuliaPhysics/BeamletOptics.jl/milestones) that collects its issues. The board below is generated from the milestones on every build of this documentation.
Each planned release is a [milestone on GitHub](https://github.com/StackEnjoyer/BeamletOptics.jl/milestones) that collects its issues. The board below is generated from the milestones on every build of this documentation.

```@raw html
<RoadmapBoard />
Expand All @@ -24,7 +24,7 @@ A 1.0.0 release also needs the following features, which are not assigned to a m
```

Every planned item above is up for grabs. See [Contributing](@ref) for the contribution
guidelines and the [issue tracker](https://github.com/JuliaPhysics/BeamletOptics.jl/issues)
guidelines and the [issue tracker](https://github.com/StackEnjoyer/BeamletOptics.jl/issues)
for what is currently being discussed.

```@raw html
Expand Down
2 changes: 1 addition & 1 deletion skills/beamletoptics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This folder is an [Agent Skill](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview)
that teaches coding agents how to write simulations with
[BeamletOptics.jl](https://github.com/JuliaPhysics/BeamletOptics.jl).
[BeamletOptics.jl](https://github.com/StackEnjoyer/BeamletOptics.jl).

Install it in one of these ways:

Expand Down
2 changes: 1 addition & 1 deletion src/BeamletOptics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
BeamletOptics

Non-sequential 3D ray and Gaussian beamlet tracing for optical setups ("BMO").
Documentation: https://juliaphysics.github.io/BeamletOptics.jl/stable/
Documentation: https://stackenjoyer.github.io/BeamletOptics.jl/stable/

# AI coding assistants

Expand Down
8 changes: 4 additions & 4 deletions test/Components/TestDetector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ end
end

@testset "Ray hits: points and directions in detector coordinates" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/191: rays from the origin onto a
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/191: rays from the origin onto a
# detector at distance L, then the whole setup moved, which changes no local value
L = 50mm
dirs = [[sin(θ), cos(θ), 0.0] for θ in deg2rad.([-20, -5, 0, 10, 30])]
Expand Down Expand Up @@ -493,7 +493,7 @@ end
end

@testset "Default window holds the beam power" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/127
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/127
P0 = 1e-3
for beam in (GaussianBeamlet([0.0, 0, 0], [0.0, 1, 0], 1e-6, 1mm; P0),
AstigmaticGaussianBeamlet([0.0, 0, 0], [0.0, 1, 0], 1e-6, 1mm; P0))
Expand All @@ -509,15 +509,15 @@ end
end

@testset "Hits are values" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/42: a hit holds no reference to the
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/42: a hit holds no reference to the
# beam that made it, hence a vector of hits is one block of memory
for H in (BMO.RayHit, BMO.PolarizedRayHit, BMO.GaussianBeamletHit, BMO.AstigmaticGaussianBeamletHit)
@test isbitstype(H{Float64})
end
end

@testset "A new solve does not change the stored hits" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/42
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/42
@testset "Beam rotated between solves" begin
pd = Detector(50mm)
translate3d!(pd, [0, 100mm, 0])
Expand Down
4 changes: 2 additions & 2 deletions test/TestAstigmaticGaussianPhysical.jl
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ dominant(E) = E[argmax(abs.(E))]
end

@testset "A child beamlet continues its parent" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/124
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/124
λ = 1000nm
w0 = 1mm
P0 = 1e-3
Expand Down Expand Up @@ -541,7 +541,7 @@ dominant(E) = E[argmax(abs.(E))]
end

@testset "Detector field follows the polarization" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/123
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/123
λ = 1000nm
w0 = 1mm
P0 = 1e-3
Expand Down
18 changes: 9 additions & 9 deletions test/TestBugFixes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const BMO = BeamletOptics
const mm = 1e-3

@testset "Issue#11" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/11
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/11
# A very narrow point source produced a scattered spot diagram behind a lens system that had
# been moved and rotated before (suspected rounding errors of `_world_to_sdf`).
@testset "Narrow point source through a double Gauss lens" begin
Expand Down Expand Up @@ -95,8 +95,8 @@ end
end

@testset "Issue#22 and Issue#23" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/22
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/23
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/22
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/23

mutable struct TestSubstrate{T, S <: BMO.AbstractShape{T}, N} <:
BMO.AbstractRefractiveOptic{T, N}
Expand Down Expand Up @@ -214,7 +214,7 @@ end
end

@testset "Issue#51" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/51
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/51
mirror = BeamletOptics.SphericalMirror(0.1, 0.01, 0.2)
system = StaticSystem([mirror])
beam = Beam([0, -0.19, 0.07], [0.0, 1, 0])
Expand Down Expand Up @@ -248,7 +248,7 @@ end
end

@testset "Issue#80" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/80
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/80
# Near-axis rays through hyperbolic plano-concave and plano-convex lenses.
# A plano-conic lens with k = -n² images a collimated beam that enters through the plane
# face exactly onto a point: every outgoing ray passes through the (real or virtual)
Expand Down Expand Up @@ -287,7 +287,7 @@ end
end

@testset "Issue#82" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/82
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/82
rng = MersenneTwister(1)
n = 1.458
spurious = 0
Expand Down Expand Up @@ -348,7 +348,7 @@ end
end

@testset "Issue#87" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/87
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/87
# Oblique unit vector (a ray direction from a pulse shaper), for which
# dot(normalize(d), normalize(d)) - 1 = 4.4e-16 > eps()
d = [-0.9999762904273509, 0.006881465035232346, -0.0002530259335731185]
Expand Down Expand Up @@ -406,7 +406,7 @@ end
end

@testset "Issue#209" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/209
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/209
# At the waist of a beamlet on a tilted axis the height of the divergence ray is rounding
# noise, and its slope was taken from the direction of that noise: w0 was up to 4000 times
# too small exactly at the waist
Expand Down Expand Up @@ -439,7 +439,7 @@ end
end

@testset "Issue#210" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/210
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/210
# The Lagrange invariant of a GaussianBeamlet was replaced by λ/π when it differed by more
# than an absolute threshold, which gave w0 / M2 for large M2 or λ and never warned
@testset "Waist radius for any M2 and λ" begin
Expand Down
4 changes: 2 additions & 2 deletions test/TestGaussianBeamlet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ const mm = 1e-3
end

@testset "Field phase in and in front of a medium" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/126
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/126
λ = 1e-6
n = 1.5
# glass from y = 50.0 mm to about 50.5 mm
Expand Down Expand Up @@ -241,7 +241,7 @@ end
end

@testset "Gouy phase is collected along the beam" begin
# https://github.com/JuliaPhysics/BeamletOptics.jl/issues/125
# https://github.com/StackEnjoyer/BeamletOptics.jl/issues/125
λ = 1e-6
n = 1.5
w0 = 1mm
Expand Down
Loading