cont_delay_synapse

cont_delay_synapse#

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

Static synapse with a continuous, sub-timestep delay (NEST cont_delay_synapse).

Delivery is identical to static_synapse — each presynaptic spike on edge e delivers the constant amplitude weight[e] (pA), no per-edge state evolves — except that delay may fall between grid steps. The substrate honours the sub-step part by delivering at the integer floor delay and splitting the delivered amplitude across the two bracketing grid steps (the fractional_delay output-carry seam); an integer-multiple delay reduces exactly to static_synapse.

Parameters:
  • weight (ArrayLike or Quantity, optional) – Per-edge synaptic weight (pA; bare numbers interpreted as pA, sign preserved). Default 1.0 pA.

  • delay (Quantity, optional) – Homogeneous continuous delay; must be finite, strictly positive and >= dt (the NEST resolution floor). Need not be a multiple of dt. Default 1.0 ms.

  • receptor_type (int, optional) – Postsynaptic receptor port (non-negative integer). Default 0.

Raises:

ValueError – If delay is non-finite, non-positive, or shorter than the simulation resolution dt (NEST floor; checked when dt is known), or if receptor_type < 0.

See also

static_synapse

Fixed grid-delay delivery (the integer-multiple-delay limit).

bernoulli_synapse

Static delivery with stochastic (Bernoulli) transmission.

Notes

NEST models/cont_delay_synapse.h decomposes a continuous delay \(d\) into an integer step count and a sub-step offset. With resolution \(h\), set_status (cont_delay_synapse_impl.h lines 72-87) computes \(\mathrm{frac} = \operatorname{modf}(d/h)\): an on-grid delay (\(\mathrm{frac}=0\)) keeps delay_steps = d/h, delay_offset_ = 0; an off-grid delay sets delay_steps = \lfloor d/h\rfloor + 1 and delay_offset_ = h(1-\mathrm{frac}), so the realised delay is \(\mathrm{delay\_steps}\cdot h - \mathrm{delay\_offset\_} = d\). send() (lines 218-246) emits one spike carrying that offset; only a precise (*_ps) postsynaptic neuron integrates the true off-grid arrival, whereas a grid neuron ignores the offset and receives the event at \(\lceil d/h\rceil\).

Grid-faithful first-moment scheme. EventPlasticProj is a grid integrator and cannot place an event between steps. Instead, because this spec sets fractional_delay = True, the substrate delivers the (binary) event at the integer floor delay \(k_{lo} = \lfloor d/h\rfloor\) and splits the delivered amplitude across the two bracketing grid steps with a one-step FIR \([\,1-\mathrm{frac},\ \mathrm{frac}\,]\), \(\mathrm{frac} = d/h - k_{lo}\). This conserves total charge exactly (\((1-\mathrm{frac}) + \mathrm{frac} = 1\), so the time-integrated postsynaptic current — hence the integrated depolarization — is preserved) and places the arrival centroid exactly at \(d\) (first moment exact). Measured against NEST’s precise iaf_psc_exp_ps (which integrates the true off-grid arrival at \(t+d\)), the integrated depolarization \(\int V_m\) and the broad EPSP peak amplitude therefore agree to \(\sim 10^{-4}\) relative and the peak timing to within one step; the sole residual is a bounded sub-step onset transient (a ripple at the PSC onset discontinuity, \(\mathrm{frac}\)-dependent and first order in \(h/\tau\) there, vanishing as \(h\to 0\)) that a grid integrator cannot avoid. frac == 0 (an integer-multiple delay) collapses to a plain grid delay, byte-identical to static_synapse. The seam is delivery-side only: the event matmul still sees a binary presynaptic vector (ctx.pre_spike stays binary), and the rule kernel itself is the trivial static rule.

References

Examples

>>> import brainstate
>>> import brainunit as u
>>> from brainpy.state import cont_delay_synapse
>>> brainstate.environ.set(dt=0.1 * u.ms)
>>> s = cont_delay_synapse(weight=20.0 * u.pA, delay=0.17 * u.ms)
>>> s.fractional_delay
True
>>> s.stochastic
False
>>> s.edge_state_init()
{}