  A periodic array of topological spin textures, such as skyrmions and
hedgehogs, is called the multiple-$Q$ spin texture, as it is represented by a
superposition of multiple spin density waves. Depending on the way of
superposition, not only the magnetic but also the topological properties are
modified, leading to a variety of quantum transport and optical phenomena
caused by the emergent electromagnetic fields through the Berry phase. Among
others, the phase degree of freedom of the superposed waves is potentially
important for such modifications, but its effect has not been fully elucidated
thus far. Here we perform systematic theoretical analyses of magnetic and
topological properties of the multiple-$Q$ spin textures with the phase degree
of freedom. By introducing a hyperspace with an additional dimension
corresponding to the phase degree of freedom, we establish a generic framework
to deal with the phase shift in the multiple-$Q$ spin textures. Applying the
framework to the two-dimensional 3$Q$ spin textures, we clarify the complete
topological phase diagram while changing the phase and magnetization, which
depends on the types of the superposed waves. We also study the
three-dimensional 4$Q$ spin textures and clarify even richer topological phase
diagrams. In particular, we find novel topological phase transitions associated
with the previously unidentified Dirac strings on which the hedgehogs and
antihedgehogs cause pair creation and fusion. Moreover, we demonstrate that
phase shifts are caused by an external magnetic field in both 3$Q$ and 4$Q$
cases by analyzing the numerical data in the previous studies. Our results
illuminate the topological aspects of the skyrmion and hedgehog lattices with
the phase degree of freedom, which would be extended to other multiple-$Q$
textures and useful for the exploration of topologically nontrivial magnetic
phases and exotic quantum phenomena.
