Compile¶
Diagram compiler: topology analysis and execution plan construction.
This module provides the complete compilation pipeline:
evaluation_order_of()— Depth-first search over the port dependencies (implemented inwiring.py): the topological execution order of the output ports, an algebraic loop refused. The standalone check after manual wiring ischeck_algebraic_loops().build_execution_plan()— Constructs an immutableExecutionPlanfrom a diagram. Callsevaluation_order_of()internally.compile_diagram()— Top-level entry point that builds the plan and wraps it in a backend evaluator.
- minilink.core.compile.compiler.validate_equation_shapes(system, label=None)[source]¶
Probe the textbook hooks once and check their declared shapes.
f(continuous leaves),step(discrete leaves), and the standard output ports created by the constructor (y->h,x-> state) are evaluated at(x0, u_nominal, t=0); a wrong-length result raisesValueErrornaming the block, the hook, and both shapes. Custom port computes are not probed (they may be expensive or stateful).
- minilink.core.compile.compiler.compile(system, backend='numpy', verbose=False)[source]¶
Compile a system into a typed evaluator.
Returns
StaticEvaluatorfor staticSystemleaves (n=0),StepEvaluatorforStepSystemleaves,DynamicsEvaluatorforDynamicSystemleaves and diagrams.- Parameters:
system (System or DiagramSystem) – The system to compile.
backend (str) –
'numpy'or'jax'.verbose (bool) – If
True, print timed compilation steps.
- minilink.core.compile.compiler.compile_auto(system, verbose=False)[source]¶
Compile with JAX when it is installed and
systemtraces, else with NumPy.Returns
(backend, evaluator). Only two verdicts fall back to NumPy: JAX cannot be imported, or the system is “not JAX-traceable”; any other error from the JAX compile surfaces.
- minilink.core.compile.compiler.compile_diagram(diagram, backend='numpy', *, bind_params=False, verbose=False)[source]¶
Compile a DiagramSystem into a backend evaluator.
- Parameters:
diagram (DiagramSystem) – The wired diagram to compile.
backend (str) –
'numpy'or'jax'.bind_params (bool, optional) – If
True, each plan operation stores a deep copy of that subsystem’sparamsand evaluators pass it intof/ portcompute. IfFalse(default),Noneis passed and blocks use liveself.params.verbose (bool) – If
True, print timed compilation steps.
- Returns:
A stateless evaluator that can compute state derivatives and outputs.
- Return type:
Examples
>>> from minilink.core.compile.compiler import compile_diagram >>> evaluator = compile_diagram(diagram) >>> dx = evaluator.f(x, u, t)
Notes
bind_params=Truesnapshots only each subsystem’sparamsdict into the plan. It does not make userf/ portcomputeimplementations pure if they still read or mutate other instance state; seeminilink.core.system.System.
- minilink.core.compile.compiler.build_execution_plan(diagram, *, bind_params=False)[source]¶
Build an immutable ExecutionPlan from a DiagramSystem.
This is the core compilation step. It:
Orders the output ports, refusing an algebraic loop, via
evaluation_order_of().Assigns each output port a slice in the flat signal buffer.
Builds the gather-source recipes for each port and state operation.
Returns a frozen
ExecutionPlan.
- Parameters:
diagram (DiagramSystem) – Must have subsystems added and connections wired.
bind_params (bool, optional) – When
True, setbound_params/bound_paramson each row (deep copy ofsubsystem.paramsonly; seecompile_diagram()Notes).
- Return type:
Warn when two random blocks hold one seed: they would draw the same signal.
Execution plan data structures for compiled diagrams.
An ExecutionPlan is the output of the compilation step: it captures,
in an immutable and flattened form, all the information needed to evaluate a
DiagramSystem without any dictionary lookups
or recursive calls.
The plan is consumed by evaluator backends
(NumpyDiagramEvaluator,
JaxDiagramEvaluator) which walk through the
operation lists in topological order to compute state derivatives and outputs.
- minilink.core.compile.execution_plan.NOMINAL = 0¶
Source is a constant value (port not connected, or not a dependency).
- minilink.core.compile.execution_plan.EXTERNAL_INPUT = 1¶
Source is an external input to the diagram (from the diagram’s
uvector).
- minilink.core.compile.execution_plan.INTERNAL_SIGNAL = 2¶
Source is an output from another subsystem (from the internal signal buffer).
- class minilink.core.compile.execution_plan.PortOperation(compute_func, local_x_slice, gather_sources, out_slice, u_dim, bound_params=None, label='', sys_id='')[source]¶
One output-port evaluation step in topological order.
When a diagram is compiled, every output port becomes a PortOperation. During evaluation, operations execute sequentially in topological order: for each operation, gather the local input vector
ufrom the signal buffer, call the compute function, and write the result into the buffer.- Parameters:
compute_func (Callable[[...], ndarray])
local_x_slice (slice)
gather_sources (tuple[tuple[int, object, int], ...])
out_slice (slice)
u_dim (int)
bound_params (dict | None)
label (str)
sys_id (str)
- compute_func¶
The port’s compute function
(x, u, t, params) → y.paramsmay beNone(use liveself.paramsin the block) or a bound snapshot whenbind_params=Trueat compile time.- Type:
Callable[…, np.ndarray]
- local_x_slice¶
Index slice into the global state vector
xthat extracts this subsystem’s local state. For static systems (n = 0):slice(0, 0).- Type:
slice
- gather_sources¶
Recipe for assembling the local input vector
ufrom various sources. Each entry is(source_type, source_value, dim)where:source_type = NOMINAL (0): Port not connected or not a dependency.source_valueis the constantnp.ndarray(nominal value).source_type = EXTERNAL_INPUT (1): From the diagram’s external input vector.source_valueis asliceinto the diagram’su.source_type = INTERNAL_SIGNAL (2): From another subsystem’s output.source_valueis asliceinto the internal signal buffer.
- Type:
tuple[tuple[int, Any, int], …]
- out_slice¶
Where to write this port’s output in the internal signal buffer.
- Type:
slice
- u_dim¶
Total dimension of the assembled local input vector. Equal to the sum of all
dimvalues ingather_sources.- Type:
int
- bound_params¶
If set, a deep copy of the subsystem
paramsat compile time; passed as the fourth argument tocompute_func. IfNone, evaluators passNoneso blocks use their defaultself.params. This does not freeze other instance attributes; purity ofcompute_funcis not enforced.- Type:
dict | None
- sys_id¶
Id of the owning subsystem in the diagram. Used by the parametric evaluator tier to route nested diagram params (
params[sys_id]).- Type:
str
- class minilink.core.compile.execution_plan.StateOperation(f_func, local_x_slice, gather_sources, u_dim, bound_params=None, label='', sys_id='')[source]¶
One state-derivative evaluation step.
Similar to
PortOperation, but callsf(x, u, t) → dxinstead ofh(x, u, t) → y. The result is written into the global derivative vectordxatlocal_x_slice.- Parameters:
f_func (Callable[[...], ndarray])
local_x_slice (slice)
gather_sources (tuple[tuple[int, object, int], ...])
u_dim (int)
bound_params (dict | None)
label (str)
sys_id (str)
- f_func¶
The subsystem’s state-derivative function
(x, u, t, params) → dx.paramsmay beNoneor a bound snapshot (seebound_params).- Type:
Callable[…, np.ndarray]
- local_x_slice¶
Index slice into the global state vector
xand derivative vectordxfor this subsystem’s local state.- Type:
slice
- gather_sources¶
Recipe for assembling the local input vector
u. Same format asPortOperation.gather_sources— theffunction always needs all inputs (no dependency filtering).- Type:
tuple[tuple[int, Any, int], …]
- u_dim¶
Total dimension of the assembled local input vector.
- Type:
int
- bound_params¶
Same semantics as
PortOperation.bound_paramsforf_func(paramsdict snapshot only; seeminilink.core.system.System).- Type:
dict | None
- sys_id¶
Same semantics as
PortOperation.sys_id.- Type:
str
- class minilink.core.compile.execution_plan.ExecutionPlan(state_dim, signal_dim, port_ops, state_ops, output_slices, external_output_slices)[source]¶
Immutable flattened execution schedule for a compiled diagram.
Built by
build_execution_plan(). Consumed by evaluator backends to compute state derivatives and outputs without any dictionary lookups or recursive traversals.- Parameters:
state_dim (int)
signal_dim (int)
port_ops (tuple[PortOperation, ...])
state_ops (tuple[StateOperation, ...])
output_slices (dict[tuple[str, str], slice])
external_output_slices (dict[str, slice])
- state_dim¶
Total state dimension of the diagram (sum of all subsystem
nvalues).- Type:
int
- signal_dim¶
Total size of the internal signal buffer (sum of all output port dimensions across all subsystems).
- Type:
int
- port_ops¶
Output-port operations in topological order. Evaluating them sequentially fills the internal signal buffer.
- Type:
tuple[PortOperation, …]
- state_ops¶
State-derivative operations. Evaluating them sequentially (after the port operations) fills the derivative vector
dx.- Type:
tuple[StateOperation, …]
- output_slices¶
Map from
(subsystem_id, port_id)to the correspondingslicein the internal signal buffer. Used to extract specific port outputs after evaluation.- Type:
dict[tuple[str, str], slice]
- external_output_slices¶
Diagram boundary outputs only: maps diagram output port id (keys of
outputson the diagram) to the slice in the internal buffer that holds the connected source subsystem port’s signal. Empty when the diagram has no external outputs.- Type:
dict[str, slice]
NumPy/JAX backend policy: the backend strings, array_module, and the lazy JAX imports.
- minilink.core.backends.COMPILE_BACKENDS: tuple[str, ...] = ('numpy', 'jax')¶
Backends accepted by
minilink.core.compile.compiler.compile().
- minilink.core.backends.SIMULATOR_BACKENDS: tuple[str, ...] = ('numpy', 'jax', 'auto')¶
Backends accepted by
Simulator.
- minilink.core.backends.TRANSCRIPTION_BACKENDS: tuple[str, ...] = ('numpy', 'jax', 'direct')¶
Backends accepted by JAX trajectory-optimization transcriptions.
- minilink.core.backends.normalize_backend(name, *, allow_auto=False, allow_direct=False)[source]¶
Validate and lowercase a compile-backend string.
"numpy"NumPy evaluator. Always available.
"jax"JAX evaluator. Hard-requires JAX (
pip install jax jaxlib)."auto"Try JAX, fall back to NumPy. Used by the simulator.
"direct"Use
f()directly (no compiled evaluator); valid for some trajectory-optimization transcriptions onDynamicSystemorDiagramSystem."auto"and"direct"are simulator / transcription concepts: the low-levelminilink.core.compile.compiler.compile()only accepts"numpy"and"jax";allow_auto/allow_directadmit them at the layer that understands them.- Parameters:
name (str or None) – Backend identifier.
Noneis treated as"numpy".allow_auto (bool, optional) – Allow the
"auto"value (Simulator-level concept).allow_direct (bool, optional) – Allow the
"direct"value (transcription-level concept).
- Returns:
Normalized lowercase backend string.
- Return type:
str
- minilink.core.backends.array_module(*values)[source]¶
Return
jax.numpyif any value is a JAX array/tracer, elsenumpy.This is the hybrid-backend idiom for equation paths: bind
xp = array_module(x)once at the top off/h, then write the math withxpso the same code runs under NumPy and traces under JAX.- Return type:
ModuleType
- minilink.core.backends.jax_installed()[source]¶
Return True when the
jaxpackage is importable (without importing it).- Return type:
bool
- minilink.core.backends.require_jax()[source]¶
Return
jax(lazy, cached) under the float64 policy. Raises if JAX is not installed.- Return type:
ModuleType
- minilink.core.backends.require_jax_numpy()[source]¶
Return
jax.numpy(lazy, cached). Raises if JAX is not installed.- Return type:
ModuleType
- minilink.core.backends.jax_x64_policy()[source]¶
Library policy: 64-bit floats in JAX unless
MINILINK_JAX_X64=0.MINILINK_JAX_X64=0keeps JAX’s float32 default, for GPU or reinforcement-learning workloads.- Return type:
bool
- minilink.core.backends.ensure_jax_x64()[source]¶
Apply
jax_x64_policy()to the JAX config (idempotent; JAX required).Called by every JAX evaluator constructor and by
require_jax_numpy(), so tools built on JAX evaluators never need the caller to enable x64. Without JAX it raisesrequire_jax()’s error, with the install hint.- Return type:
ModuleType
- minilink.core.backends.configure_jax(*, enable_x64=None)[source]¶
Configure process-wide JAX options used by Minilink JAX code paths.
- Parameters:
enable_x64 (bool | None)
- Return type:
ModuleType
- minilink.core.backends.is_jax_key(key)[source]¶
Truefor a JAX PRNG key (concrete or traced).- Return type:
bool
- minilink.core.backends.numpy_generator(key)[source]¶
A NumPy generator from a generator, an integer seed, or
None.- Return type:
Generator
Compiled evaluator ABCs — output, dynamics, step, and static contracts.
Concrete backends live in numpy_evaluators and jax_evaluators.
- minilink.core.compile.evaluators.evaluators.outputs_from_ports(system, x, u, t, params)[source]¶
Evaluate every output port on
system.- Return type:
dict
- class minilink.core.compile.evaluators.evaluators.OutputEvaluator[source]¶
Base class for compiled evaluators — output tier only.
Boundary signals are returned as a dict keyed by output port id.
- class minilink.core.compile.evaluators.evaluators.DynamicsEvaluator[source]¶
Base class for compiled continuous-time evaluators.
Subclasses implement
f,f_p,outputs, andoutputs_p. Integration helpers are mixed in by the NumPy / JAX backend modules.
- class minilink.core.compile.evaluators.evaluators.StepEvaluator[source]¶
Base class for compiled discrete-time evaluators.
Subclasses implement
step,step_p,outputs, andoutputs_p. Rollout helpers live on the NumPy / JAX backend mixins.
- class minilink.core.compile.evaluators.evaluators.StaticEvaluator[source]¶
Compiled evaluator for stateless IO blocks — no evolution map.
Step rollouts and diagram input gathering for compiled evaluators.
Shared by NumPy and JAX step evaluators and by Computer.
- minilink.core.compile.evaluators.step_rollout.gather_u(gather_sources, u_dim, signals, u)[source]¶
Assemble a subsystem local input vector from a compiled gather plan.
Each entry in
gather_sourcesis(source_type, source_value, dim)as stored onPortOperationandStateOperation. Source types areINTERNAL_SIGNAL,NOMINAL, andEXTERNAL_INPUT. ForINTERNAL_SIGNALandEXTERNAL_INPUT,source_valueis asliceintosignalsor the diagram boundary inputurespectively.- Parameters:
gather_sources (tuple[tuple[int, object, int], ...]) – Flattened wiring plan for one subsystem input port bundle.
u_dim (int) – Expected local input dimension (sum of
dimover sources).signals (ndarray) – Internal signal buffer (1-D) or port-signal workspace used for
INTERNAL_SIGNALlookups.u (ndarray) – Diagram boundary input vector.
- Returns:
Local input
u_localwith shape(u_dim,).- Return type:
ndarray
- class minilink.core.compile.evaluators.step_rollout.StepRolloutMixin[source]¶
Discrete-time rollouts for compiled
StepSystemevaluators.Subclasses must implement
step,step_p,outputs, andoutputs_pand exposen,m,p, and_u_nominal.- rollout(x0, *, n_steps, u=None)[source]¶
Roll out
x_{k+1} = step(x_k, u_k, k)forn_stepstransitions.Returns a state-only
StepRolloutwithk.shape == (n_steps + 1,),x.shape == (n, n_steps + 1), andu.shape == (m, n_steps + 1). Signal histories are owned byComputerandHybridSimulator.- Return type:
StepRollout
NumPy compiled evaluators — dynamics, diagrams, step, and static.
Integration methods show textbook RK4 / Euler formulas inline.
- class minilink.core.compile.evaluators.numpy_evaluators.IntegrationMixin[source]¶
RK4 / Euler integration on
f(),f_p(),f_ivp(),f_ivp_p().- rk4_integrate_zoh(x0, u_sequence, t0, dt)[source]¶
ZOH RK4 rollout:
u_sequenceshape(N, m)→ states(N+1, n).
- rk4_integrate_linear(x0, u_knots, t0, dt)[source]¶
Linear-
uRK4 rollout:u_knotsshape(K, m)→ states(K, n).
- euler_integrate_zoh(x0, u_sequence, t0, dt)[source]¶
ZOH Euler rollout:
u_sequenceshape(N, m)→ states(N+1, n).
- integrate_zoh_rollout(x0, u_hold, t0, dt_hold, *, dt_inner=None)[source]¶
Piecewise-constant
u_holdover[t0, t0 + dt_hold].- Returns:
t_samples (ndarray, shape (n_sub + 1,))
x_samples (ndarray, shape (n_sub + 1, n))
- integrate_zoh(x0, u_hold, t0, dt_hold, *, dt_inner=None)[source]¶
Advance state with piecewise-constant
u_hold; return final state.
- integrate_zoh_p(x0, u_hold, t0, dt_hold, params, *, dt_inner=None)[source]¶
Parametric twin of
integrate_zoh().
- class minilink.core.compile.evaluators.numpy_evaluators.NumpyDynamicEvaluator(system)[source]¶
Compiled evaluator for a
DynamicSystemusing NumPy.- Parameters:
system (DynamicSystem)
- class minilink.core.compile.evaluators.numpy_evaluators.NumpyDiagramEvaluator(plan, diagram)[source]¶
Stateless NumPy evaluator for a compiled diagram.
- Parameters:
plan (ExecutionPlan)
- class minilink.core.compile.evaluators.numpy_evaluators.NumpyStaticEvaluator(system)[source]¶
NumPy evaluator for a static
Systemleaf (n == 0).- Parameters:
system (System)
- class minilink.core.compile.evaluators.numpy_evaluators.NumpyStepEvaluator(system)[source]¶
Compiled evaluator for a
StepSystemusing NumPy.- Parameters:
system (StepSystem)
- class minilink.core.compile.evaluators.numpy_evaluators.NumpyStepDiagramEvaluator(plan, diagram)[source]¶
Stateless NumPy evaluator for a compiled step diagram.
- Parameters:
plan (StepExecutionPlan)
JAX compiled evaluators — dynamics, diagrams, step, and static.
Integration methods show textbook RK4 / Euler formulas inline.
- class minilink.core.compile.evaluators.jax_evaluators.JaxIntegrationMixin[source]¶
RK4 / Euler integration on trace and JIT
ftiers.- rk4_step_ivp_trace_p(x, t, dt, params)[source]¶
Pre-JIT parametric IVP RK4 step for JAX composition.
- euler_step_ivp_trace_p(x, t, dt, params)[source]¶
Pre-JIT parametric IVP Euler step for JAX composition.
- rk4_integrate_zoh_trace(x0, u_sequence, t0, dt)[source]¶
Pre-JIT ZOH-input rollout for JAX composition.
- rk4_integrate_zoh_trace_p(x0, u_sequence, t0, dt, params)[source]¶
Pre-JIT parametric ZOH-input rollout for JAX composition.
- rollout_batch(x0s, u_sequences=None, *, t0=0.0, dt, n_steps=None, params=None)[source]¶
Roll out a family of RK4 / ZOH trajectories in one
jax.vmapcall.- Parameters:
x0s (array, shape
(B, n)) – One initial state per family member.u_sequences (None,
(N, m), or(B, N, m)) – Held inputs per step: the compiled nominal input (n_stepsrequired), one sequence shared by the batch, or one per member.t0 (float) – Start time and step, shared by the batch.
dt (float) – Start time and step, shared by the batch.
params (None or pytree) –
Noneuses the compiled values. Otherwise a params pytree whose leaves are either shared by the batch or carry a leading axis of sizeB— a leaf with one more dimension than the compiled value is a family ({"l": jnp.linspace(0.5, 2.0, B)}sweeps a length).
- Returns:
Sampled states,
x0first, for every member of the family.- Return type:
jax.Array, shape
(B, N + 1, n)
- rk4_integrate_linear_trace(x0, u_knots, t0, dt)[source]¶
Pre-JIT linear-
urollout for JAX composition.
- rk4_integrate_linear_trace_p(x0, u_knots, t0, dt, params)[source]¶
Pre-JIT parametric linear-
urollout for JAX composition.
- rk4_integrate_ivp_trace_p(x0, t0, dt, n_steps, params)[source]¶
Pre-JIT parametric IVP rollout for JAX composition.
- euler_integrate_zoh_trace(x0, u_sequence, t0, dt)[source]¶
Pre-JIT ZOH Euler rollout for JAX composition.
- euler_integrate_zoh_trace_p(x0, u_sequence, t0, dt, params)[source]¶
Pre-JIT parametric ZOH Euler rollout for JAX composition.
- euler_integrate_ivp_trace(x0, t0, dt, n_steps)[source]¶
Pre-JIT IVP Euler rollout for JAX composition.
- euler_integrate_ivp_trace_p(x0, t0, dt, n_steps, params)[source]¶
Pre-JIT parametric IVP Euler rollout for JAX composition.
- integrate_zoh_rollout(x0, u_hold, t0, dt_hold, *, dt_inner=None)[source]¶
Piecewise-constant
u_holdover[t0, t0 + dt_hold].- Returns:
t_samples (ndarray, shape (n_sub + 1,))
x_samples (ndarray, shape (n_sub + 1, n))
- integrate_zoh(x0, u_hold, t0, dt_hold, *, dt_inner=None)[source]¶
Advance state with piecewise-constant
u_hold; return final state.
- integrate_zoh_p(x0, u_hold, t0, dt_hold, params, *, dt_inner=None)[source]¶
Parametric twin of
integrate_zoh().
- class minilink.core.compile.evaluators.jax_evaluators.JaxDynamicEvaluator(system, verbose=False)[source]¶
Compiled evaluator for a
DynamicSystemusing JAX.- Parameters:
system (DynamicSystem)
- f_jit(x, u, t=0.0)¶
dx = f(x, u, t) with frozen params.
- f_jit_p(x, u, t, params)¶
dx = f(x, u, t, p) with caller-supplied params.
- outputs_jit(x, u, t=0.0)¶
All boundary output ports, frozen params.
- outputs_jit_p(x, u, t, params)¶
All boundary output ports; caller-supplied params.
- class minilink.core.compile.evaluators.jax_evaluators.JaxDiagramEvaluator(plan, diagram, verbose=False)[source]¶
JAX-compatible evaluator for a compiled diagram.
- Parameters:
plan (ExecutionPlan)
- f_jit(x, u, t=0.0)¶
dx = f(x, u, t) with frozen params.
- f_jit_p(x, u, t, params)¶
dx = f(x, u, t, p) with caller-supplied params.
- outputs_jit(x, u, t=0.0)¶
All boundary output ports, frozen params.
- outputs_jit_p(x, u, t, params)¶
All boundary output ports; caller-supplied params.
- class minilink.core.compile.evaluators.jax_evaluators.JaxStaticEvaluator(system, verbose=False)[source]¶
JAX evaluator for a static
Systemleaf.- Parameters:
system (System)
- outputs_jit(x, u, t=0.0)¶
All boundary output ports, frozen params.
- outputs_jit_p(x, u, t, params)¶
All boundary output ports; caller-supplied params.
- class minilink.core.compile.evaluators.jax_evaluators.JaxStepEvaluator(system, verbose=False)[source]¶
Compiled evaluator for a
StepSystemusing JAX.- Parameters:
system (StepSystem)
- rollout(x0, *, n_steps, u=None)[source]¶
Roll out
x_{k+1} = step(x_k, u_k, k)forn_stepstransitions.Returns a state-only
StepRolloutwithk.shape == (n_steps + 1,),x.shape == (n, n_steps + 1), andu.shape == (m, n_steps + 1). Signal histories are owned byComputerandHybridSimulator.
- outputs_jit(x, u, k=0)¶
All boundary output ports, frozen params.
- outputs_jit_p(x, u, k, params)¶
All boundary output ports; caller-supplied params.
- step_jit(x, u, k=0)¶
x_{k+1} = step(x, u, k) with frozen params.
- step_jit_p(x, u, k, params)¶
x_{k+1} = step(x, u, k, p) with caller-supplied params.
- class minilink.core.compile.evaluators.jax_evaluators.JaxStepDiagramEvaluator(plan, diagram, verbose=False)[source]¶
JAX evaluator for a compiled step diagram.
- Parameters:
plan (StepExecutionPlan)
- outputs_jit(x, u, k=0)¶
All boundary output ports, frozen params.
- outputs_jit_p(x, u, k, params)¶
All boundary output ports; caller-supplied params.
- step_jit(x, u, k=0)¶
x_{k+1} = step(x, u, k) with frozen params.
- step_jit_p(x, u, k, params)¶
x_{k+1} = step(x, u, k, p) with caller-supplied params.
- rollout(x0, *, n_steps, u=None)[source]¶
Roll out
x_{k+1} = step(x_k, u_k, k)forn_stepstransitions.Returns a state-only
StepRolloutwithk.shape == (n_steps + 1,),x.shape == (n, n_steps + 1), andu.shape == (m, n_steps + 1). Signal histories are owned byComputerandHybridSimulator.