I am getting confused as to how to perform gate operations using matrices and am hoping someone will help me walk through this example.
Say I want to perform a Pauli-X gate on the 3rd qubit in a 3-qubit system. That operation would be:
U = I ⊗ I ⊗ X
Then say I have the state $|001\rangle$ so after applying U the state would become $|000\rangle$. I am trying to use Python and NumPy to calculate this but I believe I am missing something.
i = np.array([[1, 0], [0, 1]]) x = np.array([[0, 1], [1, 0]]) state_0 = np.array([, ]) state_1 = np.array([, ]) x_3 = np.kron(np.kron(i,i),x) v = np.kron(np.kron(state_0, state_0), state_1) print(x_3.dot(v))
This code outputs:
[       ]
I am unsure if this output is correct and if it is how would I see this as the state $|000\rangle$? Any clarifications would be very useful! Thank you!