SymmetryGapJunction

SymmetryGapJunction#

class brainpy.state.SymmetryGapJunction(couples, states, conn, weight, param_type=<class 'brainstate.ParamState'>)#

Implements a symmetric electrical coupling (gap junction) between neuron populations.

This class represents electrical synapses where the conductance is identical in both directions. Gap junctions allow bidirectional flow of electrical current directly between neurons, with the current magnitude proportional to the voltage difference between connected neurons.

Parameters:
  • couples (Union[Tuple[Dynamics, Dynamics], Dynamics]) – Either a single Dynamics object (when pre and post populations are the same) or a tuple of two Dynamics objects (pre, post) representing the coupled neuron populations.

  • states (Union[str, Tuple[str, str]]) – Either a single string (when pre and post states are the same) or a tuple of two strings (pre_state, post_state) representing the state variables to use for calculating voltage differences (typically membrane potentials).

  • conn (Callable) – Connection function that returns pre_ids and post_ids arrays defining connections.

  • weight (Union[Callable, ArrayLike]) – Conductance weights for the gap junctions. The same weight applies in both directions of the connection.

  • param_type (type, optional) – The parameter state type to use for weights, defaults to ParamState.

Notes

The symmetric gap junction applies identical conductance in both directions between connected neurons, ensuring balanced electrical coupling in the network.

See also

AsymmetryGapJunction

For gap junctions with different conductances in each direction.

References

Examples

>>> import brainpy
>>> import brainstate
>>> import saiunit as u
>>> # Create two neuron populations
>>> neurons = brainpy.state.HH(100)
>>> neurons.init_state(batch_size=1)
>>> # Create symmetric gap junctions (self-coupling)
>>> gj = brainpy.state.SymmetryGapJunction(
...     couples=neurons,
...     states='V',
...     conn=lambda pre_size, post_size: ([0,1,2], [1,2,0]),
...     weight=0.1 * u.msiemens,
... )