Skip to main content
Pre-release

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

fpm-rs

Reconstruct and simulate image-plane Fourier ptychographic microscopy (FPM) acquisitions from Rust or Python.

fpm-rs gives microscopy researchers and algorithm developers a CPU-based core for compiling illumination geometry, simulating measurements, and recovering a complex object. It supports image-plane FPM only: diffraction-plane ptychography, multislice propagation, and GPU execution are not implemented.

What it can do for you

  • Compile an optical model. Describe planar, spherical, calibrated, or coded illumination and turn it into Fourier-space sampling and a pupil.
  • Simulate an acquisition. Generate ideal or camera-affected intensity frames from synthetic or supplied complex objects.
  • Reconstruct the object. Start with alternating projection, or use FPIE, EPRY, ADMM, or gradient descent when their calibration and regularization options fit the experiment.
  • Keep a run inspectable. Record diagnostics, write checkpoints, and compare simulations with known ground truth. Optional Parquet support writes self-describing result and benchmark bundles for downstream analysis.
  • Measure at the right layer. Reusable reference/estimate metrics, optimization objectives, reconstruction evaluation, and recorder-driven diagnostics are separate APIs.

A typical workflow

  1. Compile the optics and illumination into an ImagePlaneModel.
  2. Load measured intensity frames, or simulate them from a known object.
  3. Build a ReconstructionProblem, run an algorithm, and inspect amplitude, phase, diagnostics, or checkpoints.

The same forward model is used for simulation and reconstruction, while algorithms consume the compiled model rather than experimental geometry.

Array layout contract

The Rust API uses native ndarray arrays and views. Pointwise utilities and metrics accept arbitrary logical layouts, including transposed and stepped views. Computational inputs whose kernels use flat Fourier-grid offsets—such as pupils, synthetic objects, measurement stacks, crop operations, and direct forward-model spectra—require standard C-style row-major layout. Those APIs validate the layout without copying and return a NonStandardLayout error for strided input. Owned result and diagnostic arrays are ordinary ndarray arrays. Result bundle export is a strict persistence boundary and rejects nonstandard result layouts rather than silently materializing a copy.

Python follows the same distinction. Metrics accept strided NumPy arrays. Reconstruction, simulation, pupil, and measurement inputs require C-contiguous arrays and raise an error suggesting numpy.ascontiguousarray; the caller therefore decides whether to pay for that copy. Accepted NumPy inputs are copied into Rust-owned storage at the binding boundary. Arrays opened through a result bundle are loaded on first access, cached, and exposed as immutable NumPy arrays.

Start here

Install the Python package:

python -m pip install fpm-rs

Then compile a small model, simulate it, and reconstruct it:

import numpy as np
import fpm_rs as fpm

optics = fpm.Optics(532e-9, 0.10, 4.0, 6.5e-6)
leds = fpm.LEDArray((3, 3), 4e-3, 90e-3, (1.0, 1.0))
model = fpm.compile_model(optics, leds, (32, 32))

simulation = fpm.simulate(
    model,
    np.ones(model.reconstruction_shape, dtype=np.complex128),
    seed=1234,
)
problem = fpm.ReconstructionProblem(
    simulation.measurements,
    simulation.reconstruction_model,
)
result = fpm.AlternatingProjection(iterations=20).run(problem)
print(result.amplitude.shape)

For the Rust equivalent, run:

cargo run --example simulate_and_reconstruct

Go deeper

License

fpm-rs is available under the MIT License.

Metadata

Release files for fpm-rs 0.2.0b1

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

Source distribution (sdist)

Source distribution for fpm-rs 0.2.0b1
File Size Uploaded
fpm_rs-0.2.0b1.tar.gz 247.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for fpm-rs 0.2.0b1
File
fpm_rs-0.2.0b1-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
fpm_rs-0.2.0b1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64 Details
fpm_rs-0.2.0b1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ ARM64 Details
fpm_rs-0.2.0b1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
fpm_rs-0.2.0b1-cp314-cp314-macosx_10_12_x86_64.whl CPython 3.14 CPython 3.14 macOS 10.12+ x86-64 Details
fpm_rs-0.2.0b1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
fpm_rs-0.2.0b1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
fpm_rs-0.2.0b1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64 Details
fpm_rs-0.2.0b1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
fpm_rs-0.2.0b1-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details
fpm_rs-0.2.0b1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
fpm_rs-0.2.0b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
fpm_rs-0.2.0b1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details
fpm_rs-0.2.0b1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
fpm_rs-0.2.0b1-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details

Total release size: 137.9 MB

Release files / fpm_rs-0.2.0b1.tar.gz

Download URL fpm_rs-0.2.0b1.tar.gz
Size 247.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d4c2de8c4e88767f5ee1fc9c335a4bdae79851042b07d065e7348426348b2cbe
BLAKE2b-256 checksum
How to use checksums
fa752298e921a0dc56d72c022acf7aba816198fd92e3c57d5ae35326eb25929a
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp314-cp314-win_amd64.whl

Download URL fpm_rs-0.2.0b1-cp314-cp314-win_amd64.whl
Size 9.9 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
fa1011fea7850fd544ce2b7f52e3fa3a818e55a67039c48d572469d1f190d485
BLAKE2b-256 checksum
How to use checksums
7017dc13ecd6ca88169dca997898d32293b5650477ecfb8f3d5a8f2e0f90df56
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL fpm_rs-0.2.0b1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 9.7 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
3d189f7716896274f247ff10fd8f4b245ddaa3875f28fb5a5946406fa958dbf2
BLAKE2b-256 checksum
How to use checksums
2380f58c0bf8f086a6657cdd931644ef84b80ca7f5f7aa2b44a6bccef847befe
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL fpm_rs-0.2.0b1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 8.8 MB
Tags CPython 3.14 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
d41995cdd431c724aedb5d77e206716232569275577a04c75d5923f3d1bfcbdf
BLAKE2b-256 checksum
How to use checksums
07a4d52b78a298b8abef6abbfccf5739513e0bc4fe376111859e310ce3dd4bde
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp314-cp314-macosx_11_0_arm64.whl

Download URL fpm_rs-0.2.0b1-cp314-cp314-macosx_11_0_arm64.whl
Size 8.4 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c8bead0432d1cf1eb9a8a8fa6877b155c6eaed2e9b63684df8b234a42720adac
BLAKE2b-256 checksum
How to use checksums
29b745f725af42dd1b6d6dd7563792b547759980db0ced5606802381584adca0
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp314-cp314-macosx_10_12_x86_64.whl

Download URL fpm_rs-0.2.0b1-cp314-cp314-macosx_10_12_x86_64.whl
Size 9.1 MB
Tags CPython 3.14 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
56205e21ed023ff1bb858b0a5c0f8d3cd07a14014adb89f55f094fcdaa36f046
BLAKE2b-256 checksum
How to use checksums
c1e8365d1925637e2d6f8dc93e05b8db89fe9fcce70a73b6834dc09db6adf0b4
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp313-cp313-win_amd64.whl

Download URL fpm_rs-0.2.0b1-cp313-cp313-win_amd64.whl
Size 9.9 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
273a1355127f846562b8560a380e4fec381a4e8a40b339bec825d71606f79395
BLAKE2b-256 checksum
How to use checksums
3d4bfefba37b3968a8f335e2472c53b2579896dfa9a3a44dda9adb22c8cbf252
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL fpm_rs-0.2.0b1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 9.7 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
45b15e915417b5095ad2e9144a781b03a50e5523934715e5126a86770314a059
BLAKE2b-256 checksum
How to use checksums
b746b33e7edc5659af1111b17e12797af697f0374ef282dfe4d3a19153191051
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL fpm_rs-0.2.0b1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 8.8 MB
Tags CPython 3.13 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
a222b412cab62ee390c13c5396870197fcfb74b007969dc2c5cd45a05c9d9d2a
BLAKE2b-256 checksum
How to use checksums
e59c72ce969821832d2d2ea2bd70efae6394f52c4594d5200fb00b5bb3741ac1
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp313-cp313-macosx_11_0_arm64.whl

Download URL fpm_rs-0.2.0b1-cp313-cp313-macosx_11_0_arm64.whl
Size 8.4 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6a3ac0dd4d3f5b941e2c0d1bb8645d6e09ae3cb7f9604829da1dd07c233825a1
BLAKE2b-256 checksum
How to use checksums
c711dc6f8973bc97adaeb2ecb970e7e79197b7c786a1f4e967288949681731fb
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp313-cp313-macosx_10_12_x86_64.whl

Download URL fpm_rs-0.2.0b1-cp313-cp313-macosx_10_12_x86_64.whl
Size 9.1 MB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
6e1bf4a7c94f3820ae0112b5567bf0a7de9a3ea34e2cddcbd4606c80a0977b30
BLAKE2b-256 checksum
How to use checksums
dcb68526065a59b813139857389e84ad9de0b93da8276e8a08b0519893ebfe36
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp312-cp312-win_amd64.whl

Download URL fpm_rs-0.2.0b1-cp312-cp312-win_amd64.whl
Size 9.9 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
a7bb52d03354029b0c1dba4f520409361cd4dc3ea06ab2ddb40bc2bee32bceb8
BLAKE2b-256 checksum
How to use checksums
40a78cc9b58dc6f169d7fd1ff5be44b13e45a05c353b4e9a2d1e31b61c993231
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL fpm_rs-0.2.0b1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 9.7 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
cb66c6c4450b1f8a605faf751f1c5ddaf50c4131d2d7cdc9de18d9582ec36adc
BLAKE2b-256 checksum
How to use checksums
d3af9bf365852ac27b7413c2bd2c5f409eec9bcc6d292f817c462a4ae1582353
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL fpm_rs-0.2.0b1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 8.8 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
14b321508dd9bac9e2ade4953c16bf57d96b49c71556d3101b7c52c382574aee
BLAKE2b-256 checksum
How to use checksums
58a3dbd28d572e8eca8a0a497b74f7feba4c7ae0e1f82e7293937abbb21f1b46
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp312-cp312-macosx_11_0_arm64.whl

Download URL fpm_rs-0.2.0b1-cp312-cp312-macosx_11_0_arm64.whl
Size 8.4 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
dae5594db627dc122e86913bf9b1d446b43a7e601a794c89306e120f9f850067
BLAKE2b-256 checksum
How to use checksums
69ab864b608d4a889875fb9957720ab800378dee24504095aa6b3ddd6e1efe6e
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 Aug 3, 2026.

Transparency log

Release files / fpm_rs-0.2.0b1-cp312-cp312-macosx_10_12_x86_64.whl

Download URL fpm_rs-0.2.0b1-cp312-cp312-macosx_10_12_x86_64.whl
Size 9.1 MB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b00cfad5666c018088af30bbe334ffad1c07b4a4c101bc1359e4747c48786843
BLAKE2b-256 checksum
How to use checksums
a6a8131689fa36b7d2f6c85231dc9792510d1c4063a885384dcd793062678741
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 Aug 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0b1 This release

16 release files

0.1.0

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