Download environment/library-agent/tools/physics_tool_c2/TOOL_README.md from Dynamical-Systems/sdl2: direct link, hf CLI and curl.
- Browser
- Download file 32 kB
-
https://huggingface.co/datasets/Dynamical-Systems/sdl2/resolve/main/environment/library-agent/tools/physics_tool_c2/TOOL_README.md
- Command line
-
hf download hf://datasets/Dynamical-Systems/sdl2/environment/library-agent/tools/physics_tool_c2/TOOL_README.md
-
curl -L -o TOOL_README.md https://huggingface.co/datasets/Dynamical-Systems/sdl2/resolve/main/environment/library-agent/tools/physics_tool_c2/TOOL_README.md
NdFeB SPS physics-model tool (owner-built; numpy-only), package C2
Owner-built. This is Dynamical's model, fitted to RPI's released records. It is not an RPI or collaborator model, and its assumptions about those records are model choices, listed under "Fitted assumptions" below.
What it is. A conditional executable physics model of spark-plasma-sintered, Dy/Tb-free NdFeB. It is a hierarchical Bayesian process → density → grain size → coercivity → remanence → energy-product chain, fitted to the historical specimens A–E, the sample E anneal series, the slide-18 density series and the densities of bodies #1–#4, with declared literature priors. It averages competing mechanism hypotheses for densification (D1 diffusion, D2 creep, D3 liquid-phase, D0 other) and for coercivity (H1 residual hydrogen, H2 grain-boundary liquid continuity, H3 α-Fe/decomposition, H4 grain size/Kronmüller, H5 open porosity/oxidation, H0 other). It also carries three declared explanations of why load applied during heating lowers coercivity (the load-timing indicator; see "Load timing").
Evidence class: owner-built conditional executable physics model (Dynamical's model fitted to RPI's released records and declared literature priors; not an RPI or collaborator model); not a physical observation; does not calibrate current-body coercivity.
Limits you should know before using it.
- Only four independent magnetic specimens exist (A, C, D, E pellet), all at 850–950 °C and ≥ 97 %TD.
No body #1–#4 has magnetic data, so coercivity predictions for porous bodies at 750–850 °C are extrapolations. They are driven mainly by priors and by which mechanism is right; the outputs say so
(
prior_dominated,mechanism_dominated,out_of_hull). - RPI's bodies are isotropic (⟨cos θ⟩ = 0.5): Br ≲ Js/2 ≈ 8 kG and (BH)max ≲ Br²/4 (≈ 13–16 MGOe at full density).
The objective (Hci ≥ 20 kOe and ~45–48 MGOe, Dy/Tb-free, at operating temperature) needs Br ≥ 13.4 kG, i.e. grain
alignment.
alignment_cosandT_measure_Care declared scenarios, never calibrated. - The coercivity-mechanism weights are close to their prior: the historical data barely discriminate the mechanisms in
the current regime. Use
eigto see which measurement would. - The load-timing weights are at their prior (see "Load timing"). One historical contrast (D vs E) cannot separate the three explanations.
- The residual-hydrogen mechanism (H1) did not fully converge: its fits reach R-hat 1.014–1.018 over 8 chains (the criterion is 1.01; effective sample sizes are adequate). H1 carries 0.007 of the coercivity-mechanism weight.
- The coercivity-mechanism weights are evidence-uncertain: the evidence estimators disagree, and moving each model's evidence within the spread of its own estimates moves these weights by more than a factor of 3: H1 0.003–0.020, H2 0.093–0.286, H3 0.089–0.348, H5 0.072–0.298, H0 0.078–0.353.
- Degassing enters the fit at two states only. The model assumes samples A–C correspond to completeness 0 and D/E to completeness 1; RPI's record does not state A–C's dehydrogenation. Intermediate completeness is interpolated, and completeness above 1 and complete degassing are declared extrapolations.
Load timing: three declared explanations
RPI's historical specimens D and E were both made from degassed powder at 850 °C and reached near full density. D had the load applied during heating (conventional SPS) and reached Hci 2.86 kOe; E had the load applied only on cooling and reached 7.71 kOe. Three explanations are declared, and every coercivity mechanism H0–H5 is combined with each of them:
trap, hydrogen trapping. Load applied during heating closes the porosity before residual hydrogen escapes; the trapped hydrogen degrades the grain-boundary phase. The penalty follows the hydrogen trapped by early pore closure, beyond what an open-pore schedule would leave. It is zero for load on cooling and vanishes when degassing is complete (degas_completeness: "complete"), whatever the load schedule.load, load timing itself. Load acting while the Nd-rich grain-boundary phase is liquid or soft squeezes it to the triple junctions, independent of hydrogen. The penalty follows the time-integrated load while the boundary phase is soft (midpoint prior 700 ± 40 °C, above the 655–665 °C ternary eutectic). It persists with complete degassing; it grows with slow cooling under load, slow load ramps and a dwell under load, and shrinks with faster heating.current, current path. With the load on, punch–compact contact routes the pulsed current through the compact and overheats the particle necks, independent of hydrogen. The penalty grows with heating rate (current density) and peak temperature, persists with complete degassing, and is absent when the compact carries no current (load on cooling, orcurrent_path: "insulated").
How they enter: ln Hci = (mechanism H) − b_LT · Π(route), where b_LT is the penalty at RPI's D route relative to E (fitted from the D–E contrast, shared by the three explanations) and Π is the explanation's normalised penalty: exactly 1 at D's route, exactly 0 at E's route, and saturating (each explanation's damage cannot exceed a bounded multiple of D's). Every explanation therefore reproduces D and E; they differ only away from those two routes.
Fitted weights. trap 0.37, load 0.28, current 0.35 (within the coercivity mechanisms: trap 0.33–0.96, load 0.02–0.43, current 0.02–0.58; with each model's evidence moved within the spread of its own estimates: trap 0.21–0.59, load 0.14–0.43, current 0.20–0.54). They are prior-dominated: the prior is 1/3 each, the historical records (A–E) contain no route that separates the explanations, and the two evidence estimators disagree by up to 3.5 nats for a single model, more than most differences between labels. One exception: within H1 (residual hydrogen), trap carries 0.96, because that pairing alone lets hydrogen also account for the non-degassed sample C; H1 itself carries 0.007 of the coercivity-mechanism weight. The weights rest on the evidence of single-label models
(each coercivity mechanism fitted once per explanation): bridge sampling on the NUTS draws (36 estimates) and SMC runs of 6000 particles x 80 moves (36 estimates) over the 18 single-label models; 18 models have two or more estimates, whose spread is 0.90 nats at the median and 3.50 nats at the largest. Each model's evidence is the median of its estimates.
Measurements that separate them (rank candidates with eig): a crossed design of complete degassing (confirmed by a
hydrogen measurement) × load in heating vs on cooling (trap predicts the penalty disappears; load and current do not);
load in heating with an electrically insulated compact (current predicts the penalty disappears); heating rate under
load in heating, 10 vs 50 °C/min (current: larger penalty; load: smaller; trap: slightly larger); load on cooling with
slow cooling or a slow load ramp, or load from the start of the dwell (load predicts a penalty; trap and current
predict little or none on cooling).
Where to read them. predict(...)["outputs"][<magnetic output>]["by_load_timing"] (median, q05, q95, n per
explanation), mechanism_weights["load_timing"], p_meets_spec(...)["by_load_timing"], and condition() updates the
weights with new observations.
Fitted assumptions (model choices; RPI has not stated these)
Each is a choice the fit makes where the released record is silent or partial.
- A–C at degassing completeness 0, D and E at completeness 1. The record does not state A–C's dehydrogenation. The two states anchor the completeness scale.
- Owner-digitized Hk and (BH)max for D and E from the deck curves. The (BH)max shape calibration across those curves has a log-sd of 0.033 (about ±3 %).
- Load-timing alternatives are normalised at RPI's D and E routes (see "Load timing"). D and E are taken as the slide-12 rows: 850 °C, 10 °C/min, 10 min, 50 MPa, degassed; D with the load through heating, E with 0→50 MPa over 850→700 °C on cooling (1.5 min).
- Degassing in the planned route (600 °C, 15 min, sealed quartz) is treated as the fitted D/E state (completeness 1; D and E were degassed 600 °C/10 min). This is not calibrated.
- Pore closure for the hydrogen-trapping explanation at or below 850 °C (prior on the closure temperature truncated at 850 °C). This is a prior choice informed by the near-full density of historical A, C and D, which had the load during heating and reached ≥ 97.7 %TD after 850–950 °C dwells; it is not a measurement.
- #1–#3 pooled as one preparation (
PREP-C750) and #4 as its own preparation (PREP-C800): RPI stated the same degassing set-point for all batches and a new degassed batch for 800 °C. - Route conditions in the density fit: #1–#3 load on cooling (RPI's records); #4 load on cooling inferred from its trace (displacement jump at T_peak), not stated by RPI; 60 MPa and 5 min (panel plan where delivered settings were not supplied); cooling rates and load ramps from the owner's readings of the display traces.
- Default load ramp 0.3 min (
load_ramp_min): the owner's reading of the display traces (75–80 % of the early-cooling displacement rise within about 15–21 s). Sample E's slide-12 row is 1.5 min. - Default cooling rate 100 °C/min: E's slide-12 segment; the traces read 90–103 °C/min.
Artifact hashes (sha256)
| file | sha256 |
|---|---|
| ndfeb_physics_tool.py (tool module) | 683baabf1c8ec7d10d362aa6e0da8aa23818ae6a3bd8a2d33ff002512f9dc995 |
| physics.py | 444139f68fedcd65ca2f32cf1b92db02028e1573b033efdc8923878ab459411c |
| forward.py | 006ab6cad8859ecc4fe73a014805ef7fe3aca863dfd3af4ffe3acb724b7bb63a |
| posterior_tool.npz (thinned posterior + prior draws) | dd198156b153bf63b79586f1a6cb44ba7774d273f250153bf71d59a88ca902c6 |
| TOOL_MANIFEST.json | 8742f369042ca23da81f75096ecf0604902d0d78f2813e98e61fc6e514b4013f |
Loading (files are mounted by sha256, without names)
import importlib.util
from importlib.machinery import SourceFileLoader
raw = '/workspace/raw/'
TOOL, PHYS, FWD, POST, MAN = ('683baabf1c8ec7d10d362aa6e0da8aa23818ae6a3bd8a2d33ff002512f9dc995', '444139f68fedcd65ca2f32cf1b92db02028e1573b033efdc8923878ab459411c', '006ab6cad8859ecc4fe73a014805ef7fe3aca863dfd3af4ffe3acb724b7bb63a', 'dd198156b153bf63b79586f1a6cb44ba7774d273f250153bf71d59a88ca902c6', '8742f369042ca23da81f75096ecf0604902d0d78f2813e98e61fc6e514b4013f')
loader = SourceFileLoader('ndfeb_physics_tool', raw + TOOL)
spec = importlib.util.spec_from_loader('ndfeb_physics_tool', loader)
tool = importlib.util.module_from_spec(spec); loader.exec_module(tool)
pm = tool.load(physics=raw + PHYS, forward=raw + FWD, posterior=raw + POST, manifest=raw + MAN)
load(..., manifest=...) verifies every file's sha256 against the manifest. Pass all five hashes in
compute(..., artifact_sha256s=[...]). Results are deterministic for a given seed.
Routes (inputs and units)
A route is a dict. Only T_peak_C is required. The defaults follow RPI's planned panel route and the #1–#4 records (see "Fitted assumptions").
Unknown values of pressure_mode, anneal, current_path and degas_completeness raise an error.
| key | default | meaning |
|---|---|---|
T_peak_C |
— | peak (dwell) temperature, °C |
heating_rate_C_per_min |
10 | ramp rate |
dwell_min |
5 | dwell at peak, minutes |
P_MPa |
60 | applied pressure |
pressure_mode |
"cooling" |
"cooling": no load during heating/dwell, load applied at T_peak on cooling; "heating": load ramps up during heating and is held (conventional SPS); "dwell": no load during heating, load rising from the start of the dwell and held through dwell and cooling (a declared scenario: no record uses it, so both modules report out_of_hull and calibrated is false) |
cooling_rate_C_per_min |
100 | |
load_ramp_min |
0.3 | "cooling"/"dwell" mode: minutes for the load to rise from 0 to P_MPa (owner readings of the #1–#4 display traces ≈ 0.3; sample E 1.5) |
degas |
1.0 | probability that the 600 °C dehydrogenation step was applied at all (0–1). The default is an assumption, not a record |
degas_completeness |
1.0 | how complete that step was, as a fraction d of the fitted D/E state: a number in [0, 1.5], {"distribution": "uniform", "low": .., "high": ..} (0 ≤ low ≤ high ≤ 1.5), {"distribution": "beta", "a": .., "b": ..} (a, b > 0), or "complete". d > 1 is a declared extrapolation (ln Hci gains ε·(d − 1) times the draw's own completeness-0-to-1 change, ε ~ U(0, 1)). "complete" is a declared scenario: no residual hydrogen at the start of sintering (H1's hydrogen term and the trap penalty see none; the other mechanisms' generic degassing terms stay at the fitted D/E state). The effective state of a draw is occurrence × d. Routes or observations that share a prep must share degas_completeness (one powder batch). Batch records or a hydrogen measurement pin d; until then it is not calibrated |
current_path |
"compact" |
"compact": a loaded compact in a conductive graphite die carries the pulsed current (RPI lines its die with graphite foil); "insulated": the compact is electrically isolated (e.g. a BN-coated or alumina-lined die), so the current penalty is zero. "insulated" is a declared scenario |
anneal |
"none" |
"none", "900" (900 °C/2 h) or "900+520" |
prep |
"new" |
preparation: "new" (fresh lot effect) or a fitted one: PREP-HIST-ND, PREP-HIST-DG, PREP-S18, PREP-C750 (#1–#3), PREP-C800 (#4). Any other label (e.g. "new-A", "new-B") is a distinct new preparation: routes and observations with the same label share its preparation effect and degas state (one powder batch), so they must share degas_completeness; give each powder batch, such as each degassing arm of a design, its own label |
alignment_cos |
0.5 | ⟨cos θ⟩; 0.5 = isotropic. Other values are a declared scenario |
T_measure_C |
20 | measurement/operating temperature, °C; ≠ 20 is a declared scenario |
Functions
pm.predict(route, n_draws=4000, seed=0, rho_observed=None, rho_scenario=None) → dict with:
outputs[name]fordensity_rel,grain_um,Hci_kOe,Br_kGs,Hk_over_Hci,BHmax_MGOe, each with:median,mean,sd,q05,q25,q75,q95(floats),quantiles(dictq01,q025,q05,q10,q25,q50,q75,q90,q95,q975,q99),mu_lnandsd_ln(a quantile-matched log-normal approximation over the positive draws),lognormal_adequate(bool) andlognormal_max_log_error(largest |ln q − (mu_ln + z_q·sd_ln)| over q05–q95; adequate below 0.25;null/ false when fewer than 10 draws are positive or a central quantile is ≤ 0),frac_nonpositive,by_mechanism(dict mechanism → {median, q05, q95, n}),by_load_timing(magnetic outputs: dict explanation → {median, q05, q95, n}),posterior_to_prior_spread_ratio(squared IQR ratio, log scale except density and Hk/Hci),between_mechanism_share,prior_dominated,mechanism_dominated,conditioned_on_observed_density,density_scenario_declared(bools).outputs["density_g_cm3"]carries the summary statistics andquantilesonly.- Recording a forecast: record the
quantiles, not mean ± sd. The magnetic predictives are skewed mixtures over mechanisms, load-timing explanations and degassing states.forecast_record()returns a ready-to-store record. flag_rules(text) states how the flags are computed.out_of_hull:{"density": {...}, "magnetic": {...}}, each withdistance(standardised),out_of_hull(bool) andoutside_features(declared scenarios outside every record, such aspressure_mode=dwell,current_path=insulatedanddegas_completeness=complete, are listed here and setout_of_hull).mechanism_weights: nested,{"density": {"D1": w, ...}, "magnetic": {"H1": w, ...}, "load_timing": {"trap": w, "load": w, "current": w}}.ceilings,objectiveandscenarios(alignment_cos,T_measure_C,degas_occurrence_probability,degas_completeness,degas_extrapolation_beyond_fitted_state,degas_complete_declared,current_path,pressure_mode_dwell_declared, andcalibrated: true only at isotropic alignment, 20 °C, completeness 0 or 1, a current-carrying compact and load in heating or on cooling).rho_observed(g/cm³ or relative): conditions the magnetics on a measured density (an existing body; a fixed 0.005 relative spread). For a body not yet made, passrho_scenario={"mean": .., "sd": ..}(g/cm³ if the mean is above 1.5, else relative): the magnetics then carry that density uncertainty. Passing both raises an error. Withrho_observedthe result carries arho_observed_note.- Predictions are for a measured new body (specimen-to-specimen and measurement scatter included).
pm.p_meets_spec(route, spec, n_draws=6000, seed=0, rho_observed=None, rho_scenario=None) → posterior probability
that one body meets the spec. Spec keys (all optional, at least one): Hci_kOe_min, BHmax_MGOe_min, Br_kGs_min,
density_rel_min, T_operating_C; an unknown key or a non-numeric value raises an error. Returns p_meets_spec,
monte_carlo_se, marginals (per spec key), by_magnetic_mechanism, by_load_timing, mechanism_weights (flat,
magnetic only), load_timing_weights, prior_predictive_p, prior_dominated, out_of_hull,
no_draw_meets_spec (true when no posterior and no prior-predictive draw meets the spec; then p_upper_95 = 3 /
n_draws is a 95 % upper bound on the probability, and prior_dominated reads false), scenario_not_calibrated,
scenarios.
pm.forecast_record(route, body_id=None, rho_observed=None, n_draws=8000, seed=0, outputs=("density_rel", "Hci_kOe", "Br_kGs", "BHmax_MGOe", "Hk_over_Hci"), rho_scenario=None) → a committed-forecast record (schema
ndfeb-forecast-record-v1): body_id (your neutral identifier), the resolved route, scenarios, conditioning
(rho_observed, rho_scenario), per output quantiles, mu_ln, sd_ln, lognormal_adequate,
lognormal_max_log_error, median, frac_nonpositive and the flags, out_of_hull, mechanism_weights, n_draws,
seed, quantile_levels, units, tool_version and artifact_sha256. It is deterministic for a given seed and
strictly JSON-serialisable.
Hydrogen measurements ("H_ppm" in eig) are modelled on the model's residual-hydrogen index of the sintered
body (1 = the hydrogen of non-degassed powder; pore closure follows the load mode), with a declared log-sd of 0.25
and a declared detection limit of 0.01 on that index: a body below it, such as one made from completely degassed
powder, reads at the limit. Both numbers are assumptions, not calibrations.
pm.eig(candidates, n_outer=1500, n_inner_per_mechanism=None, seed=0, target=None, goal=None, method="v4") ranks
candidate experiments by expected information gain (EIG, in nats). Each candidate is {"name": str, "measurements": [...]}, and each measurement is one body: {"route": {...}, "rho_observed": optional, "quantities": [...], "replicates": 1}. Quantities come from "Hci", "Br", "sq" (Hk/Hci), "density", "grain" (SEM), "H_ppm"
(hydrogen content) and "Hci_ratio_T". "Hci_ratio_T" is the same body measured at 20 °C and at "T2_C" (default
120). Requested with "Hci" in the same measurement, the two are modelled jointly. The default quantities are
["Hci", "Br", "sq"], and unknown quantity names raise an error.
Several bodies made by the same route share that route's latent values but each has its own specimen effect.
Routes that use the same prep share its preparation effect and degas state, so they must share
degas_completeness. A design with several bodies per arm or a crossed design (for example degassing × pressure
mode) is written as one measurement per body, and each degassing arm gets its own prep label (any label other
than the fitted ones is a distinct new preparation). For example, complete degassing × load timing at 850 °C, one
body per cell:
cells = [(mode, dc) for mode in ("heating", "cooling") for dc in (1.0, "complete")]
crossed = {"name": "degassing x load timing", "measurements": [
{"route": {"T_peak_C": 850, "dwell_min": 10, "P_MPa": 50, "pressure_mode": mode, "degas_completeness": dc,
"prep": "new-standard" if dc == 1.0 else "new-complete"},
"rho_observed": 0.97, "quantities": ["Hci"]} for mode, dc in cells]}
out = pm.eig([crossed], n_outer=400, seed=0)
out["ranking"][0]["eig_load_timing_nats"], out["ranking"][0]["eig_magnetic_mechanism_nats"]
Hci, Br, Hk/Hci and Hci_ratio_T are modelled at 20 °C, so a route with T_measure_C ≠ 20 raises an error
for those quantities. For a hot reading, use Hci_ratio_T with T2_C.
Indicators. EIG is reported for every discrete indicator in mechanism_weights: the magnetic and density
mechanisms, and any other (for example load_timing). The keys are eig_magnetic_mechanism_* and
eig_density_mechanism_* (the v3.1 names), and eig_<indicator>_* for any other indicator. eig_indicators[name]
holds the same numbers for every indicator under uniform keys. An indicator that nothing in the design depends on
reports exactly 0 (structural_zero). For example, the density mechanism gets 0 when every body has a measured
density and no density is measured.
What the number means. eig_<indicator>_nats is the information the design is expected to give about the
indicator. Two cases:
- When the bracket is closed (
eig_<indicator>_bracket_closed, typical for one or two bodies), the value is the nested estimate, H(current weights) minus the expected entropy of the updated weights, clipped into the bracket [lower bound, upper] (value_clipped_to_bracketineig_indicatorssays when the clip was applied). It agrees with the v3.1 estimator within Monte Carlo error. - Otherwise the value is a lower bound, max(
eig_<indicator>_lower_bound, 0): the design gains at least this much information about the indicator.
The lower end is the largest of three bounds computed on the same simulated outcomes, each of which holds however
rough its posterior is (lower_bound_source names the one used):
- the exact nested posterior over the stored draws, with the outcome's own stored draw left out (v3.1's exclude-own estimate, made leave-out);
- a classifier trained on outcomes simulated from the other half of the stored draws;
- the two pooled by how many stored draws fit the outcome.
eig_<indicator>_se is the SE of the value and eig_<indicator>_lower_bound_se the SE of the bound. The most any
design can gain is the entropy of the current weights (eig_indicators[name]["prior_entropy_nats"]).
How far to trust it.
eig_<indicator>_lower_bound_stable, also given aseig_<indicator>_converged, is true when two independent halves of the calculation agree within 2 combined SE. Each half uses its own simulated outcomes and a classifier trained on the other half's stored draws.all_convergedis true when every lower bound in the result is stable.eig_<indicator>_bracketis [lower bound, upper end]. The upper end uses the v3.1 estimate with the outcome's own draw included, so it runs high. The bracket is closed when |upper − lower| ≤ max(0.05, 2 SE), v3.1's rule.- For designs with several bodies across routes, the bracket stays open, and more inner draws do not close it. The stored posterior holds about 2,000 draws per mechanism. A multi-body design pins the route-level values more tightly than those draws are spaced, so no estimator built on them can bound the EIG from above. Rank such designs by the lower bound.
- Monte Carlo spread: the SE (about 0.02 nats for a lower bound, about 0.008 for a closed nested estimate) covers
the simulated outcomes within one run. A different
seedredraws which stored draws generate the outcomes, and that shifts every design's value by about 0.03–0.05 nats in the same direction. Compare designs within one call or with the same seed. A difference smaller than about 3 SEs, or 0.05 nats across seeds, is not resolved; a largern_outerlowers both in proportion to 1/√n_outer. - Nested designs: adding bodies to the same routes, or quantities to the same bodies, should not lower the bound. In the tests on this posterior it held within 3 combined SE; adding grain and H_ppm to two bodies at each of three routes once lowered the bound by 0.07 nats.
- Lower bounds from different designs can still sit below their true EIGs by somewhat different amounts. For example, adding grain and H_ppm to two bodies per route lowered the bound by up to 0.07 nats. The classifier captures smooth relations between per-route summaries, and information in a strongly nonlinear joint relation (H_ppm against Hci under the hydrogen mechanism) may be under-credited. Treat a lead of under 0.05 nats between designs of very different size or quantity mix as provisional.
- Difference from v3.1 on informative designs: v3.1's inner set contains copies of the stored draw that generated
each simulated outcome. Its brackets therefore close at the EIG for a world that is exactly one of the stored
draws, which credits a design for identifying a single stored draw. v4 leaves the generating stored draw out,
because the real material is not one of the stored draws. It still reports the v3.1-style value with the copies
kept, as
stored_draw_bracket,stored_draw_natsandstored_draw_closedineig_indicators. On informative multi-body designs that value sits above v4's lower bound, because it credits identifying a stored draw.
Other outputs per candidate.
eig_all_parameters_natsand_se(a lower bound).expected_posterior_<indicator>_weights,p_identify_<indicator>_mechanism_mapand its_bracket(magnetic and density).ln_Hci_sd_target_nowandln_Hci_sd_target_expected_afterattarget(a route; default the first measured route), andln_Hci_sd_reduction_target. The expected-after value is an upper bound (a held-out prediction error), so the reduction is conservative.ess_inner_median: the effective number of inner draws that fit a simulated outcome. Values below about 20 mean the value comes mainly from the classifier.orderingslists the candidate names under every metric.
Goal option. goal={"route": {...}, "spec": {...}, "rho_observed": optional} uses the spec keys of
p_meets_spec (Hci_kOe_min, BHmax_MGOe_min, Br_kGs_min, density_rel_min, T_operating_C), and unknown keys
raise an error. Let G = 1 if the next body made by the goal route meets the spec, scored on measured values as in
p_meets_spec. For one posterior draw (parameters and shared latent values), p = P(G = 1 | draw).
- Aleatoric: body-to-body and measurement scatter make G uncertain even when the draw is known. No experiment
removes it:
aleatoric_entropy_nats= average over draws of H(p). - Epistemic: p itself is uncertain because the draw is uncertain:
p_success_epistemic_sd_now= sd of p over the posterior, andepistemic_entropy_nats=event_entropy_nats−aleatoric_entropy_nats, whereevent_entropy_nats= H(p_success_now). This is the most any experiment can gain about G. goal.eig_event_nats, also given aseig_goal_event_nats, is a lower bound on the information the experiment gives about G.goal.eig_event_bracket= [lower bound, epistemic entropy]; the upper end is a true upper bound.p_success_epistemic_sd_expected_afteris the expected sd of p after the experiment, an upper bound.expected_posterior_p_success_quantilesgives the spread of the updated success probability over the possible outcomes. It is approximate and shrinks toward the current value where the approximation is weak.- When no draw meets the spec,
no_draw_meets_specis true and every goal information measure is 0.
Runtime and options. At the defaults (n_outer 1500, n_inner_per_mechanism 4000) in the science image with
8 threads on a busy host, a single-body candidate takes about 4 s. A candidate with 6 to 12 bodies over 3 or 4 routes
takes about 10–25 s, and the goal option adds little. Results are deterministic for a given seed.
method="nmc-v3.1" runs the earlier estimator unchanged, for comparison. It has no goal option, and it refuses a posterior that carries a per-draw indicator beyond the two mechanisms (for example load_timing). H_ppm and
Hci_ratio_T use declared, uncalibrated measurement models, so their EIGs are conditional on those assumptions.
Example: pm.eig([{"name": "two bodies, 800 C", "measurements": [{"route": {"T_peak_C": 800}, "quantities": ["Hci", "Br", "sq", "density"]}] * 2}], goal={"route": {"T_peak_C": 800}, "spec": {"Hci_kOe_min": 10, "density_rel_min": 0.95}}).
pm.condition(observations, k_latent=32, seed=12345) → (updated_model, info): importance-reweights the stored
draws by a list of new observations, one dict per new body (e.g.
[{"route": {...}, "rho_observed": 6.0, "Hci_kOe": 3.1, "Br_kGs": 5.0}]; optional keys Hci_kOe, Br_kGs,
Hk_kOe, density_rel, grain_um, rho_observed). A magnetic observation needs the body's measured density
(rho_observed or density_rel); without it the call raises an error. Routes may carry degas,
degas_completeness and current_path; the completeness of one preparation is shared by its observations. The
mechanism weights and the load-timing weights are both updated (info["mechanism_weights"]["load_timing"]).
info["ess_per_mechanism"] below ~200 for a mechanism that still carries weight means a refit is needed.
Density observations in condition(). A measured density updates the density module only when it is given as
density_rel: the relative density, a fraction of 7.62 g/cm³ (a value above 1.5 is read as g/cm³ and divided by
7.62). In condition(), rho_observed is only the measured density that the body's magnetic quantities (Hci_kOe,
Br_kGs, Hk_kOe, grain_um) are conditioned on; it does not update the density module. An observation that
carries only rho_observed and no magnetic quantity updates nothing. A density-only observation:
dens_model, dens_info = pm.condition([{"route": {"T_peak_C": 800, "prep": "new"}, "density_rel": 0.70}], k_latent=8)
dens_info["mechanism_weights"]["density"], pm.w["density"]
dens_model.predict({"T_peak_C": 800, "prep": "new"})["outputs"]["density_rel"]["median"]
Example
r = pm.predict({'T_peak_C': 800, 'prep': 'PREP-C800'}, rho_scenario={'mean': 6.2, 'sd': 0.3})
r['outputs']['Hci_kOe']['quantiles']['q05'], r['outputs']['Hci_kOe']['quantiles']['q95']
r['outputs']['Hci_kOe']['prior_dominated'], r['out_of_hull']['magnetic']['out_of_hull']
d = {'T_peak_C': 850, 'heating_rate_C_per_min': 10, 'dwell_min': 10, 'P_MPa': 50, 'pressure_mode': 'heating'}
std = pm.predict(d, rho_scenario={'mean': 7.45, 'sd': 0.05})['outputs']['Hci_kOe']['by_load_timing']
full = pm.predict(dict(d, degas_completeness='complete'), rho_scenario={'mean': 7.45, 'sd': 0.05})
full['outputs']['Hci_kOe']['by_load_timing']['trap']['median'], std['trap']['median']
pm.p_meets_spec({'T_peak_C': 850, 'pressure_mode': 'heating', 'P_MPa': 50},
{'Hci_kOe_min': 20, 'BHmax_MGOe_min': 45, 'T_operating_C': 120})
rec = pm.forecast_record({'T_peak_C': 800, 'degas_completeness': {'distribution': 'uniform', 'low': 0.85, 'high': 1.0}},
body_id='body-x', rho_scenario={'mean': 6.2, 'sd': 0.3})
rec['outputs']['Hci_kOe']['quantiles']['q05'], rec['outputs']['Hci_kOe']['quantiles']['q95']