NEST-Compatible Spatial Networks#

Spatially-structured network primitives compatible with the NEST simulator nest.spatial API. These build layers of nodes embedded in 2-D or 3-D space, define distance-dependent connection kernels and masks, and provide tools to inspect and visualize the resulting connectivity.

Layers & Positions#

Construct populations whose nodes carry spatial coordinates.

spatial.Layer

A set of node positions in 2-D or 3-D space.

spatial.grid

Build a regular cell-centered lattice (NEST nest.spatial.grid).

spatial.free

Build a free-position layer (NEST nest.spatial.free).

spatial.pos

Exposes .x/.y/.z building a given per-axis expression class (NEST pos etc.).

spatial.source_pos

Exposes .x/.y/.z building a given per-axis expression class (NEST pos etc.).

spatial.target_pos

Exposes .x/.y/.z building a given per-axis expression class (NEST pos etc.).

Distance & Displacement#

Compute spatial relationships between source and target nodes.

spatial.displacement

Pairwise displacement post - pre.

spatial.pairwise_distance

Pairwise Euclidean distance.

spatial.Distance

Pairwise Euclidean distance between two layers (NEST Distance).

Connection Kernels#

Distance-dependent connection-probability profiles.

spatial.gaussian

Gaussian distance-dependent connection probability.

spatial.exponential

Exponential distance-dependent connection probability.

spatial.gamma

Gamma distance-dependent connection probability.

spatial.gabor

Rectified-Gabor connection probability on the (x, y) displacements (NEST gabor).

spatial.gaussian2D

Bivariate-Gaussian connection probability on the (x, y) displacements (NEST gaussian2D).

Masks#

Spatial regions that restrict the set of candidate targets.

spatial.circular

Circular mask (2-D): target within radius of source.

spatial.spherical

Spherical mask (3-D): target within radius of source (same cutoff as circular).

spatial.box

Box mask (2-D/3-D): target displacement within [lower_left, upper_right].

spatial.rectangular

Rectangular mask (2-D): target displacement within [lower_left, upper_right].

spatial.doughnut

Doughnut (annulus) mask (2-D): inner_radius < d <= outer_radius.

spatial.elliptical

Elliptical mask (2-D): displacement inside a rotated ellipse (NEST elliptical).

spatial.ellipsoidal

Ellipsoidal mask (3-D): displacement inside a rotated ellipsoid (NEST ellipsoidal).

Spatial Connection Rules#

Distance-dependent pairwise-Bernoulli connectivity.

spatial.SpatialConnRule

Spatially-resolved pairwise-Bernoulli rule: p(d) within an optional mask.

spatial.spatial_pairwise_bernoulli

Distance-dependent pairwise-Bernoulli connection rule (NEST spatial pairwise_bernoulli).

Node Selection & Introspection#

Query nodes by position or mask and dump the resulting layer connectivity.

spatial.center_element

Local index of the node nearest the layer centroid (NEST FindCenterElement).

spatial.nearest_element

Local index of the node nearest each query location (NEST FindNearestElement).

spatial.select_nodes_by_mask

Local indices of the nodes lying inside mask anchored at anchor (NEST SelectNodesByMask).

spatial.target_nodes

Realized target indices of each source node (NEST GetTargetNodes).

spatial.target_positions

Coordinates of each source node's realized targets (NEST GetTargetPositions).

spatial.dump_layer_nodes

Write each node's local index + coordinates to outname (NEST DumpLayerNodes).

spatial.dump_layer_connections

Write each realized edge's endpoints, weight, delay and displacement (NEST DumpLayerConnections).

Visualization#

Plot layers, connection targets/sources, and probability kernels.

spatial.plot_layer

Scatter a layer's node positions (NEST PlotLayer).

spatial.plot_targets

Highlight one source node's realized targets (NEST PlotTargets).

spatial.plot_sources

Highlight one target node's realized sources (NEST PlotSources).

spatial.plot_probability_parameter

Heatmap of a connection kernel p(d) over a 2-D field (NEST PlotProbabilityParameter).