aeif_cond_alpha_astro#

class brainpy.state.aeif_cond_alpha_astro(*args, **kwargs)#

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. Read the labelled 'I_SIC' current channel and store it into the one-step delayed I_SIC state.

4. SIC delivery semantics

The astrocyte slow-inward current (SIC) is delivered on the JAX substrate by a EventProjection — the sic_connection — that deposits weight·SIC into this neuron’s labelled 'I_SIC' current channel each step (add_current_input). Each update() reads (and pops) that channel before the unlabelled I_stim read, so the device current and the SIC current land in their own terms with no collision, and stores it into I_sic (pA) for the next step.

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. The host-side event queue used by earlier revisions is removed: the SIC current is a State-backed channel, so the whole simulation lowers into one compiled for_loop.

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 16 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 is delivered as a State-backed current channel. The membrane ODE at step \(k\) uses the stored \(I_{SIC}^{(k)}\) from the previous update call, so a SIC current deposited at step \(s\) first affects dynamics on step \(s + 1\), matching NEST’s one-step ring-buffer semantics at the minimum delay.

Additional implementation implications:

  • SIC arrives via add_current_input(key, weight·SIC, label='I_SIC') and is read with sum_current_inputs(label='I_SIC') — no host-side event queue.

  • The labelled 'I_SIC' read happens before the unlabelled I_stim read, so device currents and the SIC current never collide.

  • 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 brainunit as u
>>> neuron = brainpy.state.aeif_cond_alpha_astro(in_size=2)
>>> neuron.init_state()
>>> # A slow-inward current is deposited on the labelled 'I_SIC' channel
>>> # (as the sic_connection projection does inside a Simulator).
>>> with brainstate.environ.context(dt=0.1 * u.ms, t=0.0 * u.ms):
...     neuron.add_current_input('sic', 20.0, label='I_SIC')
...     spikes = neuron.update(x=80.0 * u.pA)
>>> 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'), w_by_rec=None)[source]#

Advance the neuron by one simulation step.

The astrocyte slow-inward current (SIC) is delivered by a EventProjection (the sic_connection) that deposits weight·SIC into this neuron’s labelled 'I_SIC' current channel each step. update reads (and pops) that channel, stores it into I_sic (pA) for the next step — a one-step delay, exactly like I_stim — and the membrane ODE adds the i_sic term.

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).

  • w_by_rec (ArrayLike or None, optional) – Per-receptor synaptic conductance jumps supplied by the Simulator’s multi-receptor bridge, shape (*varshape, n_receptors) as a dimensionless nS mantissa. Column 0 (receptor_type=1) is added to the excitatory conductance and column 1 (receptor_type=2) to the inhibitory conductance. When None (the legacy path), the jumps are self-pulled from the label='w_ex'/'w_in' delta inputs instead.

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).

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 brainunit.math. The labelled 'I_SIC' current channel is read before the unlabelled I_stim read so the device current and the SIC current land in their own terms (no channel collision).