So let's asume I have a product state/quantum register as a result of a tensor product of two qubits.

Lets take a "hard" product state matrix like: $$\frac{1}{\sqrt{2}} \begin{bmatrix} \frac12 + \frac{i}{4} \\\frac12 + \sqrt{\frac{7}{16}}i \\ \frac12 + \frac{i}{4} \\ \frac12 + \sqrt{\frac{7}{16}}i \end{bmatrix}$$

How would I decompose it back to the tensor product of two qubits?


1 Answer 1


You know that: $$\begin{pmatrix}a_1\\a_2\end{pmatrix}\otimes\begin{pmatrix}b_1\\b_2\end{pmatrix}=\begin{pmatrix}a_1b_1\\a_1b_2\\a_2b_1\\a_2b_2\end{pmatrix}=\frac{1}{\sqrt{2}}\begin{pmatrix}\frac12+\frac{\mathrm{i}}{4}\\\frac12+\mathrm{i}\sqrt{\frac{7}{16}}\\\frac12+\frac{\mathrm{i}}{4}\\\frac12+\mathrm{i}\sqrt{\frac{7}{16}}\end{pmatrix}$$ Assuming you don't see any obvious structure (which isn't the case here, so we could speed up the computation a bit in this case), you can proceed using the fact that: $$\left|a_1b_1\right|^2+\left|a_1b_2\right|^2=\left|a_1\right|^2$$ Using similar equations, you can find the squared modulus of each coefficient. You then want to find their argument. Let us the arguments of the $a_i$ as $\theta_i$ and those of $b_i$ as $\varphi_1$. The argument of $a_ib_j$ is then $\theta_i+\varphi_j\pmod{2\pi}$. You can thus deduce each phase from the equations.

Applying this to this example, we find: $$\left|a_1\right|^2=\frac12\left|\frac12+\frac{\mathrm{i}}{4}\right|^2+\frac12\left|\frac12+\mathrm{i}\sqrt{\frac{7}{16}}\right|^2=\frac{5}{32}+\frac{11}{32}=\frac12$$ Computing $\left|a_2\right|^2$ leads to the exact same computation. We also have: $$\left|b_1\right|^2=\frac12\left|\frac12+\frac{\mathrm{i}}{4}\right|^2+\frac12\left|\frac12+\frac{\mathrm{i}}{4}\right|^2=\frac{5}{16}$$ We could perform a similar computation for $\left|b_2\right|^2$, or simply use the fact that $\left|b_1\right|^2+\left|b_2\right|^2=1$ to find $\left|b_2\right|^2=\frac{11}{16}$. We now want to compute the associated phases. We have: $$\begin{align} \theta_1+\varphi_1&=\arctan\left(\frac12\right)\\ \theta_1+\varphi_2&=\arctan\left(\frac{\sqrt{7}}{2}\right)\\ \theta_2+\varphi_1&=\arctan\left(\frac12\right)\\ \theta_2+\varphi_2&=\arctan\left(\frac{\sqrt{7}}{2}\right) \end{align}$$ We thus find $\theta_1=\theta_2$, which simplifies the equations to: $$\begin{align} \theta_1+\varphi_1&=\arctan\left(\frac12\right)\\ \theta_1+\varphi_2&=\arctan\left(\frac{\sqrt{7}}{2}\right)\end{align}$$ Note that we won't have enough equations to fully determine all the variables. This is expected: note that if you apply a global phase of $\theta_1$ on the first qubit and a global phase of $-\theta_1$ on the second one, you will end up with the same vector. We can thus consider $\theta_1$ as a variable and express $\varphi_1$ and $\varphi_2$ as functions of $\theta_1$, which finally fives us all of our solutions: $$a_1=\frac{1}{\sqrt{2}}\mathrm{e}^{\mathrm{i}\theta_1}$$ $$a_2=\frac{1}{\sqrt{2}}\mathrm{e}^{\mathrm{i}\theta_1}$$ $$b_1=\frac{\sqrt{5}}{4}\mathrm{e}^{\mathrm{i}\left(\arctan\left(\frac12\right)-\theta_1\right)}$$ $$b_2=\frac{\sqrt{11}}{4}\mathrm{e}^{\mathrm{i}\left(\arctan\left(\frac{\sqrt{7}}{2}\right)-\theta_1\right)}$$ In particular, for $\theta_1=0$, we have: $$a_1=\frac{1}{\sqrt{2}}$$ $$a_2=\frac{1}{\sqrt{2}}$$ $$b_1=\frac12+\frac{\mathrm{i}}{4}$$ $$b_2=\frac12+\mathrm{i}\frac{\sqrt{7}}{4}$$

  • $\begingroup$ i dont get the part with \theta_1 + \phi_1 .... Like were do the 1/2 or sqrt(7)/2 come from? $\endgroup$ May 2, 2023 at 19:27
  • $\begingroup$ @ChristianBernhard If a complex number $z=a+\mathrm{i}b$ has a real part that is positive, that is if $a\geqslant0$, then its argument is given by $\arctan\left(\frac{b}{a}\right)$. The $\frac12$ comes from $\frac12=\frac{\frac14}{\frac12}$, since we want to compute the argument of $\frac12+\mathrm{i}\frac14$, while the other one comes from $\frac{\sqrt{7}}{2}=\frac{\sqrt{\frac{7}{16}}}{\frac12}$, since we want to compute the argument of $\frac12+\mathrm{i}\sqrt{\frac{7}{16}}$. $\endgroup$
    – Tristan Nemoz
    May 3, 2023 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.