Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

diffBloch

Coverage Python PyTorch NumPy Pydantic uv Ruff mypy License: MIT Docs

Differentiable Bloch-wave structure refinement for 3D electron diffraction.

📖 Documentation: https://diffbloch.com/ — Usage guide and API reference.

Quickstart

Prerequisite: install uv and Git LFS for the bundled .cif_pets experimental data and plan-checkpoint .npz checkpoints, then sync the project environment from the repository root:

git lfs install
git lfs pull
uv sync --dev

Run CLI commands through uv run unless you have separately installed the diffbloch console script on your shell PATH.

# Run the optimizer and update trainable structural parameters:
uv run diffbloch run refine examples/Colmey_et_al_2026/data/quartz-no-abs

For Developers

We welcome collaborations and interested parties may contribute to the codebase.

Every merge to main re-runs the end to end (e2e) physics anchors. These correspond to rapid tests of the codebase's key functionalities and integration. Specifically, the measured mean R_obs for the example quartz refinement is expected to remain the same upon changes made to the directory. This Fig. tracks the result of this test upon every merge; the shaded band is the pinned tolerance. A flat line inside the band is the desired outcome, evidence the physics is reproducible commit over commit. Gaps are commits with no valid measurement (the committed checkpoint was stale for that commit's recipe, so the fast anchor could not score it).

Mean R_obs of the quartz e2e test for every merge to main

Citation

If you use diffBloch in your research, please cite it as:

Doherty, T., Malik, S., Colmey, B., Maitland, I. & Midgley, P. (2026). diffBloch, version 0.2.0. https://github.com/Differentiable-Electron-Crystallography/diffBloch

Metadata

Release files for diffBloch 0.2.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for diffBloch 0.2.0rc1
File Size Uploaded Provenance Actions
diffbloch-0.2.0rc1.tar.gz 361.9 kB With provenance Details for diffbloch-0.2.0rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for diffBloch 0.2.0rc1
File Interpreter ABI Platform Actions
diffbloch-0.2.0rc1-py3-none-any.whl Python 3 none any Details for diffbloch-0.2.0rc1-py3-none-any.whl

Total release size: 763.6 kB

Release files / diffbloch-0.2.0rc1.tar.gz

Download URL diffbloch-0.2.0rc1.tar.gz
Size 361.9 kB
Tags Source
SHA-256 checksum
How to use checksums
11b6401ba1fa5136bbc1285d001153823d97a49d48b0d3285eab9c43db55148f
BLAKE2b-256 checksum
How to use checksums
8decaef13a913eea75e3f344040f748fec99cd0209d4532fbf4831090d708873
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Release files / diffbloch-0.2.0rc1-py3-none-any.whl

Download URL diffbloch-0.2.0rc1-py3-none-any.whl
Size 401.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95fe81855ea24b72c277bbdebf20dfc0e2d6f43ad29229bda89b996b4bec49d0
BLAKE2b-256 checksum
How to use checksums
6ab3b87899c17ffb7fdac48fb5bd0420f24ce305ce67b1f1ae99574478251899
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

Security for diffBloch 0.2.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for diffbloch-0.2.0rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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