# Introduction to Quantum Physics

### A complex Number

$c = a + ib$

Acircle of radius 1:  $e^{-i\theta}$

### Single Qubit System ($\mathcal{C}^{2}$ -space)

$|\psi \rangle = \alpha |0 \rangle + \beta | 1 \rangle $

$ \langle \psi | \psi \rangle = 1 \implies \alpha^{2} + \beta^{2} = 1 $

- Operators are 2 by 2 matrices, vectors are 2 by 1 column vectors.

#### General form of single qubit Unitary Operation

A single qubit quantum state can be written as

$$\left|\psi\right\rangle = \alpha\left|0\right\rangle + \beta \left|1\right\rangle$$


where $\alpha$ and $\beta$ are complex numbers. In a measurement the probability of the bit being in $\left|0\right\rangle$ is $|\alpha|^2$ and $\left|1\right\rangle$ is $|\beta|^2$. As a vector this is

$$
\left|\psi\right\rangle =  
\begin{pmatrix}
\alpha \\
\beta
\end{pmatrix}
$$
Where
$$\left| 0 \right\rangle =  
\begin{pmatrix}
1 \\
0
\end{pmatrix}; \left|1\right\rangle =  
\begin{pmatrix}
0 \\
1
\end{pmatrix}. 
$$


Note due to conservation probability $|\alpha|^2+ |\beta|^2 = 1$ and since global phase is undetectable $\left|\psi\right\rangle := e^{i\delta} \left|\psi\right\rangle$ we only requires two real numbers to describe a single qubit quantum state.

A convenient representation is

$$\left|\psi\right\rangle = \cos(\theta/2)\left|0\right\rangle + \sin(\theta/2)e^{i\phi}\left|1\right\rangle$$

where $0\leq \phi < 2\pi$, and $0\leq \theta \leq \pi$.  From this it is clear that there is a one-to-one correspondence between qubit states ($\mathbb{C}^2$) and the points on the surface of a unit sphere ($\mathbb{R}^3$). This is called the Bloch sphere representation of a qubit state.

Quantum gates/operations are usually represented as matrices. A gate which acts on a qubit is represented by a $2\times 2$ unitary matrix $U$. The action of the quantum gate is found by multiplying the matrix representing the gate with the vector which represents the quantum state.

$$\left|\psi'\right\rangle = U\left|\psi\right\rangle$$

A general unitary must be able to take the $\left|0\right\rangle$ to the above state. That is 

$$
U = \begin{pmatrix}
\cos(\theta/2) & a \\
e^{i\phi}\sin(\theta/2) & b 
\end{pmatrix}
$$ 

where $a$ and $b$ are complex numbers constrained such that $U^\dagger U = I$ for all $0\leq\theta\leq\pi$ and $0\leq \phi<2\pi$. This gives 3 constraints and as such $a\rightarrow -e^{i\lambda}\sin(\theta/2)$ and $b\rightarrow e^{i\lambda+i\phi}\cos(\theta/2)$ where $0\leq \lambda<2\pi$ giving 

$$
U = \begin{pmatrix}
\cos(\theta/2) & -e^{i\lambda}\sin(\theta/2) \\
e^{i\phi}\sin(\theta/2) & e^{i\lambda+i\phi}\cos(\theta/2) 
\end{pmatrix}.
$$

This is the most general form of a single qubit unitary.





### Quantum Gates:
Quanum gates are Unitary Transformation. There exist a universal set of quantum gates. Hadamard gate, X,Y,Z, paili gates, Cnot gate are few examples.



### Multiqubit System ($\mathcal{C}^{4}$ -space)

$|\psi \rangle = \alpha |00 \rangle + \beta | 01 \rangle + \gamma |10 \rangle + \delta | 11 \rangle $

$ \langle \psi | \psi \rangle = 1 \implies \alpha^{2} + \beta^{2} + \gamma^{2} + \delta^{2} = 1 $

- Operators are 4 by 4 matrices, vectors are 4 by 1 column vectors.

#### Realization of multi-qubit through single qubit

The space of quantum computer grows exponential with the number of qubits. For $n$ qubits the complex vector space has dimensions $d=2^n$. To describe states of a multi-qubit system, the tensor product is used to "glue together" operators and basis vectors.

Let's start by considering a 2-qubit system. Given two operators $A$ and $B$ that each act on one qubit, the joint operator $A \otimes B$ acting on two qubits is

$$\begin{equation}
	A\otimes B = 
	\begin{pmatrix} 
		A_{00} \begin{pmatrix} 
			B_{00} & B_{01} \\
			B_{10} & B_{11}
		\end{pmatrix} & A_{01} 	\begin{pmatrix} 
				B_{00} & B_{01} \\
				B_{10} & B_{11}
			\end{pmatrix} \\
		A_{10} 	\begin{pmatrix} 
					B_{00} & B_{01} \\
					B_{10} & B_{11}
				\end{pmatrix} & A_{11} 	\begin{pmatrix} 
							B_{00} & B_{01} \\
							B_{10} & B_{11}
						\end{pmatrix}
	\end{pmatrix},						
\end{equation}$$

where $A_{jk}$ and $B_{lm}$ are the matrix elements of $A$ and $B$, respectively.

Analogously, the basis vectors for the 2-qubit system are formed using the tensor product of basis vectors for a single qubit:
$$\begin{equation}\begin{split}
	\left|{00}\right\rangle &= \begin{pmatrix} 
		1 \begin{pmatrix} 
			1  \\
			0
		\end{pmatrix} \\
		0 \begin{pmatrix} 
			1  \\
			0 
		\end{pmatrix}
	\end{pmatrix} = \begin{pmatrix} 1 \\ 0 \\ 0 \\0 \end{pmatrix}~~~\left|{01}\right\rangle = \begin{pmatrix} 
	1 \begin{pmatrix} 
	0 \\
	1
	\end{pmatrix} \\
	0 \begin{pmatrix} 
	0  \\
	1 
	\end{pmatrix}
	\end{pmatrix} = \begin{pmatrix}0 \\ 1 \\ 0 \\ 0 \end{pmatrix}\end{split}
\end{equation}$$
    
$$\begin{equation}\begin{split}\left|{10}\right\rangle = \begin{pmatrix} 
	0\begin{pmatrix} 
	1  \\
	0
	\end{pmatrix} \\
	1\begin{pmatrix} 
	1 \\
	0 
	\end{pmatrix}
	\end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 1 \\ 0 \end{pmatrix}~~~ 	\left|{11}\right\rangle = \begin{pmatrix} 
	0 \begin{pmatrix} 
	0  \\
	1
	\end{pmatrix} \\
	1\begin{pmatrix} 
	0  \\
	1 
	\end{pmatrix}
	\end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\1 \end{pmatrix}\end{split}
\end{equation}.$$

Note we've introduced a shorthand for the tensor product of basis vectors, wherein $\left|0\right\rangle \otimes \left|0\right\rangle$ is written as $\left|00\right\rangle$. The state of an $n$-qubit system can described using the $n$-fold tensor product of single-qubit basis vectors. Notice that the basis vectors for a 2-qubit system are 4-dimensional; in general, the basis vectors of an $n$-qubit sytsem are $2^{n}$-dimensional.

### Superposition and Entanglement

Superposition in 2 qubit system : $|\psi \rangle = \alpha |00 \rangle + \beta | 01 \rangle + \gamma |10 \rangle + \delta | 11 \rangle $



- It can be written in direct product of lower qubit states.



Entanglement in two qubit system: 



An entanglement circuit: 


- It can not be written in direct product of lower qubit states


$\begin{bmatrix}
    p   \\
    q 
\end{bmatrix} \otimes \begin{bmatrix}
    r   \\
    s 
\end{bmatrix} = c \begin{bmatrix}
    m   \\
    0 \\
    0 \\
    n
\end{bmatrix}$


### Quantum Circuits and Quantum Algorithms

Execution of Quantum Algorithm (A unitary matrix), is challangeing task. This is because one need to find out product of single or multi-qubit gates to represent that algorithm.

$$
QFT: F_{N} =  \frac{1}{\sqrt{N}} \left( \begin{array}{cccccc}
    1  &         1   &        1       &     1          &   \cdots   &  1   \\
    1  &  \omega_{n} & \omega_{n}^{2} & \omega_{n}^{3} &   \cdots   & \omega_{n} ^{N-1}\\
    1  &  \omega_{n}^{2} & \omega_{n}^{4} & \omega_{n}^{6} &   \cdots   & \omega_{n} ^{2(N-1)}\\
    1  &  \omega_{n}^{3} & \omega_{n}^{6} & \omega_{n}^{9} &   \cdots   & \omega_{n} ^{3(N-1)}\\
   \vdots  & \vdots  & \vdots         & \vdots         &    \dots   & \vdots \\
   1  &  \omega_{n}^{(N-1)} & \omega_{n}^{2(N-1)} & \omega_{n}^{3(N-1)} &   \cdots   & \omega_{n} ^{(N-1((N-1)}\\
\end{array}\right )
$$


Figure: Execution of QFT algorithm

### Measurement

- Only observable can be measured.
- What is being measured? E, P or X? Non of these are being measured. We measure probability through $<\psi | \psi>$.
- After measurement, system collapse to one of the eigen state. Due to time evolution, it will superposed to many states in future.

### Noise and Error

- Current time Quantum Computers are **Noisy Intermediate-Scale Quantum (NISQ)**
- Decoherence : Quantum decoherence is the loss of quantum coherence. Decoherence can be viewed as the loss of information from a system into the environment (often modeled as a heat bath).
- Circuit depth: The depth of a circuit is the longest path in the circuit. The path length is always an integer number, representing the number of gates it has to execute in that path.
- Fidelity: fidelity is the measure of the distance between two quantum states. Fidelity equal to 1, means that two states are equal. In the case of a density matrix, fidelity represents the overlap with a reference pure state.


```python

```

70ae0de7fab9092ebcbb172f36dcdc1fd3ab01e3
ipynb
Jupyter Notebook
day1/3. Quantum-Physics-of-Quantum-Computing.ipynb
srh-dhu/Quantum-Computing-2021
5d6f99776f10224df237a2fadded25f63f5032c3
MIT
2021-07-23T13:38:20.000Z
2021-09-07T00:40:09.000Z
day1/3. Quantum-Physics-of-Quantum-Computing.ipynb
Pratha-Me/Quantum-Computing-2021
bd9cf9a1165a47c61f9277126f4df04ae5562d61
MIT
2021-07-31T08:43:38.000Z
2021-07-31T08:43:38.000Z
day1/3. Quantum-Physics-of-Quantum-Computing.ipynb
Pratha-Me/Quantum-Computing-2021
bd9cf9a1165a47c61f9277126f4df04ae5562d61
MIT
2021-07-24T06:14:36.000Z
2021-07-29T22:02:12.000Z
Qwen/Qwen-72B
1. YES
2. YES