zoomy_core.model.reconstruction_inverse module#
Symbolic inverse of the reconstruction-variables map.
Given a forward map wb_k = f_k(state) (one entry per state slot,
as ZArray), invert_reconstruction() returns the closed-form
inverse state_k = g_k(WB), where WB is a vector of fresh
WB_<state_name> symbols. The inverse is auto-derived via
sympy.solve; topological ordering between slots (e.g. depth-first,
then momentum) is left to sympy. Used by both
zoomy_core.model.basemodel.Model.state_from_reconstruction()
and the corresponding SystemModel-level derived field, so the same
inverse logic is shared symbol-by-symbol whether invoked on the
model’s primitive state or on the SystemModel’s post-CoV state.
- zoomy_core.model.reconstruction_inverse.invert_reconstruction(forward, state_syms)#
Return the symbolic inverse of
forwardas a ZArray of lengthlen(state_syms).- Parameters:
forward (ZArray | sequence) – Reconstruction-variables map — entry
kis the symbolic expression for the WB primitive in slotk, in terms ofstate_syms.state_syms (sequence of sympy.Symbol) – State symbols, in slot order.
- Returns:
Inverse map — entry
kisstate_syms[k]expressed as a sympy expression inWB_<state_name>symbols. For slots where the forward is the identity (forward[k] == state[k]) the inverse is also the identity (WB_<state_name>), nosolvecall.- Return type:
- zoomy_core.model.reconstruction_inverse.reconstruction_symbols(state_syms)#
Return the fresh
WB_<name>symbols paired withstate_syms.One
WB_<state_name>Symbol per state slot, in slot order. The inverse is expressed in terms of these — at lambdification time the runtime feeds them with the limiter’s primitive face values.