BornSim
Vector Born-series scattering from continuous, isotropic random media.
Python |
|
Documentation |
|
Tests |
|
Quality |
|
Coverage |
|
Release |
|
License |
BornSim models how light scatters from three-dimensional refractive-index fluctuations. Build a random or structured medium, solve its coherent Born series, and inspect angular scattering, phase functions, \(\mu_s\), anisotropy \(g\), and reduced scattering \(\mu_s'\).
3D medium opacity |
3D SPF surface |
The left view shows the simulated refractive-index volume; opacity is a visual encoding, not absorption. The right view shows the normalized scattering phase function in direction space. Both figures are generated from the same BornSim-style workflow below.
Quick start
from bornsim import EnsembleSampling, Grid, Solver, Source
from bornsim.medium.random_medium import GaussianMedium
from bornsim.units import ureg
grid = Grid(shape=(16, 16, 16), spacing=50 * ureg.nanometer)
medium = GaussianMedium(
background_refractive_index=1.33,
refractive_index_std=0.01,
correlation_length=100 * ureg.nanometer,
)
solver = Solver(
source=Source(wavelength=633 * ureg.nanometer),
order=3,
)
result = solver.ensemble(
medium=medium,
grid=grid,
ensemble_sampling=EnsembleSampling(realizations=4, seed=42),
)
print(result.mu_s.to("1 / millimeter"))
print(result.g)
print(result.mu_s_prime.to("1 / millimeter"))
result.plot()
For one fixed structured sample, use solver.solve(target=volume). The result can also be visualized directly:
volume = medium.to_volume(grid=grid, seed=42)
medium_figure = volume.plot_3d(
field="refractive_index",
opacity_scale="increasing",
)
phase_figure = solver.solve(target=volume).plot_phase_function(view="3d")
medium_figure.write_html("medium.html", include_plotlyjs=True)
phase_figure.write_html("phase_function.html", include_plotlyjs=True)
What BornSim models
Media: Gaussian, exponential, and Whittle–Matérn random fields, seeded random spheres, and composable structured geometry.
Numerics: vector volume-integral propagation with configurable Born order, angular quadrature, grid spacing, and ensemble sampling.
Results: differential scattering, full directional phase functions, cross sections, uncertainty estimates, saved provenance, and Matplotlib or Plotly visualizations.
Units: explicit physical units for wavelengths, lengths, angles, and scattering coefficients through bornsim.units.ureg.
Installation
BornSim requires Python 3.11 or newer.
$ python -m pip install BornSim
For development:
$ git clone https://github.com/MartinPdeS/BornSim.git
$ cd BornSim
$ python -m pip install -e ".[testing,documentation]"
$ python -m pytest tests
Learn more
Documentation — theory, API reference, numerical conventions, and visualization guidance.
Examples — random media, structured samples, Born orders, validation, and result plots.
Medium visualization guide — interactive 3D volume and phase-function views.
Repository — issues and contributions.
Scientific scope
BornSim uses the linearized dielectric contrast \(\delta\varepsilon \approx 2 n_0 \delta n\). Its coefficients describe finite numerical samples and are not automatically intrinsic infinite-medium transport coefficients. Check grid, angular, sample-size, synthesis-box, and ensemble convergence before interpreting results quantitatively.
License
BornSim is released under the MIT License. See LICENSE.
Metadata
Release files for BornSim 0.5.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bornsim-0.5.7.tar.gz | 2.1 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bornsim-0.5.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.1 MB
Release files / bornsim-0.5.7.tar.gz
| Download URL | bornsim-0.5.7.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6390bf14e61a754793ad9baf0cd0df6ff2f92006497229356d38b32c16490968
|
|
BLAKE2b-256 checksum How to use checksums |
60bcf921bf6ec4a349e09cd4c44b8ef9dce5139bc1b39b16cb7401b618da435a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|
Release files / bornsim-0.5.7-py3-none-any.whl
| Download URL | bornsim-0.5.7-py3-none-any.whl |
|---|---|
| Size | 62.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
642ce68011ce11356130d175ba573e408554e4baf00c5ff425a5c5fa531d803e
|
|
BLAKE2b-256 checksum How to use checksums |
bc9d3c97ff4c0686f478e94f168fe851a87306ae3015b825c947b72d37c4f2af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.17
|
Security for BornSim 0.5.7
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.