Computed software examples
Checked synthetic demonstrations from released packages and public pre-alpha op_infer.
The first five examples use released versions of OP System, OP Engine, trade-study and VBPCApy. The sixth is an imported, commit-pinned artifact from public pre-alpha op_infer; it does not imply a package release. A final section shows design and verification examples for OP System and OP Engine. All data are synthetic. The plots show computations rather than findings from an application study; their captions state the assumptions and what is checked.
Python source · Numerical inputs and outputs · Versions and artifact hashes · Build notes
Artifact versions: op-system 0.10.0, op-engine 0.9.0, trade-study 0.6.0, vbpca-py 0.5.0, numpy 2.5.4, matplotlib 3.11.2. These are the versions used to generate the displayed artifacts; current releases may be newer.
Spatial diffusion
OP System compiles a named-axis expression for a periodic diffusion stencil; OP Engine integrates the resulting field with fourth-order Runge–Kutta (RK4). The stencil is supplied explicitly on 64 equally spaced cells. Faster spatial variation fades sooner than slower variation.
The code checks the full trajectory against the exact Fourier-mode solution of the discrete spatial stencil, with a maximum absolute difference below 2e-10. This measures temporal integration error for the chosen grid. It does not measure error against a continuum PDE or establish accuracy for other spatial discretizations.
Stochastic transfers
OP Engine runs 512 independent realizations of a two-state transfer process using the exact stochastic simulation algorithm (SSA), with one event clock per run. Each starts with 40 units; each remaining unit transfers at rate 0.6. The example retains the accepted firing counts and checks conservation and the correspondence between counts and transferred units.
Replicated designs
trade-study evaluates ten sample-mean designs using 512 paired replicates. The measurement standard deviation is either 1 or 1.5. The noisier measurement is assigned a lower cost; the standard measurement has a fixed setup cost. Those costs are illustrative assumptions. The circles mark designs for which no alternative improves both mean error and assumed cost.
The table reads the same generated data as the figure. Error estimates depend on these 512 simulated replicates. A design is nondominated when no other design is at least as good on both stated objectives and better on at least one. Choosing a design for an application also requires preferences or constraints relevant to that application.
On smaller screens, scroll the table to see cost and nondominance.
| Samples | Measurement SD | Mean squared error | Assumed cost | Nondominated |
|---|---|---|---|---|
| 8 | 1.0 | 0.137 | 16.0 | Yes |
| 8 | 1.5 | 0.308 | 4.4 | Yes |
| 16 | 1.0 | 0.065 | 24.0 | No |
| 16 | 1.5 | 0.146 | 8.8 | Yes |
| 32 | 1.0 | 0.029 | 40.0 | Yes |
| 32 | 1.5 | 0.064 | 17.6 | Yes |
| 64 | 1.0 | 0.015 | 72.0 | Yes |
| 64 | 1.5 | 0.034 | 35.2 | Yes |
| 128 | 1.0 | 0.008 | 136.0 | Yes |
| 128 | 1.5 | 0.019 | 70.4 | Yes |
Incomplete data
VBPCApy fits a two-component model to observed entries of a noisy synthetic matrix. Roughly 35% of entries are withheld, shown in gray. The generating signal uses two patterns; that choice is supplied to the fitted model.
The root mean squared reconstruction error on withheld noisy observations is about 0.22 for this seeded example; the generating noise standard deviation is 0.2. This is one reconstruction check with a known component count. Choosing the rank and assessing uncertainty calibration require separate studies.
Archetypes from incomplete categorical data
This example follows the steps of the 2024 cultural-transmission paper on synthetic data. Each of 150 samples is a mixture of three archetypes, drawn from Dirichlet weights, and has 24 categorical variables with three levels; about 30% of the variables are unobserved. VBPCApy’s MissingAwareOneHotEncoder codes each variable as indicator columns and leaves an unobserved variable missing rather than setting it to zero. A two-component VBPCA model is fitted to the observed indicators, and archetypal analysis (Mørup and Hansen 2012) is applied to its reconstruction.
The recovered memberships correlate with the generating memberships at 0.89, 0.92 and 0.89 for the three archetypes, with mean absolute error 0.10. With every variable observed, the same analysis gives 0.94, 0.95 and 0.94, so the missing entries cost some precision. Recovery is also limited by drawing one level per variable. The numbers of components and archetypes are supplied; choosing them requires separate checks. The archetypal analysis is written in the script, because the py_pcha release used in the paper does not run under NumPy 2.
Inference calibration
op_infer evaluates one Normal-model fixture for which the posterior density is available analytically. The left panel compares 1,024 seeded draws from that fixture with the exact posterior density. The right panel summarizes randomized-rank probability-integral-transform values from 64 simulation-based calibration (SBC) replicates.
The fixture completed all 64 requested replicates without a failed attempt. Its recorded gate label is underpowered pass: the implementation and accounting checks passed, but the replicate count is below the prespecified power floor. The histogram is therefore a software demonstration, not a calibration certificate or application result.
Retained data · Summary · Upstream manifest · Pinned source identity · SVG · PDF
OP stack design and verification
These examples show design choices of OP System and OP Engine on synthetic models, each with an independent check. They use released OP System 0.10.0 and OP Engine 0.9.1 with JAX and CPU PyTorch. Every figure reports software behavior within the packages’ documented scope, not a finding about a study system. The research page compares the stack with related tools.
Python source and pinned dependencies · Numerical inputs and outputs · Versions and artifact hashes · Build notes
The array library is chosen at call time. OP System compiles a validated, declarative description (equations or hazard-style transitions, with named axes for groups, space and traits) into one evaluator. The array library is selected from the inputs, so the same compiled model runs under NumPy, under JAX and, within the documented qualified scope, under PyTorch. The numerical method does not change with the namespace.
jax.jit, which may fuse and reorder operations, the float64 error differs from the eager value only at the 10−15 level. The dotted and dash-dot lines are machine epsilon for each precision, drawn as references; the error of a 400-step integration is well above epsilon, as expected. Synthetic model, assumed parameters. Figure downloads, data and source.Model authors can check a compiled model. OP System’s qualification report compares a compiled right-hand side with equations the author writes independently, under each array library and precision, and records optional balance checks with their stated conditions.
A model written for one run can be batched or differentiated. The same compiled evaluator can be mapped over a parameter grid or differentiated with respect to a parameter without being rewritten.
jax.vmap over the same compiled evaluator. (a) Producer concentration at the final time over a 45 × 45 grid of two parameters (producer growth rate and inflow nutrient), from one vectorized call; the marker is the nominal pair. (b) The 2025 members over time: median and 5th to 95th percentile band, with a separately computed eager NumPy run at the nominal parameters overlaid. A vectorized JAX evaluation at the nominal pair agrees with that NumPy run to within 10−9 maximum absolute difference. No timing is shown; single-call wall-clock values are recorded in the data file with the CPU model for the record only, since single calls without repetitions are not a benchmark. Synthetic model, assumed parameters. Figure downloads, data and source.jax.grad through 400 fixed Runge-Kutta steps over the compiled evaluator. (b) Central finite differences of the same discrete 400-step calculation approach the autodiff derivative with slope 2 as the step shrinks, reaching 1.3 × 10−10 relative disagreement before round-off dominates. This checks the derivative of the discrete solver, not continuous-time sensitivity, and it covers the engine's fixed-step methods; the adaptive step controller is not a traced path, as the package documentation states. Figure downloads, data and source.One specification, several solvers. OP Engine takes compiled models into explicit and adaptive ordinary-differential-equation methods, operator-split and implicit schemes for partial differential equations, exact stochastic simulation with retained event counts, tau-leaping and steady-state solves. The compiler publishes interface contracts, and the engine owns time integration; the user supplies any spatial discretization.
jax.vmap from two starting guesses; with early exit disabled, each solve is a fixed-length traced loop. These are independent solves at each parameter value, not continuation along a branch. Every state with a true convergence flag lies within 10−6 of a root of the cubic; states with a false flag occur only where the branch being sought does not exist past a fold, and they are omitted from the plot. The unstable branch is drawn from the cubic's roots as a reference. A one-state toy chosen for its closed-form check; it is not the published plankton model on the research page. Figure downloads, data and source.