Oops. Make a mistake in the explanation. The code is only for 2-qubit. The math demonstration in the early part is for a 3–qubit problem. I have made some changes to the explanation.

Oops. Make a mistake in the explanation. The code is only for 2-qubit. The math demonstration in the early part is for a 3–qubit problem. I have made some changes to the explanation.