# QWorld Bronze: One Qubit

## One Qubit

*Quantum systems are linear systems: "The quantum states are represented by vectors and quantum operators are represented by matrices. The new quantum states are calculated by corresponding matrix-vector multiplications."*

A qubit (quantum bit) has two states: state 0 and state 1.

They are denoted by ket-notation:

$|0\rangle = \{{1 \atop 0}\} \\ \ \\ |1\rangle = \{{0 \atop 1}\}$

### NOT operator

NOT operator flips the value of a qubit.

We use capital letter for the matrix form of the operators:

$X$.

The action of $X$ on the qubit:

$X |0\rangle = |1\rangle$

More explicitly, $X|0\rangle = X\{{1 \atop 0}\} = \{{0 \atop 1}\} = |1\rangle$.

Similarly, $X|1\rangle = |0\rangle$.

More explicitly, $X|1\rangle = X\{{0 \atop 1}\} = \{{1 \atop 0}\} = |0\rangle$.

*Why is the NOT operator referred to as the x-gate?*

*In Bronze, we use only real numbers, but we should note that complex numbers are also used in quantum computing. When complex numbers are used, the state of a qubit can be represented by a four dimensional real number valued vector, which is not possible to visualize. On the other hand, it is possible to represent such state in three dimensions (with real numbers). This representation is called Bloch sphere.In three dimensions, we have axes: x, y, and z. X refers to the rotation with respect to x-axis. Similarly, we have the rotation with respect to y-axis and z-axis. In Bronze, we will also see the operator Z (z-gate). The operator Y is defined with complex numbers.*### Hadamard operator

Hadamard operator ($H$ or h-gate) looks similar to a fair coin-flipping.

But, there are certain dissimilarities:

- we have a negative entry, and
- instead of $\frac{1}{2}$, we have its square root$\frac{1}{\sqrt{2}}$.

### One-step Hadamard

Start in $|0\rangle$.

After applying $H$:

$H |0\rangle = H\{ {1 \atop 0}\} = \bigg\{ { \frac{1}{\sqrt{2}} \atop \frac{1}{\sqrt{2}}}\bigg\}$

After measurement, we observe the states $|0\rangle$ and $|1\rangle$ with equal probability $\frac{1}{2}$.

Let's start in $|1\rangle$.

After applying $H$:

$H |1\rangle = H\{ {0 \atop 1}\} = \bigg\{ { \frac{1}{\sqrt{2}} \atop \frac{-1}{\sqrt{2}}}\bigg\}$

After measurement, we observe the states $|0\rangle$ and $|1\rangle$ with equal probability $\frac{1}{2}$

We obtain the same values even when one of the values is negative.

*The absolute value of a negative value is positive.*

*The square of a negative value is also positive.*

As we have observed, the second fact fits better when reading the measurement results.

The value of the system being in a state is called its **amplitude**.

In the above example, the amplitudes of states $|0\rangle$ and $|1\rangle$ are respectively $\sqrt{2}$ and $-\sqrt{2}$.

The probabilities of observing them after a measurement are $\frac{1}{2}$.

*Remark that, after observing state $0$, the new state will be $|0\rangle$, and, after observing state $1$, the new state will be $|1\rangle$.*

**When a quantum system is measured, the probability of observing one state is the square of its value [*].**

*[*] the square of its magnitude value when using complex numbers*

### States $|+\rangle$ and $|-\rangle$

In the literature, the quantum states obtained after applying $H$ to $|0\rangle$ and $|1\rangle$ are known as **ket-plus** ($|+\rangle$) and **ket-minus** ($|-\rangle$) states.

### Task 1

What are the probabilities of observing the states $|0\rangle$ and $|1\rangle$ if the system is in $\big\{{-\frac{3}{5} \atop -\frac{4}{5}}\big\}$ or $\big\{{\frac{3}{5} \atop -\frac{4}{5}}\big\}$ or $\big\{{\frac{1}{\sqrt{3}} \atop -\frac{2}{\sqrt{3}}}\big\}$?

### Quantum state

*What do we know at this point?*

- A quantum state can be represented by a vector, in which each entry can be zero, a positive value, or a negative value.
- We can also say that the amplitude of being in any state can be zero, a positive value, or a negative value.
- The probability of observing one state after measurement is the square of its amplitude.

*What else can we say?*

Can the entries of a quantum state be arbitrary?

Do you remember the properties of a probabilistic state?