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 edgeedelivers the constant amplitudeweight[e](pA), no per-edge state evolves — except thatdelaymay 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 (thefractional_delayoutput-carry seam); an integer-multiple delay reduces exactly tostatic_synapse.- Parameters:
weight (
ArrayLikeorQuantity, optional) – Per-edge synaptic weight (pA; bare numbers interpreted as pA, sign preserved). Default1.0pA.delay (
Quantity, optional) – Homogeneous continuous delay; must be finite, strictly positive and>= dt(the NEST resolution floor). Need not be a multiple ofdt. Default1.0 ms.receptor_type (
int, optional) – Postsynaptic receptor port (non-negative integer). Default0.
- Raises:
ValueError – If
delayis non-finite, non-positive, or shorter than the simulation resolutiondt(NEST floor; checked whendtis known), or ifreceptor_type < 0.
See also
static_synapseFixed grid-delay delivery (the integer-multiple-delay limit).
bernoulli_synapseStatic delivery with stochastic (Bernoulli) transmission.
Notes
NEST
models/cont_delay_synapse.hdecomposes a continuous delay \(d\) into an integer step count and a sub-step offset. With resolution \(h\),set_status(cont_delay_synapse_impl.hlines 72-87) computes \(\mathrm{frac} = \operatorname{modf}(d/h)\): an on-grid delay (\(\mathrm{frac}=0\)) keepsdelay_steps = d/h,delay_offset_ = 0; an off-grid delay setsdelay_steps = \lfloor d/h\rfloor + 1anddelay_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.
EventPlasticProjis a grid integrator and cannot place an event between steps. Instead, because this spec setsfractional_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 preciseiaf_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 tostatic_synapse. The seam is delivery-side only: the event matmul still sees a binary presynaptic vector (ctx.pre_spikestays 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() {}