TransWikia.com

Trying to understand this measurement of a simple quantum circuit

Quantum Computing Asked by Maka on March 27, 2021

It’s a newbie question, I know. But I was just wondering if someone could help me understand why this simple circuit results with the measurement shown. I’ve just didn’t get the last step. It’s not supposed that the last Hadamard gate would cancel the first one on q[0]? Why I still got results like 011 or 111?

Simple quantum circuit

One Answer

You can think of the circuit operation as follows. Remembering that for Hadamard matrix: $H times H = mathbb{I}$, your circuit looks like the following: $$ H otimes mathbb{I} otimes mathbb{I}(CCNOT(H|0rangle otimes H|0rangle otimes |0rangle )) $$ Let's focus on the inner-most part first: $$ H|0rangle otimes H|0rangle otimes |0rangle =frac{1}{sqrt{2}}(|0rangle + |1rangle) otimes frac{1}{sqrt{2}}(|0rangle + |1rangle) otimes |0rangle = frac{1}{2}(|000rangle + |010rangle + |100rangle + |110rangle). $$ Now, the action of $CCNOT$ gate is that, if the first two qubits are $1$, then the third qubit would be flipped. But notice that in the above state, only the last term has two $1$'s in it, i.e. the $|110rangle$ term. So, the action of $CCNOT$ on the above state would be: $$ CCNOT(frac{1}{2}(|000rangle + |010rangle + |100rangle + |110rangle)) = frac{1}{2}(|000rangle + |010rangle + |100rangle + |111rangle). $$ Now we apply the Hadamard matrix on the first qubit only: $$ H otimes mathbb{I} otimes mathbb{I}(frac{1}{2}(|000rangle + |010rangle + |100rangle + |111rangle)) = frac{1}{2}(frac{1}{sqrt{2}}(|0rangle + |1rangle)|00rangle + frac{1}{sqrt{2}}(|0rangle + |1rangle)|10rangle + frac{1}{sqrt{2}}(|0rangle - |1rangle)|00rangle + frac{1}{sqrt{2}}(|0rangle - |1rangle)|11rangle)). $$ Simplify it! Would be a good exercise if nothing else. :) You would see that the resulting state has the terms that you have shown in the second picture.

Correct answer by Hasan Iqbal on March 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP