  We develop the notion of entwinement to characterize the amount of quantum
entanglement between internal, discretely gauged degrees of freedom in a
quantum field theory. This concept originated in the program of reconstructing
spacetime from entanglement in holographic duality. We define entwinement
formally in terms of a novel replica method which uses twist operators charged
in a representation of the discrete gauge group. In terms of these twist
operators we define a non-local, gauge-invariant object whose expectation value
computes entwinement in a standard replica limit. We apply our method to the
computation of entwinement in symmetric orbifold conformal field theories in
1+1 dimensions, which have an $S_N$ gauging. Such a theory appears in the weak
coupling limit of the D1-D5 string theory which is dual to AdS$_3$ at strong
coupling. In this context, we show how certain kinds of entwinement measure the
lengths, in units of the AdS scale, of non-minimal geodesics present in certain
excited states of the system which are gravitationally described as conical
defects and the $M=0$ BTZ black hole. The possible types of entwinement that
can be computed define a very large new class of quantities characterizing the
fine structure of quantum wavefunctions.
