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:16] – 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 the Bloch sphere representation of qubits and demonstrates how to obtain Bloch vectors with the accompanying Python code. | + | This first entry introduces the Bloch sphere representation of qubits and demonstrates how to obtain Bloch vectors with the [[https:// |
| ---- | ---- | ||
| Line 7: | Line 7: | ||
| ===== 1. Qubit states and density matrices ===== | ===== 1. Qubit states and density matrices ===== | ||
| - | A pure qubit state is written as | + | 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. \] |
| - | < | + | From this vector we form the density matrix |
| - | |\psi\rangle = \alpha |0\rangle + \beta |1\rangle, \quad \alpha, \beta \in \mathbb{C}, \quad |\alpha|^2 + |\beta|^2 = 1. | + | |
| - | </ | + | |
| - | + | ||
| - | From this vector we form the density matrix | + | |
| - | + | ||
| - | < | + | |
| - | \rho = |\psi\rangle \langle \psi |. | + | |
| - | </ | + | |
| ---- | ---- | ||
| Line 25: | Line 17: | ||
| 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 | + | 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_i = \operatorname{Tr}(\rho \, \sigma_i), \quad i \in \{x, | + | |
| - | </ | + | |
| - | + | ||
| - | For pure states we obtain | + | |
| - | + | ||
| - | ---- | + | |
| ===== 3. Using the code ===== | ===== 3. Using the code ===== | ||
| Line 57: | Line 30: | ||
| <code python> | <code python> | ||
| import numpy as np | import numpy as np | ||
| - | import | + | import |
| # Basis states | # Basis states | ||
| Line 73: | Line 46: | ||
| Expected output: | Expected output: | ||
| - | * < | + | $|0\rangle$ maps to the north pole $(0,0,1)$. |
| - | * < | + | |
| - | * < | + | $|1\rangle$ maps to the south pole $(0,0,-1)$. |
| + | |||
| + | $|+\rangle$ maps to a point on the equator | ||
| ---- | ---- | ||
| Line 84: | Line 59: | ||
| <code bash> | <code bash> | ||
| - | python | + | python |
| </ | </ | ||