Skip to main content

diffpes

License PyPI Downloads PyPI version Python Versions Documentation Status tests codecov DOI Ruff ty jax_badge Lines of Code

diffpes is a JAX-based ARPES simulation toolkit with Python-native APIs and certified forward execution. A certified run stores its observable and scientific evidence in the same differentiable PyTree. The evidence includes bounded physics claims, provenance, domain margins, derivatives, local information-flow diagnostics, and a named assurance policy. JAX compiles and batches the numerical certification path. Portable serialization stays at the filesystem boundary.

Certification here means bounded scientific evidence, not a security credential. Storage consistency markers detect accidental mismatches only.

The geometry layer converts crystal coordinates, detector angles, and photon energy into fixed-shape momentum rasters. Its JAX derivatives expose calibration sensitivity to the work function, inner potential, sample azimuth, and detector frame.

Coherent spectral workflows

diffpes.matrixel owns coherent channel assembly, band projection, polarization contraction, and matrix-element inversion coordinates. diffpes.simul consumes these amplitudes in the spectral and detector pipeline.

The production spectral surface preserves complex transition sources through the final observable. diffpes.simul.spectral_intensity_resolvent is the degeneracy-safe path. spectral_intensity_eigen is a faster path for gauge-invariant band weights away from degeneracies. Both consume the causal self-energy returned by evaluate_self_energy.

diffpes.simul.simulate_arpes and simulate_arpes_cut compose that intrinsic observable with the canonical single-kz detector chain. They require explicit Hamiltonians and the complete matrix-element carriers. Each source domain is conservatively mapped into DetectorCalibration bins. Domains are mixed in detector space before transmission, native-coordinate resolution, background, sensitivity, exposure, and bin-volume conversion. There is no level-string workflow or projection-probability compatibility dispatcher.

Python indexing conventions

Use standard Python/NumPy indexing everywhere (zero-based, end-exclusive).

  • Non-s orbitals: slice(1, 9) -> indices 1..8
  • p orbitals: slice(1, 4) -> indices 1..3
  • d orbitals: slice(4, 9) -> indices 4..8

Do not use MATLAB-style indexing notation in Python code.

Example

import jax.numpy as jnp

import jax

from diffpes.simul import evaluate_self_energy, spectral_intensity_eigen
from diffpes.types import make_self_energy_model

omega = jnp.linspace(-1.0, 1.0, 501)
self_energy = evaluate_self_energy(
    omega,
    make_self_energy_model(gamma=0.08),
)
eigenvalues = jnp.array([-0.25, 0.30])
band_weights = jnp.array([0.8, 0.2])
intrinsic = jax.vmap(
    lambda energy, sigma: spectral_intensity_eigen(
        eigenvalues,
        band_weights,
        energy,
        sigma,
        1.0e-4,
    )
)(
    omega,
    self_energy,
)

Test coverage

Test coverage identifies the source lines that the tests execute. Run the coverage check with this command:

source .venv/bin/activate
pytest tests/ --cov=src/diffpes --cov-report=term-missing

Use these priorities to increase coverage toward 100%:

  1. Simulation and types: These modules already have good coverage. Add a test for each coherent matrix-element or spectral branch.
  2. HDF5: Round-trip every PyTree type. Test each load and save error path.
  3. VASP file readers: Test read_doscar, read_eigenval, read_kpoints, read_poscar, and read_procar with minimal repository fixtures.
  4. Plotting: Exercise the public plotting API in tests. GUI code can use a lower coverage target.
  5. Edge branches: Cover optional arguments and their error messages. Include make_band_structure(..., kpoint_weights=...).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffpes-2026.6.11.tar.gz (594.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffpes-2026.6.11-py3-none-any.whl (710.9 kB view details)

Uploaded Python 3

File details

Details for the file diffpes-2026.6.11.tar.gz.

File metadata

  • Download URL: diffpes-2026.6.11.tar.gz
  • Upload date:
  • Size: 594.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.6

File hashes

Hashes for diffpes-2026.6.11.tar.gz
Algorithm Hash digest
SHA256 3a0816e794db402c5bee4969504c23aa717f52d8d4299cf51b3ac14e8a3c6ef1
MD5 fe3ded0d3aea825951dd3c400e156cdf
BLAKE2b-256 d5192f4766af335945f6cd9ab8da35760ebd4605eebfe4f183b39b8fe2d686b9

See more details on using hashes here.

File details

Details for the file diffpes-2026.6.11-py3-none-any.whl.

File metadata

  • Download URL: diffpes-2026.6.11-py3-none-any.whl
  • Upload date:
  • Size: 710.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.6

File hashes

Hashes for diffpes-2026.6.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a4123e0b5a87123035215f1fddb72982a5b5bd1c34c909da9c6049b09b3296dc
MD5 cab350c104bb37c8c95182b7ca47adda
BLAKE2b-256 0743793c2fc8df14a28b0f2dc14ccd6f41c4f661cc2a5ebcf8ff728e81cd2d6b

See more details on using hashes here.

Release history Release notifications | RSS feed

2026.6.13

2 files

2026.6.12

2 files

This release

2026.6.11 This release

2 files

2026.6.9

2 files

2026.6.4

2 files

2026.6.3

2 files

2026.6.2

2 files

2026.6.1

2 files

2026.3.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page