I'd like to know if there's an easy way to predict what is the output of the following code taken from this resource at question 13:
qc= QuantumCircuit(3)
qc.h(0)
qc.cx([0,0],[1,2])
backend_sv = BasicAer.get_backend('statevector_simulator')
job = execute(qc, backend_sv,shots=1024)
result = job.result()
sv_ev = result.get_statevector(qc)
This is intended to be a practice question for the IBM Qiskit Certification. This means that one should be able to solve it without having access to a computer, and without pen and paper.
I'm able to find the solution on pen and paper, but the matrices are large $8$ by $8$. The correct answer is the following:
[0.70710678+0.j 0. +0.j 0. +0.j 0. +0.j
0. +0.j 0. +0.j 0. +0.j 0.70710678+0.j]
I know that the output after the first three gates is the first Bell state, tensored with the $|0>$ state:
$$\frac{|00\rangle + |11\rangle}{\sqrt{2}} |0\rangle$$
But applying the last CNOT gate is not something I can do in my head. Is there an easier way to find the solution without dealing with 8x8 matrices in one's head?