Skip to main content

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)

Selecting nuclear data

Select neutron and photon data independently. Both settings start unset, and choosing one never sets the other:

yamc.neutron_cross_section_data = "fendl-3.2d"
yamc.photon_cross_section_data = "endf-b8.1"

Each accepts a library keyword, an existing local data directory, or a mapping: neutron mappings use nuclide names such as Fe56, and photon mappings use element symbols such as Fe. Assigning a mapping replaces that particle's selection; it does not turn one entry into a default for other species. None or an empty mapping unsets only that particle's selection. Explicit material data overrides remain supported.

Calculation Cross-section selection
Neutron transport neutron_cross_section_data
Primary-photon transport photon_cross_section_data
Coupled neutron-photon transport Both
D1S shutdown dose Both, plus explicit decay and activation sources
Standalone irradiation/transmutation Neutron data, plus explicit transmutation sources
Decay-only, activity, decay heat or contact-dose estimate Neither; decay data remains required

Neutron-induced photon production comes from the neutron evaluation; the photon selection controls the emitted photons' interactions, including the selected dataset's atomic relaxation. D1S emission instead uses the decay and activation settings. Thermal S(alpha,beta) tables follow the material's neutron library. The photon setting does not enable photonuclear transport.

Missing required data raises before transport instead of selecting another library. Selecting FENDL photons still selects FENDL photons: missing atomic relaxation is reported, not silently replaced by ENDF/B-VIII.1. Exported HTML also preserves particle-specific sources; local-only data must be embedded.

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 (both particle settings and 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 for simulate_transport are refused here too, and the coupled method does not take data_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.22.0

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

Built distributions (wheels)

Table of built distributions (wheels) for yamc-core 0.22.0
File Actions
yamc_core-0.22.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for yamc_core-0.22.0-cp310-abi3-win_amd64.whl
yamc_core-0.22.0-cp310-abi3-pyemscripten_2026_0_wasm32.whl CPython 3.10 abi3 PyEmscripten 2026.0+ WebAssembly Details for yamc_core-0.22.0-cp310-abi3-pyemscripten_2026_0_wasm32.whl
yamc_core-0.22.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.22.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
yamc_core-0.22.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for yamc_core-0.22.0-cp310-abi3-macosx_11_0_arm64.whl

Total release size: 87.9 MB

Release files / yamc_core-0.22.0-cp310-abi3-win_amd64.whl

Download URL yamc_core-0.22.0-cp310-abi3-win_amd64.whl
Size 33.3 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
00796cacfece2e818f3d6922887dac0ea7503bee6c496bf3240104637a2ae4cc
BLAKE2b-256 checksum
How to use checksums
9df58ab134f38837cd9d0d96f055cf8ea72fe6db212d0138cf7c3635ca67d52c
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 13, 2026.

Transparency log

Release files / yamc_core-0.22.0-cp310-abi3-pyemscripten_2026_0_wasm32.whl

Download URL yamc_core-0.22.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
acf3665dd6cf138b83c835fcc36e7921af76ec476a3b5b5b06fb801940494bc9
BLAKE2b-256 checksum
How to use checksums
36e2806c441cba5d8f93c0bab35ce53c71dc2065a58a30507216fbae86a8f0d9
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 13, 2026.

Transparency log

Release files / yamc_core-0.22.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL yamc_core-0.22.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 34.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
b2f2ec96878dc6d940db3c04827ad4d40bbc27ae88ff3827f0cee71d02ab1a89
BLAKE2b-256 checksum
How to use checksums
0f5100f38c2a230a58de3e9ec8e23ee11a22eabfbd0d18cb554d0b4593d3e4e0
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 13, 2026.

Transparency log

Release files / yamc_core-0.22.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL yamc_core-0.22.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
174debfe7160649353e8629389bbe05ec992ea634d111d03046f0b45803508fb
BLAKE2b-256 checksum
How to use checksums
412924bdc79a37d2e605945c2fe02a45c270a3ca2eb0d5b063a16367d3652e41
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 13, 2026.

Transparency log

Security for yamc-core 0.22.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.

Select from 4 files

Attestation for yamc_core-0.22.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 13, 2026.

Transparency log

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.

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