diffpes 2026.3.1__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 (56) hide show
  1. diffpes-2026.3.1/LICENSE +9 -0
  2. diffpes-2026.3.1/PKG-INFO +176 -0
  3. diffpes-2026.3.1/README.md +94 -0
  4. diffpes-2026.3.1/pyproject.toml +277 -0
  5. diffpes-2026.3.1/src/diffpes/__init__.py +65 -0
  6. diffpes-2026.3.1/src/diffpes/inout/__init__.py +88 -0
  7. diffpes-2026.3.1/src/diffpes/inout/chgcar.py +459 -0
  8. diffpes-2026.3.1/src/diffpes/inout/doscar.py +248 -0
  9. diffpes-2026.3.1/src/diffpes/inout/eigenval.py +258 -0
  10. diffpes-2026.3.1/src/diffpes/inout/hdf5.py +818 -0
  11. diffpes-2026.3.1/src/diffpes/inout/helpers.py +295 -0
  12. diffpes-2026.3.1/src/diffpes/inout/kpoints.py +433 -0
  13. diffpes-2026.3.1/src/diffpes/inout/plotting.py +757 -0
  14. diffpes-2026.3.1/src/diffpes/inout/poscar.py +174 -0
  15. diffpes-2026.3.1/src/diffpes/inout/procar.py +331 -0
  16. diffpes-2026.3.1/src/diffpes/inout/py.typed +0 -0
  17. diffpes-2026.3.1/src/diffpes/maths/__init__.py +68 -0
  18. diffpes-2026.3.1/src/diffpes/maths/dipole.py +368 -0
  19. diffpes-2026.3.1/src/diffpes/maths/gaunt.py +496 -0
  20. diffpes-2026.3.1/src/diffpes/maths/spherical_harmonics.py +336 -0
  21. diffpes-2026.3.1/src/diffpes/py.typed +0 -0
  22. diffpes-2026.3.1/src/diffpes/radial/__init__.py +47 -0
  23. diffpes-2026.3.1/src/diffpes/radial/bessel.py +198 -0
  24. diffpes-2026.3.1/src/diffpes/radial/integrate.py +128 -0
  25. diffpes-2026.3.1/src/diffpes/radial/wavefunctions.py +335 -0
  26. diffpes-2026.3.1/src/diffpes/simul/__init__.py +146 -0
  27. diffpes-2026.3.1/src/diffpes/simul/broadening.py +258 -0
  28. diffpes-2026.3.1/src/diffpes/simul/crosssections.py +196 -0
  29. diffpes-2026.3.1/src/diffpes/simul/expanded.py +1021 -0
  30. diffpes-2026.3.1/src/diffpes/simul/forward.py +586 -0
  31. diffpes-2026.3.1/src/diffpes/simul/oam.py +112 -0
  32. diffpes-2026.3.1/src/diffpes/simul/polarization.py +443 -0
  33. diffpes-2026.3.1/src/diffpes/simul/py.typed +0 -0
  34. diffpes-2026.3.1/src/diffpes/simul/resolution.py +122 -0
  35. diffpes-2026.3.1/src/diffpes/simul/self_energy.py +142 -0
  36. diffpes-2026.3.1/src/diffpes/simul/spectrum.py +1116 -0
  37. diffpes-2026.3.1/src/diffpes/simul/workflow.py +424 -0
  38. diffpes-2026.3.1/src/diffpes/tightb/__init__.py +68 -0
  39. diffpes-2026.3.1/src/diffpes/tightb/diagonalize.py +340 -0
  40. diffpes-2026.3.1/src/diffpes/tightb/hamiltonian.py +286 -0
  41. diffpes-2026.3.1/src/diffpes/tightb/projections.py +134 -0
  42. diffpes-2026.3.1/src/diffpes/types/__init__.py +162 -0
  43. diffpes-2026.3.1/src/diffpes/types/aliases.py +52 -0
  44. diffpes-2026.3.1/src/diffpes/types/bands.py +1064 -0
  45. diffpes-2026.3.1/src/diffpes/types/dos.py +510 -0
  46. diffpes-2026.3.1/src/diffpes/types/geometry.py +306 -0
  47. diffpes-2026.3.1/src/diffpes/types/kpath.py +365 -0
  48. diffpes-2026.3.1/src/diffpes/types/params.py +496 -0
  49. diffpes-2026.3.1/src/diffpes/types/py.typed +0 -0
  50. diffpes-2026.3.1/src/diffpes/types/radial_params.py +482 -0
  51. diffpes-2026.3.1/src/diffpes/types/self_energy.py +271 -0
  52. diffpes-2026.3.1/src/diffpes/types/tb_model.py +531 -0
  53. diffpes-2026.3.1/src/diffpes/types/volumetric.py +608 -0
  54. diffpes-2026.3.1/src/diffpes/utils/__init__.py +30 -0
  55. diffpes-2026.3.1/src/diffpes/utils/math.py +255 -0
  56. diffpes-2026.3.1/src/diffpes/utils/py.typed +0 -0
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Debangshu Mukherjee, Oak Ridge National Laboratory
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,176 @@
1
+ Metadata-Version: 2.3
2
+ Name: diffpes
3
+ Version: 2026.3.1
4
+ Summary: Differentiable ARPES simulations in JAX
5
+ Keywords: ARPES,MBE,JAX,Differentiable Programming
6
+ Author: Debangshu Mukherjee, Jacob Cook
7
+ Author-email: Debangshu Mukherjee <mukherjeed@ornl.gov>, Jacob Cook <cookjl2@ornl.gov>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2026 Debangshu Mukherjee, Oak Ridge National Laboratory
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17
+ Classifier: Development Status :: 4 - Beta
18
+ Classifier: Intended Audience :: Science/Research
19
+ Classifier: License :: OSI Approved :: MIT License
20
+ Classifier: Operating System :: OS Independent
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Scientific/Engineering :: Physics
24
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
25
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
26
+ Classifier: Typing :: Typed
27
+ Requires-Dist: numpy>=2.2.1
28
+ Requires-Dist: matplotlib>=3.10.0
29
+ Requires-Dist: jax>=0.7.0 ; sys_platform == 'win64'
30
+ Requires-Dist: jax>=0.7.0 ; sys_platform == 'darwin'
31
+ Requires-Dist: jax>=0.7.0 ; sys_platform == 'linux'
32
+ Requires-Dist: jaxtyping>=0.3.0
33
+ Requires-Dist: chex>=0.1.85
34
+ Requires-Dist: beartype>=0.21.0
35
+ Requires-Dist: jupyter>=1.1.1
36
+ Requires-Dist: ipykernel>=7.2.0
37
+ Requires-Dist: h5py>=3.15.1
38
+ Requires-Dist: diffpes[docs,test,dev,notebooks,cuda] ; extra == 'all'
39
+ Requires-Dist: jax[cuda12]>=0.7.0 ; platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'cuda'
40
+ Requires-Dist: nvidia-cudnn-cu12>=9.5.0 ; platform_machine == 'x86_64' and sys_platform == 'linux' and extra == 'cuda'
41
+ Requires-Dist: diffpes[docs,test,notebooks] ; extra == 'dev'
42
+ Requires-Dist: black[jupyter]>=25.1.0 ; extra == 'dev'
43
+ Requires-Dist: build>=1.2.2.post1 ; extra == 'dev'
44
+ Requires-Dist: twine>=6.1.0 ; extra == 'dev'
45
+ Requires-Dist: ruff>=0.12.9 ; extra == 'dev'
46
+ Requires-Dist: pygount>=3.1.0 ; extra == 'dev'
47
+ Requires-Dist: pre-commit>=4.5.1 ; extra == 'dev'
48
+ Requires-Dist: isort>=6.0.1 ; extra == 'dev'
49
+ Requires-Dist: ty>=0.0.19 ; extra == 'dev'
50
+ Requires-Dist: black>=26.1.0 ; extra == 'dev'
51
+ Requires-Dist: jupyter-black>=0.4.0 ; extra == 'dev'
52
+ Requires-Dist: diffpes[dev,cuda] ; extra == 'dev-cuda'
53
+ Requires-Dist: sphinx>=7.0.0 ; extra == 'docs'
54
+ Requires-Dist: sphinx-rtd-theme>=3.0.2 ; extra == 'docs'
55
+ Requires-Dist: nbsphinx>=0.9.7 ; extra == 'docs'
56
+ Requires-Dist: myst-parser>=2.0.0 ; extra == 'docs'
57
+ Requires-Dist: ipykernel>=6.29.5 ; extra == 'docs'
58
+ Requires-Dist: nbconvert>=7.16.6 ; extra == 'docs'
59
+ Requires-Dist: furo>=2025.7.19 ; extra == 'docs'
60
+ Requires-Dist: sphinx-autodoc-typehints>=3.0.1 ; extra == 'docs'
61
+ Requires-Dist: numpydoc>=1.9.0 ; extra == 'docs'
62
+ Requires-Dist: pydoclint>=0.7.3 ; extra == 'docs'
63
+ Requires-Dist: interrogate>=1.7.0 ; extra == 'docs'
64
+ Requires-Dist: ipywidgets>=8.1.0 ; extra == 'notebooks'
65
+ Requires-Dist: ipykernel>=6.29.5 ; extra == 'notebooks'
66
+ Requires-Dist: nbconvert>=7.16.6 ; extra == 'notebooks'
67
+ Requires-Dist: pytest>=8.3.5 ; extra == 'test'
68
+ Requires-Dist: pytest-cov>=6.0.0 ; extra == 'test'
69
+ Requires-Dist: pytest-xdist>=3.0.0 ; extra == 'test'
70
+ Requires-Dist: chex>=0.1.89 ; extra == 'test'
71
+ Maintainer: Debangshu Mukherjee
72
+ Maintainer-email: Debangshu Mukherjee <mukherjeed@ornl.gov>
73
+ Requires-Python: >=3.12, <3.15
74
+ Provides-Extra: all
75
+ Provides-Extra: cuda
76
+ Provides-Extra: dev
77
+ Provides-Extra: dev-cuda
78
+ Provides-Extra: docs
79
+ Provides-Extra: notebooks
80
+ Provides-Extra: test
81
+ Description-Content-Type: text/markdown
82
+
83
+ # diffpes
84
+
85
+ JAX-based ARPES simulation toolkit with Python-native APIs.
86
+
87
+ ## Expanded-input workflows
88
+
89
+ The package includes expanded-input wrappers that let you call the
90
+ simulator with plain arrays/scalars while still running JAX kernels.
91
+
92
+ ### Function mapping
93
+
94
+ - `ARPES_simulation_Novice` -> `diffpes.simul.simulate_novice_expanded`
95
+ - `ARPES_simulation_Basic` -> `diffpes.simul.simulate_basic_expanded`
96
+ - `ARPES_simulation_Basicplus` -> `diffpes.simul.simulate_basicplus_expanded`
97
+ - `ARPES_simulation_Advanced` -> `diffpes.simul.simulate_advanced_expanded`
98
+ - `ARPES_simulation_Expert` -> `diffpes.simul.simulate_expert_expanded`
99
+ - `ARPES_simulation_SOC` -> `diffpes.simul.simulate_soc_expanded`
100
+ - Dynamic dispatch by level -> `diffpes.simul.simulate_expanded`
101
+ (use `level="soc"` with `surface_spin` for SOC)
102
+
103
+ ### Notes
104
+
105
+ - Default energy-axis padding behavior:
106
+ `min(eigenbands)-1` to `max(eigenbands)+1`.
107
+ - Incident angles for expanded wrappers are interpreted in degrees.
108
+ - Wrappers return the standard `ArpesSpectrum` PyTree.
109
+
110
+ ### Python indexing conventions
111
+
112
+ Use standard Python/NumPy indexing everywhere (zero-based, end-exclusive).
113
+
114
+ - Non-s orbitals: `slice(1, 9)` -> indices 1..8
115
+ - p orbitals: `slice(1, 4)` -> indices 1..3
116
+ - d orbitals: `slice(4, 9)` -> indices 4..8
117
+
118
+ Do not use MATLAB-style indexing notation in Python code.
119
+
120
+ ### Example
121
+
122
+ ```python
123
+ import jax.numpy as jnp
124
+
125
+ from diffpes.simul import simulate_expanded
126
+
127
+ # [nkpt, nband]
128
+ eigenbands = jnp.linspace(-2.0, 0.5, 100).reshape(20, 5)
129
+ # [nkpt, nband, natom, 9]
130
+ surface_orb = jnp.ones((20, 5, 2, 9)) * 0.1
131
+
132
+ spectrum = simulate_expanded(
133
+ level="advanced",
134
+ eigenbands=eigenbands,
135
+ surface_orb=surface_orb,
136
+ ef=0.0,
137
+ sigma=0.04,
138
+ fidelity=2500,
139
+ temperature=15.0,
140
+ photon_energy=11.0,
141
+ polarization="unpolarized",
142
+ incident_theta=45.0,
143
+ incident_phi=0.0,
144
+ polarization_angle=0.0,
145
+ )
146
+ ```
147
+
148
+ ## Test coverage
149
+
150
+ Test coverage measures which lines of source code are executed
151
+ during tests. Run it with:
152
+
153
+ ```bash
154
+ source .venv/bin/activate
155
+ pytest tests/ --cov=src/diffpes --cov-report=term-missing
156
+ ```
157
+
158
+ To get as close to 100% as possible:
159
+
160
+ 1. **Simul and types** — Already well covered. Any new branch
161
+ (e.g. new polarization or dispatch level) should have a
162
+ corresponding test.
163
+ 2. **Expanded dispatch** — Test every `simulate_expanded(level=...)`
164
+ branch (novice, basic, basicplus, advanced, expert, soc) and
165
+ the unknown-level `ValueError`.
166
+ 3. **HDF5** — Round-trip all PyTree types; test error paths
167
+ (unknown type on load, missing group, unsupported type on save).
168
+ 4. **VASP file readers** (`read_doscar`, `read_eigenval`, `read_kpoints`,
169
+ `read_poscar`, `read_procar`) — Add tests that call each reader
170
+ on minimal in-repo fixture files (e.g. under `tests/fixtures/`)
171
+ so the parsing code paths are executed.
172
+ 5. **Plotting** — Exercise the public plotting API in tests (or
173
+ accept lower coverage for GUI-oriented code).
174
+ 6. **Edge branches** — Cover optional arguments (e.g.
175
+ `make_band_structure(..., kpoint_weights=...)`) and error
176
+ messages so one-off branches are hit.
@@ -0,0 +1,94 @@
1
+ # diffpes
2
+
3
+ JAX-based ARPES simulation toolkit with Python-native APIs.
4
+
5
+ ## Expanded-input workflows
6
+
7
+ The package includes expanded-input wrappers that let you call the
8
+ simulator with plain arrays/scalars while still running JAX kernels.
9
+
10
+ ### Function mapping
11
+
12
+ - `ARPES_simulation_Novice` -> `diffpes.simul.simulate_novice_expanded`
13
+ - `ARPES_simulation_Basic` -> `diffpes.simul.simulate_basic_expanded`
14
+ - `ARPES_simulation_Basicplus` -> `diffpes.simul.simulate_basicplus_expanded`
15
+ - `ARPES_simulation_Advanced` -> `diffpes.simul.simulate_advanced_expanded`
16
+ - `ARPES_simulation_Expert` -> `diffpes.simul.simulate_expert_expanded`
17
+ - `ARPES_simulation_SOC` -> `diffpes.simul.simulate_soc_expanded`
18
+ - Dynamic dispatch by level -> `diffpes.simul.simulate_expanded`
19
+ (use `level="soc"` with `surface_spin` for SOC)
20
+
21
+ ### Notes
22
+
23
+ - Default energy-axis padding behavior:
24
+ `min(eigenbands)-1` to `max(eigenbands)+1`.
25
+ - Incident angles for expanded wrappers are interpreted in degrees.
26
+ - Wrappers return the standard `ArpesSpectrum` PyTree.
27
+
28
+ ### Python indexing conventions
29
+
30
+ Use standard Python/NumPy indexing everywhere (zero-based, end-exclusive).
31
+
32
+ - Non-s orbitals: `slice(1, 9)` -> indices 1..8
33
+ - p orbitals: `slice(1, 4)` -> indices 1..3
34
+ - d orbitals: `slice(4, 9)` -> indices 4..8
35
+
36
+ Do not use MATLAB-style indexing notation in Python code.
37
+
38
+ ### Example
39
+
40
+ ```python
41
+ import jax.numpy as jnp
42
+
43
+ from diffpes.simul import simulate_expanded
44
+
45
+ # [nkpt, nband]
46
+ eigenbands = jnp.linspace(-2.0, 0.5, 100).reshape(20, 5)
47
+ # [nkpt, nband, natom, 9]
48
+ surface_orb = jnp.ones((20, 5, 2, 9)) * 0.1
49
+
50
+ spectrum = simulate_expanded(
51
+ level="advanced",
52
+ eigenbands=eigenbands,
53
+ surface_orb=surface_orb,
54
+ ef=0.0,
55
+ sigma=0.04,
56
+ fidelity=2500,
57
+ temperature=15.0,
58
+ photon_energy=11.0,
59
+ polarization="unpolarized",
60
+ incident_theta=45.0,
61
+ incident_phi=0.0,
62
+ polarization_angle=0.0,
63
+ )
64
+ ```
65
+
66
+ ## Test coverage
67
+
68
+ Test coverage measures which lines of source code are executed
69
+ during tests. Run it with:
70
+
71
+ ```bash
72
+ source .venv/bin/activate
73
+ pytest tests/ --cov=src/diffpes --cov-report=term-missing
74
+ ```
75
+
76
+ To get as close to 100% as possible:
77
+
78
+ 1. **Simul and types** — Already well covered. Any new branch
79
+ (e.g. new polarization or dispatch level) should have a
80
+ corresponding test.
81
+ 2. **Expanded dispatch** — Test every `simulate_expanded(level=...)`
82
+ branch (novice, basic, basicplus, advanced, expert, soc) and
83
+ the unknown-level `ValueError`.
84
+ 3. **HDF5** — Round-trip all PyTree types; test error paths
85
+ (unknown type on load, missing group, unsupported type on save).
86
+ 4. **VASP file readers** (`read_doscar`, `read_eigenval`, `read_kpoints`,
87
+ `read_poscar`, `read_procar`) — Add tests that call each reader
88
+ on minimal in-repo fixture files (e.g. under `tests/fixtures/`)
89
+ so the parsing code paths are executed.
90
+ 5. **Plotting** — Exercise the public plotting API in tests (or
91
+ accept lower coverage for GUI-oriented code).
92
+ 6. **Edge branches** — Cover optional arguments (e.g.
93
+ `make_band_structure(..., kpoint_weights=...)`) and error
94
+ messages so one-off branches are hit.
@@ -0,0 +1,277 @@
1
+ [project]
2
+ name = "diffpes"
3
+ version = "2026.03.01"
4
+ description = "Differentiable ARPES simulations in JAX"
5
+ authors = [
6
+ {name = "Debangshu Mukherjee", email = "mukherjeed@ornl.gov"},
7
+ {name = "Jacob Cook", email = "cookjl2@ornl.gov"},
8
+ ]
9
+ license = {file = "LICENSE"}
10
+ maintainers = [{name = "Debangshu Mukherjee", email = "mukherjeed@ornl.gov"}]
11
+ keywords = [
12
+ "ARPES",
13
+ "MBE",
14
+ "JAX",
15
+ "Differentiable Programming",
16
+ ]
17
+ readme = "README.md"
18
+ requires-python = ">=3.12, <3.15"
19
+ classifiers = [
20
+ "Development Status :: 4 - Beta",
21
+ "Intended Audience :: Science/Research",
22
+ "License :: OSI Approved :: MIT License",
23
+ "Operating System :: OS Independent",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Programming Language :: Python :: 3.14",
26
+ "Topic :: Scientific/Engineering :: Physics",
27
+ "Topic :: Scientific/Engineering :: Chemistry",
28
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
29
+ "Typing :: Typed",
30
+ ]
31
+ dependencies = [
32
+ "numpy>=2.2.1",
33
+ "matplotlib>=3.10.0",
34
+ "jax>=0.7.0 ; sys_platform == 'win64'",
35
+ "jax>=0.7.0 ; sys_platform == 'darwin'",
36
+ "jax>=0.7.0 ; sys_platform == 'linux'",
37
+ "jaxtyping>=0.3.0",
38
+ "chex>=0.1.85",
39
+ "beartype>=0.21.0",
40
+ "jupyter>=1.1.1",
41
+ "ipykernel>=7.2.0",
42
+ "h5py>=3.15.1",
43
+ ]
44
+
45
+ [tool.setuptools]
46
+ include-package-data = true
47
+ license-files = []
48
+
49
+ [tool.setuptools.packages.find]
50
+ namespaces = true
51
+ where = ["src"]
52
+
53
+ [project.optional-dependencies]
54
+ cuda = [
55
+ "jax[cuda12]>=0.7.0 ; platform_machine == 'x86_64' and sys_platform == 'linux'",
56
+ "nvidia-cudnn-cu12>=9.5.0 ; platform_machine == 'x86_64' and sys_platform == 'linux'",
57
+ ]
58
+ docs = [
59
+ "sphinx>=7.0.0",
60
+ "sphinx-rtd-theme>=3.0.2",
61
+ "nbsphinx>=0.9.7",
62
+ "myst-parser>=2.0.0",
63
+ "ipykernel>=6.29.5",
64
+ "nbconvert>=7.16.6",
65
+ "furo>=2025.7.19",
66
+ "sphinx-autodoc-typehints>=3.0.1",
67
+ "numpydoc>=1.9.0",
68
+ "pydoclint>=0.7.3",
69
+ "interrogate>=1.7.0",
70
+ ]
71
+ test = [
72
+ "pytest>=8.3.5",
73
+ "pytest-cov>=6.0.0",
74
+ "pytest-xdist>=3.0.0",
75
+ "chex>=0.1.89",
76
+ ]
77
+ notebooks = [
78
+ "ipywidgets>=8.1.0",
79
+ "ipykernel>=6.29.5",
80
+ "nbconvert>=7.16.6",
81
+ ]
82
+ dev = [
83
+ "diffpes[docs,test,notebooks]",
84
+ "black[jupyter]>=25.1.0",
85
+ "build>=1.2.2.post1",
86
+ "twine>=6.1.0",
87
+ "ruff>=0.12.9",
88
+ "pygount>=3.1.0",
89
+ "pre-commit>=4.5.1",
90
+ "isort>=6.0.1",
91
+ "ty>=0.0.19",
92
+ "black>=26.1.0",
93
+ "jupyter-black>=0.4.0",
94
+ ]
95
+ dev_cuda = [
96
+ "diffpes[dev,cuda]",
97
+ ]
98
+ all = [
99
+ "diffpes[docs,test,dev,notebooks,cuda]",
100
+ ]
101
+
102
+ [build-system]
103
+ requires = ["uv_build>=0.10.4,<0.11.0"]
104
+ build-backend = "uv_build"
105
+
106
+ [tool.pytest.ini_options]
107
+ testpaths = ["tests"]
108
+ python_files = "test_*.py"
109
+ python_classes = "Test*"
110
+ python_functions = "test_*"
111
+
112
+ [tool.coverage.run]
113
+ source = ["diffpes"]
114
+ omit = ["*/tests/*", "*/site-packages/*"]
115
+
116
+ [tool.pydoclint]
117
+ style = "numpy"
118
+ check-return-types = true
119
+ check-yield-types = true
120
+ check-arg-order = true
121
+ require-return-section-when-returning = true
122
+ require-yield-section-when-yielding = true
123
+
124
+ [tool.interrogate]
125
+ fail-under = 90
126
+ style = "sphinx"
127
+ exclude = ["tests", "build", "dist"]
128
+ ignore-init-module = true
129
+ quiet = true
130
+
131
+ [tool.ruff]
132
+ include = ["pyproject.toml", "src/**/*.py"]
133
+ line-length = 79
134
+ target-version = "py312"
135
+ exclude = [
136
+ ".bzr",
137
+ ".direnv",
138
+ ".eggs",
139
+ ".git",
140
+ ".git-rewrite",
141
+ ".hg",
142
+ ".ipynb_checkpoints",
143
+ ".mypy_cache",
144
+ ".nox",
145
+ ".pants.d",
146
+ ".pyenv",
147
+ ".pytest_cache",
148
+ ".pytype",
149
+ ".ruff_cache",
150
+ ".svn",
151
+ ".tox",
152
+ ".venv",
153
+ ".vscode",
154
+ "__pypackages__",
155
+ "_build",
156
+ "buck-out",
157
+ "build",
158
+ "dist",
159
+ "node_modules",
160
+ "site-packages",
161
+ "venv",
162
+ ]
163
+
164
+ [tool.ruff.format]
165
+ quote-style = "double"
166
+ indent-style = "space"
167
+ skip-magic-trailing-comma = false
168
+ line-ending = "auto"
169
+ docstring-code-format = true
170
+ docstring-code-line-length = 79
171
+
172
+ [tool.ruff.lint]
173
+ select = [
174
+ "D",
175
+ "E",
176
+ "F",
177
+ "B",
178
+ "I",
179
+ "N",
180
+ "UP",
181
+ "ANN",
182
+ "S",
183
+ "A",
184
+ "C4",
185
+ "PIE",
186
+ "PT",
187
+ "RET",
188
+ "SIM",
189
+ "ARG",
190
+ "ERA",
191
+ "PL",
192
+ ]
193
+ ignore = [
194
+ "ANN401",
195
+ "PYI021",
196
+ "F722",
197
+ "COM812",
198
+ "D205",
199
+ "D212",
200
+ "UP037",
201
+ "F821",
202
+ ]
203
+
204
+ [tool.ruff.lint.flake8-bugbear]
205
+ extend-immutable-calls = [
206
+ "jax.numpy.zeros",
207
+ "jax.numpy.ones",
208
+ "jax.numpy.array",
209
+ "jax.numpy.asarray",
210
+ "jnp.zeros",
211
+ "jnp.ones",
212
+ "jnp.array",
213
+ "jnp.asarray",
214
+ ]
215
+
216
+ [tool.ruff.lint.pylint]
217
+ max-args = 10
218
+
219
+ [tool.ruff.lint.isort]
220
+ known-third-party = ["jax", "jaxtyping"]
221
+
222
+ [tool.ruff.lint.pydocstyle]
223
+ convention = "numpy"
224
+
225
+ [tool.ruff.lint.per-file-ignores]
226
+ "tests/**/*.py" = [
227
+ "D",
228
+ "ANN",
229
+ "S",
230
+ "PLR",
231
+ "ARG",
232
+ "ERA",
233
+ "B",
234
+ "A",
235
+ "C4",
236
+ "PIE",
237
+ "PT",
238
+ "RET",
239
+ "SIM",
240
+ "N",
241
+ "UP",
242
+ "F401",
243
+ "F841",
244
+ "PLR2004",
245
+ ]
246
+ # Physics modules: standard physics variable names (H=Hamiltonian,
247
+ # l/m=quantum numbers, M=matrix element, R=radial/lattice, W=work fn)
248
+ "src/diffpes/tightb/*.py" = ["E741", "N803", "N806"]
249
+ "src/diffpes/maths/*.py" = ["E741", "N803", "N806", "ARG001"]
250
+ "src/diffpes/simul/forward.py" = ["E741", "N806"]
251
+ "src/diffpes/simul/self_energy.py" = ["S101"]
252
+
253
+ [tool.ty.environment]
254
+ python-version = "3.12"
255
+ root = ["./src"]
256
+
257
+ [tool.ty.src]
258
+ include = ["src"]
259
+ exclude = ["tests"]
260
+
261
+ [tool.black]
262
+ line-length = 79
263
+ target-version = ["py312", "py313"]
264
+ include = '\.pyi?$'
265
+ exclude = '''
266
+ /(
267
+ \.git
268
+ | \.hg
269
+ | \.mypy_cache
270
+ | \.tox
271
+ | \.venv
272
+ | _build
273
+ | buck-out
274
+ | build
275
+ | dist
276
+ )/
277
+ '''
@@ -0,0 +1,65 @@
1
+ """Differentiable ARPES simulations in JAX.
2
+
3
+ Extended Summary
4
+ ----------------
5
+ A comprehensive toolkit for Angle-Resolved PhotoEmission
6
+ Spectroscopy (ARPES) simulations using JAX for automatic
7
+ differentiation and GPU acceleration. Supports five levels
8
+ of physical sophistication from basic Gaussian convolution
9
+ to full polarization-dependent dipole matrix element
10
+ calculations.
11
+
12
+ Routine Listings
13
+ ----------------
14
+ :mod:`inout`
15
+ VASP file parsers (POSCAR, EIGENVAL, KPOINTS, DOSCAR, PROCAR).
16
+ :mod:`radial`
17
+ Differentiable radial primitives (Bessel, wavefunctions, integrals).
18
+ :mod:`simul`
19
+ ARPES simulation functions at five complexity levels.
20
+ :mod:`types`
21
+ PyTree data structures and factory functions.
22
+ :mod:`utils`
23
+ Mathematical utilities (Faddeeva function, normalization).
24
+
25
+ Examples
26
+ --------
27
+ >>> import diffpes
28
+ >>> bands = diffpes.inout.read_eigenval("EIGENVAL", fermi_energy=-1.5)
29
+ >>> orb = diffpes.inout.read_procar("PROCAR")
30
+ >>> params = diffpes.types.make_simulation_params(sigma=0.04)
31
+ >>> spectrum = diffpes.simul.simulate_basic(bands, orb, params)
32
+
33
+ Notes
34
+ -----
35
+ All computations are JAX-compatible and support automatic
36
+ differentiation for gradient-based optimization of ARPES
37
+ simulation parameters.
38
+ """
39
+
40
+ import os
41
+ from importlib.metadata import version
42
+
43
+ os.environ.setdefault(
44
+ "XLA_FLAGS",
45
+ "--xla_cpu_multi_thread_eigen=true intra_op_parallelism_threads=0",
46
+ )
47
+
48
+ import jax # noqa: E402
49
+
50
+ jax.config.update("jax_enable_x64", True)
51
+
52
+ from . import inout, maths, radial, simul, tightb, types, utils # noqa: E402
53
+
54
+ __version__: str = version("diffpes")
55
+
56
+ __all__: list[str] = [
57
+ "__version__",
58
+ "inout",
59
+ "maths",
60
+ "radial",
61
+ "simul",
62
+ "tightb",
63
+ "types",
64
+ "utils",
65
+ ]