qubit
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| qubit [May 14, 2026 at 11:38] – external edit 127.0.0.1 | qubit [May 25, 2026 at 13:16] (current) – Ivan Janevski | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| A classical bit can be `0` or `1`. There are no probabilities involved at all, but we can assign them anyway. If a bit is `1`, then it's `1` with 100% probability and `0` with 0% probability. Conversely, if a bit is `0`, then it's `1` with 0% probability and `0` with 100% probability. | A classical bit can be `0` or `1`. There are no probabilities involved at all, but we can assign them anyway. If a bit is `1`, then it's `1` with 100% probability and `0` with 0% probability. Conversely, if a bit is `0`, then it's `1` with 0% probability and `0` with 100% probability. | ||
| - | A qubit works in a very similar way. It also has two states: $\lvert 0\rangle$ and $\lvert 1\rangle$, except the total probability is distributed between those two. A qubit is often in both states at the same time: a small amount in state $\lvert 0\rangle$ and a small amount in state $\lvert 1\rangle$. A qubit $\lvert\psi\rangle$ is written in the following form, using what is known as [[dirac-notation|Dirac notation]]: | + | A qubit works in a similar way. It also has two states: $\lvert 0\rangle$ and $\lvert 1\rangle$, except the total probability is distributed between those two. A qubit is often in both states at the same time: a small amount in state $\lvert 0\rangle$ and a small amount in state $\lvert 1\rangle$. A qubit $\lvert\psi\rangle$ is written in the following form, using what is known as [[dirac-notation|Dirac notation]]: |
| $$\lvert\psi\rangle = a\lvert 0\rangle + b\lvert 1\rangle$$ | $$\lvert\psi\rangle = a\lvert 0\rangle + b\lvert 1\rangle$$ | ||
| Line 20: | Line 20: | ||
| $$|a|^2 + |b|^2 = 1$$ | $$|a|^2 + |b|^2 = 1$$ | ||
| - | |||
| - | ## States | ||
| - | |||
| - | ### Basis state | ||
| - | |||
| - | ### Pure state | ||
| - | |||
| - | A qubit is in a pure state when it's in one of the basis states with 100% probability. When we say 100% probability we mean a complex probability amplitude $1 + i0$. Conversely, when we say 0% probability we mean a complex probability amplitude $0 + i0$. | ||
| - | |||
| - | Because there are only two basis states, and a pure state is when a qubit is in one of the two basis states, there are also only two pure states: | ||
| - | |||
| - | $$ \lvert\psi\rangle = \underbrace{\left(1 + i0\right)}_{a}\cdot \lvert 0\rangle + \underbrace{\left(0 + i0\right)}_{b}\cdot\lvert 1\rangle$$ | ||
| - | |||
| - | $$ \lvert\psi\rangle = \underbrace{\left(0 + i0\right)}_{a}\cdot\lvert 0\rangle + \underbrace{\left(1 + i0\right)}_{b}\cdot\lvert 1\rangle$$ | ||
| - | |||
| - | ### Mixed state | ||
| - | A qubit is in a mixed state when total probability distributed among states. | ||
| - | |||
| - | $$ \lvert\psi\rangle = \underbrace{\left(\frac{1}{2} + i0\right)}_{a}\cdot \lvert 0\rangle + \underbrace{\left(\frac{1}{2} + i0\right)}_{b}\cdot \lvert 1\rangle$$ | ||
| - | |||
| - | $$ \lvert\psi\rangle = \left(\frac{1}{\sqrt{2}} + i 0 \right)\cdot\lvert 0\rangle + \left(\frac{1}{\sqrt{2}} + i\frac{1}{\sqrt{2}}\right)\cdot \lvert 1\rangle$$ | ||
| - | |||
| - | When a qubit is measured the state collapses to a pure state. In both of these examples, the probabilities are equally distributed. Measuring these qubits will yield either state with 50% probability. | ||
| - | |||
| - | ### Invalid state | ||
| - | A qubit is in an invalid state when the square magnitutdes of its probability amplitudes don't add up to $1$. This is not allowed by quantum mechanics so a qubit will never find itself in an invalid state. | ||
| - | |||
| - | An example is a qubit that's in both states with 100% probability, | ||
| - | $$ \lvert\psi\rangle = \left(1 + 0i\right)\lvert 0\rangle + \left(1 + 0i\right)\lvert 1\rangle$$ | ||
| - | |||
| - | When we sum the square magnitudes we get the result $2$ | ||
| - | $$ |1 + 0i|^2 + |1 + 0i|^2 = 1^2 + 1^2 = 2$$ | ||
| - | |||
| - | The interpretation of this result is that the qubit exists with a total probability of 200%, which doesn' | ||
| - | |||
| - | ## Evolution | ||
| - | The equation that governs quantum mechanics is the Shrodinger equation. In the most general case it's written in the following form. | ||
| - | |||
| - | $$i\hbar\frac{\partial}{\partial t}\lvert \psi\rangle = H\lvert\psi\rangle$$ | ||
| - | |||
| - | The ket $\lvert \psi\rangle$ is a quantum state. Mathematically, | ||
| - | |||
| - | In quantum mechanics, there is a postulate that the system should be fully described its state $\lvert\psi\rangle$. This is not a law of nature. Rather it's our responsibility to make that so, by choosing a Hilbert space that appropriately captures all possible states. Often it's possible to combine Hilbert spaces with a tensor product to make a more general Hilbert space that fits our needs. | ||
| - | |||
| - | When the Hilbert space is chosen, one identifies a Hamiltonian that captures the energies of the system. This is done either by looking (e.g. the spherical symmetry in the Hydrogen atom) or just by constructing one that satisfies being a linear Hermitian operator. The Hamiltonian is then plugged in the Schrodinger equation as solved for state $\lvert\psi\rangle$. | ||
| - | |||
| - | ### Hydrogen atom | ||
| - | Let's take a particle like an electron inside a hydrogen atom. A postulate in quantum mechanics is that an electron should be fully described by its state $\lvert\psi\rangle$. We need a Hilbert space that captures all possible states of an electron. But first, what is an electron state? | ||
| - | |||
| - | An electron is an object in 3D space. Like with qubit, its probability amplitudes are complex numbers. Therefore a state should be something that associates a complex number $\mathbb C$ with every point in space $\mathbb R^3$. So we'll define the electron state as a function $\lvert\psi\rangle: | ||
| - | |||
| - | We also need the electron to exist *somewhere* in the universe. According to the Born rule, the probability of finding an electron at a point $(x, y, z)$ is proportional to the square magnitude of the complex number associated with that point. Therefore, if we integrate square magnitude of the function across all of 3D space we should get $1$. | ||
| - | |||
| - | So, to capture all possible electron states, we choose the Hilbert space to be a space of all square-integrable functions. This is compactly written as $L^2(\mathbb R^3)$. | ||
| - | |||
| - | $$ \lvert\psi\rangle\in \left\{ f:\mathbb R^3\mapsto\mathbb C \text{ such that } \int_{\mathbb R^3} |f(x)|^2 \mathrm dx = 1\right \} \quad \text{ same as } \quad \lvert\psi\rangle\in L^2(\mathbb R^3)$$ | ||
| - | |||
| - | When it comes to the Hamiltonian, | ||
| - | |||
| - | $$H = -\frac{\hbar^2}{2m}\nabla^2 + V$$ | ||
| - | |||
| - | The Schrodinger equation becomes: | ||
| - | $$-i\hbar\frac{\partial}{\partial t}\lvert\psi\rangle = \left(-\frac{\hbar^2}{2m}\nabla^2 + V\right)\lvert\psi\rangle$$ | ||
| - | |||
| - | If we let the potential $V$ be the Coulomb potential $V = e^2/ | ||
| - | |||
| - | ### Qubit | ||
| - | Let's turn back to the qubit. A postulate in quantum mechanics is that a qubit should be fully described by its state $\lvert\psi\rangle$. We need a Hilbert space that captures all possible states of a qubit. But what is a qubit state? | ||
| - | |||
| - | Unlike the electron, qubit is quite limited in its degrees of freedom: instead of being distributed across all of 3D space, there are only two places the probability amplitudes can go to. We can do something similar to an electron and define a qubit state to be a function $\lvert\psi\rangle: | ||
| - | |||
| - | So, to capture all qubit states, we choose the Hilbert space to be the 2-dimensional complex vector space $\mathbb C^2$. | ||
| - | $$ \lvert \psi\rangle\in \left\{\begin{pmatrix}a \\ b\end{pmatrix}\text{ where } a, b\in \mathbb C \text{ and } |a|^2 + |b|^2 = 1 \right \} \text{ same as } \lvert\psi\rangle\in\mathbb C^2$$ | ||
| - | |||
| - | Now we need a Hamiltonian. The Hamiltonian is a bit odd. It encodes the energy of the system -- but what is the kinetic and potential energy of a qubit? The truth is, qubit doesn' | ||
| - | |||
| - | Mathematically, | ||
| - | |||
| - | $$H = \begin{pmatrix}x & z - iw \\ z + iw & y \end{pmatrix}$$ | ||
| - | |||
| - | When we plug this in the Schrodinger equation we get the following expression:; | ||
| - | |||
| - | $$i\hbar\frac{\partial}{\partial t}\begin{pmatrix}a(t)\\b(t)\end{pmatrix} = \begin{pmatrix}x & z - iw \\ z + iw & y \end{pmatrix}\cdot\begin{pmatrix}a(t)\\b(t)\end{pmatrix}$$ | ||
| - | |||
| - | This is a first order differential equation with respect to time, so when we solve it for the column vector (a, b): | ||
| - | |||
| - | $$\begin{pmatrix}a(t)\\b(t)\end{pmatrix} = e^{iH(t)/ | ||
| - | |||
| - | Notice $H$ is in an exponential function $e^x$, yet $H$ is a 2x2 matrix. How do we define an exponential function of a matrix? We can do it by defining $e^x$ via its Maclaurin series $e^x = 1 + x + x^2 / 2 + \cdots$. | ||
| - | |||
| - | $$e^H = 1 + H + \frac{H^2}{2} + \frac{H^2}{6} + \cdots$$ | ||
| - | |||
| - | ## Visualization | ||
| - | A classical bit only has two states, `0` and `1`. Therefore you can easily picture a classical bit as an on-off switch. | ||
| - | |||
| - | A qubit is a little more complex. However we've seen it consists of two probability amplitudes $\alpha$ and $\beta$, both of which are complex numbers. According to the Schrodinger equation their phases evolve in opposite directions (both at the same angular frequency), but their amplitudes do not change. | ||
| - | |||
| - | Therefore, you can picture a qubit like an analog clock with two hands: One hand spinning clockwise and the other hand spinning counter-clockwise. They' | ||
qubit.1778758708.txt.gz · Last modified: by 127.0.0.1
