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:17] 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 17: Line 17:
 The Pauli matrices are The Pauli matrices are
  
-\sigma_x = + \[ \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}. \] 
-\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}.+
  
-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 47: 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 63: 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 74: 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>