Let’s start from global U(1) symmetry, A quantum wavefunction for a charged particle is

An extra term pops out


A miu is not physically observable, so we need to so some math tricks to surface it out


In this case, i.e. electromagnetism, the phase change is a simple U(1) group, to extend U(1) to generic U(2), U(3), covariant derivative is needed, hence the more complex Yang-Mills Field strength equation:
