biem-helmholtz-sphere
Documentation: https://biem-helmholtz-sphere.readthedocs.io
Source Code: https://github.com/ultrasphere-dev/biem-helmholtz-sphere
Acoustic scattering from multiple n-spheres in NumPy / PyTorch
Installation
Install this via pip (or your favourite package manager):
pip install biem-helmholtz-sphere
Usage (GUI)
uvx biem-helmholtz-sphere serve
Usage
Boundary Integral Equation Method (BIEM) for the Helmholtz equation.
Let $d \in \mathbb{N} \setminus \lbrace 1 \rbrace$ be the dimension of the space, $k$ be the wave number, and $\mathbb{S}^{d-1} = \lbrace x \in \mathbb{R}^d \mid |x| = 1 \rbrace$ be a unit sphere in $\mathbb{R}^d$. Let $B := {0, ..., }$ be the index set of spheres, $c_b \in \mathbb{R}^d$ be the center of sphere $b \in B$, and $\rho_b > 0$ be the radius of sphere $b \in B$. Assume that the closure of spheres do not overlap, i.e.,
$$ \forall b, b' \in B, b \neq b', |c_b - c_b'| > \rho_b + \rho_b' $$
Asuume that $u_\text{in}$ is an incident wave satisfying the Helmholtz equation
$$ \Delta u_\text{in} + k^2 u_\text{in} = 0 $$
and scattered wave $u$ satisfies the following:
$$ \begin{cases} \Delta u + k^2 u = 0 \quad &x \in \mathbb{R}^d \setminus \overline{\mathbb{S}^{d-1}} \ \alpha u + \beta \nabla u \cdot n_x = -\alpha u_\text{in} -\beta \nabla u_\text{in} \cdot n_x \quad &x \in \mathbb{S}^{d-1} \ \lim_{|x| \to \infty} |x|^{\frac{d-1}{2}} \left( \frac{\partial u}{\partial |x|} - i k u \right) = 0 \quad &\frac{x}{|x|} \in \mathbb{S}^{d-1} \end{cases} $$
The following code assumes
$$ d = 3, k = 1, u_\text{in} (x) = e^{i k x_0}, c_0 = (0, 2, 0), c_1 = (0, -2, 0), \rho_0 = 1, \rho_1 = 1, \alpha = 1, \beta = 0 \quad \text{(Sound-soft)} $$
and computes the scattered wave at $(0, 0, 0)$.
>>> from array_api_compat import numpy as xp
>>> from biem_helmholtz_sphere import BIEMResultCalculator, biem, plane_wave
>>> from ultrasphere import create_from_branching_types
>>> c = create_from_branching_types("ba")
>>> uin, uin_grad = plane_wave(k=xp.asarray(1.0), direction=xp.asarray((1.0, 0.0, 0.0)))
>>> calc = biem(c, uin=uin, uin_grad=uin_grad, k=xp.asarray(1.0), n_end=6, eta=xp.asarray(1.0), centers=xp.asarray(((0.0, 2.0, 0.0), (0.0, -2.0, 0.0))), radii=xp.asarray((1.0, 1.0)), kind="outer")
>>> complex(xp.round(calc.uscat(xp.asarray((0.0, 0.0, 0.0))), 6))
(-0.741333-0.669657j)
Accuracy
- The radius of spheres is fixed to
1.0. - The incident wave is $u_\text{in} (x) = e^{i k x_0}$.
- For
n_balls == 2, spheres are centered at(0, 2, 0, ...)and(0, -2, 0, ...). - For
n_balls == 4, ..., spheres are placed in 2D grid pattern with distance of4.0between adjacent spheres.
vs Wavenumber k
2D
3D
vs Number of Spheres n_balls
2D
Citation
Consider citing the following paper if you use this package in your research:
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Credits
This package was created with Copier and the browniebroke/pypackage-template project template.
Metadata
Release files for biem-helmholtz-sphere 1.2.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 | Actions |
|---|---|---|---|---|
| biem_helmholtz_sphere-1.2.0.tar.gz | 27.1 kB | With provenance | Details for biem_helmholtz_sphere-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| biem_helmholtz_sphere-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for biem_helmholtz_sphere-1.2.0-py3-none-any.whl |
Total release size: 51.1 kB
Release files / biem_helmholtz_sphere-1.2.0.tar.gz
| Download URL | biem_helmholtz_sphere-1.2.0.tar.gz |
|---|---|
| Size | 27.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d59bb0441628620a139872fc84321396dff794ef20755177c5fbb76fb0e01d3d
|
|
BLAKE2b-256 checksum How to use checksums |
991f06d3160e7c0135df4d73f716811fd558f096b48b553562aa988f8c8b010a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.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.
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 Feb 7, 2026.
Transparency logRelease files / biem_helmholtz_sphere-1.2.0-py3-none-any.whl
| Download URL | biem_helmholtz_sphere-1.2.0-py3-none-any.whl |
|---|---|
| Size | 24.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
27e85e4f3d209a367eff8e6fbea270fe292bb8017cdc8c25044d1e0f3b8c9f52
|
|
BLAKE2b-256 checksum How to use checksums |
13d78f8dc9895fcfe5095c9075045f6e5e4f87c36cc9a5a5bdb847a88ccf6d24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.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.
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 Feb 7, 2026.
Transparency logSecurity for biem-helmholtz-sphere 1.2.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for biem_helmholtz_sphere-1.2.0.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 Feb 7, 2026.
Transparency logA 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.