photonpower-fieldtracing 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. photonpower_fieldtracing-0.1.0/LICENSE +21 -0
  2. photonpower_fieldtracing-0.1.0/PKG-INFO +93 -0
  3. photonpower_fieldtracing-0.1.0/README.md +79 -0
  4. photonpower_fieldtracing-0.1.0/pyproject.toml +57 -0
  5. photonpower_fieldtracing-0.1.0/setup.cfg +4 -0
  6. photonpower_fieldtracing-0.1.0/src/fieldtracing/__init__.py +7 -0
  7. photonpower_fieldtracing-0.1.0/src/fieldtracing/_types.py +12 -0
  8. photonpower_fieldtracing-0.1.0/src/fieldtracing/chain.py +1186 -0
  9. photonpower_fieldtracing-0.1.0/src/fieldtracing/edge.py +517 -0
  10. photonpower_fieldtracing-0.1.0/src/fieldtracing/field.py +434 -0
  11. photonpower_fieldtracing-0.1.0/src/fieldtracing/focus.py +208 -0
  12. photonpower_fieldtracing-0.1.0/src/fieldtracing/fourier.py +65 -0
  13. photonpower_fieldtracing-0.1.0/src/fieldtracing/lpia.py +335 -0
  14. photonpower_fieldtracing-0.1.0/src/fieldtracing/mesh.py +320 -0
  15. photonpower_fieldtracing-0.1.0/src/fieldtracing/pft.py +221 -0
  16. photonpower_fieldtracing-0.1.0/src/fieldtracing/propagation.py +68 -0
  17. photonpower_fieldtracing-0.1.0/src/fieldtracing/py.typed +0 -0
  18. photonpower_fieldtracing-0.1.0/src/fieldtracing/results.py +164 -0
  19. photonpower_fieldtracing-0.1.0/src/fieldtracing/rtt_bridge.py +288 -0
  20. photonpower_fieldtracing-0.1.0/src/fieldtracing/selection.py +244 -0
  21. photonpower_fieldtracing-0.1.0/src/fieldtracing/semiclassical.py +112 -0
  22. photonpower_fieldtracing-0.1.0/src/fieldtracing/sft.py +253 -0
  23. photonpower_fieldtracing-0.1.0/src/fieldtracing/units.py +31 -0
  24. photonpower_fieldtracing-0.1.0/src/photonpower_fieldtracing.egg-info/PKG-INFO +93 -0
  25. photonpower_fieldtracing-0.1.0/src/photonpower_fieldtracing.egg-info/SOURCES.txt +56 -0
  26. photonpower_fieldtracing-0.1.0/src/photonpower_fieldtracing.egg-info/dependency_links.txt +1 -0
  27. photonpower_fieldtracing-0.1.0/src/photonpower_fieldtracing.egg-info/requires.txt +5 -0
  28. photonpower_fieldtracing-0.1.0/src/photonpower_fieldtracing.egg-info/top_level.txt +1 -0
  29. photonpower_fieldtracing-0.1.0/tests/test_api_sketch.py +54 -0
  30. photonpower_fieldtracing-0.1.0/tests/test_aplanatic.py +80 -0
  31. photonpower_fieldtracing-0.1.0/tests/test_chain.py +351 -0
  32. photonpower_fieldtracing-0.1.0/tests/test_curvature_fit.py +67 -0
  33. photonpower_fieldtracing-0.1.0/tests/test_debye.py +358 -0
  34. photonpower_fieldtracing-0.1.0/tests/test_edge.py +49 -0
  35. photonpower_fieldtracing-0.1.0/tests/test_edge_2d.py +126 -0
  36. photonpower_fieldtracing-0.1.0/tests/test_edge_uniform.py +250 -0
  37. photonpower_fieldtracing-0.1.0/tests/test_example_7_5.py +241 -0
  38. photonpower_fieldtracing-0.1.0/tests/test_field.py +150 -0
  39. photonpower_fieldtracing-0.1.0/tests/test_focus.py +43 -0
  40. photonpower_fieldtracing-0.1.0/tests/test_lpia.py +43 -0
  41. photonpower_fieldtracing-0.1.0/tests/test_lpia_batch.py +90 -0
  42. photonpower_fieldtracing-0.1.0/tests/test_lpia_surface.py +147 -0
  43. photonpower_fieldtracing-0.1.0/tests/test_maslov_2d.py +96 -0
  44. photonpower_fieldtracing-0.1.0/tests/test_mesh.py +205 -0
  45. photonpower_fieldtracing-0.1.0/tests/test_pft.py +42 -0
  46. photonpower_fieldtracing-0.1.0/tests/test_pft_inverse.py +118 -0
  47. photonpower_fieldtracing-0.1.0/tests/test_plan.py +320 -0
  48. photonpower_fieldtracing-0.1.0/tests/test_propagation.py +35 -0
  49. photonpower_fieldtracing-0.1.0/tests/test_reference_files.py +132 -0
  50. photonpower_fieldtracing-0.1.0/tests/test_rtt_adapter.py +187 -0
  51. photonpower_fieldtracing-0.1.0/tests/test_rtt_bridge.py +148 -0
  52. photonpower_fieldtracing-0.1.0/tests/test_rtt_psf.py +171 -0
  53. photonpower_fieldtracing-0.1.0/tests/test_rtt_smoke.py +69 -0
  54. photonpower_fieldtracing-0.1.0/tests/test_selection.py +40 -0
  55. photonpower_fieldtracing-0.1.0/tests/test_semiclassical.py +113 -0
  56. photonpower_fieldtracing-0.1.0/tests/test_sft.py +75 -0
  57. photonpower_fieldtracing-0.1.0/tests/test_sft_2d.py +154 -0
  58. photonpower_fieldtracing-0.1.0/tests/test_units_fourier.py +36 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KF
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.4
2
+ Name: photonpower-fieldtracing
3
+ Version: 0.1.0
4
+ Summary: Numerical reference implementation of field tracing (hybrid field, PFT, SFT, LPIA)
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: numpy>=1.24
10
+ Requires-Dist: scipy>=1.10
11
+ Provides-Extra: plot
12
+ Requires-Dist: matplotlib>=3.8; extra == "plot"
13
+ Dynamic: license-file
14
+
15
+ # Fieldtracing
16
+
17
+ Numerische Referenzimplementierung und Testprogramme zum Paper
18
+ [„Theoretische Grundlagen des Field Tracing“](docs/paper/fieldtracing.tex): hybride
19
+ Felddarstellung U·exp(iψ), geometrische Feldpropagation mit Jacobi-Faktor und Maslov-Index,
20
+ punktweise und semi-analytische Fourier-Transformation (PFT, SFT), lokale
21
+ Ebene-Grenzflächen-Näherung (LPIA), Kantenbeugung und Fokussierung.
22
+
23
+ **Ziel:** Die hier geprüften Bausteine sollen später [Raytatouille](https://github.com/PhotonPower/Raytatouille)
24
+ um Field Tracing erweitern. Deshalb gelten hier dieselben Konventionen (mm, µm, rad,
25
+ exp(i(k·r − ωt)), Fresnel-Convention A), und jede Formel wird gegen eine unabhängige Referenz
26
+ getestet, bevor sie portiert wird.
27
+
28
+ **Stand:** Die Meilensteine F0–F5 sind abgeschlossen: alle Bausteine in 1D und 2D, hybride
29
+ Darstellung mit Operatorkette und Planer, Integrationstest des Beispiels aus Abschnitt 7.5, lesende
30
+ Brücke zu Raytatouille und der vom Maintainer freigegebene Integrationsvorschlag (ADR-Entwurf,
31
+ API-Skizze, Sollwertdateien unter `reference/field/`). Der Port (F6) geschieht in Raytatouille nach
32
+ dessen Release v1.0 (M8). Plan und Nacharbeiten: [docs/roadmap.md](docs/roadmap.md).
33
+
34
+ ## Installieren und testen
35
+
36
+ Als Paket (PyPI-Name `photonpower-fieldtracing`, der Name `fieldtracing` ist dort vergeben; im Code
37
+ weiter `import fieldtracing`):
38
+
39
+ ```bash
40
+ pip install photonpower-fieldtracing
41
+ ```
42
+
43
+ Zum Entwickeln:
44
+
45
+ ```bash
46
+ python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
47
+ pip install -r requirements-dev.txt
48
+ pip install -e .
49
+ pytest # alle Referenztests
50
+ ruff check . && ruff format --check . && mypy
51
+ ```
52
+
53
+ Python ≥ 3.10; Laufzeitabhängigkeiten nur NumPy und SciPy.
54
+
55
+ ## Aufbau
56
+
57
+ ```text
58
+ src/fieldtracing/ Python-Paket (Code und Kommentare englisch)
59
+ fourier.py Fourier-Konvention des Papers auf zentrierten Gittern
60
+ propagation.py Winkelspektrum, Rayleigh-Sommerfeld- und Van-Vleck-Kern
61
+ semiclassical.py geometrische Propagation: Jacobi-Gesetz, Maslov-Index
62
+ pft.py, sft.py punktweise und semi-analytische Fourier-Transformation
63
+ edge.py Kantenwelle und gleichmäßige erfc-Lösung
64
+ focus.py Fokuskette mit exakt sphärischer Phase, Airy-Integral
65
+ lpia.py vektorielles Snellius-Gesetz, Fresnel-Operator (3×3)
66
+ selection.py Kennzahlen und Auswahlregeln (Kapitel 7)
67
+ field.py hybride Darstellung: GridlessField, GriddedField
68
+ mesh.py Jacobi-Faktor und Kaustiken aus unstrukturierten Strahlwolken
69
+ chain.py Operatoren mit Protokoll, Planer, Operatorkette
70
+ rtt_bridge.py Strahldaten aus Raytatouille → hybrides Feld (ADR 0004)
71
+ results.py Sollwertdateien im Format raytatouille-result
72
+ tests/ pytest, ein Testmodul je Baustein, Sollwerte unabhängig berechnet
73
+ reference/field/ Sollwertdateien für den Port
74
+ tools/ Erzeugen der Sollwertdateien
75
+ experiments/ explorative Skripte (nicht Teil der Tests)
76
+ docs/ Plan, Konventionen, Architektur, Testfälle, Quellen, ADRs, Paper
77
+ ```
78
+
79
+ ## Dokumentation
80
+
81
+ - [Plan und Meilensteine](docs/roadmap.md)
82
+ - [Konventionen](docs/konventionen.md) (verbindlich, abgestimmt mit Raytatouille)
83
+ - [Architektur des Pakets](docs/architektur.md)
84
+ - [Testfälle mit Sollwerten](docs/testfaelle.md)
85
+ - [Integration in Raytatouille](docs/integration-raytatouille.md)
86
+ - [Geprüfte Literaturquellen](docs/quellen.md)
87
+ - [Architekturentscheidungen](docs/adr/README.md)
88
+ - [Regeln für Programmieragenten](AGENTS.md)
89
+ - [Paper (LaTeX)](docs/paper/fieldtracing.tex), die CI baut daraus ein PDF
90
+
91
+ ## Lizenz
92
+
93
+ MIT, siehe [LICENSE](LICENSE).
@@ -0,0 +1,79 @@
1
+ # Fieldtracing
2
+
3
+ Numerische Referenzimplementierung und Testprogramme zum Paper
4
+ [„Theoretische Grundlagen des Field Tracing“](docs/paper/fieldtracing.tex): hybride
5
+ Felddarstellung U·exp(iψ), geometrische Feldpropagation mit Jacobi-Faktor und Maslov-Index,
6
+ punktweise und semi-analytische Fourier-Transformation (PFT, SFT), lokale
7
+ Ebene-Grenzflächen-Näherung (LPIA), Kantenbeugung und Fokussierung.
8
+
9
+ **Ziel:** Die hier geprüften Bausteine sollen später [Raytatouille](https://github.com/PhotonPower/Raytatouille)
10
+ um Field Tracing erweitern. Deshalb gelten hier dieselben Konventionen (mm, µm, rad,
11
+ exp(i(k·r − ωt)), Fresnel-Convention A), und jede Formel wird gegen eine unabhängige Referenz
12
+ getestet, bevor sie portiert wird.
13
+
14
+ **Stand:** Die Meilensteine F0–F5 sind abgeschlossen: alle Bausteine in 1D und 2D, hybride
15
+ Darstellung mit Operatorkette und Planer, Integrationstest des Beispiels aus Abschnitt 7.5, lesende
16
+ Brücke zu Raytatouille und der vom Maintainer freigegebene Integrationsvorschlag (ADR-Entwurf,
17
+ API-Skizze, Sollwertdateien unter `reference/field/`). Der Port (F6) geschieht in Raytatouille nach
18
+ dessen Release v1.0 (M8). Plan und Nacharbeiten: [docs/roadmap.md](docs/roadmap.md).
19
+
20
+ ## Installieren und testen
21
+
22
+ Als Paket (PyPI-Name `photonpower-fieldtracing`, der Name `fieldtracing` ist dort vergeben; im Code
23
+ weiter `import fieldtracing`):
24
+
25
+ ```bash
26
+ pip install photonpower-fieldtracing
27
+ ```
28
+
29
+ Zum Entwickeln:
30
+
31
+ ```bash
32
+ python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
33
+ pip install -r requirements-dev.txt
34
+ pip install -e .
35
+ pytest # alle Referenztests
36
+ ruff check . && ruff format --check . && mypy
37
+ ```
38
+
39
+ Python ≥ 3.10; Laufzeitabhängigkeiten nur NumPy und SciPy.
40
+
41
+ ## Aufbau
42
+
43
+ ```text
44
+ src/fieldtracing/ Python-Paket (Code und Kommentare englisch)
45
+ fourier.py Fourier-Konvention des Papers auf zentrierten Gittern
46
+ propagation.py Winkelspektrum, Rayleigh-Sommerfeld- und Van-Vleck-Kern
47
+ semiclassical.py geometrische Propagation: Jacobi-Gesetz, Maslov-Index
48
+ pft.py, sft.py punktweise und semi-analytische Fourier-Transformation
49
+ edge.py Kantenwelle und gleichmäßige erfc-Lösung
50
+ focus.py Fokuskette mit exakt sphärischer Phase, Airy-Integral
51
+ lpia.py vektorielles Snellius-Gesetz, Fresnel-Operator (3×3)
52
+ selection.py Kennzahlen und Auswahlregeln (Kapitel 7)
53
+ field.py hybride Darstellung: GridlessField, GriddedField
54
+ mesh.py Jacobi-Faktor und Kaustiken aus unstrukturierten Strahlwolken
55
+ chain.py Operatoren mit Protokoll, Planer, Operatorkette
56
+ rtt_bridge.py Strahldaten aus Raytatouille → hybrides Feld (ADR 0004)
57
+ results.py Sollwertdateien im Format raytatouille-result
58
+ tests/ pytest, ein Testmodul je Baustein, Sollwerte unabhängig berechnet
59
+ reference/field/ Sollwertdateien für den Port
60
+ tools/ Erzeugen der Sollwertdateien
61
+ experiments/ explorative Skripte (nicht Teil der Tests)
62
+ docs/ Plan, Konventionen, Architektur, Testfälle, Quellen, ADRs, Paper
63
+ ```
64
+
65
+ ## Dokumentation
66
+
67
+ - [Plan und Meilensteine](docs/roadmap.md)
68
+ - [Konventionen](docs/konventionen.md) (verbindlich, abgestimmt mit Raytatouille)
69
+ - [Architektur des Pakets](docs/architektur.md)
70
+ - [Testfälle mit Sollwerten](docs/testfaelle.md)
71
+ - [Integration in Raytatouille](docs/integration-raytatouille.md)
72
+ - [Geprüfte Literaturquellen](docs/quellen.md)
73
+ - [Architekturentscheidungen](docs/adr/README.md)
74
+ - [Regeln für Programmieragenten](AGENTS.md)
75
+ - [Paper (LaTeX)](docs/paper/fieldtracing.tex), die CI baut daraus ein PDF
76
+
77
+ ## Lizenz
78
+
79
+ MIT, siehe [LICENSE](LICENSE).
@@ -0,0 +1,57 @@
1
+ # Python package fieldtracing: numerical reference implementation for the field tracing paper.
2
+ # Development tools are pinned in requirements-dev.txt.
3
+
4
+ [build-system]
5
+ requires = ["setuptools>=77"]
6
+ build-backend = "setuptools.build_meta"
7
+
8
+ [project]
9
+ # on PyPI as photonpower-fieldtracing (the name fieldtracing is taken there); import fieldtracing
10
+ name = "photonpower-fieldtracing"
11
+ version = "0.1.0"
12
+ description = "Numerical reference implementation of field tracing (hybrid field, PFT, SFT, LPIA)"
13
+ readme = "README.md"
14
+ license = "MIT"
15
+ license-files = ["LICENSE"]
16
+ requires-python = ">=3.10"
17
+ dependencies = ["numpy>=1.24", "scipy>=1.10"]
18
+
19
+ [project.optional-dependencies]
20
+ plot = ["matplotlib>=3.8"]
21
+
22
+ [tool.setuptools.packages.find]
23
+ where = ["src"]
24
+
25
+ [tool.setuptools.package-data]
26
+ fieldtracing = ["py.typed"]
27
+
28
+ [tool.pytest.ini_options]
29
+ testpaths = ["tests"]
30
+ # Expensive reference computations carry the marker `slow`; run them with `pytest -m slow`.
31
+ addopts = "-ra -m 'not slow'"
32
+ markers = [
33
+ "slow: expensive reference computation (nightly workflow, pytest -m slow)",
34
+ "rtt: needs the raytatouille package (workflow rtt.yml); skipped if it is not installed",
35
+ ]
36
+
37
+ [tool.ruff]
38
+ line-length = 100
39
+ target-version = "py310"
40
+
41
+ [tool.ruff.lint]
42
+ select = ["E", "F", "W", "I", "B", "UP", "NPY", "RUF"]
43
+ ignore = ["RUF001", "RUF002", "RUF003"] # Greek letters and typographic characters in physics text
44
+
45
+ [tool.mypy]
46
+ strict = true
47
+ python_version = "3.10"
48
+ files = ["src", "tests", "tools"]
49
+
50
+ [[tool.mypy.overrides]]
51
+ # SciPy ships no type information; raytatouille is optional (typed when installed).
52
+ module = ["scipy", "scipy.*", "raytatouille", "raytatouille.*"]
53
+ ignore_missing_imports = true
54
+
55
+ [tool.ruff.lint.per-file-ignores]
56
+ # Exploratory scripts: long print lines and inline lambdas are fine.
57
+ "experiments/*" = ["E501", "E731"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,7 @@
1
+ """Field tracing: numerical reference implementation of the paper's building blocks.
2
+
3
+ Python prototypes and reference tests; the verified kernels are later ported to Raytatouille
4
+ (see docs/integration-raytatouille.md).
5
+ """
6
+
7
+ __version__ = "0.1.0"
@@ -0,0 +1,12 @@
1
+ """Shared array type aliases (inputs from np.linspace etc. are `floating[Any]`)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any, TypeAlias
6
+
7
+ import numpy as np
8
+ from numpy.typing import NDArray
9
+
10
+ FloatArray: TypeAlias = NDArray[np.floating[Any]]
11
+ ComplexArray: TypeAlias = NDArray[np.complexfloating[Any, Any]]
12
+ IntArray: TypeAlias = NDArray[np.integer[Any]]