Skip to main content

Free-Form SAS Inversion for SAXS/SANS

A package for the free-form inversion of Small Angle Scattering (SAS) problems arising from X-ray and Neutron sources.

This is a much improved algorithm and implementation over that proposed in the paper: https://journals.iucr.org/j/issues/2022/04/00/jl5041/index.html

SAS Inversion

Small Angle Scattering is used to probe and analyse the nanoscale structure of materials. An excellent introduction to (fixed-form) SAS inversion can be found in: https://journals.iucr.org/j/issues/2021/06/00/gj5274/gj5274.pdf

Free-Form SAS Inversion

Free-form SAS inversion seeks to determine the distributions of structural properties of nanoparticles (e.g. radius, length), but cruically (unlike conventional SAS inversion) does not make any assumptions about the forms these distributions take (hence free-form).

A Small Angle Scattering experiment records the intensity, i.e. squared amplitude, $I(q)$ of the scattered wave as a function of the scattering vector $q$. The scattering vector $q$ is itself a function of the small angle $\theta$ and is given by

q = \frac{4 \pi}{\lambda} \sin\left(\frac{\theta}{2}\right)

where $\lambda$ is the wavelength of the radiation source. For small angles, $\sin(\theta) \approx \theta$ and the scattering vector reduces to

q \approx \frac{2 \pi}{\lambda}\theta

i.e. essentially the small angle normalised by the wavelength of the radiation.

Form Factors (aka Green's Functions)

The form factor $F(q)$ describes the intensity $I(q)$ of scattering from a single nanoparticle over a full range of q and constitutes its SAS fingerprint. For example, the form factor $F(q)$ for a sphere of radius $r$ is given via $j_1(z)$ the spherical Bessel function of the first kind as

F(q) = \left[ V(r)\Delta\rho \dfrac{3j_1(qr)}{qr} \right]^2

where $V$ is the sphere volume and $\Delta\rho$ the scattering length density difference.

This repository currently contains the form factors for:

More form-factors will be added as the project progresses (as the code in this repository is vectorized and GPU accelerated, we are unable to directly use the form factors from SASView).

Polydispersity

In a real SAS experiment, we are likely to see a population of nanoparticles that possess size and/or orientational distributions, this is called polydispersity. The resultant intensity $I(q)$ is then averaged over the distributions. For example, for spheres with different radii,

I(q) = \int F(q,r) w(r) dr

where $w(r)$ is the distribution over the radius.

Metadata

Release files for ffsi 0.1.4

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

Source distribution (sdist)

Source distribution for ffsi 0.1.4
File Size Uploaded
ffsi-0.1.4.tar.gz 25.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ffsi 0.1.4
File Interpreter ABI Platform
ffsi-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 71.4 kB

Release files / ffsi-0.1.4.tar.gz

Download URL ffsi-0.1.4.tar.gz
Size 25.7 kB
Tags Source
SHA-256 checksum
How to use checksums
46ee0105d1993dbfce99953f8ba2be3da39cba13d87cbf894f30a263582c6ad2
BLAKE2b-256 checksum
How to use checksums
05ad2c6ea4e6c4f157d944b73964333a9398e7284791d7cf79f2997681c8d4bb
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 28, 2026.

Transparency log

Release files / ffsi-0.1.4-py3-none-any.whl

Download URL ffsi-0.1.4-py3-none-any.whl
Size 45.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e9a69cc4dfa849ae4eadd6e94908a51c8d4dabad002d235ff01773128c3176b
BLAKE2b-256 checksum
How to use checksums
70ce61b881b368a75645750a639959ae81addd5cde8307e1cb68aa58aed1e985
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 28, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.5

2 release files

This release

0.1.4 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 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