Skip to content

Interactive visualizations of quantum gates and states on the Bloch sphere—built to intuitively explore single-qubit operations. Lecture 2 of the Lie groups with applications series with Quantum Formalism

Notifications You must be signed in to change notification settings

brian-hepler-phd/bloch-sphere-visualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Bloch Sphere Visualization and Quantum Gate Analysis

Developed as supplemental material for Quantum Formalism's "Lie Groups with Applications" course (Lectures 2).

See my full portfolio at: https://bhepler.com/portfolio/

Goal

To create an interactive tool for visualizing the dynamics of a single qubit on the Bloch sphere under the action of various quantum gates. This project demonstrates the fundamental connection between Lie groups (unitary gates) and Lie algebras (gate generators) via the matrix exponential and logarithm maps, $G^t = \exp(t \log(G))$.

Key Concepts & Relevance

  • Quantum Computing: Qubit states, Bloch Sphere representation, Quantum Gates (Pauli X, Y, Z, Hadamard H, user-defined unitary).
  • Lie Theory: Lie Groups (SU(2), U(2)), Lie Algebras ($\mathfrak{su}(2)$), Exponential Map, Matrix Logarithm, One-Parameter Subgroups.
  • Quantum Mechanics: Unitary evolution, state transformation.
  • Visualization: Representing abstract quantum states and operations geometrically.
  • Relevance: Provides intuition for single-qubit operations, a foundational element of quantum computation. Clearly demonstrates the practical application of the exponential/logarithm map from Lie theory in generating continuous quantum gate operations.

Implementation & Activities

  • Designed and implemented an interactive Python visualization tool using NumPy, SciPy, Matplotlib (mplot3d), and ipywidgets.
  • Represented single-qubit states $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$ as vectors on the 3D Bloch sphere using the standard coordinate mapping.
  • Implemented the continuous evolution of an initial state (e.g., $|0\rangle$) under a quantum gate $G$ over a time parameter $t \in [0, 1]$ using the formula $G^t = \exp(t \log(G))$.
    • Computed the matrix logarithm $\log(G)$ using SciPy's linalg.logm to find the corresponding Lie algebra generator (up to a factor of $i$).
    • Computed the matrix exponential $\exp(t \log(G))$ using SciPy's linalg.expm for various $t$.
  • Visualized the trajectory of the quantum state on the Bloch sphere surface as $t$ varies from 0 (identity operation) to 1 (full gate operation).
  • Included standard gates (Pauli X, Y, Z; Hadamard H) and allowed for user input of arbitrary 2x2 unitary matrices (with validation).
  • Effectively communicated the direct link between abstract Lie theory (exp/log maps connecting algebras and groups) and concrete quantum computation concepts (generating gate operations).

Technologies & Skills

  • Languages: Python
  • Libraries: NumPy, SciPy (linalg.expm, linalg.logm), Matplotlib (mplot3d), ipywidgets
  • Concepts: Lie Groups (SU(2)/U(2)), Lie Algebras ($\mathfrak{su}(2)$), Exponential Map, Matrix Logarithm, One-Parameter Subgroups, Quantum Computing (Qubits, Gates), Bloch Sphere Representation, Quantum State Evolution, Interactive Visualization, Linear Algebra.

Visualizations

Bloch Sphere Trajectory GIF Figure 1: Animated GIF showing the trajectory of the |0⟩ state (initially pointing up along Z) evolving on the Bloch sphere under the action of $G^t = \exp(t \log G)$ for a selected gate G (e.g., Hadamard H) as t goes from 0 to 1.

Theoretical Background

The evolution path visualized is generated by the one-parameter subgroup $G^t = \exp(tA)$, where $A = \log(G)$ is an element of the Lie algebra (skew-Hermitian traceless matrices for SU(2)). This demonstrates how the exponential map provides a canonical path from the identity element ($t=0$) to any group element $G$ ($t=1$) within the Lie group.

About

Interactive visualizations of quantum gates and states on the Bloch sphere—built to intuitively explore single-qubit operations. Lecture 2 of the Lie groups with applications series with Quantum Formalism

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published