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.12.tar.gz (614.0 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.12-py3-none-any.whl (735.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: diffpes-2026.6.12.tar.gz
  • Upload date:
  • Size: 614.0 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.12.tar.gz
Algorithm Hash digest
SHA256 c87208df497907bcc6f85ea12595fbe514e331555abacad1809fc5dcf784c8af
MD5 ca8b9bef9ae4b7388202d66a151a76bd
BLAKE2b-256 5815ce58892ff53fbdc7360b7446e0be559095f6f8954a51510ad6a28cc76b1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: diffpes-2026.6.12-py3-none-any.whl
  • Upload date:
  • Size: 735.0 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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 73861a745bb6f1e83091b7024de46422e4257e1963cd763235f9681d46832c1f
MD5 4e09f61ebc418ade7ea59f5e6f1b9e0c
BLAKE2b-256 75664ccf88911f7584329117fe00a1b4b08b72224348a2436817aec722710ae2

See more details on using hashes here.

Release history Release notifications | RSS feed

2026.6.13

2 files

This release

2026.6.12 This release

2 files

2026.6.11

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