(A) Our theory predicts that grid cell firing patterns will be shifted toward whichever wall the animal last encountered, even in a fully learned environment. In B, Left (B, Right) this shift is detected by computing the cross-correlation between west (south) conditioned firing fields, shifted by a spatial offset , and the unshifted east (north) conditioned firing field. The cross-correlation peaks when the spatial shift is positive in the x direction (positive in the y direction), as predicted by theory. Cross-correlations are averaged over all grid cells. (C) This effect can also be seen by comparing histograms of spike positions around firing-field centers for different path conditions.