Attractors with a 2D or 1D architecture align grid maps.

a, Schematics of the network model, including an input layer with place cell-like activity (purple), feedforward all-to-all connections with Hebbian plasticity and a grid cell layer (green) with global inhibition and a set of excitatory recurrent collaterals of fixed structure. b, Schematics of the recurrent connectivity from a given cell (orange) to its neighbors (green) in a 2D (top) or 1D (bottom) setup. c, Representative examples of maps belonging to the same 2D (top) or 1D (bottom) network at the end of training. d, Average of all autocorrelograms in the same two simulations, highlighting the 6 maxima around the center (black circles). e, Superposition of the 6 maxima around the center (as in d) for all individual autocorrelograms in the same two simulations.

Quantification of the alignment and contraction of grid maps by different attractor architectures.

a, Distribution of gridness (left), spacing (center) and spread (right) at the end of the learning process across conditions (quartiles; identical simulations except for the architecture of recurrent collaterals). b, Smoothed distribution of maxima relative to the main axis of the corresponding autocorrelogram. c, Mean evolution of gridness (top) and spacing (bottom) in transient maps along the learning process, calculated from individual (left) or average (right) autocorrelograms.

The population activity in all attractor conditions is locally 2-dimensional, with no boundary or singularities.

a, Distribution across conditions of the fraction of the data with local dimensionality of 2 (quartiles). b, Distribution of local dimensionality across physical space in representative examples of 1D and 2D conditions. c, Average distribution of local dimensionality for all conditions (same color code as in b). d-f, As a-c for but exploring deviations of the local homology H1 from a value of 1, the value expected away from borders and singularities.

For 1D and 2D architectures, the population activity is an orientable manifold with the homology of torus.

a, Smoothed density of pooled data (colored areas) and average across simulations (circles) of persistence diagrams with coefficients in Z2 for H0 (grey), H1 (blue) and H2 (red) corresponding to simulations in the 1D (top) and 2D (bottom) conditions. b, As a but with coefficients in Z3. Similarity with a implies that population activity lies within an orientable surface. c, Distribution across simulations of lifetime difference between consecutive generators ordered for each simulation from longest to shortest lifetime for 1D (left) and 2D (right). Maxima coincide with Betti numbers. d, Pie plot and table indicating the number of simulations (out of 100 in each condition) classified according to their Betti numbers.

Features of the attractor architecture observed in the persistent homology of neural activity.

a, From top to bottom, diagrams as in Figure 4a but for the point cloud of neurons in conditions 1D, 2D and 1DL. Each panel shows smoothed density of pooled data (colored areas) and average (circles) persistence diagrams for H0 (gray), H1 (blue) and H2 (red) with coefficients in Z2. b, As in Figure 4c, distribution of the difference between consecutive generators ordered for each simulation from longest to shortest lifetime. c, Pie plots showing the percentage of simulations in which each combination of Betti numbers was found.

Multiple configurations for the alignment of grid maps by one-dimensional attractors.

a, Top: Population map for 4 representative examples of 1D simulations with increasing configuration order (indicated) from left to right. Color indicates the region of the ring attractor best describing the mean population activity at each position. Schematics of some of the frontiers, defined by abrupt changes in color (black), and hexagonal tiles maximally coinciding with these frontiers (semi-transparent white) are included for visualization purposes. Bottom: Schematic representation of the order of the solution as the minimum number of colors traversing the perimeter of the hexagonal tile or, equivalently, the minimum number of hexagonal tiles whose perimeter is traversed by one cycle of the attractor. b, Table indicating the number of simulations out of 100 in which each configuration order was found. c, Schematic representation of the ring attractor extending in space from a starting point to different order neighbors in a hexagonal arrangement. d, As a but for the 1DL condition. Gray scale emphasizes the lack of connections between extremes of the stripe attractor.

Two different visualizations of the twisted torus obtained with Isomap.

a, Top: Representative examples of dimensionality reduction into a structure resembling a tetrahedron for different conditions (indicated). Data points are colored according to the distance to one of the four cluster centers obtained with k-means (each one close to tetrahedron vertices; k = 4). Bottom: Same data and color code but plotted in physical space. The white square indicates the minimal tile containing all colors, with correspondence between edges, indicated by arrows, matching the basic representation of the twisted torus. b, Representative examples of dimensionality reduction into a torus structure squeezed at two points, obtained in other simulations using identical Isomap parametrization. Hue (color) and value (from black to bright) indicate angular and radial cylindrical coordinates, respectively. c, For the same two examples (indicated), three dimensional renderings. To improve visualization of the torus cavity, color is only preserved for data falling along the corresponding dashed lines in b.

Methods in topological data analysis and examples.

a, Basic representation of different geometries (indicated) and their corresponding Betti numbers. b, Local dimensionality of a sphere (i) and a local neighborhood (ii), computed by obtaining its local principal components (iii) and finding and elbow on the rate of explained variance (iv). c, Left, top: Birth and death of a generator in H1 (a cycle) for the same collection of datapoints and increasing radius. Left, bottom: barcode diagram indicating the birth and death of all generators. Right: Lifetime diagram indicating the birth and length of bars in b, distinctively indicating relevant generators and noise. d, Local homology in different locations of a locally two-dimensional object. Deviations from the Betti number B1 = 1 can indicate boundaries (B1 = 0) or singularities (B1 > 1) as exemplified. e, Orientable (top, torus) and non-orientable (bottom, Klein bottle) objects with Betti numbers [1, 2, 1] in Z2 but different Betti numbers in Z3 (indicated).

Persistent homology and Betti numbers for condition 1DL.

a, Smoothed density of pooled data (colored areas) and average across simulations (circles) of persistence diagrams with coefficients in Z2 for H0 (grey), H1 (blue) and H2 (red) corresponding to simulations in the 1DL condition. b, as a but in Z3. c, Distribution across simulations of lifetime difference between consecutive generators ordered for each simulation from longest to shortest lifetime. d, Pie plot and table indicating the number of simulations (out of 100) classified according to their Betti numbers.