Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
projects:quantum:hottblockp1 [2025/09/23 11:16] kymkiprojects: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://github.com/erikkallman/hottbloch|accompanying Python code]].
  
 ---- ----
Line 7: Line 7:
 ===== 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. \] From this vector we form the density matrix \[ \rho = |\psi\rangle \langle \psi |. \]+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 +From this vector we form the density matrix \[ \rho = |\psi\rangle \langle \psi |. \]
- +
-<latex> +
-\rho = |\psi\rangle \langle \psi |. +
-</latex>+
  
 ---- ----
Line 21: Line 17:
 The Pauli matrices are The Pauli matrices are
  
-<latex> + \[ \sigma_x = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}, \quad \sigma_y = \begin{bmatrix} 0 & -i \\ i & 0 \end{bmatrix}, \quad \sigma_z = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}. \] 
-\sigma_x = +
-\begin{bmatrix} +
-0 & 1 \\ 1 & 0 +
-\end{bmatrix}, \quad +
-\sigma_y = +
-\begin{bmatrix} +
-0 & -i \\ i & 0 +
-\end{bmatrix}, \quad +
-\sigma_z = +
-\begin{bmatrix} +
-1 & 0 \\ 0 & -1 +
-\end{bmatrix}. +
-</latex>+
  
-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\}. \] 
  
-<latex> +For pure states we obtain \(\|r\|=1\), so every qubit corresponds to a point on the unit sphere \(S^2\).
-r_i = \operatorname{Tr}(\rho \, \sigma_i), \quad i \in \{x,y,z\}. +
-</latex> +
- +
-For pure states we obtain <latex>\|r\|=1</latex>, so every qubit corresponds to a point on the unit sphere <latex>S^2</latex>. +
- +
-----+
  
 ===== 3. Using the code ===== ===== 3. Using the code =====
Line 53: Line 30:
 <code python> <code python>
 import numpy as np import numpy as np
-import hott_bloch_edu as h+import hottbloch as h
  
 # Basis states # Basis states
Line 69: Line 46:
 Expected output: Expected output:
  
-  * <latex>|0\rangle</latex> maps to the north pole (0,0,1). +$|0\ranglemaps to the north pole $(0,0,1)$.  
-  * <latex>|1\rangle</latex> maps to the south pole (0,0,-1). + 
-  * <latex>|+\rangle</latex> maps to a point on the equator (1,0,0).+$|1\ranglemaps to the south pole $(0,0,-1)$.  
 + 
 +$|+\ranglemaps to a point on the equator $(1,0,0)$.
  
 ---- ----
Line 80: Line 59:
  
 <code bash> <code bash>
-python hott_bloch_edu.py --out ./hott_outputs --loop equator --theta 0+python hottbloch.py --out ./hott_outputs --loop equator --theta 0
 </code> </code>