Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2020/ii/paper-2/15c/d/i/solution

After the first Hadamard gate, the joint state is
The controlled SWAP gate then gives
After the second Hadamard gate, it is

New to topics? Read the docs here!