Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| projects:quantum:hottblockp1 [2025/09/23 11:13] – kymki | projects:quantum:hottblockp1 [2025/09/23 11:46] (current) – kymki | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Post 1 — Qubits and the Bloch Sphere ====== | ||
| - | # Post 1 — Qubits and the Bloch Sphere | + | This first entry introduces |
| - | This first entry introduces the Bloch sphere representation of qubits and demonstrates how to obtain Bloch vectors with the accompanying Python code. | + | ---- |
| - | --- | + | ===== 1. Qubit states and density matrices ===== |
| - | ## 1. Qubit states and density matrices | + | A pure qubit state is written as \[ |\psi\rangle = \alpha |0\rangle + \beta |1\rangle, \quad \alpha, \beta \in \mathbb{C}, \quad |\alpha|^2 + |\beta|^2 = 1. \] |
| - | A pure qubit state is written as | + | From this vector we form the density matrix |
| - | \[ | + | |
| - | |\psi\rangle | + | |
| - | \] | + | |
| - | From this vector we form the density matrix | + | ---- |
| - | \[ | + | |
| - | \rho = |\psi\rangle \langle \psi |. | + | |
| - | \] | + | |
| - | --- | + | ===== 2. Mapping to the Bloch sphere |
| - | + | ||
| - | ## 2. Mapping to the Bloch sphere | + | |
| The Pauli matrices are | The Pauli matrices are | ||
| - | \[ | ||
| - | \sigma_x = | ||
| - | \begin{bmatrix} | ||
| - | 0 & 1 \\ 1 & 0 | ||
| - | \end{bmatrix}, | ||
| - | \sigma_y = | ||
| - | \begin{bmatrix} | ||
| - | 0 & -i \\ i & 0 | ||
| - | \end{bmatrix}, | ||
| - | \sigma_z = | ||
| - | \begin{bmatrix} | ||
| - | 1 & 0 \\ 0 & -1 | ||
| - | \end{bmatrix}. | ||
| - | \] | ||
| - | The Bloch vector is defined by | + | \[ \sigma_x = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}, |
| - | \[ | + | |
| - | r_i = \operatorname{Tr}(\rho \, \sigma_i), \quad i \in \{x,y,z\}. | + | The Bloch vector is defined by \[ r_i = \operatorname{Tr}(\rho \, \sigma_i), \quad i \in \{x,y,z\}. \] |
| - | \] | + | |
| For pure states we obtain \(\|r\|=1\), | For pure states we obtain \(\|r\|=1\), | ||
| - | --- | + | ===== 3. Using the code ===== |
| - | ## 3. Using the code | + | The function |
| - | + | ||
| - | The function | + | |
| Example: | Example: | ||
| - | ```python | + | < |
| import numpy as np | import numpy as np | ||
| - | import | + | import |
| # Basis states | # Basis states | ||
| Line 66: | Line 42: | ||
| ket_plus = (ket0 + ket1) / np.sqrt(2) | ket_plus = (ket0 + ket1) / np.sqrt(2) | ||
| print(" | print(" | ||
| - | ```` | + | </ |
| Expected output: | Expected output: | ||
| - | * $|0\rangle$ maps to the north pole $(0, | + | $|0\rangle$ maps to the north pole $(0,0,1)$. |
| - | * $|1\rangle$ maps to the south pole $(0, | + | |
| - | * $|+\rangle$ maps to a point on the equator $(1,0,0)$. | + | $|1\rangle$ maps to the south pole $(0,0,-1)$. |
| + | |||
| + | $|+\rangle$ maps to a point on the equator $(1,0,0)$. | ||
| - | --- | + | ---- |
| - | ## 4. Visualization | + | ===== 4. Visualization |
| To plot Bloch points or loops, use: | To plot Bloch points or loops, use: | ||
| - | ```bash | + | < |
| - | python | + | python |
| - | ``` | + | </ |
| - | This produces a static Bloch sphere with a marked state. | + | This produces a static Bloch sphere with a marked state. |
| Images are saved in `./ | Images are saved in `./ | ||
| - | --- | + | ---- |
| - | ## Conclusion | + | ===== Conclusion |
| - | This establishes the basic correspondence between qubit states and points on the Bloch sphere. In subsequent posts we extend this to continuous paths, closed loops, and their associated geometric phases. | + | This establishes the basic correspondence between qubit states and points on the Bloch sphere. |
| + | In subsequent posts we extend this to continuous paths, closed loops, and their associated geometric phases. | ||