# How is it possible to guess what state the qubit was in by measuring it?

Let's say that the qubit is in the state $$\psi = \alpha|0\rangle+\beta|1\rangle$$. We want to find out the values $$\alpha$$ and $$\beta$$.

If we measure it in, say, the standard basis, then the outcome we get is either $$|0\rangle$$ or $$|1\rangle$$. So, how do we find out the given values?

I recently came across the problem that asked to compare the probabilities of finding out the $$\alpha$$ and $$\beta$$ if we measured the qubit in two different bases and I'm not sure how to calculate them.

• – glS Jul 26 '20 at 18:59

Let's describe the one qubit pure stat in Bloch sphere notation (in order to avoid the global phase ambiguity):

$$|\psi \rangle = \cos\big(\frac{\theta}{2}\big) |0\rangle + e^{i\varphi} \sin\big(\frac{\theta}{2}\big)$$

The problem can be solved with the quantum state tomography, but in this answer, I want to consider a slightly different approach for dealing with the pure states. This answer is a generalized version of this answer. Here we assume that the described state can be prepared as many times as we want.

We are going to execute three different experiments to estimate the $$\alpha = \cos\big(\frac{\theta}{2}\big)$$ and $$\beta = e^{i\varphi} \sin\big(\frac{\theta}{2}\big)$$, where $$\theta$$ is in $$[0, \pi]$$ range, $$\varphi$$ is in $$[-\pi, \pi)$$ range (in the Bloch sphere formalism $$\varphi$$ is in $$[0, 2\pi)$$, but we can, without any problems, take $$[-\pi, \pi)$$ range for our convenience). The first experiment will give us $$\theta$$ and the last two experiments will give us $$\varphi$$ from which it will be straightforward to calculate $$\alpha$$, $$\beta$$, and thus the $$|\psi \rangle$$ pure state.

The first experiment: determining $$\theta$$.

Execute $$N$$ times (bigger $$N$$ will give a better answer) $$Z$$ basis measurements. Note that the probabilities of measuring $$|0\rangle$$ $$\left( P(0) \right)$$ and $$|1\rangle$$ $$\left(P(1)\right)$$ states have these relations with the outcomes of the experiment:

$$P(0) = \lim_{N \rightarrow \infty} \frac{N_{0}}{N} = |\alpha|^2 = \cos^2 \big(\frac{\theta}{2}\big) \\ P(1) = \lim_{N \rightarrow \infty} \frac{N_{1}}{N} = |\beta|^2 = \sin^2\big(\frac{\theta}{2}\big)$$

So:

$$\theta = 2 \arccos \big(\sqrt{(P(0))}\big) = 2 \arcsin \big(\sqrt{(P(1))}\big)$$

because values of $$\frac{\theta}{2}$$ is in the $$[0, \frac{\pi}{2}]$$ range.

The second experiment: the absolute value of the relative phase.

We have defined the relative phase $$\varphi$$ in the range $$[-\pi, \pi)$$ and here we are going to find the $$|\varphi|$$. For that, we apply a Hadamard gate:

$$H \left( \cos\big(\frac{\theta}{2}\big) |0\rangle + e^{i\varphi} \sin \big(\frac{\theta}{2} \big) \right) = \\ = \frac{1}{\sqrt{2}} \left( \cos\big(\frac{\theta}{2}\big) + e^{i\varphi} \sin \big(\frac{\theta}{2} \big) \right) |0\rangle + \frac{1}{\sqrt{2}} \left( \cos\big(\frac{\theta}{2}\big) - e^{i\varphi} \sin \big(\frac{\theta}{2} \big) \right) |1\rangle$$

If we calculate the probabilities of measuring $$|0\rangle$$ ($$P'(0)$$) and $$|1\rangle$$ $$P'(1)$$ we will obtain that:

$$P'(0) = \frac{1}{2} \left| \cos\big(\frac{\theta}{2}\big) + e^{i\varphi} \sin \big(\frac{\theta}{2} \big) \right|^2 = \frac{1 + \cos(\varphi) \sin(\theta)}{2} \\ P'(1) = \frac{1}{2} \left| \cos\big(\frac{\theta}{2}\big) - e^{i\varphi} \sin \big(\frac{\theta}{2} \big) \right|^2 = \frac{1 - \cos(\varphi) \sin(\theta)}{2}$$

That is why:

$$\varphi = \pm \arccos \left( \frac{P'(0) - P'(1)}{\sin(\theta)} \right)$$

because the range of usual principal value arccosine function is equal to $$[0, \pi]$$. We know $$\theta$$, we know how to calculate $$P'(0)$$ and $$P'(1)$$ from the new experiment with Hadamard gate, so we will be able to find $$|\varphi|$$. If $$\sin(\theta) = 0$$, then we can just skip the second and the third experiments, because in that case we have either $$|\psi\rangle = |1\rangle$$ ($$\theta = \pi$$) or $$|\psi\rangle = |0\rangle$$ ($$\theta = 0$$).

Also, note that:

$$\langle X \rangle = \langle \psi | X | \psi \rangle = \langle \psi |H Z H| \psi \rangle = P(0) - P(1)$$

So, the formula can be written in this way:

$$\theta = \pm \arccos \left( \frac{\langle X \rangle}{\sin(\theta)} \right)$$

The third experiment: determining the sign of the relative phase.

For this we will need to apply $$S^{\dagger}$$ then $$H$$ gates to the initial state before $$N$$ measurements:

$$H S^{\dagger} \left( \cos\big(\frac{\theta}{2}\big) |0\rangle + e^{i\varphi} \sin \big(\frac{\theta}{2} \big) \right) = \\ = \frac{1}{\sqrt{2}} \left( \cos\big(\frac{\theta}{2}\big) - i e^{i\varphi} \sin \big(\frac{\theta}{2} \big) \right) |0\rangle + \frac{1}{\sqrt{2}} \left( \cos\big(\frac{\theta}{2}\big) + i e^{i\varphi} \sin \big(\frac{\theta}{2} \big) \right) |1\rangle$$

The probabilities:

$$P''(0) = \frac{1}{2} \left| \cos\big(\frac{\theta}{2}\big) - ie^{i\varphi} \sin \big(\frac{\theta}{2} \big) \right|^2 = \frac{1 + \sin(\varphi) \sin(\theta)}{2} \\ P''(1) = \frac{1}{2} \left| \cos\big(\frac{\theta}{2}\big) + ie^{i\varphi} \sin \big(\frac{\theta}{2} \big) \right|^2 = \frac{1 - \sin(\varphi) \sin(\theta)}{2}$$

For the sign of the relative phase we have:

$$sign(\varphi) = sign \left( \arcsin \left(\frac{P''(0) - P''(1)}{\sin(\theta)} \right) \right) = sign \left( P''(0) - P''(1) \right)$$

because the range of usual principal value of arcsine function is $$[-\frac{\pi}{2}, \frac{\pi}{2}]$$ and $$\sin(\theta) > 0$$ $$\left( \theta \in [0, \pi] \right)$$.

Also, note that for the expectation value of the $$Y$$ operator (as can be seen from this answer) we have this relation:

$$\langle Y \rangle = \langle \psi| Y | \psi\rangle = \langle \psi| S H Z H S^{\dagger} | \psi\rangle = P''(0) - P''(1)$$

By taking this into account and combining the last two experiments we can obtain the relative phase:

$$\varphi = sign \big( \langle Y \rangle \big) \arccos \left( \frac{\langle X \rangle}{\sin(\theta)} \right)$$

You measure many times and collect statistics. E.g. you do $$1000$$ measurements and find $$600$$ times the first outcome. You can then deduce that $$|\alpha|^2\simeq 0.6$$ and $$|\beta|^2\sim0.4$$ (using appropriate statistical methods to compute the associated estimation errors).

Note that this does not fully characterise the state, but only gives you the amplitudes $$|\alpha|,|\beta|$$. You do not have access to any other information, unless you also do measurements on a different basis.

If you measure for example in the $$|\pm\rangle$$ basis, you will find that this gives you information about the relative phase (more specifically, it gives you the value of $$2\operatorname{Re}(\alpha^*\beta)$$). To definitively pinpoint the state, you will then also need the probabilities in a third measurement basis, e.g. the basis $$|0\rangle\pm i\lvert0\rangle$$, which allow you to compute $$2\operatorname{Im}(\alpha^* \beta)$$.

• yes, $|\pm \rangle$ basis measurement will give information about the relative phase, but one more procedure is needed in order to gain full information about the phase as was described in this answer. – Davit Khachatryan Jul 26 '20 at 20:40
• @DavitKhachatryan of course, I amended the sentence, thanks – glS Jul 26 '20 at 20:49

Usually, the calculation of amplitudes can be accomplished by either of the following properties:

1. Complex amplitudes are always normalized (as they form the probabilities) so $$|\alpha|^2+|\beta|^2$$=1

2. Using the geometric interpretation of quantum bit (if you know the angle $$\theta$$) which realized the two-dimensional vector in your case on a unit circle in a 2D complex vector space (or Hilbert space), so you can write the state as $$\psi$$ = $$\cos$$ $$\theta|0\rangle$$ + $$\sin$$ $$\theta|1\rangle$$ where $$\theta$$ will be the angle between $$|0\rangle$$ and the superposition state $$\psi$$ (and the states $$|0\rangle$$ and $$|1\rangle$$ are orthonormal). It will satisfy 1 as $$\sin^2\theta$$+$$\cos^2\theta$$=1

3. Using the above, you can perform the measurement in the sign basis or any arbitrary basis, keeping in mind the angle and the amplitudes of that basis in accordance with the standard basis of $$|0\rangle$$ and $$|1\rangle$$ (example, for sign basis you will have amplitutes as 1/$$\sqrt2$$ and the basis will be rotated by 45 degree clockwise so $$|+\rangle$$ will be at $$+\pi/4$$ and $$|-\rangle$$ will be at $$-\pi/4$$ angle with horizontal $$|0\rangle$$)

4. Alternatively, you can change your state's notation from ket to vector and solve using matrices if you find that convenient (but it won't be of much help for large number of qubits).
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 99, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9778262376785278, "perplexity": 194.91611474608666}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-17/segments/1618038085599.55/warc/CC-MAIN-20210415125840-20210415155840-00428.warc.gz"}