hh_psc_alpha_clopath#

class brainpy.state.hh_psc_alpha_clopath(in_size, E_L=Quantity(-54.402, 'mV'), C_m=Quantity(100., 'pF'), g_Na=Quantity(12000., 'nS'), g_K=Quantity(3600., 'nS'), g_L=Quantity(30., 'nS'), E_Na=Quantity(50., 'mV'), E_K=Quantity(-77., 'mV'), t_ref=Quantity(2., 'ms'), tau_syn_ex=Quantity(0.2, 'ms'), tau_syn_in=Quantity(2., 'ms'), I_e=Quantity(0., 'pA'), tau_u_bar_plus=Quantity(114., 'ms'), tau_u_bar_minus=Quantity(10., 'ms'), tau_u_bar_bar=Quantity(500., 'ms'), V_m_init=Quantity(-65., 'mV'), Act_m_init=None, Inact_h_init=None, Act_n_init=None, u_bar_plus_init=Quantity(0., 'mV'), u_bar_minus_init=Quantity(0., 'mV'), u_bar_bar_init=Quantity(0., 'mV'), gsl_error_tol=1e-06, spk_fun=ReluGrad(alpha=0.3, width=1.0), spk_reset='hard', name=None)#

NEST-compatible Hodgkin-Huxley neuron with Clopath plasticity support.

Current-based spiking neuron using the Hodgkin-Huxley formalism with voltage-gated sodium and potassium channels, leak conductance, alpha-function postsynaptic currents, threshold-and-local-maximum spike detection, and three additional low-pass filtered voltage traces for Clopath voltage-based STDP. Follows NEST models/hh_psc_alpha_clopath.{h,cpp} implementation with adaptive Runge-Kutta integration (RK45).

1. Mathematical Model

Membrane and ionic current dynamics:

The membrane potential evolves as

\[C_m \frac{dV_m}{dt} = -(I_{Na} + I_K + I_L) + I_{stim} + I_e + I_{syn,ex} + I_{syn,in}\]

where

\[\begin{split}I_{Na} &= g_{Na}\, m^3\, h\, (V_m - E_{Na}) \\ I_K &= g_K\, n^4\, (V_m - E_K) \\ I_L &= g_L\, (V_m - E_L)\end{split}\]

Gating variables \(m\) (Na activation), \(h\) (Na inactivation), \(n\) (K activation) obey first-order kinetics:

\[\frac{dx}{dt} = \alpha_x(V)(1 - x) - \beta_x(V)\,x\]

with voltage-dependent rate functions (voltage \(V\) in mV, rates in 1/ms):

\[\begin{split}\alpha_n &= \frac{0.01\,(V + 55)}{1 - e^{-(V+55)/10}}, \quad \beta_n = 0.125\,e^{-(V+65)/80} \\ \alpha_m &= \frac{0.1\,(V + 40)}{1 - e^{-(V+40)/10}}, \quad \beta_m = 4\,e^{-(V+65)/18} \\ \alpha_h &= 0.07\,e^{-(V+65)/20}, \quad \beta_h = \frac{1}{1 + e^{-(V+35)/10}}\end{split}\]

Clopath low-pass filtered voltage traces:

The model extends standard hh_psc_alpha with three additional state variables for Clopath voltage-based plasticity:

\[\begin{split}\frac{d\bar{u}_+}{dt} &= \frac{-\bar{u}_+ + V_m}{\tau_{\bar{u}_+}} \\ \frac{d\bar{u}_-}{dt} &= \frac{-\bar{u}_- + V_m}{\tau_{\bar{u}_-}} \\ \frac{d\bar{\bar{u}}}{dt} &= \frac{-\bar{\bar{u}} + \bar{u}_-}{\tau_{\bar{\bar{u}}}}\end{split}\]
  • \(\bar{u}_+\) (u_bar_plus) is a slow-filtered voltage with time constant \(\tau_{\bar{u}_+} = 114\) ms, used for LTP induction.

  • \(\bar{u}_-\) (u_bar_minus) is a fast-filtered voltage with time constant \(\tau_{\bar{u}_-} = 10\) ms, used for LTD induction.

  • \(\bar{\bar{u}}\) (u_bar_bar) is a second-stage slow filter of \(\bar{u}_-\) with time constant \(\tau_{\bar{\bar{u}}} = 500\) ms, used for homeostatic sliding threshold in the Clopath rule.

These traces are integrated as part of the same 11-dimensional ODE system and are accessible to connected Clopath synapse models for computing voltage-dependent weight updates.

Alpha-function synaptic currents:

Each synapse type (excitatory/inhibitory) is modelled as a second-order linear system producing an alpha-shaped postsynaptic current:

\[\begin{split}\frac{dI_{syn}}{dt} &= dI_{syn} - \frac{I_{syn}}{\tau_{syn}} \\ \frac{d(dI_{syn})}{dt} &= -\frac{dI_{syn}}{\tau_{syn}}\end{split}\]

A spike arriving with weight \(w\) (in pA) adds \(w \cdot e / \tau_{syn}\) to \(dI_{syn}\), normalizing the peak current to \(w\) for \(w = 1\). Incoming spike weights are split by sign: positive weights drive excitatory state (\(dI_{syn,ex}\)), negative weights drive inhibitory state (\(dI_{syn,in}\)).

2. Spike Detection and Refractory Handling

A spike is detected when the membrane potential crosses 0 mV from below and a local maximum is detected (i.e., the potential starts decreasing). Formally, a spike is emitted when:

  1. refractory_step_count == 0 (not in refractory period), and

  2. V_m >= 0 mV (threshold crossing), and

  3. V_old > V_m (local maximum — potential is now falling).

Unlike integrate-and-fire models, no voltage reset occurs. The potassium current naturally repolarizes the membrane after a spike. During the refractory period \(t_{ref}\), spike emission is suppressed but all state variables (including the Clopath filtered voltages) continue evolving according to their differential equations.

3. Update Order Per Simulation Step

The update follows NEST’s exact order:

  1. Record pre-integration membrane potential (V_old).

  2. Integrate the full 11-dimensional ODE system \((V_m, m, h, n, dI_{ex}, I_{ex}, dI_{in}, I_{in}, \bar{u}_+, \bar{u}_-, \bar{\bar{u}})\) over one time step \([t, t+dt]\) using adaptive RK45 (Dormand-Prince).

  3. Add arriving synaptic spike inputs to \(dI_{syn,ex}\) and \(dI_{syn,in}\).

  4. Check spike condition: V_m >= 0 and V_old > V_m and r == 0.

  5. Update refractory counter and record spike time.

  6. Store buffered external stimulation current for the next step.

4. Numerical Integration

Uses a JAX-based adaptive RKF45 integrator via AdaptiveRungeKuttaStep to match NEST’s GSL RKF45 adaptive integrator. Default tolerance is gsl_error_tol=1e-6. All neurons are integrated simultaneously in a vectorized fashion.

5. Assumptions, Constraints, and Computational Implications

  • C_m > 0, g_Na >= 0, g_K >= 0, g_L >= 0, tau_syn_ex > 0, tau_syn_in > 0, tau_u_bar_plus > 0, tau_u_bar_minus > 0, tau_u_bar_bar > 0, and t_ref >= 0 are enforced at construction.

  • External current update(x=...) is buffered for one step, matching NEST ring-buffer semantics.

  • The adaptive RKF45 integrator performs vectorized integration across all neurons simultaneously, enabling efficient GPU acceleration.

  • Spike detection uses a local maximum criterion rather than threshold crossing alone, matching biological action potential dynamics.

  • The three Clopath voltage traces add computational overhead (~27% increase in ODE dimensions compared to hh_psc_alpha), but enable voltage-based plasticity without requiring additional post-hoc filtering.

Parameters:
  • in_size (Size) – Population shape specification. All per-neuron parameters are broadcast to self.varshape derived from in_size.

  • E_L (ArrayLike, optional) – Leak reversal potential \(E_L\) in mV; scalar or array broadcastable to self.varshape. Determines resting potential. Default is -54.402 * u.mV.

  • C_m (ArrayLike, optional) – Membrane capacitance \(C_m\) in pF; broadcastable to self.varshape and strictly positive. Default is 100. * u.pF.

  • g_Na (ArrayLike, optional) – Sodium peak conductance \(g_{Na}\) in nS; broadcastable to self.varshape and non-negative. Default is 12000. * u.nS.

  • g_K (ArrayLike, optional) – Potassium peak conductance \(g_K\) in nS; broadcastable to self.varshape and non-negative. Default is 3600. * u.nS.

  • g_L (ArrayLike, optional) – Leak conductance \(g_L\) in nS; broadcastable to self.varshape and non-negative. Default is 30. * u.nS.

  • E_Na (ArrayLike, optional) – Sodium reversal potential \(E_{Na}\) in mV; broadcastable to self.varshape. Default is 50. * u.mV.

  • E_K (ArrayLike, optional) – Potassium reversal potential \(E_K\) in mV; broadcastable to self.varshape. Default is -77. * u.mV.

  • t_ref (ArrayLike, optional) – Absolute refractory period \(t_{ref}\) in ms; broadcastable to self.varshape and non-negative. Converted to integer step counts by ceil(t_ref / dt). Default is 2. * u.ms.

  • tau_syn_ex (ArrayLike, optional) – Excitatory alpha time constant \(\tau_{syn,ex}\) in ms; broadcastable to self.varshape and strictly positive. Default is 0.2 * u.ms.

  • tau_syn_in (ArrayLike, optional) – Inhibitory alpha time constant \(\tau_{syn,in}\) in ms; broadcastable to self.varshape and strictly positive. Default is 2. * u.ms.

  • I_e (ArrayLike, optional) – Constant injected current \(I_e\) in pA; scalar or array broadcastable to self.varshape. Default is 0. * u.pA.

  • tau_u_bar_plus (ArrayLike, optional) – Time constant \(\tau_{\bar{u}_+}\) in ms for slow voltage filter \(\bar{u}_+\) (used in Clopath LTP); broadcastable to self.varshape and strictly positive. Default is 114. * u.ms.

  • tau_u_bar_minus (ArrayLike, optional) – Time constant \(\tau_{\bar{u}_-}\) in ms for fast voltage filter \(\bar{u}_-\) (used in Clopath LTD); broadcastable to self.varshape and strictly positive. Default is 10. * u.ms.

  • tau_u_bar_bar (ArrayLike, optional) – Time constant \(\tau_{\bar{\bar{u}}}\) in ms for second-stage slow filter \(\bar{\bar{u}}\) (used in Clopath homeostatic threshold); broadcastable to self.varshape and strictly positive. Default is 500. * u.ms.

  • V_m_init (ArrayLike, optional) – Initial membrane potential in mV; broadcastable to self.varshape. Default is -65. * u.mV.

  • Act_m_init (ArrayLike or None, optional) – Initial Na activation gating variable (dimensionless, range [0,1]); broadcastable to self.varshape. If None, initialized to equilibrium value at V_m_init. Default is None.

  • Inact_h_init (ArrayLike or None, optional) – Initial Na inactivation gating variable (dimensionless, range [0,1]); broadcastable to self.varshape. If None, initialized to equilibrium value at V_m_init. Default is None.

  • Act_n_init (ArrayLike or None, optional) – Initial K activation gating variable (dimensionless, range [0,1]); broadcastable to self.varshape. If None, initialized to equilibrium value at V_m_init. Default is None.

  • u_bar_plus_init (ArrayLike, optional) – Initial value for \(\bar{u}_+\) in mV; broadcastable to self.varshape. Default is 0. * u.mV.

  • u_bar_minus_init (ArrayLike, optional) – Initial value for \(\bar{u}_-\) in mV; broadcastable to self.varshape. Default is 0. * u.mV.

  • u_bar_bar_init (ArrayLike, optional) – Initial value for \(\bar{\bar{u}}\) in mV; broadcastable to self.varshape. Default is 0. * u.mV.

  • gsl_error_tol (ArrayLike, optional) – Unitless local RKF45 error tolerance, broadcastable and strictly positive. Default is 1e-6.

  • spk_fun (Callable, optional) – Surrogate spike nonlinearity used by get_spike() for differentiable spike generation. Default is braintools.surrogate.ReluGrad().

  • spk_reset (str, optional) – Reset policy inherited from Neuron. 'hard' applies stop-gradient to match NEST hard reset semantics. Default is 'hard'.

  • name (str or None, optional) – Optional node name for debugging and visualization.

Parameter Mapping

Table 17 Parameter mapping to model symbols#

Parameter

Type / shape / unit

Default

Math symbol

Semantics

in_size

Size; scalar/tuple

required

Defines neuron population shape self.varshape.

E_L

ArrayLike, broadcastable to self.varshape (mV)

-54.402 * u.mV

\(E_L\)

Leak reversal potential (resting potential).

C_m

ArrayLike, broadcastable (pF), > 0

100. * u.pF

\(C_m\)

Membrane capacitance.

g_Na

ArrayLike, broadcastable (nS), >= 0

12000. * u.nS

\(g_{Na}\)

Sodium peak conductance.

g_K

ArrayLike, broadcastable (nS), >= 0

3600. * u.nS

\(g_K\)

Potassium peak conductance.

g_L

ArrayLike, broadcastable (nS), >= 0

30. * u.nS

\(g_L\)

Leak conductance.

E_Na

ArrayLike, broadcastable (mV)

50. * u.mV

\(E_{Na}\)

Sodium reversal potential.

E_K

ArrayLike, broadcastable (mV)

-77. * u.mV

\(E_K\)

Potassium reversal potential.

t_ref

ArrayLike, broadcastable (ms), >= 0

2. * u.ms

\(t_{ref}\)

Absolute refractory period duration.

tau_syn_ex

ArrayLike, broadcastable (ms), > 0

0.2 * u.ms

\(\tau_{syn,ex}\)

Excitatory alpha-kernel time constant.

tau_syn_in

ArrayLike, broadcastable (ms), > 0

2. * u.ms

\(\tau_{syn,in}\)

Inhibitory alpha-kernel time constant.

I_e

ArrayLike, broadcastable (pA)

0. * u.pA

\(I_e\)

Constant external current added every step.

tau_u_bar_plus

ArrayLike, broadcastable (ms), > 0

114. * u.ms

\(\tau_{\bar{u}_+}\)

Time constant for slow voltage filter (Clopath LTP).

tau_u_bar_minus

ArrayLike, broadcastable (ms), > 0

10. * u.ms

\(\tau_{\bar{u}_-}\)

Time constant for fast voltage filter (Clopath LTD).

tau_u_bar_bar

ArrayLike, broadcastable (ms), > 0

500. * u.ms

\(\tau_{\bar{\bar{u}}}\)

Time constant for second-stage filter (Clopath homeostasis).

V_m_init

ArrayLike, broadcastable (mV)

-65. * u.mV

Initial membrane potential.

Act_m_init

ArrayLike or None, dimensionless

None

Initial Na activation; None uses equilibrium at V_m_init.

Inact_h_init

ArrayLike or None, dimensionless

None

Initial Na inactivation; None uses equilibrium at V_m_init.

Act_n_init

ArrayLike or None, dimensionless

None

Initial K activation; None uses equilibrium at V_m_init.

u_bar_plus_init

ArrayLike, broadcastable (mV)

0. * u.mV

Initial value for \(\bar{u}_+\).

u_bar_minus_init

ArrayLike, broadcastable (mV)

0. * u.mV

Initial value for \(\bar{u}_-\).

u_bar_bar_init

ArrayLike, broadcastable (mV)

0. * u.mV

Initial value for \(\bar{\bar{u}}\).

gsl_error_tol

ArrayLike, broadcastable, unitless, > 0

1e-6

Local absolute tolerance for the embedded RKF45 error estimate.

spk_fun

Callable

ReluGrad()

Surrogate gradient function for spike generation.

spk_reset

str

'hard'

Reset mode; 'hard' stops gradient through reset.

V#

Membrane potential \(V_m\). Shape: self.varshape. Units: mV.

Type:

brainstate.HiddenState

m#

Na activation gating variable (dimensionless). Shape: self.varshape. Range: [0, 1].

Type:

brainstate.HiddenState

h#

Na inactivation gating variable (dimensionless). Shape: self.varshape. Range: [0, 1].

Type:

brainstate.HiddenState

n#

K activation gating variable (dimensionless). Shape: self.varshape. Range: [0, 1].

Type:

brainstate.HiddenState

I_syn_ex#

Excitatory postsynaptic current \(I_{syn,ex}\). Shape: self.varshape. Units: pA.

Type:

brainstate.ShortTermState

I_syn_in#

Inhibitory postsynaptic current \(I_{syn,in}\). Shape: self.varshape. Units: pA.

Type:

brainstate.ShortTermState

dI_syn_ex#

Excitatory alpha-kernel derivative state. Shape: self.varshape. Units: pA/ms.

Type:

brainstate.ShortTermState

dI_syn_in#

Inhibitory alpha-kernel derivative state. Shape: self.varshape. Units: pA/ms.

Type:

brainstate.ShortTermState

u_bar_plus#

Slow-filtered voltage \(\bar{u}_+\) for Clopath LTP. Shape: self.varshape. Units: mV.

Type:

brainstate.HiddenState

u_bar_minus#

Fast-filtered voltage \(\bar{u}_-\) for Clopath LTD. Shape: self.varshape. Units: mV.

Type:

brainstate.HiddenState

u_bar_bar#

Second-stage filtered voltage \(\bar{\bar{u}}\) for Clopath homeostasis. Shape: self.varshape. Units: mV.

Type:

brainstate.HiddenState

I_stim#

One-step delayed external current buffer. Shape: self.varshape. Units: pA.

Type:

brainstate.ShortTermState

refractory_step_count#

Remaining refractory steps. Shape: self.varshape. Dtype: int32.

Type:

brainstate.ShortTermState

last_spike_time#

Time of most recent spike emission. Shape: self.varshape. Units: ms. Updated to t + dt on spike emission.

Type:

brainstate.ShortTermState

integration_step#

Persistent RKF45 substep size estimate (ms).

Type:

brainstate.ShortTermState

Raises:

ValueError – If any of the following conditions are violated: - C_m <= 0 - t_ref < 0 - tau_syn_ex <= 0 or tau_syn_in <= 0 - tau_u_bar_plus <= 0, tau_u_bar_minus <= 0, or tau_u_bar_bar <= 0 - g_Na < 0, g_K < 0, or g_L < 0 - gsl_error_tol <= 0

Notes

  • Unlike IAF models, the HH model does not reset the membrane potential after a spike. Repolarization occurs naturally through the potassium current.

  • During the refractory period, the neuron’s subthreshold dynamics continue to evolve freely; only spike emission is suppressed.

  • Spike weights are interpreted as current amplitudes (pA). Positive weights are excitatory; negative weights are inhibitory.

  • The three Clopath-related voltage traces (u_bar_plus, u_bar_minus, u_bar_bar) are integrated as part of the same 11-dimensional ODE system, matching NEST’s GSL integration. This adds ~27% computational overhead compared to hh_psc_alpha.

  • The adaptive RKF45 integrator evaluates the ODE right-hand side multiple times per step, so computation cost scales with desired accuracy (controlled by gsl_error_tol).

  • Spike detection combines threshold crossing (0 mV) and local maximum detection, matching the biological action potential waveform.

References

See also

hh_psc_alpha

Hodgkin-Huxley neuron without Clopath plasticity support.

clopath_synapse

Voltage-based STDP synapse model that uses these filtered traces.

Examples

Create a population of HH neurons with Clopath plasticity support:

>>> import brainstate as bst
>>> import brainpy_state as bps
>>> import saiunit as u
>>> bst.environ.set(dt=0.1 * u.ms)
>>> neurons = bps.hh_psc_alpha_clopath(
...     in_size=100,
...     tau_u_bar_plus=114. * u.ms,  # Slow LTP filter
...     tau_u_bar_minus=10. * u.ms,  # Fast LTD filter
...     tau_u_bar_bar=500. * u.ms,   # Homeostatic filter
... )
>>> neurons.init_state()
>>> # Simulate with constant current injection
>>> spikes = neurons.update(400. * u.pA)
>>> # Access Clopath voltage traces for plasticity computation
>>> u_plus = neurons.u_bar_plus.value
>>> u_minus = neurons.u_bar_minus.value
>>> u_bar = neurons.u_bar_bar.value
get_spike(V=None)[source]#

Generate differentiable spike output via surrogate gradient function.

Applies the surrogate spike function self.spk_fun to the membrane potential, producing a differentiable approximation of the Heaviside step function for gradient-based learning. For HH neurons, the spike threshold is 0 mV.

Usage in training:

  • The actual spike detection in update() uses the discrete threshold- and-local-maximum criterion (non-differentiable).

  • This method provides a separate, differentiable spike signal for backpropagation through time (BPTT) or surrogate gradient learning.

  • The returned values do not affect the neuron dynamics; they are purely for gradient computation.

Parameters:

V (ArrayLike or None, optional) – Membrane potential in mV; scalar or array broadcastable to state shape. If None (default), uses the current state self.V.value.

Returns:

Differentiable spike-like signal with shape matching V. Output range depends on self.spk_fun; for ReluGrad(), positive values indicate suprathreshold activity, with gradient flowing through the ReLU derivative at the threshold (0 mV).

Return type:

ArrayLike

Notes

  • The membrane potential V is scaled to be unitless before applying self.spk_fun, as surrogate functions expect dimensionless inputs.

  • Common surrogate functions include: - braintools.surrogate.ReluGrad(): piecewise linear, fast. - braintools.surrogate.Sigmoid(): smooth, symmetric. - braintools.surrogate.ATan(): unbounded, soft.

  • For inference (non-training), use the boolean spike array from update() thresholded at 0 instead of this method.

Examples

Compute differentiable spike output for a given voltage:

>>> import brainpy_state as bps
>>> import saiunit as u
>>> neurons = bps.hh_psc_alpha_clopath(in_size=10)
>>> neurons.init_state()
>>> V_test = u.math.array([[-70., -10., 0., 5., 20.]]) * u.mV
>>> spikes_surrogate = neurons.get_spike(V_test)
>>> print(spikes_surrogate)  # Differentiable approximation
init_state(**kwargs)[source]#

Initialize all neuron state variables.

Creates and initializes the 11-dimensional state vector for each neuron: membrane potential, three gating variables (m, h, n), two pairs of alpha-kernel states (excitatory/inhibitory), three Clopath filtered voltages, and auxiliary states for refractory handling and spike timing.

Initialization logic:

  • Membrane potential (V): set to V_m_init.

  • Gating variables (m, h, n): if explicit Act_m_init, Inact_h_init, Act_n_init are provided, use those values; otherwise, compute equilibrium values at V_m_init using rate functions.

  • Alpha-kernel states (dI_syn_ex, I_syn_ex, dI_syn_in, I_syn_in): initialized to zero.

  • Clopath filtered voltages (u_bar_plus, u_bar_minus, u_bar_bar): set to u_bar_plus_init, u_bar_minus_init, u_bar_bar_init (default 0 mV).

  • Auxiliary states: I_stim set to 0 pA, refractory_step_count set to 0, last_spike_time set to -1e7 ms (far past), integration_step set to dt.

Parameters:

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

Notes

  • Equilibrium gating variables are computed using _hh_psc_alpha_clopath_equilibrium() at the scalar value of V_m_init[0] (first element if V_m_init is an array).

  • Initial Clopath filtered voltages default to 0 mV, matching NEST behavior. For long-running simulations starting from rest, consider setting these to V_m_init to avoid initial transient artifacts in voltage-based plasticity.

  • This method must be called before the first update() call.

See also

_hh_psc_alpha_clopath_equilibrium

Computes equilibrium gating variables.

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

Advance the neuron by one simulation step.

Integrates the full 11-dimensional Hodgkin-Huxley dynamics by one time step, including membrane potential, gating variables, synaptic currents, and three Clopath filtered voltage traces. Follows NEST’s exact update order for hh_psc_alpha_clopath with adaptive RK45 integration.

Update sequence:

  1. Record pre-integration membrane potential (V_old) for spike detection.

  2. Integrate the full 11-dimensional ODE system \((V_m, m, h, n, dI_{ex}, I_{ex}, dI_{in}, I_{in}, \bar{u}_+, \bar{u}_-, \bar{\bar{u}})\) over one time step \([t, t+dt]\) using adaptive RK45 (Dormand-Prince method) with tolerance gsl_error_tol.

  3. Add arriving synaptic spike inputs to \(dI_{syn,ex}\) and \(dI_{syn,in}\) (spike weights split by sign; positive -> excitatory, negative -> inhibitory).

  4. Check spike condition: V_m >= 0 mV and V_old > V_m and refractory_step_count == 0.

  5. Update refractory counter: set to ceil(t_ref / dt) on spike, otherwise decrement if positive.

  6. Record spike time as t + dt if spike detected.

  7. Store buffered external stimulation current x for the next step (one-step delay, matching NEST ring-buffer semantics).

Integration details:

  • Uses AdaptiveRungeKuttaStep with method 'RKF45' for vectorized integration of all neurons simultaneously.

  • The ODE right-hand side includes all 11 state equations with full coupling.

  • Alpha-kernel normalization ensures a weight of 1 pA produces a peak PSC of 1 pA.

Spike detection semantics:

  • No hard reset: Unlike IAF models, the membrane potential is not clamped after a spike. The potassium current \(I_K\) naturally repolarizes the cell.

  • Local maximum criterion: A spike is only emitted when the voltage both exceeds 0 mV and starts to fall (V_old > V_m), matching biological action potential detection.

  • Refractory suppression: Spike emission is blocked during the refractory period, but all state variables (including Clopath filters) continue evolving.

Parameters:

x (ArrayLike, optional) – External stimulation current in pA; scalar or array broadcastable to self.varshape. Added to I_e and synaptic currents in the membrane equation. Buffered for one step (applied in the next update call). Default is 0. * u.pA.

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

Notes

  • The external current x is buffered: the current passed in step \(t\) affects the dynamics at step \(t+1\). This matches NEST’s ring-buffer semantics for device input.

  • Delta inputs (spike-driven) and current inputs (continuous) are summed via sum_delta_inputs() and sum_current_inputs() from the Dynamics base class.

  • Spike weights are interpreted as current amplitudes (pA). To convert from conductance-based models, multiply weights by driving force.

  • The Clopath filtered voltages (u_bar_plus, u_bar_minus, u_bar_bar) are updated automatically as part of the ODE integration. External code (e.g., Clopath synapse models) can read these values after update() completes.

  • Integration is performed with an adaptive vectorized RKF45 loop. All arithmetic is unit-aware via saiunit.math.