  We introduce configuration space as a natural representation for calculating
the mechanical relaxation patterns of incommensurate two-dimensional (2D)
bilayers, bypassing supercell approximations to encompass aperiodic relaxation
patterns. The approach can be applied to a wide variety of 2D materials through
the use of a continuum model in combination with a generalized stacking fault
energy for interlayer interactions. We present computational results for
small-angle twisted bilayer graphene and molybdenum disulfide (MoS$_2$), a
representative material of the transition metal dichalcogenide (TMDC) family of
2D semiconductors. We calculate accurate relaxations for MoS$_2$ even at small
twist-angle values, enabled by the fact that our approach does not rely on
empirical atomistic potentials for interlayer coupling. The results demonstrate
the efficiency of the configuration space method by computing relaxations with
minimal computational cost for twist angles down to $0.05^\circ$, which is
smaller than what can be explored by any available real space techniques. We
also outline a general explanation of domain formation in 2D bilayers with
nearly-aligned lattices, taking advantage of the relationship between real
space and configuration space.
