yamc-core
Yet Another Monte Carlo: neutron and photon transport for fusion neutronics. Constructive solid and mesh geometry, coupled neutron-photon transport, CAD import, flexible tallies and transport-coupled transmutation, with the whole solver in Rust.
This is the compiled distribution, and it provides the yamc module itself, so
the import name and the distribution name differ (as pillow provides PIL).
Install yamc rather than this: it pins the
matching version of this wheel and is where the documentation lives.
import yamc
# A point source inside a Li/Be sphere.
inner = yamc.Sphere(x0=0, y0=0, z0=0, radius=1.0)
outer = yamc.Sphere(x0=0, y0=0, z0=0, radius=200.0, boundary="vacuum")
breeder = yamc.Material(
composition={"Li6": 0.035, "Li7": 0.465, "Be9": 0.5},
density=2.0,
temperature=294,
)
breeder.read_nuclear_data({
"Be9": "tests/Be9.arrow",
"Li6": "tests/Li6.arrow",
"Li7": "tests/Li7.arrow",
})
void = yamc.Cell(name="void", region=inner.below)
blanket = yamc.Cell(name="blanket", region=inner.above & outer.below, material=breeder)
geometry = yamc.Geometry([void, blanket])
source = yamc.NeutronSource(
energy=yamc.sources.fusion_neutron_spectrum(20000.0),
position=(0, 0, 0),
)
tally = yamc.Tally(name="tbr", cells=blanket, scores=["H3-production"])
model = yamc.Model(geometry=geometry, tallies=[tally], source=source)
results = model.simulate_transport(total_particles=250_000, seed=1)
print(results[tally].mean)
CAD imprint threads
The CAD extra uses stable CadQuery from PyPI. Limit imprinting to fewer threads to reduce its peak RAM usage, at the cost of speed:
import cadquery
from yamc.cad import CadToYamc
assembly = cadquery.Assembly()
assembly.add(cadquery.Workplane().box(1, 1, 1), name="left")
assembly.add(cadquery.Workplane().box(1, 1, 1).translate((1, 0, 0)), name="right")
mesher = CadToYamc()
mesher.add_cadquery_object(assembly, ["steel", "aluminum"])
mesh = mesher.mesh_surfaces(imprint_threads=2)
Both mesh() and mesh_surfaces() accept imprint_threads="all" (the
default) or a positive integer. Only imprinting uses this setting: the prior
OCC thread-pool size and default launch count are restored before meshing,
including when imprinting fails. Skipped and single-solid imprints do not
change the thread pool. Glue behavior is unchanged.
Relationship to yani
yamc is a superset: it ships everything
yani has (materials, decay data,
irradiation schedules, inventories) plus neutron and photon transport,
geometry, tallies and transport-coupled transmutation. The two are
alternatives. Installing both puts two extension modules in one process, so
yamc.Material and yani.Material are distinct types and the nuclear-data
configuration (cross_section_data, the four transmutation_* sources) exists
twice, once per package.
Pick yamc when the neutron spectrum should come from a transport solve; pick
yani when you have a spectrum already and want none of the transport stack.
What it does not do
- Tally reliability checks include a relative-error check of every populated bin. Higher moments and the 201-sample tail fit remain aggregate checks, not per-bin tail guarantees. An unestimable tail gives an incomplete verdict, not a pass. Both figure-of-merit checks need at least 0.1 s of last-half history; mean stability uses a 95% Student-t slope test on disjoint block means rather than monotonic cumulative snapshots.
- Fixed-source transport only. No criticality or eigenvalue calculations.
- One transmutation stepper (
ForwardEulerStepper, beginning-of-step rates). No predictor-corrector. - Nuclear-data uncertainty covers MF=33 cross sections, plus the decay data
for transmutation.
simulate_transport(data_uncertainty=...)gives every tally a nuclear-data standard deviation and a replica mean beside its unchanged nominal mean, from one run whose histories carry a weight per cross-section replica. It supports CPU transport with track-length and collision-estimator tallies in every tracking mode, with survival biasing, weight windows, coupled and D1S photons (photon tallies carry the neutron data's uncertainty) and MPI, and refuses, with the reason, GPU, overlay tallies, mesh tallies and per-nuclide bins.simulate_transmutation(method="independent", data_uncertainty=...)gives a standard deviation on inventories, activity and decay heat. Its one transport carries the same replica weights and tallies every reaction rate once per replica, so each replica's rates carry the flux's response to its own cross sections (self-shielding, shield transmission). The transport configurations the weights refuse forsimulate_transportare refused here too, and the coupled method does not takedata_uncertainty.
- Pathways are reported per product (
get_production_routes), but there is no automatic pathway search across the whole inventory.
Metadata
Release files for yamc-core 0.20.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| yamc_core-0.20.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for yamc_core-0.20.0-cp310-abi3-win_amd64.whl |
| yamc_core-0.20.0-cp310-abi3-pyemscripten_2026_0_wasm32.whl | CPython 3.10 | abi3 | PyEmscripten 2026.0+ WebAssembly | Details for yamc_core-0.20.0-cp310-abi3-pyemscripten_2026_0_wasm32.whl |
| yamc_core-0.20.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details for yamc_core-0.20.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| yamc_core-0.20.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for yamc_core-0.20.0-cp310-abi3-macosx_11_0_arm64.whl |
Total release size: 87.6 MB
Release files / yamc_core-0.20.0-cp310-abi3-win_amd64.whl
| Download URL | yamc_core-0.20.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 33.2 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b42bb8811d22067ab2f49b38d1481b39a8849c541582c8b44fa2f707ac789b7f
|
|
BLAKE2b-256 checksum How to use checksums |
33be3d8803a809e53708ffff192d3429cb8000bf31108fd648d167b75db4afa6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 11, 2026.
Transparency logRelease files / yamc_core-0.20.0-cp310-abi3-pyemscripten_2026_0_wasm32.whl
| Download URL | yamc_core-0.20.0-cp310-abi3-pyemscripten_2026_0_wasm32.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.10 PyEmscripten 2026.0+ WebAssembly abi3 |
|
SHA-256 checksum How to use checksums |
f33702f72e64ea482b561f79f963415c6f563d6d3622cca1a851fb86dfba7101
|
|
BLAKE2b-256 checksum How to use checksums |
effba2260c9026c6c8a9367ad5480bded7dcc6910e61575a4818e3e3272c9964
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 11, 2026.
Transparency logRelease files / yamc_core-0.20.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | yamc_core-0.20.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 34.0 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
1199b5da95366c3c72f80bf5ed9facf5938bd3bf0a1bff26f34bae24b2f2dc0e
|
|
BLAKE2b-256 checksum How to use checksums |
caf9ddfa8afbad27d9097ec70f77879ed02015b9e1b764fb405f62b2b68e2e5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 11, 2026.
Transparency logRelease files / yamc_core-0.20.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | yamc_core-0.20.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 14.2 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
34cf7e2b6a744da1dae3c66b6b94f7709a1fa7f9c852f073d66569485c4f06a3
|
|
BLAKE2b-256 checksum How to use checksums |
7f8dd440638465ec7e81acf26c83768e9d7419d7f5c7340bb397ed1896c99c6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 11, 2026.
Transparency logSecurity for yamc-core 0.20.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 4 files in this release have been uploaded with provenance metadata.
Attestation for yamc_core-0.20.0-cp310-abi3-win_amd64.whl
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 Nov 11, 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.