The swap test allows us to measure the angle between 2 Qubits and .

Algorithm

Having initialized to , the above algorithm results in the state . As such the probability of measuring in the first Qubit is given by

Hence the swap gate allows us to measure the between two Quantum states.