As far as I understand, you receive an output from a quantum computer for an algorithm in the form of an amplitude, which is one of the many states your qubits may be in, however this amplitude is a complex number.

I understand that you have to square the amplitude to find the probability of finding that amplitude, but how do you convert that original amplitude into something relevant to the problem (i.e. that 3*5=15)? Is there coding within the algorithm to change the amplitude into a malleable answer?

  • $\begingroup$ The way that the amplitudes are relevant, in general, is that the quantum states allow you to prepare probability distributions over measurement outcomes, in which you are quite likely to get a result which contains meaningful information. Unfortunately, "meaningful information" is quite an open-ended concept: there are many ways that you could use a piece of data to do something useful. Are you looking for a demonstration of a meaningful quantum algorithm? $\endgroup$ Nov 1, 2012 at 20:21
  • $\begingroup$ No, I am confused as to how you get from a system of qubits, let's say their state is (010), to a binary number on a quantum register. $\endgroup$ Nov 1, 2012 at 22:16

2 Answers 2


The state of a qubit, or of a collection of qubits, is given by a state vector. However, most people would say that the output of a quantum computer is in fact the result of a measurement, which transforms the state into one which indicates a single outcome.

There are many ways to approach this, but the simplest one to describe mathematically is complete measurement in the standard basis. In this case, you transform a quantum state on $n$ qubits into an $n$-bit string.

Suppose that you have a state $|\psi\rangle \in \mathbb C^{2^n}$ on $n$ qubits, given by $$ |\psi\rangle \;=\; \sum_{x \in \{0,1\}^n} \!u_x \;|x_1 x_2 \cdots x_n \rangle \;, \quad \text{such that } \sum\limits_{x\in\{0,1\}^n} \!|u_x|^2 = 1 .$$

In order to get a classical output from a quantum computer, one thing you can do is to perform a complete measurement in the standard basis. What this means is that we collapse the state to some single output vector $y \in \{0,1\}^n$. We get different bit-strings $y$ with different probabilities, governed by the formula $$ \Pr\nolimits_\psi(y) \;=\; \Bigl| \langle y | \psi \rangle \Bigr|^2 \;=\; \left| \sum_{x \in \{0,1\}^n} \!u_x \; \langle y_1 y_2 \cdots y_n | x_1 x_2 \cdots x_n \rangle \right|^2 \;=\; \left| u_y \right|^2 \;. $$ The outcome is then just a random output string $y \in \{0,1\}^n$, where the probabilities are given by the non-negative real numbers $|u_y|^2$. Afterwards, you can compute with the measurement result $y \in \{0,1\}^n$ however you like, with a classical computer.

It's possible to describe performing a measurement only on a single bit, or with respect to bases other than the standard basis, but that's not really necessary to answer your question; measuring all of the qubits is certainly something you can do, and it's enough to get classical outputs from quantum computations.


Let me answer by an example that might be helpful for understanding this issue (without formally answering your question).

Assume that you put "15" as an input into a quantum-algorithm that factors numbers.

Now, the output $\lvert \phi \rangle \in (\mathbb{C^2})^{\otimes3}$ is a 3-qubit state (representing an integer in [1,8] in the computational basis), which has the following probabilities ("amplitudes") when measured ($M$) in that basis:

$\lvert \phi \rangle \stackrel{M}{\to} 1$ w.p. $p_1=0$
$\lvert \phi \rangle \stackrel{M}{\to}2$ w.p. $p_2=0$
$\lvert \phi \rangle \stackrel{M}{\to}3$ w.p. $p_3=0.5$
$\lvert \phi \rangle \stackrel{M}{\to}4$ w.p. $p_4=0.001$
$\lvert \phi \rangle \stackrel{M}{\to}5$ w.p. $p_5=0.499$
$\lvert \phi \rangle \stackrel{M}{\to}6,7,8$ w.p $p_6=p_7=p_8=0$

(numbers are just for fun.. Not real numbers)

Does it make sense how the output's probabilities are actually very relevant to the problem?

  • $\begingroup$ Thank you, it does. However it seems a little bit farfetched that the 3rd possible amplitude corresponds to the integer 3, so the question still remains, how would you convert 'the 3rd amplitude having a high probability' into the integer 4, (if this was how they corresponded). Or am I wrong and the amplitudes do correspond to integers? Otherwise, how do we 'sort' these amplitudes. I.e. are they numbered p1, p2, p3 etc in from lowest (if that is the correct term) possible state (000) to highest (111)? $\endgroup$ Nov 1, 2012 at 18:02
  • $\begingroup$ If we forget that there are amplitudes at all, how do we get from a certain state of a system (i.e. 010) to a binary number for example on a quantum register? $\endgroup$ Nov 1, 2012 at 22:14

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.