You want to represent the tensor product!
What is the tensor product?
In a rough sense, we define the tensor product as the obvious bilinear binary operator $\otimes$ such that we can write things like:$$\big(\langle a|~\otimes\langle b|\big) ~\big(X \otimes Y\big)~\big(|c\rangle \otimes |d\rangle\big) = \langle a |X|c\rangle\langle b|Y|d\rangle.$$You might implement this in a programming language with whatever tuple or pair operators you have available: however we have one big nuance, which is that we want to make this into a new vector space atop the field $\mathbb C$, and therefore this operator $\otimes$ injects into a smaller part of a larger space. So we can define basis elements like $|01\rangle = |0\rangle \otimes |1\rangle$ for the space, but please be aware that while you can use linearity make sense of e.g. $$\big(a |0\rangle + b |1\rangle\big) \otimes \big(c |0\rangle + d |1\rangle\big) = ac |00\rangle + ad |01\rangle + bc |10\rangle + bd |11\rangle,$$you cannot in general go from an arbitrary vector $\alpha|00\rangle + \beta|01\rangle + \gamma |10\rangle + \delta |11\rangle$ in this new space on the right, back to a separated version as you see on the left. (A criterion: notice that for the separable states $\alpha\delta = \beta\gamma = abcd$; you can do it therefore when this "determinant" $\alpha\delta-\beta\gamma$ vanishes.)
Similarly to the basis states, we can expand the operator states in terms of their basis matrix elements like $|01\rangle\langle 11|,$ and that gives us the full space of possible operators and vectors in the space.
How can I concretely represent this?
Well I notice that your "intuitive" approach appears to be to combine the two vectors into another big vector, so you take the pair ([1, 0], [0, 1])
which would represent $|01\rangle$ and represent it as the vector [1, 0, 0, 1]
. This has a certain elegance at first because it means that your tensor product of operators looks like:$$X \otimes Y = \begin{bmatrix}X & 0\\ 0 & Y\end{bmatrix}.$$However, what do you notice about the vector [a, b, c, d]
?
It is always separable into ([a, b], [c, d]).
D'oh! We can't express entanglement in this language without storing explicit linear combinations of vectors.
There is a better way: it turns out that you can just renumber the states by their binary encoding, so $$|00\rangle \mapsto |0'\rangle,\\ |01\rangle \mapsto |1'\rangle,\\ |10\rangle \mapsto |2'\rangle,\\ |11\rangle \mapsto |3'\rangle.$$ Now the primed space on the right is just $\mathbb C^4$. (The mathematical kind, not the explosive kind.) So [α, β, γ, δ]
can just be your programming representation of $\alpha |0'\rangle + \beta |1'\rangle + \gamma |2'\rangle + \delta |3'\rangle.$
What about our tensor product on operators, though? They must have a very complicated form! Well, yes and no. Yes it's a little complicated, but no you don't have to program it, it's in your programming language already as the "Kronecker product", obscure enough to be a little buried but useful enough that somebody needed it and added it. It is just the formula: $$\hat X \otimes \hat Y = \begin{bmatrix} X_{00}~\hat Y & X_{01}~\hat Y\\X_{10}~\hat Y&X_{11}~\hat Y\end{bmatrix},$$ where $X_{ij} = \langle i|\hat X|j\rangle.$ This space of 4x4 complex matrices inherits all of the nice theory that you want, too: for example you may be able to see that the product of Hermitian matrices is Hermitian.