aeif_cond_alpha_astro#

class brainpy.state.aeif_cond_alpha_astro(in_size, V_peak=Quantity(0., "mV"), V_reset=Quantity(-60., "mV"), t_ref=Quantity(0., "ms"), g_L=Quantity(30., "nS"), C_m=Quantity(281., "pF"), E_ex=Quantity(0., "mV"), E_in=Quantity(-85., "mV"), E_L=Quantity(-70.6, "mV"), Delta_T=Quantity(2., "mV"), tau_w=Quantity(144., "ms"), a=Quantity(4., "nS"), b=Quantity(80.5, "pA"), V_th=Quantity(-50.4, "mV"), tau_syn_ex=Quantity(0.2, "ms"), tau_syn_in=Quantity(2., "ms"), I_e=Quantity(0., "pA"), gsl_error_tol=1e-06, V_initializer=Constant(value=-70.6 mV), g_ex_initializer=Constant(value=0. nS), g_in_initializer=Constant(value=0. nS), w_initializer=Constant(value=0. pA), spk_fun=ReluGrad(alpha=0.3, width=1.0), spk_reset='hard', ref_var=False, name=None)#

NEST-compatible aeif_cond_alpha_astro neuron model.

Short description

Conductance-based adaptive exponential integrate-and-fire neuron with alpha-shaped synapses and support for astrocyte slow inward current (SIC).

Description

This model follows NEST models/aeif_cond_alpha_astro.{h,cpp} and is a direct extension of aeif_cond_alpha with an additional SIC current term in the membrane equation.

1. Continuous dynamics

Let \(V\) be membrane voltage and \(w\) adaptation current.

\[C_m \frac{dV}{dt} = -g_L (V - E_L) + g_L \Delta_T \exp\!\left(\frac{V - V_{th}}{\Delta_T}\right) - g_{ex}(V - E_{ex}) - g_{in}(V - E_{in}) - w + I_e + I_{stim} + I_{SIC}.\]

Adaptation dynamics:

\[\tau_w \frac{dw}{dt} = a (V - E_L) - w.\]

Alpha conductance states (two states per channel):

\[\frac{d\,dg_{ex}}{dt} = -\frac{dg_{ex}}{\tau_{syn,ex}}, \qquad \frac{d g_{ex}}{dt} = dg_{ex} - \frac{g_{ex}}{\tau_{syn,ex}},\]
\[\frac{d\,dg_{in}}{dt} = -\frac{dg_{in}}{\tau_{syn,in}}, \qquad \frac{d g_{in}}{dt} = dg_{in} - \frac{g_{in}}{\tau_{syn,in}}.\]

Incoming spike weights are interpreted in nS and split by sign:

\[dg_{ex} \leftarrow dg_{ex} + \frac{e}{\tau_{syn,ex}} w_+, \qquad dg_{in} \leftarrow dg_{in} + \frac{e}{\tau_{syn,in}} |w_-|.\]

2. Refractory and spike handling

During refractory integration, effective voltage is clamped to V_reset and \(dV/dt = 0\). Otherwise the RHS uses \(\min(V, V_{peak})\) as in NEST.

Threshold detection uses:

  • V_peak if Delta_T > 0

  • V_th if Delta_T == 0

On a detected spike (inside RKF45 substeps):

  • V <- V_reset

  • w <- w + b

  • refractory counter r <- refractory_counts + 1 if t_ref > 0

3. Update order per simulation step (NEST semantics)

  1. Integrate ODEs on \((t, t+dt]\) with adaptive RKF45.

  2. Inside integration loop: refractory clamp and spike/reset/adaptation.

  3. Decrement refractory counter once.

  4. Apply arriving spike weights to dg_ex / dg_in.

  5. Store new external current into one-step delayed I_stim.

  6. Store SIC ring-buffer value for next step in I_SIC.

4. SIC event semantics

sic_events passed to update() emulate NEST SICEvent handling. For an event with weight, coefficient series coeffs and delay_steps:

  • effective ring-buffer offset is delay_steps - 1,

  • each coefficient is added to future SIC buffer entries as weight * coeffs[i].

This matches NEST handle(SICEvent&) where contributions are written to sic_currents_ and become available through I_SIC with one-step delayed application in membrane dynamics.

Parameters:
  • in_size (Size) – Population shape. States are broadcast/initialized over self.varshape derived from in_size.

  • V_peak (ArrayLike) – Voltage-like parameters in mV, each broadcastable to self.varshape.

  • V_reset (ArrayLike) – Voltage-like parameters in mV, each broadcastable to self.varshape.

  • V_th (ArrayLike) – Voltage-like parameters in mV, each broadcastable to self.varshape.

  • E_ex (ArrayLike) – Voltage-like parameters in mV, each broadcastable to self.varshape.

  • E_in (ArrayLike) – Voltage-like parameters in mV, each broadcastable to self.varshape.

  • E_L (ArrayLike) – Voltage-like parameters in mV, each broadcastable to self.varshape.

  • Delta_T (ArrayLike) – Voltage-like parameters in mV, each broadcastable to self.varshape.

  • t_ref (ArrayLike) – Time constants in ms, broadcastable to self.varshape.

  • tau_w (ArrayLike) – Time constants in ms, broadcastable to self.varshape.

  • tau_syn_ex (ArrayLike) – Time constants in ms, broadcastable to self.varshape.

  • tau_syn_in (ArrayLike) – Time constants in ms, broadcastable to self.varshape.

  • g_L (ArrayLike) – Conductances in nS, broadcastable to self.varshape.

  • a (ArrayLike) – Conductances in nS, broadcastable to self.varshape.

  • C_m (ArrayLike) – Membrane capacitance in pF, broadcastable to self.varshape.

  • b (ArrayLike) – Currents in pA, broadcastable to self.varshape.

  • I_e (ArrayLike) – Currents in pA, broadcastable to self.varshape.

  • gsl_error_tol (ArrayLike) – Unitless local RKF45 error tolerance, broadcastable and strictly positive.

  • V_initializer (Callable) – Initializer callables used by init_state() and reset_state().

  • g_ex_initializer (Callable) – Initializer callables used by init_state() and reset_state().

  • g_in_initializer (Callable) – Initializer callables used by init_state() and reset_state().

  • w_initializer (Callable) – Initializer callables used by init_state() and reset_state().

  • spk_fun (Callable) – Surrogate spike function used by get_spike().

  • spk_reset (str) – Reset mode inherited from Neuron.

  • ref_var (bool) – If True, allocate and expose self.refractory state.

  • name (str | None) – Optional node name.

Parameter Mapping

Table 14 Parameter mapping to model symbols#

Parameter

Type / shape / unit

Default

Math symbol

Semantics

in_size

Size; scalar or tuple

required

Population shape defining self.varshape.

V_peak

ArrayLike, broadcastable to self.varshape (mV)

0.0 * u.mV

\(V_\mathrm{peak}\)

Spike detection threshold when Delta_T > 0 and RHS clamp limit via \(\min(V, V_{peak})\).

V_reset

ArrayLike, broadcastable (mV)

-60.0 * u.mV

\(V_\mathrm{reset}\)

Membrane reset value and refractory clamp voltage.

t_ref

ArrayLike, broadcastable (ms)

0.0 * u.ms

\(t_\mathrm{ref}\)

Absolute refractory duration converted to integer step counts using ceil(t_ref / dt).

g_L, C_m

ArrayLike, broadcastable (nS, pF)

30.0 * u.nS, 281.0 * u.pF

\(g_L\), \(C_m\)

Leak conductance and membrane capacitance in the AdEx membrane ODE.

E_ex, E_in, E_L

ArrayLike, broadcastable (mV)

0.0 * u.mV, -85.0 * u.mV, -70.6 * u.mV

\(E_\mathrm{ex}\), \(E_\mathrm{in}\), \(E_L\)

Excitatory, inhibitory, and leak reversal potentials.

Delta_T, V_th

ArrayLike, broadcastable (mV)

2.0 * u.mV, -50.4 * u.mV

\(\Delta_T\), \(V_\mathrm{th}\)

Exponential spike-initiation slope and soft-threshold location.

tau_w, a, b

ArrayLike, broadcastable (ms, nS, pA)

144.0 * u.ms, 4.0 * u.nS, 80.5 * u.pA

\(\tau_w\), \(a\), \(b\)

Adaptation time constant, subthreshold coupling, and spike-triggered jump amplitude.

tau_syn_ex, tau_syn_in

ArrayLike, broadcastable (ms)

0.2 * u.ms, 2.0 * u.ms

\(\tau_{\mathrm{syn,ex}}\), \(\tau_{\mathrm{syn,in}}\)

Alpha conductance time constants for excitatory/inhibitory channels.

I_e

ArrayLike, broadcastable (pA)

0.0 * u.pA

\(I_e\)

Constant injected current added every RKF45-accepted substep.

gsl_error_tol

ArrayLike, broadcastable, unitless, > 0

1e-6

Local absolute tolerance for the embedded RKF45 error estimate.

V_initializer

Callable

Constant(-70.6 * u.mV)

Initializer for membrane state V.

g_ex_initializer, g_in_initializer

Callable

Constant(0.0 * u.nS)

Initializers for g_ex and g_in; dg_ex and dg_in are always reset to zero.

w_initializer

Callable

Constant(0.0 * u.pA)

Initializer for adaptation current w.

spk_fun

Callable

ReluGrad()

Surrogate spike nonlinearity used by get_spike().

spk_reset

str

'hard'

Reset policy inherited from Neuron; hard reset matches NEST behavior.

ref_var

bool

False

If True, expose boolean state self.refractory.

name

str | None

None

Optional node name.

Raises:
  • ValueError – If parameters violate NEST-compatible constraints: V_reset < V_peak, V_peak >= V_th, Delta_T >= 0, C_m > 0, t_ref >= 0, all time constants strictly positive, and gsl_error_tol > 0. Also raised when the exponential threshold expression can overflow at spike time, for invalid SIC event tuples or non-positive SIC delays, and for runtime instability guards in update().

  • TypeError – If incompatible unitful/unitless values are passed and arithmetic fails during parameter broadcasting, SIC event coercion, or updates.

V#

Membrane potential \(V_m\) (mV).

Type:

HiddenState

dg_ex, dg_in

Alpha auxiliary states stored as numeric values representing \(\mathrm{nS}/\mathrm{ms}\).

Type:

ShortTermState

g_ex, g_in

Excitatory and inhibitory conductances (nS).

Type:

HiddenState

w#

Adaptation current (pA).

Type:

HiddenState

I_stim#

One-step delayed injected current buffer (pA).

Type:

ShortTermState

I_sic#

One-step delayed SIC current (pA) loaded from the SIC queue.

Type:

ShortTermState

refractory_step_count#

Remaining refractory grid steps (int32).

Type:

ShortTermState

integration_step#

Persistent RKF45 substep size estimate (ms).

Type:

ShortTermState

last_spike_time#

Last emitted spike time (ms); written as t + dt on spike.

Type:

ShortTermState

refractory#

Optional boolean refractory indicator, available only when ref_var=True.

Type:

ShortTermState

Recordables

Dynamic recordables follow NEST naming:

  • V_m

  • g_ex

  • g_in

  • w

  • I_SIC

See also

aeif_cond_alpha

AdEx alpha-conductance model without SIC support.

aeif_cond_alpha_multisynapse

AdEx alpha-conductance model with multiple receptor ports.

sic_connection

NEST-style SIC connection model for astrocyte-mediated currents.

Notes

The alpha-synapse subsystem is identical to aeif_cond_alpha; for an event of effective conductance weight \(w\) injected via dg += e w / \tau, the resulting conductance kernel is:

\[g(t) = w \cdot \frac{t}{\tau} \exp\!\left(1-\frac{t}{\tau}\right),\quad t \ge 0.\]

SIC handling is discrete-time queue based. If an SIC event e arrives at simulation step \(s_e\) with delay d_e (steps), weight w_e, and coefficients \(c_{e,i}\), this implementation enqueues:

\[Q[s_e + d_e - 1 + i] \mathrel{+}= w_e c_{e,i}.\]

The membrane ODE at step \(k\) uses stored \(I_{SIC}^{(k)}\) from the previous update call, so a delay of 1 step first affects dynamics on step \(s_e + 1\), matching NEST ring-buffer semantics.

Additional implementation implications:

  • sic_events accepts dict, tuple/list, scalar, or iterable forms; tuple/list forms must have length 2 or 3.

  • Event coeffs can be scalar, state-shaped, or leading-time-array; each coefficient creates one future queue entry.

  • Queue memory cost scales with active future SIC bins and state size.

  • As with aeif_cond_alpha, t_ref=0 can allow multiple in-loop spikes within one simulation step.

References

Examples

>>> import brainpy
>>> import brainstate
>>> import saiunit as u
>>> neuron = brainpy.state.aeif_cond_alpha_astro(in_size=2)
>>> neuron.init_state()
>>> sic = {'weight': 20.0 * u.pA, 'coefficients': [1.0, 0.5], 'delay_steps': 2}
>>> with brainstate.environ.context(dt=0.1 * u.ms, t=0.0 * u.ms):
...     spikes = neuron.update(x=80.0 * u.pA, sic_events=[sic])
>>> spikes.shape
(2,)
get_spike(V=None)[source]#

Evaluate surrogate spike output from membrane voltage.

Parameters:

V (ArrayLike, optional) – Voltage values with shape broadcastable to self.varshape and units compatible with mV. If None, uses current state self.V.value.

Returns:

Surrogate spike activation produced by spk_fun((V - V_th) / (V_th - V_reset)).

Return type:

ArrayLike

init_state(**kwargs)[source]#

Initialize persistent and short-term state variables.

Parameters:

**kwargs – Unused compatibility parameters accepted by the base-state API.

Raises:
  • ValueError – If an initializer cannot be broadcast to requested shape.

  • TypeError – If initializer outputs have incompatible units/dtypes for the corresponding state variables.

update(x=Quantity(0., 'pA'), sic_events=None)[source]#

Advance the neuron by one simulation step with optional SIC events.

Parameters:
  • x (ArrayLike, optional) – Continuous external current input in pA, broadcastable to self.varshape. This value is stored into I_stim and applied at the next simulation step (one-step delay).

  • sic_events (object, optional) – SIC event payload consumed by _enqueue_sic_events(). Enqueued values are popped for the current queue step and stored into I_sic for the next update call.

Returns:

Binary spike tensor with dtype jnp.float64 and shape self.V.value.shape. A value of 1.0 indicates at least one internal spike event occurred during the integrated interval \((t, t+dt]\).

Return type:

jax.Array

Raises:
  • ValueError – If RKF45 integration enters a guarded unstable regime (V < -1e3 mV or |w| > 1e6 pA), if SIC tuple/list events have unsupported lengths, or if SIC delay_steps is not positive.

  • TypeError – If SIC event values cannot be interpreted as numeric arrays.

Notes

Integration is performed with an adaptive vectorized RKF45 loop, including in-loop spike/reset/adaptation events and optional multiple spikes per step. All arithmetic is unit-aware via saiunit.math. SIC events are enqueued after ODE integration, then current-step SIC queue values are popped and written to I_sic for use in the next call.