Exp2Syn#

class braincell.synapse.Exp2Syn(size, name=None, tau1=Quantity(0.1, 'ms'), tau2=Quantity(10., 'ms'), e=Quantity(0., 'mV'))[source]#

NEURON-compatible Exp2Syn template.

This class follows the dynamics in NEURON’s exp2syn.mod:

  • states: A and B in uS

  • decay: A' = -A / tau1, B' = -B / tau2

  • conductance: g = B - A

  • inward-positive point current: I = g * (e - V_post)

  • step-boundary event: A <- A + weighted_pre_drive * factor and same for B

Parameters:
apply_events(payload, V_post=None)[source]#

Apply one already-aggregated event payload vector.

compute_derivative(V_post=None)[source]#

Compute the derivative of the channel’s state variables.

This method should be implemented by subclasses to calculate how the channel’s state changes over time.

Parameters:
  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

Raises:

NotImplementedError – This method must be implemented by subclasses.

current(V_post)[source]#

Calculate the current for this ion channel.

This method should be implemented by subclasses to compute the current based on the channel’s specific properties and state.

Parameters:
  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

Raises:

NotImplementedError – This method must be implemented by subclasses.

root_type#

alias of HHTypedNeuron

classmethod validate_parameter_values(parameters)[source]#

Require tau1 < tau2 elementwise.

Return type:

None

Notes

The comparison runs in numpy, not u.math/jnp. Under an open JAX trace every jax operation returns a tracer even when all its inputs are concrete, so bool() on a u.math.any reduction would raise TracerBoolConversionError and make this class impossible to construct inside a jitted setup function. numpy stages nothing, and it is what the sibling positive() validator already uses.

Both mantissas are taken in ms rather than compared as quantities, so that a caller mixing us and ms is ordered on physical duration rather than on raw magnitude.