# Can I find the states of individual qubits in a quantum register using only linear algebra?

Say I have a quantum register consisting of two qubits like this $$\left| -,0\right>$$ which as a vector would be $$\frac{1}{\sqrt{2}}(1, 0, -1, 0)$$. If I only started with this vector, would it possible using only the vector formulation to find the two qubits that make it up ie. $$\left|-\right> = \frac{1}{\sqrt{2}}(1, -1)$$ and $$\left|0\right> = (1, 0)$$? How would that be done in a general case where we only have a vector $$(v_{1},v_{2}, ....v_{n})$$ and we know it consists of $$log_{2}(n)$$ qubits?

1. Find the index $$k$$ of any one of the largest magnitude entries in the vector. In your case this would be index 0 or index 2. Technically any non-zero entry will do, but if you aren't being perfectly precise then picking the largest will reduce numerical error.
2. Split $$k$$ into the "included in my subsystem" part and the "excluded from my subsystem" part. For example the index $$k=2$$ splits into the index pair $$(k_i, k_e) = (1, 0)$$ whereas the index 0 would split into (0, 0).
3. Let $$w_{r}$$ be the vector formed by holding $$k_i=r$$ fixed while you vary $$k_e$$ over all possible exterior values and tale the corresponding amplitude in the state vector. For example, you hold the 1 in (1, 0) constant while iterating the other. So you need to look up (1, 0) which is $$-1$$ and (1, 1) which is $$0$$. So $$w_{k_i}$$ would be $$(-1, 0)$$.
4. Let $$v = w_{k_i} / |w_{k_i}|$$ be the renormalized vector. This is the state vector of the subsystem, up to global phase. Note that in our case it equals $$-|0\rangle$$, which is in fact one of the qubit states (up to global phase).
5. [Optional] Verify. If $$v$$ is actually the subsystem vector, then all $$w_r$$ should be parallel to $$v$$. You can check this by checking that $$|\sum_r \langle v | w_r\rangle | = 1$$. If it's not, the internal and external states are entangled.