Skip to main content
UKPMC Funders Author Manuscripts logoLink to UKPMC Funders Author Manuscripts
. Author manuscript; available in PMC: 2026 May 15.
Published in final edited form as: Curr Biol. 2025 Feb 10;35(4):709–722.e5. doi: 10.1016/j.cub.2024.08.059

A systems model of alternating theta sweeps via firing rate adaptation

Zilong Ji 1,2,3,#, Tianhao Chu 3,#, Si Wu 3,*, Neil Burgess 1,2,5,*
PMCID: PMC7619080  EMSID: EMS213750  PMID: 39933521

Summary

Place and grid cells provide a neural system for self-location and tend to fire in sequences within each cycle of the hippocampal theta rhythm when rodents run on a linear track. These sequences correspond to the decoded location of the animal sweeping forward from its current location (“theta sweeps”). However, recent findings in open-field environments show alternating left-right theta sweeps and propose a circuit for their generation. Here, we present a computational model of this circuit, comprising theta-modulated head-direction cells, conjunctive grid × direction cells, and pure grid cells, based on continuous attractor dynamics, firing rate adaptation, and modulation by the medial-septal theta rhythm. Due to firing rate adaptation, the head-direction ring attractor exhibits left-right sweeps coding for internal direction, providing an input to the grid cell attractor network shifted along the internal direction, via an intermediate layer of conjunctive grid × direction cells, producing left-right sweeps of position by grid cells. Our model explains the empirical findings, including the alignment of internal position and direction sweeps and the dependence of sweep length on grid spacing. It makes predictions for theta-modulated head-direction cells, including relationships between theta phase precession during turning, theta skipping, anticipatory firing, and directional tuning width, several of which we verify in experimental data from anteroventral thalamus. The model also predicts relationships between position and direction sweeps, running speed, and dorsal-ventral location within the entorhinal cortex. Overall, a simple intrinsic mechanism explains the complex theta dynamics of an internal direction signal within the hippocampal formation, with testable predictions.

Introduction

The entorhinal-hippocampal system plays a crucial role in spatial navigation and goal-directed planning.13 Various spatially tuned cells, including head direction (HD),4 place,5 grid,6 and boundary vector cells,7 support the underlying computational processes involved in these functions. Beyond spatial coding, place and grid cells exhibit a temporal coding feature, i.e., theta phase precession, where the sequential firing of individual neurons occurs progressively earlier in relation to the phase of the ongoing theta rhythm driven by inputs from the medial septum.8,9 At the populational level, phase-precessing cells underlie forward-directed theta sweeps in linear track environments,10 alternating sweeps in T-maze environments11,12 and left-right-alternating sweeps in open-field environments.13

While many network models have been proposed to explain the generation of theta sweeps,1416 they primarily model forward-directed sweeps along the running direction of the animal in linear track environments. This is because the cells are arranged in a one-dimensional manner to fit the environmental setting. It remains unclear how these models can be extended to account for theta sweeps in less constrained environments, such as open fields (but see Chu et al.17 for theta sweeps in T-mazes). Inspired by a recent study demonstrating left-right-alternating theta sweeps from recordings of medial entorhinal cortex (MEC) grid cells in open-field environments,13 we developed a continuous attractor network model to illustrate theta sweeps in such environments. Our model comprises a three-layer network of theta-modulated HD cells, conjunctive grid × direction cells (hereafter referred to as conj-grid cells), and pure grid cells (Figure 1A). The theta-modulated HD cells,13,18,19,20 different from the classic HD cells,4 form a ring attractor (hereafter referred to as the HD attractor for simplicity) where the population activity represents an internal direction signal that can differ significantly from the animal’s HD. This HD attractor activates downstream conj-grid cells whose preferred internal directional tuning aligns with the internal direction coded by HD cells. The conj-grid cells then carry position-dependent input with an offset along the internal direction onto the pure grid cells attractor network (hereafter referred to as the GC attractor), driving the activity bump in the GC attractor to move. Due to firing rate adaptation and medial-septal theta modulation, the internal direction represented by the activity bump in the HD attractor sweeps from side to side of the animal’s head axis at theta rhythm. This consequently results in left-right-alternating bump sweeps in the GC attractor via the conj-grid cells.

Figure 1. The continuous attractor network model with firing rate adaptation.

Figure 1

(A) Illustration of the computation model, consisting of a head-direction ring attractor (HD attractor) and a grid cell two-dimensional attractor (GC attractor). The HD attractor receives input of the animal’s head direction, projecting directional input to the conjunctive head × grid cells, which further send a shifted phase input along the direction of head axis to drive the activity bump in the GC attractor. Two example head-direction cells in the HD attractor.

(B) Two example grid cells in the GC attractor.

(C) Top: illustration of the firing rate adaptation, which is a slow negative feedback modulation to cell firing. Bottom: cell firing frequency as a function of time when applying a constant input current. Different colors represent different adaptation strength.

(D) Train (blue) of action potentials elicited in an in vitro whole-cell patch-clamp MEC cell during 1-s pulse injection (purple). Instantaneous firing frequency (blue dots) was shown at the bottom with an exponential fit (purple curves). The plot is adapted from Yoshida et al.21 with permission.

See also Figure S1.

This model explains many of the empirical findings reported in Vollan et al.,13 including (1) the alignment of internal direction and internal location sweeps in separate attractor networks, (2) the linear relationship between sweep length and grid spacing, and (3) the increase of the sweep alternation score with running speed. It also explains and extend many of the empirical findings reported in HD cells,19,22 including (1) the relationship between theta sweeps in HD cells at the population level and theta-cycle skipping at the single-cell level and (2) broader tuning width of HD cells exhibiting theta skipping than those which do not. Moreover, we make several new predictions. These include how the modulatory theta input affects theta sweeps in both the HD and the grid cell networks, how the HD network controls theta sweeps in the downstream grid cell network, how animals’ behaviors (e.g., running speed, straight runs, and turns) modulate theta sweep features, and how theta sweeps vary in different grid modules along the MEC dorsal-ventral axis. Our model also predicts theta-modulated HD cells with specific properties, which we test with empirical data from theta-modulated HD cells recorded in the anteroventral thalamic nucleus.19

In summary, our model proposes a mechanism for intrinsic generation of theta sweeps in hardwired neural networks within the brain’s spatial navigation system. This model enhances our understanding of the generation and nature of theta sequences, potentially shedding light on the neural dynamics underlying various navigational behaviors.

Results

The computational model

The computational framework, following the neural circuit outlined in Vollan et al.,13 is composed of coupled continuous attractor networks modeling theta-modulated HD cells in the parasubiculum as a ring attractor (HD attractor) and grid cells in the MEC as a two-dimensional attractor on a neuronal sheet (GC attractor) (see Figures 1A–1C and S1 and STAR Methods for details).

Note that neurons in the HD attractor differ from classic (non-theta-modulated) HD cells.4 Instead, they encode an internal direction signal that differs from the animal’s HD—for example, by alternating left and right of the head axis—and may encode something fundamentally different, such as intended movement direction. When the animal runs in the environment, HD-dependent sensory input activates an activity bump in the theta-modulated HD attractor, whose center on the ring represents the internal direction. Activated theta-modulated HD cells that code for the internal direction (referred to as HD cells hereafter for simplicity) then activate downstream conj-grid cells in MEC layer 3, which share the same preferred internal direction as those activated HD cells. The conj-grid cells further transmit a position signal as a phase input onto the GC attractor manifold, with the input strength modulated by the animal’s running speed.23 Importantly, this phase input is slightly shifted along the preferred internal direction of the activated conj-grid cells,13 driving the activity bump in the GC attractor (representing the internal location of the animal) to move in that direction.

Neurons in the model exhibit firing rate adaptation. At the single-neuron level, this leads to a reduction in a neuron’s firing rate in response to an input of constant intensity (Figures 1D and 1E). At the network level, it induces intrinsic mobility of the activity bump by destabilizing it.24 This intrinsic mobility interacts with the external drive of sensory input, resulting in sweeps of the activity bump17 (see below). Furthermore, both the HD cells and the grid cells in the model receive theta rhythmic input from the medial septum25 with input strength increasing with the animal’s running speed (STAR Methods). This theta input governs the sweep frequency of the activity bumps induced by firing rate adaptation. In summary, the combination of intrinsic firing rate adaptation and external theta modulation results in internal direction sweeps in the HD network, which further drives the internal location sweeps in the GC attractor network via an intermediate layer of conj-grid cells (STAR Methods).

Bidirectional and forward sweeps in theta-modulated HD cells

We define the center of the activity bump on the theta-modulated HD attractor manifold as the internal direction of the animal13 (Figure 2A). From the perspective of population activity, the internal direction is a representation decoded from the collective activity of HD cells. This internal direction can differ from the actual HD in theta-modulated HD cells, unlike in classic, non-theta-modulated HD cells. We first demonstrate that with firing rate adaptation, theta-modulated HD cells exhibit sweeps of internal direction. Depending on whether the animal rotates its head, the internal direction exhibits either bidirectional sweeps (side to side of the head axis) or forward sweeps (of angle in the direction of rotation). Specifically, when the animal runs along a straight trajectory with a fixed HD, the internal direction exhibits bidirectional sweeps from side to side of the head axis (Figure 2B), with the averaged offset between internal direction and HD equal to zero (Figure 2D). This aligns with the discrete, alternating activity observed from side to side of the head axis in HD cells during fast and straight running.13

Figure 2. Alternating internal direction sweeps in HD cells and internal location sweeps in grid cells.

Figure 2

(A) A schematic of head direction and internal direction represented by the activity bump in the HD attractor.

(B) Left: bidirectional theta sweeps when the animal runs along a straight trajectory with fixed head direction (the dark line). Blue to purple dots represent the internal direction (the bump center) across 1-s simulation. More purple dots represent higher peak firing rate of the activity bump. Right: polar histogram of the offset angle of the internal direction relative to the head axis over time. Note that the cluster around the peak of internal direction may occur because the activity bump requires some time to change direction, during which its speed reduces to zero before increasing again.

(C) Left: forward-directed theta sweeps when the animal turns right (clockwise) with a constant angular speed. Right: polar histogram of the offset angle of the internal direction relative to the head axis over time.

(D) The averaged offset of the internal direction relative to the head axis as a function of head rotation speed. Positive values represent the internal direction leading ahead of the head direction.

(E) Internal direction sweeps in the model when the animal runs along a straight line with a fixed head direction (45°). More purple dots represent higher firing rate of HD cell population.

(F) Internal location sweeps from the pure grid cells, with the gray line representing the animal’s trajectory over time and the dots representing the internal location. More purple dots indicate higher firing rate of grid cell population.

(G) Internal location sweeps on a trajectory, including straight runs, turns, and immobile periods (see also Video S1).

(H) The internal location sweeps in grid cells align with the internal direction sweeps in upstream head-direction cells.

(I) A scatterplot of the internal direction sweep angle and the internal location sweep angle across all theta cycles on a simulated straight run. The gray dashed line represents identical value of the two sweep angles.

(J) The internal location sweep angle increases with the internal direction sweep angle, with the insets showing two example sweeps with different angles. The dashed line marks the identical sweep angles of the internal direction and the internal location.

(K) Internal location sweeps in grid modules with different grid spacing.

(L) Location sweep length is proportional to grid spacing. Dots represent the mean of 10 simulations at each grid spacing, with the shaded area representing the standard deviation.

See also Figures S2–S4 and Videos S1 and S2.

Furthermore, when the animal’s head rotates, the internal direction exhibits forward sweeps of angle in the direction of rotation during turning (Figure 2C). This ahead representation explains previous findings related to anticipatory firing in HD cells.26,27 Importantly, the forward theta sweeps predict the existence of theta phase precession for turning angle in theta-modulated HD cells (see results below). Moreover, we reveal a continuous spectrum from bidirectional sweeps to forward sweeps as the angular speed increases. Specifically, as the animal rotates its head faster, internal direction sweeps become more ahead of the direction of rotation in a linear manner (Figure 2D). While alternating activity in HD cells is most significantly observed during fast straight runs in open-field environments,13 forward sweeps during turning periods are an important contribution to the overall pattern of results (Figure S2; Video S1).

Internal direction sweeps in HD cells drive alternating location sweeps in grid cells

Here, we demonstrate that when the animal runs in a straight line, the bidirectional sweeps of internal direction, combined with firing rate adaptation in the grid cell network, drive left-right-alternating sweeps of internal location in grid cells (Figures 2E and 2F). Moreover, since the effect of firing rate adaptation in the HD network varies with turning and hence affects the dynamics in downstream grid cells, we also demonstrate theta sweeps in a segment of the real trajectory of a rat, including straight runs, turns, and immobile periods (see Figure 2G and Video S1). For straight runs, the sweep angle of internal location (defined as the angle between location sweep trajectory and the movement trajectory) is 24.6° ± 1.3°, while the sweep angle of internal direction (defined as the peak offsets, i.e., the direction offsets when HD cells arrive at the peak firing rate, on either side of the head axis) is 17.0° ± 0.7° (Figure 2D), which is comparable to empirical data13 (see Table S1 for parameter settings). Importantly, the internal direction sweep in the upstream HD cells drives the internal location sweep, directing it to the same side of the head axis across theta cycles (see Figures 2H and 2I and Vollan et al.13). Moreover, the sweep angle of the internal direction contributes to the sweep angle of the internal location (Figure 2J).

Different grid modules form independent continuous attractor networks13 and sweep length was found to increase proportionally with the grid spacing in each module.13 Our model implemented this finding by adjusting the ratio of mapping between the physical space and the phase space defined by the toroidal unit (STAR Methods). An increased mapping ratio results in larger grid spacing (Figure 2K). While different attractor networks receive the same speed input in physical space (the animal’s speed), networks with larger grid spacing have proportionally lower speed input in phase space after transformation. Importantly, the speed variation in phase space has only a minor effect on the sweep length on the toroidal manifold (Figure S3), indicating that the sweep lengths are equal across grid modules when mapped onto the module’s toroidal unit tile.13 The invariance of sweep length across modules, when mapped back to physical space, in turn increases proportionally with the mapping ratio, thus correlating linearly with the grid spacing (see Figures 2K and 2L and Video S2).

Instead of teleporting instantaneously back to the animal’s location at the end of each theta cycle, the activity bump sweeps continuously back to the animal’s location, because of the continuous nature of the GC attractor. During outward sweeps, grid cells exhibit higher firing rates than during inward sweeps (see Figures 2F, 2K, and S4), because the firing of cells on the outward sweep path causes firing rate adaptation, reducing their firing rate when the activity bump sweeps inward. We found the same pattern in experimental data from grid cells (Video S3), notwithstanding the presentation in Vollan et al.,13 which emphasizes the forward sweeps.

Speed modulation of theta sweep features

In our model, running speed increases both the strength of medial-septal theta modulation (consistent with experimental data28) and the strength of shifted phase input from the conjgrid cells to the GC attractor network.23 These two factors jointly affect both the sweep features in the HD attractor network and the downstream GC attractor network (Figure 3A). We checked four sweep features, including the alternation score (STAR Methods), the mean sweep angle, the variance of the sweep angle, and the internal location sweep length (Figure 3B). We first verified that the alternation score of theta sweeps in the GC attractor network increases with running speed (Figure 3C), while the variance of sweep angle decreases with running speed (Figure 3D). These two results agree with the empirical observation of increased sweep bimodality with running speed.13

Figure 3. Speed modulation of sweep features.

Figure 3

(A) Left-right-alternating theta sweeps of internal direction in the HD attractor (orange arrows) and internal location in the GC attractor (blue-purple dots) under different running speeds.

(B) Schematic of extracting the mean sweep angle, the variance of sweep angle, the sweep length, and alternation score.

(C) The relationship between the alternation score of location sweeps in grid cells and running speed of the animal. Shaded area represents the standard deviation of the results from 10 simulations of the model under each running speed.

(D) The relationship between the variance of sweep angle and running speed.

(E) The relationship between the mean sweep angle and running speed.

(F) The relationship between the sweep length and running speed.

We made additional testable predictions related to other sweep features. First, the mean sweep angle remains roughly the same as running speed increases (Figure 3E), indicating that the sweep angle is minimally affected by running speed. Second, the sweep length increases almost linearly as running speed increases (Figure 3F). This is also due to stronger input from conj-grid cells at higher speed,23 which drives the activity bump to move further. If hippocampal place cell sweeps are inherited from entorhinal grid cells,13 this could also explain the linear relationship of theta sweeps and speed found in the hippocampus.29

Firing rate adaptation modulates theta sweeps along the MEC dorsal-ventral axis

In the extreme case, without any firing rate adaptation, the internal direction tracks the animal’s HD, while the internal location tracks the animal’s position (Figure S5). In the more general case, as adaptation strength increases, our model generates several predictions that can be tested in future experiments. First, increasing the adaptation strength in HD cells increases the theta sweep angle of the internal direction (Figure 4A). Second, increasing the adaptation strength in grid cells increases the theta sweep angle of the internal location (Figure 4B). Furthermore, while sweeps in grid cells are driven by sweeps in HD cells, the location sweep angle is larger than the direction sweep angle, due to the additional firing rate adaptation in grid cells (see Figure 4B and also Figures 2J and 3A). Increasing the adaptation strength in grid cells increases the angular difference between the location sweep and the direction sweep (Figure 4B).

Figure 4. Adaptation strength modulates theta sweeps along the MEC dorsal-ventral axis.

Figure 4

(A) The sweep angle of internal direction increases with the strength of firing rate adaptation in head-direction cells, with three examples shown on the right.

(B) The angular difference between the location sweep and the direction sweep increases with the strength of firing rate adaptation in grid cells (while the adaptation strength in head-direction cells is fixed), with three examples shown on the right. Green/pink color represents larger/smaller sweep angle in internal location than that in internal direction. Note that the angular difference is always positive, meaning that the location sweep angle is larger than the direction sweep angle.

(C) The adaptation strength as a function of locations along the dorsal-ventral axis for 35 cells in the MEC with in vitro whole-cell patch-clamp recording. The gray line shows a linear fit (Pearson correlation with r = 0.48, p = 0.003). The data was obtained from Yoshida et al.21 with permission.

(D) Left: the sweep angles as a function of increased adaptation strength in the GC attractor network (with the adaptation strength in the HD attractor network fixed). Right: same as the left but shows the sweep length of internal location (normalized by the effect of grid spacing) as a function of increased adaptation strength along the dorsal-ventral axis.

(E) The sweep angles correlate positively with the sweep lengths (normalized by the effect of grid spacing) while increasing the adaptation strength in grid cells along the dorsal-ventral axis.

(F) Schematic of sampling of surrounding space with a single grid module versus with multiple grid modules. More purple colors represent sweeps in grid modules with larger adaptation strength and larger grid spacing.

See also Figure S5.

While evidence for changes of adaptation strength across HD cells is lacking, the strength of firing rate adaptation increases along the MEC dorsal-ventral axis21 (Figure 4C). This leads to a third prediction, which is that the location sweep angle is larger in grid modules located in the more ventral areas of the MEC (Figure 4D). Moreover, stronger adaptation also leads to an increase in the sweep length of internal location, even when expressed as a proportion of grid scale (Figure 4D). This suggests a positive correlation between sweep angle and sweep length across multiple grid modules along the dorsal-ventral axis because of the increase in adaptation strength (Figure 4E); that is, shorter sweeps in dorsal grid modules with smaller grid spacing are more forward directed, while longer sweeps in ventral grid modules with larger grid spacing have larger sweep angles. When the animal runs in an open field, theta sweeps from multiple grid modules can therefore cover a much larger surrounding space than single-module theta sweeps, potentially contributing to efficient sampling of the surrounding space without the need for physically visiting it (Figure 4F).

Theta phase precession correlates with theta skipping in HD cells

While classic HD cells have been reported in many brain regions such as anterodorsal thalamus, lateral mammillary bodies, and retrosplenial cortex, theta-modulated HD cells have also been found recently in the anteroventral thalamic nucleus,18,19 parasubiculum, and entorhinal cortex.13,22 By varying the theta input and firing rate adaptation, our HD attractor module generates three types of HD cells observed in previous studies (Figures 5A–5C and 6A): specifically, (1) without medial-septal theta input, cells in the HD attractor exhibit the features of classic HD cells (Figure 5A); the activity bump leads ahead of the animal’s HD when rotating, giving rise to anticipatory firing in HD cells26,27; (2) with theta input but without firing rate adaptation, cells in the HD attractor exhibit the features of theta-modulated HD cells where HD cells fire in every theta cycle (Figure 5B); and (3) with both theta input and firing rate adaptation, cells in the HD attractor exhibit the features of theta-skipping HD cells where HD cells fire in alternating theta cycles (Figure 5C).22,30

Figure 5. Theta skipping and theta phase precession in the head-direction ring attractor.

Figure 5

(A) A classic HD cell without theta modulation, simulated with a HD attractor with firing rate adaptation but without septal theta input. From left to right: the tuning field of a cell; the internal direction over 1-s time window when the animal’s head is fixed, with orange line representing the preferred direction of a probed cell; the auto-correlation of the firing of the probed cell; the internal direction over 1-s time window when the animal’s head is rotating with a constant angular speed; the spike phase of the probed cell as a function of head direction.

(B) A HD cell with theta modulation but without theta skipping, simulated with septal theta input but without firing rate adaptation.

(C) A HD cell with theta skipping, simulated with both septal theta input and firing rate adaptation.

(D) The tuning width of the three types of HD cells.

(E) Increased theta-skipping effect as the fixed head direction (dark lines) is more away from the preferred direction of a probed cell (orange lines).

(F) Theta-skipping index increases as a function of the offset between the actual head direction of the animal and the preferred internal direction of a cell for theta-skipping HD cells (blue), but not for normal theta-modulated HD cells without skipping (purple).

Figure 6. Theta skipping in the HD cells in the anteroventral thalamic nucleus.

Figure 6

(A) Examples of a classic HD cell (non-rhythmic), a normal theta-tuned HD cell without skipping (non-theta-skipping), and a theta-skipping HD cell. Left column: the tuning width. Right column: the auto-correlation.

(B) Heatmap of auto-correlations of all theta-modulated HD cells, ordered by theta-skipping index. Warmer colors represent higher correlation values. Top rows are for theta-skipping cells, and bottom rows are for normal theta-tuned HD cells without skipping.

(C) The tuning width of the three types of HD cells (classic vs. non-theta-skipping: [MWUT] with Z = 1.0, p = 0.306; classic vs. non-theta-skipping: [MWUT] with Z = 3.8, p = 1.5×10-4; classic vs theta-skipping [MWUT] with Z = 4.6, p = 5.1×10-6)).

(D) Theta-skipping index and tuning width for theta-modulated HD cells are positively correlated (Pearson correlation with r = 0.41, p = 1.53 × 10−5). Each dot is a cell, and the dark line represents a linear fitting.

(E) Theta-skipping index as a function of the offset between head direction and the preferred direction for both non-theta-skipping HD cells (purple) and theta-skipping HD cells (blue). The auto-correlation plots were taken by averaging the auto-correlation of each cell in the offset range showed on the disk, with preferred directions all aligned to the north.

From the populational view, theta skipping of individual neurons can originate from the sweeps of activity bumps, which leads to two interesting predictions. First, bump sweeps increase the tuning width of theta-skipping HD cells, compared with classic HD cells, and normal theta-modulated HD cells where there is no bump sweep (Figure 5D). Second, the theta-skipping effect becomes more significant when the animal runs along a direction with a larger offset to the preferred internal direction of the cell, as the activity bump is more likely to sweep over the preferred internal direction in alternating theta cycles (Figures 5E and 5F).

Finally, our HD attractor with firing rate adaptation and medialseptal theta input predicts the existence of theta phase precession in theta-skipping HD cells when the animal turns through the preferred internal direction of the cell (Figure 5C). This corresponds to network models of theta phase precession in place cells when the animal runs in linear track environments,14,15,17 where the activity bump sweeps over the preferred location of a place cell at progressively earlier phases of theta cycles when the animal traverses the firing field.

We verified predictions related to the firing features of theta-skipping HD cells, with empirical data containing a larger number of HD cells recorded from the anteroventral thalamic nucleus19 (Figures 6A and 6B; number of classic HD cells: 76; normal theta-modulated HD cells: 77; theta-skipping HD cells: 30). First, directional tuning width is significantly larger in theta-skipping HD cells than normal theta-modulated HD cells (Mann-Whitney U test [MWUT] with Z = 4.6, p = 5.1 × 10−6) and classic HD cells (MWUT with Z = 3.8, p = 1.5 × 10−4), while the tuning width in normal theta-modulated HD cells and classic HD cells is similar (MWUT with Z = 1.0, p = 0.306), which agrees with the model where the activity bump does not sweep in these two cases (Figure 6C). Interestingly, cells exhibiting stronger theta-skipping effect have broader tuning width (Figure 6D; Pearson correlation with r = 0.41, p = 1.53 × 10−5). Second, for theta-skipping HD cells, the skipping effect increases during the periods when the animal’s HD is more further away from the preferred internal direction of the cell, while for normal theta-modulated HD cells, the skipping effect remains weak and independent of the animal’s HD (Figure 6E).

Theta sweeps disappear with septal inactivation

Reduction in theta oscillation by pharmacological inactivation of the medial septum correlates with impairment in spatial memory tasks.31 At the neurophysiological level, septal inactivation eliminates theta skipping in HD cells in the parasubiculum and MEC,22 and it impairs phase precession in the entorhinal cortex and hippocampus.32,33 Inspired by these phenomena, we investigated how septal inactivation affects network dynamics in our model.

First, we showed that in the HD network (Figure 7A), reducing the theta rhythm magnitude decreases the occurrence of direction sweeps and therefore theta skipping in HD cells (Figures 7B and 7C), which aligns with previous empirical results.22 Moreover, since theta skipping and phase precession are two aspects of the same network (depending on whether or not the head is rotating), we predicted that reducing the theta modulation magnitude also decreases the effect of theta phase precession relative to the HD angle in HD cells (Figures 7B and 7D).

Figure 7. Theta sweeps disappear with septal inactivation.

Figure 7

(A) Schematic of inactivating medial-septal theta input to the HD cells.

(B) Reduced effect of theta skipping with head fixing (left two columns) and theta phase precession with head rotating (right two columns), with weakening of the theta input strength from the medial septum.

(C) Theta-skipping index decreases with weakening of the theta input strength.

(D) Circular linear correlation coefficient decreases with weakening of the theta input strength.

(E) Schematic of inactivating medial-septal theta input to both the HD cells and the grid cells.

(F) Left-right sweeps in grid cells with medial-septal theta input.

(G) The activity bump tracks the animal’s position without medial-septal theta input.

(H) Circular sweeps in grid cells without medial-septal theta input under increased adaptation strength.

Second, we showed that in the downstream grid cell network (Figure 7E), inactivating the septal theta rhythm leads to two dynamics different from the left-right sweeps under normal settings of firing rate adaptation and septal theta input (Figure 7F): specifically, (1) with relatively weak adaptation in grid cells, both the internal direction and location track the animal’s HD and position (Figure 7G); and (2) with relatively strong adaptation in grid cells, while the internal direction still tracks the animal’s HD, the internal location exhibits circular sweeps around the animal’s position for 360° within individual theta cycles (Figure 7H). While such circular sweeps have not been reported in empirical data, they might exist as intrinsic network dynamics under weak theta modulation from the medial septum when running speed is low.

These predictions could be tested in future inactivation experiments, bearing in mind that rotational theta may have a cholinergic component,34,35 compared with translational theta, which is controlled by GABAergic and glutamatergic medial-septal cells.36

Discussion

We demonstrated that a continuous attractor model with firing rate adaptation and medial-septal theta modulation is sufficient to explain recent experimental findings of left-right-alternating sweeps in grid cells and related directional “flickering” in theta-modulated HD cells.13 In this model, the upstream HD network generates internal direction sweeps at the theta rhythm, which activates the conj-grid cells that share the same preferred internal direction as those activated HD cells. These conj-grid cells then provide a shifted input along the same direction, driving the left-right-alternating sweeps in grid cells in a coordinated manner. This model accounts for many of the experimental findings, including the alignment of internal direction sweeps in parasubicular HD cells and internal location sweeps in grid cells, with the former driving the latter; the linear relationship between location sweep length and grid spacing across different grid modules; and the increase of the sweep alternation score with running speed.

The proposed model is improved in three aspects over previous network-based models of theta sweeps and theta phase precession when the animal runs along a linear track.1417,37 First, while phase precession has been observed in both grid cells and place cells in open fields,38,39 models for populational theta sweeps extending beyond linear track scenarios have not been well addressed so far. However, recent progress has been made, including our modeling of left-right theta sweeps in place cell networks when the animal runs toward a decision point in a T-maze,12 as well as a similar model with firing rate adaptation and theta input, which accounts for left-right-alternating sweeps in place cells in an open field.40 Second, we systematically modeled theta sweeps in a system of HD cells and grid cells, with sweep direction in HD cells determining sweep direction in downstream grid cells and place cells.13 Instead of generating theta sweeps independently in grid cell networks across multiple grid modules and place cell networks, the coordination of sweep directions across multiple networks by HD cells may help synchronize the temporal organization of spiking activity across multiple brain regions. This synchronization could potentially support the stabilization of a single coherent map for spatial navigation and episodic memory function.37,41,42 Third, our model extends beyond fast straight runs in open fields by simulating a variety of running trajectories (Figure 2F), including turning, stopping, accelerating, decelerating, and random walking (Figures 2G and S2). This broader scope can help provide a more comprehensive understanding of theta sweeps and guide experimental data analysis in more complex behavioral scenarios.

The model only requires attractor dynamics, firing rate adaptation, theta rhythmicity, and an external input to generate coherent theta weeps. The external sensory input is not necessarily from actual perception, as virtual trajectories can occur during both rapid eye movement (REM) and slow-wave sleep states. When theta rhythmicity manifests together with the external input, the network will still generate theta sweeps, as seen during REM sleep but not during slow-wave sleep.13 Equally, the decoding of theta sweeps occurs on the toroidal manifold of the grid attractor, and it is then mapped onto physical space with a consistency constraint to resolve periodic ambiguity (STAR Methods), which allows decoding of theta sweeps to unvisited locations13 (Video S1).

Our modeling and empirical results favor continuous sweeps of direction and location, instead of discrete flickers from side to side of the animal’s head axis in the HD network and forward-only grid cell sweeps as presented by Vollan et al.13 These continuous sweeps align with the continuous attractor nature of the HD system43,44 and our finding of theta phase precession during turning, which may also affect the continuity of theta sweeps in downstream grid cells. Using data from Gardner et al.,45 we decoded theta sweeps from grid cell population activity and found that the decoded position likely sweeps continuously backward to the animal’s location within individual theta cycles (see Figures S6 and Video S3). While our model favors continuous sweeps in grid cells, we did observe higher network activity during outward sweeps, compared with inward sweeps (see Figures 2F, 2K, and S4; also see Tsodyks et al.14 and Romani and Tsodyks15), which may affect the continuity of decoded position within each cycle. Thus, we consider the continuous sweeps reported here, compared with the left/right flickering of directional sweep and forward-only locational sweeps reported by Vollan et al.,13 to reflect a quantitative difference in thresholding for presentation rather than a real qualitative difference.

Our model makes numerous novel predictions related to the features of theta sweeps in both HD cells and grid cells. In theta-modulated HD cells, we predicted (1) increased directional tuning width in theta-skipping cells and (2) increased theta-skipping effect when the offset between the HD and the preferred internal direction increases, both of which we verified with empirical data from theta-modulated HD cells in anteroventral thalamus.19 Moreover, our model also predicts the existence of theta phase precession for turning angle in theta-modulated HD cells and specifically those displaying theta skipping, which we will check in detail in future.

In grid cells, we predict the following: (1) as the animal runs faster, the sweep length increases while the variance of the sweep angle decreases; (2) within a single grid module, the sweep angle in grid cells is always larger than that in upstream HD cells; and (3) across multiple grid modules along the MEC dorsal-ventral axis, there is a systematic increase in both the length and angle of theta sweeps. Compared with single-module sweeps, the multi-module sweeps provide an efficient way of covering a surrounding space without physically visiting them, potentially contributing to an efficient formation of new maps for spatial navigation (Figures 4E and 4F).4648 Moreover, we predict reduced effects of theta skipping, phase precession, and theta sweeps when the medial-septal theta rhythm magnitude decreases, which could be tested with septal inactivation in future experiments.

Our model suggests that two temporal firing features in theta-modulated HD cells, i.e., theta skipping and theta phase precession, are two aspects of the same underlying network dynamics of theta sweeps. This is supported by an empirical observation in data recorded from the anteroventral thalamic nucleus19: theta skipping HD cells, but not normal theta-modulated HD cells, show an increase in the skipping index as the animal’s HD deviates further from the cells’ preferred internal directions (Figure 6E). Since the classic HD signal is generated subcortically, arriving at the neocortex via the mammillary bodies and anterodorsal thalamus at the dorsal presubiculum,49 we hypothesize that theta-modulated HD cells in the parasubiculum inherit their firing properties from the anteroventral thalamic nucleus via the presubiculum.50 Although some studies show that HD cells in the dorsal presubiculum are not theta-modulated,51,52 others reported theta-modulated HD cells in more ventral presubiculum.20,53 A clarification of the circuit for theta-modulated HD cells in future experiments would be welcome.

While some parameters were set according to previous studies, several were determined heuristically (STAR Methods) to ensure that the firing characteristics of the modeled cells match those in real scenarios, such as the width of HD cell tuning, grid spacing, and the length and angle of theta sweeps. Despite the lack of experimental evidence for some of these settings, the model’s behavior—specifically, its ability to produce left-right theta sweeps—remains robust, as demonstrated by a sensitivity analysis (see Figure S7 and STAR Methods). However, certain aspects of our model warrant further investigation. First, the increased adaptation strength along the dorsal-ventral axis was measured from cells using in vitro patch-clamp recordings,21 which may not necessarily be grid cells. To confirm whether adaptation strength contributes to sweep length and angle along the dorsal-ventral axis will require in vivo patch-clamp recordings in behaving animals. Second, in the current model, faster running speed increases theta oscillation amplitude. In a more realistic scenario, running speed affects both the power and frequency of theta rhythmicity.5456 Future modeling could explore how changes in theta frequency with running speed impact the model’s behavior. Third, while our results are based on hardwired continuous attractor networks in the HD and grid cell systems, it remains an open question whether these attractor dynamics are inherently present at birth, and if not, how they are formed during development.

In summary, we propose a simple yet comprehensive network model where left-right-alternating theta sweeps can be generated intrinsically during open-field navigation. This theoretical framework aligns with numerous experimental findings and provides testable predictions for future research. These results enhance our understanding of the neural dynamics underlying spatial navigation and memory-related cognitive functions.

Resource Availability

Lead contact

Further information and clarification about the code can be directed to Zi-long Ji (zilong.ji@ucl.ac.uk). Any other requests can be directed to Neil Burgess (n.burgess@ucl.ac.uk).

Materials availability

The current study has not generated any new material.

Star★Methods

Key Resources Table

REAGENT or RESOURCE SOURCE IDENTIFIER
Deposited data
Grid cell dataset Gardner et al.45 https://figshare.com/articles/dataset/Toroidal_topology_of_population_activity_in_grid_cells/16764508
Head direction cell dataset Lomi et al.19 https://figshare.com/articles/datasetZ_strong_Data_code_for_Lomi_et_al_2023_strong_/22802861
Software and algorithms
Python version 3.9 Python Software Foundation https://www.python.org/
BrainPy Wang et al.57 https://github.com/brainpy/BrainPy
replay_trajectory_classification Denovellis et al.58 https://github.com/Eden-Kramer-Lab/replay_trajectory_classification
Original code and analysis This paper https://github.com/ZilongJi/GridCellThetaSweeps

Experimental Model and Study Subject Details

The grid cell dataset

The grid cell dataset was collected by Gardner et al.45 from three experimentally naive male Long Evans rats (Rats 1, 2 and 3) as they foraged for randomly scattered food crumbs in a 1.5 m × 1.5 m square open-field arena. Animals’ 2D position and head direction were obtained from 3D motion capture by attaching a set of five retroreflective markers to implant during recordings. Neural recordings were obtained via Neuropixels silicon probes targeting the MEC–parasubiculum region (one recording session for Rat 1 with single-shank probes in bilateral hemispheres, one recording session for Rat 3 with multiple-shank probes in the left hemisphere, and two recording sessions for Rat 2 with single-shank probes in bilateral hemispheres). Grid cells were identified with methods described in Sargolini et al.23 which resulted in a total of 1330 grid cells. Specifically, for Rat 1, there were 163 grid cells from two grid modules; for Rat 2, there were 483 grid cells from three modules in session 1 and 544 grid cells from three grid modules in session 2; for Rat 3, there were 140 grid cells from one grid module. We decoded theta sweeps from Rats 1 and 2 since decoding of location was most reliable due to cells were recorded from multiple grid modules (see Figure S6 and Video S3).

The head direction cell dataset

The head direction cell dataset was collected by Lomi et al.19 from six adult male Lister Hooded rats as they foraged for randomly scattered food in a 0.9 m × 0.9 m square arena. Animals’ 2D position and head direction were obtained from video tracking of two light-emitting diodes (LEDs) on the headstage. Neural recordings were obtained via chronic recording electrodes targeting the anteroventral thalamic nucleus. Head direction cells were identified using the Rayleigh vector (passing 99th percentile shuffle cutoff). To further identify theta modulated HD cells, Lomi et al.19 computed the index of rhythmicity (IR) and the index of theta phase coupling (IC) for each cell. A HD cell passing 99th percentile shuffle cutoff for IC and having an IR ≥ 0:001 was considered as a theta × HD cell. Among these theta × HD cells, they further identified theta skipping cells with theta skipping (TS) index TS > 0.1 (see below). These operations resulted in a total of 208 HD cells, among which 76 are normal HD cells without theta modulation, 77 are theta × HD cells and 30 of them are theta skipping cells.

Method Details

Details of the computational model

The computational framework consists of coupled continuous attractor networks that model theta-modulated head direction cells in the parasubiculum as a ring attractor (HD attractor) and grid cells in the MEC as a two-dimensional attractor on a neuronal sheet (GC attractor).

The HD attractor is responsible for encoding an internal direction, which can differ from the head direction of the animal, and the GC attractor maps out the animal’s location in space. Specifically, the HD cells within the HD attractor are organized in a circular arrangement corresponding to 0 to 360 degrees, with each cell firing when the animal faces a particular direction. At the population level, the center of this activity is referred to as the internal direction, which differs from the actual head direction of the animal. As the animal moves, theta rhythmic input and firing rate adaptation work together to cause the internal direction to sweep from side to side along the animal’s head axis (head direction).

This internal direction from the HD network then provides a directional input to grid cells via an intermediate layer of conjunctive grid × direction (conj-grid) cells, with a slight offset that shifts along the same direction. This directional input is represented as an external activity bump that sweeps in coordination with the internal direction in the HD network. In the GC network, the network state is characterised by a two-dimension activity bump on the attractor manifold. Due to the periodic boundary effect, when the activity bump is mapped from the toroidal manifold to physical space, it manifests as multiple bumps arranged in a hexagonal pattern. As the external input bump sweeps from side to side of the head axis at a location ahead of the current position of the animal, the activity bump in the GC attractor network exhibits left-right sweeps in a forward directed manner.

Below, we introduce each part of the model in mathematical details. For parameter settings, see Tables S1 and S2.

The head direction attractor network

Theta modulated HD cells are modeled as a ring attractor with the following form:

τhhit=hi+j=1NhJijhfh(hj)aih+Iih(V,θ), (Equation 1)

where hi is the pre-synaptic input to ith HD cell with i = 1,…,Nh, and Nh is the number of HD cells. Each HD cell receives recurrent input from other HD cells, along with firing rate adaptation aih with a form of negative feedback (see below), and the head-direction dependent sensory input Iih(V,θ). The directional input is modeled with a Gaussian form, with the peak representing the animal’s current head direction, written as,

Iih(V,θ)=Ahαhexp[(xiθ)24bh2], (Equation 2)

where αh represents theta modulation from medial septum with a form of sinusoidal wave (see details below). Ah represents the baseline input strength of head-direction cells. xi is the preferred internal direction of the ith neurons on the ring attractor, and bh controls the width of the external Gaussian input.

fh(hj) is the firing rate of the jth HD cell. The activation function fh is modeled as a global inhibition, which is written as,

fh(hj)=hj21+khjhj2, (Equation 3)

where kh represents the global inhibition strength among head-direction cells. The global inhibition is important for maintaining a localized activity bump on the ring attractor.

Jijh represents the recurrent connections between the HD cell with preferred internal direction i and the HD cell with preferred internal direction j, with the form:

Jijh=J0h2πbh2exp[||ϕiϕj||h24bh2], (Equation 4)

where ∥ ϕiϕjh denotes the circular distance of the ith HD cell with preferred internal direction ϕi and the jth HD cell with preferred internal direction ϕj on the ring and J0h denote the connection strength between cells. bh controls the tuning width of HD cells.

The grid cell attractor network

The pure grid cells are modeled as a two-dimensional continuous attractor network with the following form:

τgg(ϕi)t=g(ϕi)+jNgJijgfg(g(ϕj))aig+liconjg(V,θ), (Equation 5)

where g (ϕi)is the pre-synaptic input to ith grid cell with i = 1,…,Ng, and Ng is the number of grid cells tiling the two-dimensional neuronal sheet. ϕi = (ϕx ; ϕy) with ϕx ; ϕy (0; 2π] representing the preferred phase of the ith grid cell on the attractor sheet. We set the neuronal sheet with periodic boundaries so that it forms a toroidal manifold. To account for the hexagonal firing fields of grid cells, a mapping function is applied to transform between the location in the physical space and the location in the phase space, which is written as:

ϕ=ψ(z)=mod(Wtransz,λ)×2π, (Equation 6)

where z(x; y) is the coordinate of a location in the physical space, λ controls the grid spacing, mod(·,·) denotes the modulo operation and Ψ denotes the mapping operator. This mapping takes two steps: first, the transformation matrix Wtrans given by:

Wtrans=(113023), (Equation 7)

projects z onto two axes that are sixty degrees apart; second, the modulo operation is applied to convert the transformed coordinate into a phase coordinate. This means when the animal runs into a location away from the current location, the two locations can be wrapped to similar phases in the phase space. This mapping process leads to a grid cell with six-fold symmetry in its firing pattern.59

Grid cells in different grid modules have different grid spacing, and can operate as independent continuous attractor networks.45 To model theta sweeps in different grid modules (as shown in Figure 2K and Video S2), we vary λ above to implement them.

fg(g(ϕj))represents the firing rate of the jth grid cell, which is also modeled as a global inhibition with a form the same as in head direction cells. We denote kg as the global inhibition strength among grid cells within a module and maintain it with the same value across grid modules. Jijg represents the recurrent connections between the grid cell with the preferred phase ϕ and the grid cell with ϕj the preferred phase ϕj, with the form:

Jijg=J0g2πbg2exp[||ϕiϕj||g24bg2] (Equation 8)

where ∥ ·∥ g denotes the circular distance on the toroidal manifold, and J0g denote the connection strength. bg controls the grid field width.

Iiconjjg(V,θ) represents the shifted phase input to the ith grid cell from the upstream conj-grid cells. While we didn’t explicitly model these cells in the current model (due to a high memory consumption since we need to model a 2D attractor at each direction), the shifted phase input has three important features: first, the input strength is modulated by running speed; second, it is also modulated by septal theta oscillation as the conj-grid cells are tuned to theta rhythm.23 Third, the direction of phase offset is aligned with the internal direction from the upstream HD attractor.13 Combining all these features and re-writing Iiconjjg(V,θ) as Pig(ϕ) for simplicity, the shifted phase input is expressed as:

Iig(ϕ)=αgjIconjg(βj)=jfh(hj)T(v)exp[||ϕψ(z)w(βj)||24bg2] (Equation 9)

where ϕ is the phase coordinate, αg represents theta modulation (see below), Iconjg(βj) is the input from the jth group of conjunctive grid cells with preferred internal direction as βj. The resulting phase input equals to a weighted sum of many 2D shifted Gaussian bumps from all the conj-grid cells with the weights as the firing rate of upstream HD cells fh(hj). w(βj) is a vector with w(βj)= w0(cos βj; sin βj), where w0 represents the offset length. This term means if the conj-grid cells coding for the direction of βj are activated, they will lead to a shifted phase input with the amount of w0 along the same direction onto downstream grid cells. The strength of the resulting shifted phase input is modulated by running speed with T(V):

T(V)=T0V+Ag (Equation 10)

where T0 and Ag are both constants. This linear modulation reflects that as the animal runs faster, the firing rate of the conj-grid cells increases accordingly.23 Consequently, a higher speed can lead to a stronger shifted phase input, which drives the activity bump moves faster along the moving direction, and therefore potentially contribute to path integration.

Speed modulation of theta input from the medial septum and phase input from the conj-grid cells

In our model, running speed modulates both the oscillation magnitude of medial-septal theta input and the phase input strength from conj-grid cells.23 Theta modulation onto HD cells is defined as:

αh=1+α¯hVsin(ωθt), (Equation 11)

where the oscillation magnitude scales linearly with the running speed v,28 with α¯h a scaling factor. Similarly, theta modulation onto grid cells is defined as:

αg=1+α¯gVsin(ωθt), (Equation 12)

where the oscillation magnitude also scales linearly with the running speed v, with α¯ga scaling factor. While our previous modeling work17 has demonstrated that firing rate adaptation generates bump sweeps in a continuous attractor model of place cells, the inclusion of medial-septal theta modulation naturally constrains the bump sweep frequency to the theta rhythm, eliminating the need for precise parameter tuning. This addition enhances the model’s biological plausibility and robustness.

Firing rate adaptation

aih and aig represent firing rate adaptation in the ith HD cell and the ith grid cell, both of which have the following form:

τaas(ϕi)t=as(ϕi)+msfs(si), (Equation 13)

where s∈ {h,g}, and fs(si) represents the firing rate of the ith cell. τa is the time constant of firing rate adaptation, which is much larger compared to τh and τg, indicating that the process of firing rate adaptation is a slow dynamics compared to that of cell firing. ms represents the adaptation strength, which can be different in HD cells and grid cells, as well as in different grid modules along the dorsal-ventral axis.21 At single neuron level, firing rate adaptation reduces the firing frequency following an initial increase in response to an input of constant intensity. At the network level, it induces intrinsic mobility of the activity bump. In fact, any forms of slow negative feedback could exhibit similar effect of increasing the intrinsic mobility, i.e., short-term depression,15 and hence lead to similar network-level dynamics presented in the current study.

Parameter settings and explanation

We simulated the model proposed above using the BrainPy computational framework,57 with parameter settings shown in Tables S1 and S2. The simulated model consists of 100 theta-modulated HD cells (Nh) and 10000 theta-modulated pure grid cells (Ng) arranged on a two-dimensional neuron sheet. The rate time constants for both HD cells (τh) and grid cells (τg) are set to 10 ms, as is typical in rate based models (in spiking networks, this would need to be set on the order of 1ms due to the nature of spike firing).

For HD cells, the recurrent connections are modelled as Gaussian profiles with a standard deviation (bh) of 0.4 radians, which results in an average tuning width of 115° for non-rhythmic HD cells, 116° for HD cells with normal theta modulation, and 121° for HD cells with theta skipping. These values roughly match the experimental data from Lomi et.al.19 (96 ± 28° for non-rhythmic HD cells, 92 ± 29° for HD cells with normal theta modulation and 119 ± 12° for HD cells with theta skipping).

For grid cells, the recurrent connections are modelled as 2D Gaussian profiles with a standard deviation (bg) of 0.8, which is about 13% of the width/height of the 2D neuronal sheet. This setting primarily affects the width of each grid field, which can be further optimized by checking the grid field within empirical data. In the current study, we simply chose 0.8 as the generated field size roughly matches the real data from Gardner et.al.45 (averaged grid spacing from all data).

The time constant for firing rate adaptation, τa, is set to a much larger value of 100 ms compared to the rate time constant τg and τh. This means it takes approximately 100 ms for a neuron’s firing rate to adapt (i.e., decrease) in response to a sustained stimulus. To investigate theta sweeps along the dorsal-ventral axis where the adaptation strength increases,21 the adaptation strength of grid cells (mg) in our model is set as 0.7 for grid cells at the most dorsal part of the MEC and 1.8 for grid cells at the most ventral part of the MEC). Importantly, there is an inherent interdependence between the adaptation time constant and adaptation strength. While increasing the adaptation time constant reduces the rate of change in firing rate, increasing the adaptation strength counterbalances this effect. Thus, these two parameters jointly influence the negative feedback effect in generating intrinsic mobility in attractor networks.

It is noteworthy that the adaptation time constant in our model is set smaller than in previous studies, where it typically lasts from a few hundred milliseconds to several seconds. However, our choice of shorter adaptation time constant will not affect the result too much, since we can choose a smaller value of adaptation strength to match the time constant. In contrast, we can choose a longer adaptation time constant by scaling up the adaptation strength, which will lead to similar results. In future experimental studies and empirical analyses, it will be important to measure these two parameters with in-vivo whole cell recordings, and investigate their effects on theta sweeps independently.

The final important parameter is the offset value projected from conjunctive grid cells to pure grid cells, w0, which we set as 1/9 (approximately 1.8% of the width/height of the 2D neuronal sheet). While the offset has been shown in Vollan et al.,13 the detailed value is unclear. Further empirical data analyses will be needed to verify the actual value in future studies.

Sensitivity analysis of model parameters

We performed a detailed sensitivity analysis of how variations in key parameters affect left-right alternation sweeps in the model. The alternation score was selected as the criterion to quantify the significance of left-right theta sweeps within the model. We investigated eight key parameters: 1&2) adaptation strength in grid and HD cells; 3&4): theta modulation amplitude in grid and HD cells; 5&6): recurrent connection noise level in grid and HD cells, i.e., the homogeneity of recurrent connections; 7) offset from conj-grid cells to pure grid cells; 8) the animal’s running speed. For each parameter, we fixed the values of all other parameters to their default settings (Table S1) and varied the parameter value in a range from 10% to 200% of the default value. The change in the alternation score is shown in Figures S7A–S7H. To further quantify the sensitivity of each parameter, we calculated the difference between the highest alternation and lowest alternation scores within the varied range, and ranked these differences for the parameters from highest to lowest (Figure S7I). We found the adaptation strength of HD cell firing has the largest effect on the model’s behavior and the theta amplitude in grid cells has the smallest effect on the model’s behavior. In general, HD cell related parameters have a larger effect on the model’s behavior than grid cell related parameters since they drive left-right sweeps of internal location in grid cells. Running speed (as expected), also has large effect on the model’s behavior since it affects theta amplitude in both HD cells and grid cells, as well as the amount of shifted phase input from conj-grid cells.

Decoding theta sweeps in our model from the toroidal manifold to the physical space

To decode the internal location in the physical space in our model (see below for the decoding of location in real data), we take the location corresponding to the center of mass of the activity bump in the phase space of the grid cell torus and then transform it back to physical space using the inverse of the transformation matrix. While the mapping from physical location to phase location is one-to-one, the mapping from phase location to physical location is one-to-many. Therefore, to determine which physical location it maps to, we choose the one at the beginning of the simulation that is closest to the animal’s actual location. This approach reduces the one-to-many mapping to a one-to-one mapping at the start of the simulation and allows continuous one-to-one decoding from phase location to physical location until the end of the simulation. Since the phase location on the toroidal manifold does not have a boundary effect, this inverse mapping can result in a decoded position outside the current environment boundary, as reflected in Video S1 and Vollan et al.13

Decoding theta sweeps in the grid cell dataset with a state-space decoder

We adopted a state-space model58 to decode theta sweeps in the grid cell dataset.45 Decoding of location was most reliable from Rat 1 (163 grid cells from two modules) and Rat 2 (544 grid cells from three modules) since cells are from multiple grid modules. The encoding part of the state-space model takes two inputs: the spike array of all spike-sorted neurons and the time-aligned 2D position data. The position data was binned into 4 × 4 cm spatial bins. We built the encoding model using a 2-ms temporal bin by up-sampling the position data from 100 Hz to 200 Hz. Only periods when the running speed exceeding 4 cm/s were considered in constructing the encoding model. Since theta sweeps closely track the animals’ physical locations, we defined latent movement dynamics as a random walk process (without considering uniform and fragmented dynamics as in their original replay analysis58). The movement variance for the random walk process was computed as 10 times of the movement variance estimated from the whole position trajectory during recording. This amplification helps to increase the variance of the latent movement dynamics and makes the theta sweeps more obvious (setting the amplification value to 5 or 20 did not visually change the decoding results too much).

For decoding, we used 5-fold cross-validation. In this process, we built the encoding model on 4 folds of the data and then decoded the sequences on the remaining fifth fold. This ensures that the data used for constructing a given encoding model were not used for decoding the representation. We repeated this for each fifth of the data.

Sweep alternation score

To calculate the sweep alternation score, a three-sweep sliding window was used as in Vollan et al.13 Specifically, at the ith time step, a triplet of sweep directions αi − 1:i+1 was selected. Then the two angles between consecutive sweep pairs were calculated ai = αi − αi − 1 and bi = αi+i − αi, and the alternation score at ith time step was computed as:

si=|aibi|2max(|ai|,|bi|), (Equation 14)

where | ·| denotes the absolute value. The overall alternation score was finally calculated as the average of alternation scores across all simulation time bins: s=1NiNsi, with N the total number of time bins. The alternation score is bound between 0 and 1, with higher values indicating more regular theta sweeps of left-right-left-right-left…

Theta skipping index

To calculate the theta skipping index for each cell, we followed the method described in Brandon et al.22 First, we computed the spike time autocorrelogram (time range ± 500 ms bin width 5 ms). The autocorrelogram was further normalized by the peak value between 50 ms and 250 ms, and values above 1 (usually those around zero lag) was then clipped to 1, to ensure all the values are in a range of [0,1]. Second, the resulting autocorrelogram was fit with a cosine wave with a second interfering oscillation:

y(x)=[a1(cos(ωx)+1)+a2(cos(0.5ωx)+1)+b]×exp(|x|τ1)+cexp(x22τ22), (Equation 15)

where x is the autocorrelation lag, a1 ∈ [0;1], a2 ∈ [0;1], b∈ [0; 1]; c ∈ [−1; 1]; u ∈ [10p; 18p]; t1 ∈ [0; 5]; t2 ∈ [0; 0:005] are the searching range for parameter fitting. Third, the theta skipping index was calculated as the difference between the first and second peaks in the autocorrelogram, normalized by the larger of the two:

TS=p2p1max(p1,p2), (Equation 16)

where p1 is the model value at one cycle with x = 2π/ω and p2 is the model value at two cycles with x = 4π/ω. This skipping index is bound between -1 and 1, with higher values indicating more theta skipping.

Highlights.

  • Shows how firing rate adaptation produces left-right theta sweeps in grid cells

  • Models the interaction between internal signals for direction and location

  • Explains how theta sweeps relate to theta skipping in direction cells

  • Predicts theta phase coding of turning angle in head-direction cells

In brief.

Ji, Chu et al. present a network model of direction and grid cells, which generates an internal direction signal comprised of alternating left-right sweeps of encoded location and direction, based on attractor dynamics, firing rate adaptation, and theta modulation. The model explains existing data from foraging rodents and makes testable predictions.

Acknowledgments

We thank Richard Gardner and Edvard Moser and Eleonora Lomi and Kate Jeffery and their research groups for making their grid cell and head-direction cell data publicly available online. We thank Motoharu Yoshida and Michael Hasselmo for sharing their whole-cell patch-clamp data. The work was supported by a Wellcome Principal Research Fellowship (222457/Z/21/Z, N.B.) and a Science and Technology Innovation 2030-Brain Science and Brain-Inspired Intelligence Project (2021ZD0200204, S.W.).

Footnotes

Author Contributions

All authors conceptualized the project. Z.J. and T.C. built the model and performed the simulations with supervision from N.B. and S.W. Z.J. analyzed the experimental data with input from N.B. All authors discussed and interpreted the results. Z.J. and N.B. wrote the paper.

Declaration of Interests

The authors declare no competing interests.

Declaration of Generative AI And AI-Assisted Technologies in the Writing Process

During the preparation of this work Z.J. used ChatGPT in order to improve the readability and language of the first draft. After using this tool, Z.J. and N.B. reviewed and edited the content as needed and take full responsibility for the content of the published article.

Supplemental Information

Supplemental information can be found online at https://doi.org/10.1016/j.cub.2024.08.059.

Data and code availability

The grid cell dataset is from Gardner et al.45 and available at: https://figshare.com/articles/dataset/Toroidal_topology_of_population_activity_in_grid_cells/16764508. The head-direction cell dataset is from Lomi et al.19 and available at: https://figshare.com/articles/dataset/_strong_Data_code_for_Lomi_et_al_2023_strong_/22802861.

The in vitro patch-clamp data was requested from Yoshida et al.21

Code for reproducing all the results (including modeling and experimental data analysis) is available at: https://github.com/ZilongJi/GridCellThetaSweeps

References

  • 1.O’Keefe J, Nadel L. The hippocampus as a cognitive map. Clarendon Press; 1978. [Google Scholar]
  • 2.Morris RGM, Garrud P, Rawlins JNP, O’Keefe J. Place navigation impaired in rats with hippocampal lesions. Nature. 1982;297:681–683. doi: 10.1038/297681a0. [DOI] [PubMed] [Google Scholar]
  • 3.Pfeiffer BE, Foster DJ. Hippocampal place-cell sequences depict future paths to remembered goals. Nature. 2013;497:74–79. doi: 10.1038/nature12112. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Taube JS, Muller RU, Ranck JB. Head-direction cells recorded from the postsubiculum in freely moving rats. I. Description and quantitative analysis. J Neurosci. 1990;10:420–435. doi: 10.1523/JNEUROSCI.10-02-00420.1990. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5.O’Keefe J, Dostrovsky J. The hippocampus as a spatial map: preliminary evidence from unit activity in the freely-moving rat. Brain Res. 1971;34:171–175. doi: 10.1016/0006-8993(71)90358-1. [DOI] [PubMed] [Google Scholar]
  • 6.Hafting T, Fyhn M, Molden S, Moser M-B, Moser EI. Microstructure of a spatial map in the entorhinal cortex. Nature. 2005;436:801–806. doi: 10.1038/nature03721. [DOI] [PubMed] [Google Scholar]
  • 7.Lever C, Burton S, Jeewajee A, O’Keefe J, Burgess N. Boundary vector cells in the subiculum of the hippocampal formation. J Neurosci. 2009;29:9771–9777. doi: 10.1523/JNEUROSCI.1319-09.2009. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.O’Keefe J, Recce ML. Phase relationship between hippocampal place units and the EEG theta rhythm. Hippocampus. 1993;3:317–330. doi: 10.1002/hipo.450030307. [DOI] [PubMed] [Google Scholar]
  • 9.Hafting T, Fyhn M, Bonnevie T, Moser M-B, Moser EI. Hippocampus-independent phase precession in entorhinal grid cells. Nature. 2008;453:1248–1252. doi: 10.1038/nature06957. [DOI] [PubMed] [Google Scholar]
  • 10.Foster DJ, Wilson MA. Hippocampal theta sequences. Hippocampus. 2007;17:1093–1099. doi: 10.1002/hipo.20345. [DOI] [PubMed] [Google Scholar]
  • 11.Johnson A, Redish AD. Neural ensembles in CA3 transiently encode paths forward of the animal at a decision point. J Neurosci. 2007;27:12176–12189. doi: 10.1523/JNEUROSCI.3761-07.2007. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Kay K, Chung JE, Sosa M, Schor JS, Karlsson MP, Larkin MC, Liu DF, Frank LM. Constant sub-second cycling between representations of possible futures in the hippocampus. Cell. 2020;180:552–567.:e25. doi: 10.1016/j.cell.2020.01.014. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Vollan AZ, Gardner RJ, Moser M-B, Moser EI. Left-right-alternating theta sweeps in the entorhinal-hippocampal spatial map. Nature. 2025 doi: 10.1038/s41586-024-08527-1. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Tsodyks MV, Skaggs WE, Sejnowski TJ, McNaughton BL. Population dynamics and theta rhythm phase precession of hippocampal place cell firing: a spiking neuron model. Hippocampus. 1996;6:271–280. doi: 10.1002/(SICI)1098-1063(1996)6:3<271::AID-HIPO5>3.0.CO;2-Q. [DOI] [PubMed] [Google Scholar]
  • 15.Romani S, Tsodyks M. Short-term plasticity based network model of place cells dynamics. Hippocampus. 2015;25:94–105. doi: 10.1002/hipo.22355. [DOI] [PubMed] [Google Scholar]
  • 16.Kang L, DeWeese MR. Replay as wavefronts and theta sequences as bump oscillations in a grid cell attractor network. eLife. 2019;8:e46351. doi: 10.7554/eLife.46351. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Chu T, Ji Z, Zuo J, Mi Y, Zhang WH, Huang T, Bush D, Burgess N, Wu S. Firing rate adaptation affords place cell theta sweeps, phase precession, and procession. eLife. 2024;12:RP87055. doi: 10.7554/eLife.87055. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18.Tsanov M, Chah E, Vann SD, Reilly RB, Erichsen JT, Aggleton JP, O’Mara SM. Theta-modulated head direction cells in the rat anterior thalamus. J Neurosci. 2011;31:9489–9502. doi: 10.1523/JNEUROSCI.0353-11.2011. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19.Lomi E, Jeffery KJ, Mitchell AS. Convergence of location, direction, and theta in the rat anteroventral thalamic nucleus. iScience. 2023;26:106993. doi: 10.1016/j.isci.2023.106993. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Boccara CN, Sargolini F, Thoresen VH, Solstad T, Witter MP, Moser EI, Moser M-B. Grid cells in pre-and parasubiculum. Nat Neurosci. 2010;13:987–994. doi: 10.1038/nn.2602. [DOI] [PubMed] [Google Scholar]
  • 21.Yoshida M, Jochems A, Hasselmo ME. Comparison of properties of medial entorhinal cortex layer II neurons in two anatomical dimensions with and without cholinergic activation. PLoS One. 2013;8:e73904. doi: 10.1371/journal.pone.0073904. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Brandon MP, Bogaard AR, Schultheiss NW, Hasselmo ME. Segregation of cortical head direction cell assemblies on alternating theta cycles. Nat Neurosci. 2013;16:739–748. doi: 10.1038/nn.3383. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Sargolini F, Fyhn M, Hafting T, McNaughton BL, Witter MP, Moser M-B, Moser EI. Conjunctive representation of position, direction, and velocity in entorhinal cortex. Science. 2006;312:758–762. doi: 10.1126/science.1125572. [DOI] [PubMed] [Google Scholar]
  • 24.Mi Y, Fung CC, Wong KY, Wu S. Spike frequency adaptation implements anticipative tracking in continuous attractor neural networks. Adv Neural Inf Process Syst. 2014;27:505–513. [Google Scholar]
  • 25.Fuhrmann F, Justus D, Sosulina L, Kaneko H, Beutel T, Friedrichs D, Schoch S, Schwarz MK, Fuhrmann M, Remy S. Locomotion, theta oscillations, and the speed-correlated firing of hippocampal neurons are controlled by a medial septal glutamatergic circuit. Neuron. 2015;86:1253–1264. doi: 10.1016/j.neuron.2015.05.001. [DOI] [PubMed] [Google Scholar]
  • 26.Blair HT, Sharp PE. Anticipatory head direction signals in anterior thalamus: evidence for a thalamocortical circuit that integrates angular head motion to compute head direction. J Neurosci. 1995;15:6260–6270. doi: 10.1523/JNEUROSCI.15-09-06260.1995. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27.Taube JS, Muller RU. Comparisons of head direction cell activity in the postsubiculum and anterior thalamus of freely moving rats. Hippocampus. 1998;8:87–108. doi: 10.1002/(SICI)1098-1063(1998)8:2<87::AID-HIPO1>3.0.CO;2-4. [DOI] [PubMed] [Google Scholar]
  • 28.Vanderwolf CH. Hippocampal electrical activity and voluntary movement in the rat. Electroencephalogr Clin Neurophysiol. 1969;26:407–418. doi: 10.1016/0013-4694(69)90092-3. [DOI] [PubMed] [Google Scholar]
  • 29.Maurer AP, Burke SN, Lipa P, Skaggs WE, Barnes CA. Greater running speeds result in altered hippocampal phase sequence dynamics. Hippocampus. 2012;22:737–747. doi: 10.1002/hipo.20936. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30.Brandon MP, Bogaard AR, Libby CP, Connerney MA, Gupta K, Hasselmo ME. Reduction of theta rhythm dissociates grid cell spatial periodicity from directional tuning. Science. 2011;332:595–599. doi: 10.1126/science.1201652. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31.Winson J. Loss of hippocampal theta rhythm results in spatial memory deficit in the rat. Science. 1978;201:160–163. doi: 10.1126/science.663646. [DOI] [PubMed] [Google Scholar]
  • 32.Robinson JC, Wilmot JH, Hasselmo ME. Septo-hippocampal dynamics and the encoding of space and time. Trends Neurosci. 2023;46:712–725. doi: 10.1016/j.tins.2023.06.004. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 33.Robinson JC, Ying J, Hasselmo ME, Brandon MP. Optogenetic silencing of medial septal GABAergic neurons disrupts grid cell spatial and temporal coding in the medial entorhinal cortex. Cell Rep. 2024;43:114590. doi: 10.1016/j.celrep.2024.114590. [DOI] [PubMed] [Google Scholar]
  • 34.Shin J. Passive rotation-induced theta rhythm and orientation homeostasis response. Synapse. 2010;64:409–415. doi: 10.1002/syn.20742. [DOI] [PubMed] [Google Scholar]
  • 35.Tai SK, Ma J, Ossenkopp K-P, Leung LS. Activation of immobility-related hippocampal theta by cholinergic septohippocampal neurons during vestibular stimulation. Hippocampus. 2012;22:914–925. doi: 10.1002/hipo.20955. [DOI] [PubMed] [Google Scholar]
  • 36.Andersen P, Morris RGM, Amaral DG, Bliss TVP, O’Keefe J. In: The Hippocampus Book. Andersen P, Morris RGM, Amaral DG, Bliss TVP, O’Keefe J, editors. Oxford University Press; 2007. [Google Scholar]
  • 37.Wallenstein GV, Hasselmo ME. GABAergic modulation of hippocampal population activity: sequence learning, place field development, and the phase precession effect. J Neurophysiol. 1997;78:393–408. doi: 10.1152/jn.1997.78.1.393. [DOI] [PubMed] [Google Scholar]
  • 38.Jeewajee A, Barry C, Douchamps V, Manson D, Lever C, Burgess N. Theta phase precession of grid and place cell firing in open environments. Philos Trans R Soc Lond B Biol Sci. 2014;369:20120532. doi: 10.1098/rstb.2012.0532. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 39.Climer JR, Newman EL, Hasselmo ME. Phase coding by grid cells in unconstrained environments: two-dimensional phase precession. Eur J Neurosci. 2013;38:2526–2541. doi: 10.1111/ejn.12256. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 40.Widloski J, Foster D. Spontaneous emergence of alternating hippocampal theta sequences in a simple 2D adaptation model. Preprint at bioRxiv. 2024:2024–2026. [Google Scholar]
  • 41.Jensen O, Lisman JE. Novel lists of 7+/-2 known items can be reliably stored in an oscillatory short-term memory network: interaction with long-term memory. Learn Mem. 1996;3:257–263. doi: 10.1101/lm.3.2-3.257. [DOI] [PubMed] [Google Scholar]
  • 42.Sato N, Yamaguchi Y. Memory encoding by theta phase precession in the hippocampal network. Neural Comput. 2003;15:2379–2397. doi: 10.1162/089976603322362400. [DOI] [PubMed] [Google Scholar]
  • 43.Zhang K. Representation of spatial orientation by the intrinsic dynamics of the head-direction cell ensemble: a theory. J Neurosci. 1996;16:2112–2126. doi: 10.1523/JNEUROSCI.16-06-02112.1996. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 44.Kim SS, Rouault H, Druckmann S, Jayaraman V. Ring attractor dynamics in the Drosophila central brain. Science. 2017;356:849–853. doi: 10.1126/science.aal4835. [DOI] [PubMed] [Google Scholar]
  • 45.Gardner RJ, Hermansen E, Pachitariu M, Burak Y, Baas NA, Dunn BA, Moser M-B, Moser EI. Toroidal topology of population activity in grid cells. Nature. 2022;602:123–128. doi: 10.1038/s41586-021-04268-7. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 46.Burgess N, Recce M, O’Keefe J. A model of hippocampal function. Neural Netw. 1994;7:1065–1081. doi: 10.1016/S0893-6080(05)80159-5. [DOI] [Google Scholar]
  • 47.Kubie JL, Fenton AA. Linear look-ahead in conjunctive cells: an entorhinal mechanism for vector-based navigation. Front Neural Circuits. 2012;6:20. doi: 10.3389/fncir.2012.00020. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 48.Erdem UM, Hasselmo M. A goal-directed spatial navigation model using forward trajectory planning based on grid cells. Eur J Neurosci. 2012;35:916–931. doi: 10.1111/j.1460-9568.2012.08015.x. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 49.Taube JS. Head direction cells and the neurophysiological basis for a sense of direction. Prog Neurobiol. 1998;55:225–256. doi: 10.1016/s0301-0082(98)00004-5. [DOI] [PubMed] [Google Scholar]
  • 50.van Groen T, Wyss JM. The connections of presubiculum and parasubiculum in the rat. Brain Res. 1990;518:227–243. doi: 10.1016/0006-8993(90)90976-i. [DOI] [PubMed] [Google Scholar]
  • 51.Sharp PE. Multiple spatial/behavioral correlates for cells in the rat postsubiculum: multiple regression analysis and comparison to other hippocampal areas. Cereb Cortex. 1996;6:238–259. doi: 10.1093/cercor/6.2.238. [DOI] [PubMed] [Google Scholar]
  • 52.Lozano YR, Page H, Jacob P-Y, Lomi E, Street J, Jeffery K. Retrosplenial and postsubicular head direction cells compared during visual landmark discrimination. Brain Neurosci Adv. 2017;1:2398212817721859. doi: 10.1177/2398212817721859. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 53.Cacucci F, Lever C, Wills TJ, Burgess N, O’Keefe J. Theta-modulated place-by-direction cells in the hippocampal formation in the rat. J Neurosci. 2004;24:8265–8277. doi: 10.1523/JNEUROSCI.2635-04.2004. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 54.Jeewajee A, Barry C, O’Keefe J, Burgess N. Grid cells and theta as oscillatory interference: electrophysiological data from freely moving rats. Hippocampus. 2008;18:1175–1185. doi: 10.1002/hipo.20510. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 55.Hinman JR, Brandon MP, Climer JR, Chapman GW, Hasselmo ME. Multiple running speed signals in medial entorhinal cortex. Neuron. 2016;91:666–679. doi: 10.1016/j.neuron.2016.06.027. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 56.Dannenberg H, Lazaro H, Nambiar P, Hoyland A, Hasselmo ME. Effects of visual inputs on neural dynamics for coding of location and running speed in medial entorhinal cortex. eLife. 2020;9:e62500. doi: 10.7554/eLife.62500. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 57.Wang C, Zhang T, Chen X, He S, Li S, Wu S. BrainPy, a flexible, integrative, efficient, and extensible framework for general-purpose brain dynamics programming. eLife. 2023;12:e86365. doi: 10.7554/eLife.86365. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 58.Denovellis EL, Gillespie AK, Coulter ME, Sosa M, Chung JE, Eden UT, Frank LM. Hippocampal replay of experience at real-world speeds. eLife. 2021;10:e64505. doi: 10.7554/eLife.64505. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 59.Sreenivasan S, Fiete I. Grid cells generate an analog error-correcting code for singularly precise neural computation. Nat Neurosci. 2011;14:1330–1337. doi: 10.1038/nn.2901. [DOI] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The grid cell dataset is from Gardner et al.45 and available at: https://figshare.com/articles/dataset/Toroidal_topology_of_population_activity_in_grid_cells/16764508. The head-direction cell dataset is from Lomi et al.19 and available at: https://figshare.com/articles/dataset/_strong_Data_code_for_Lomi_et_al_2023_strong_/22802861.

The in vitro patch-clamp data was requested from Yoshida et al.21

Code for reproducing all the results (including modeling and experimental data analysis) is available at: https://github.com/ZilongJi/GridCellThetaSweeps

RESOURCES