# Calculating states of entangled and disentangled qubits

I'm writing a quantum computer simulator (about 8 qubits) and I know most of the basics (i.e. how to calculate the effect of a quantum gate on a qubit). But I have hit a wall.

Is it possible, with two qubits of $a |0\rangle + b|1\rangle$ and $c|0\rangle + d|1\rangle$ to calculate the superposition state of the two entangled? (i.e. $\alpha|00\rangle + ... +\delta|11\rangle$) and vice versa?

Also, if I have a pair of entangled qubits, and pass one through, for example, a Pauli-$x$ gate, what effect will that have on the overall entanglement?

The combined state space of the two qubits is spanned by $|00\rangle,|01\rangle,|10\rangle,|11\rangle$. You can consider $|xy\rangle$ as shorthand for the formal product $|x\rangle|y\rangle$ (which is not equal to $|y\rangle|x\rangle$ if $x\ne y$), and using that you find that the combined state is $ac|00\rangle + ad|01\rangle + bc|10\rangle + bd|11\rangle$. This is the tensor product of the states, which is an element of the tensor product of the two state spaces.

Note that this is not an entangled state, by definition. It is entangled exactly when it is not of this form. A general 2-qubit state is not of this form and can not be written as the tensor product of 1-qubit states (only as a linear combination of such separable states). To find out whether it is separable, and to separate them in that case, amounts to solving a system of equations.

In general, if a 1-qubit gate maps $|0\rangle$ to $a|0\rangle + b|1\rangle$, then, if it is applied to (e.g.) the second qubit of a pair, then $|00\rangle$ is mapped to $a|00\rangle + b|01\rangle$, etc. This is the tensor product of the identity and the 1-qubit gate. For the corresponding matrices this is the Kronecker product.

• Thanks! Could I please ask where I could find some information on the system of equations you talked about? – Xandros Jan 6 '14 at 10:15
• That would simply be $\alpha = ac,\ \beta = ad,\ \gamma = bc,\ \delta = bd$, if your combined state is given as $\alpha|00\rangle + \beta|01\rangle + \gamma|10\rangle + \delta|11\rangle$. – doetoe Jan 6 '14 at 11:22

Any state which cannot be decomposed into an exact tensor product of states over the state spaces of the subsystems is an entangled state. For example, any 2-qubit state which cannot be decomposed into $|x\rangle|y\rangle$ form is an entangled state.

As for the 2nd part of the original question:
Any local operation such as applying a Pauli-X gate can only preserve or destroy the entanglement of the original pair of qubits. Local operations (LOCC) cannot be used to create entanglement.
As an example one may consider the Bell states and observe the effect of applying the Pauli operators on any of the individual qubits in the entangled pair.

• Can you clarify how a local operation can destroy entanglement? – lionelbrits Jan 7 '15 at 15:51