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.
Reliability: integral-equation residuals, explicit refinement reports, and weak-contrast absorbing-sphere validation against Mie theory.
Absorption and ensembles: passive absorbing materials and random fields, absorption uncertainty, and coherent/diffuse scattering decomposition.
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.7.0
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.7.0.tar.gz | 1.6 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bornsim-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.7 MB
Release files / bornsim-0.7.0.tar.gz
| Download URL | bornsim-0.7.0.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
04f64ee2ad067755dfc6191183b6634e1ad2224a65098577cc428fa2ef25fc8c
|
|
BLAKE2b-256 checksum How to use checksums |
d2d07dd60f11b13f89ea9061c985efc03ef62802906342896cd1cabbfbead128
|
| 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.7.0-py3-none-any.whl
| Download URL | bornsim-0.7.0-py3-none-any.whl |
|---|---|
| Size | 73.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
579463d2ce96078e8e0de179c4fe478df961b8c579efd591b4fd259c0369ac05
|
|
BLAKE2b-256 checksum How to use checksums |
51525a9e40fb4e7c9cf34f876319fb33aeddd479928f601f3754f3e7fffdc721
|
| 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.7.0
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.