DiffEqGroupState#
- class braincell.quad.DiffEqGroupState(value, **kwargs)#
An integrable hidden state whose trailing axis indexes independent states.
This is the state class used by every hidden variable owned by a
braincell.Cell. ACellis a spatial model: its runtime arrays are shapedpop_size + (n_cv,)for voltage andpop_size + (n_point,)for mechanism variables, so the trailing axis enumerates compartments (or points) that evolve independently. That is exactly the contract ofbrainstate.HiddenGroupState—varshapeis everything but the last axis andnum_stateis the last axis — which lets an eligibility-trace learner treat one array asnum_stateseparately traced hidden units.Notes
brainstate.HiddenGroupStaterequiresvalue.ndim >= 2. This is whybraincell.Cellmakes its population axis mandatory (pop_sizedefaults to1and may not be empty) — the validation is inherited unmodified rather than relaxed.See also
DiffEqSingleStateThe ungrouped counterpart used by
SingleCompartment.stateHost-scoped factory that picks between the two.
Examples
>>> import brainunit as u >>> import numpy as np >>> import braincell >>> st = braincell.DiffEqGroupState(np.zeros((1, 4)) * u.mV) >>> st.varshape (1,) >>> st.num_state 4 >>> isinstance(st, braincell.DiffEqState) True