Skip to content

Latest commit

 

History

History
108 lines (81 loc) · 3.7 KB

File metadata and controls

108 lines (81 loc) · 3.7 KB

Bloch Walk Implementation - Summary

Paper Reference

arXiv:2507.07432 Appendix D.2 "Bloch Walk Process"

Key Parameters (from paper)

  • α = 1.0
  • β = √51 ≈ 7.141428
  • 4 symbols: {0, 1, 2, 3}
  • Single qubit quantum memory (2-dimensional Hilbert space)
  • No finite classical HMM can generate this process

Implementation Approach

Chosen Method: Kraus Operators (Equations D4-D7)

We implement the Bloch Walk using the fundamental Kraus operator formulation rather than the derived GHMM representation. This is more direct and avoids issues with the GHMM formulation in the paper.

Kraus Operators

The four Kraus operators K₀, K₁, K₂, K₃ are 2×2 matrices:

K₀ = γ * [[α+β,  0  ],
          [ 0,  α-β]]

K₁ = γ * [[α-β,  0  ],
          [ 0,  α+β]]

K₂ = γ * [[α,  β],
          [β,  α]]

K₃ = γ * [[α, -β],
          [-β,  α]]

Critical Normalization Issue

Paper's value: γ = 1/(2α² + β²) = 1/53 ≈ 0.0189

Correct value for Kraus operators: γ = 1/√(2(α+β)² + 2(α-β)²) = 1/√208 ≈ 0.0693

The Kraus operators must satisfy the completeness relation:

Σₙ Kₙ† Kₙ = I

With the paper's γ value, this sum equals 0.074·I, not I. The correct normalization is γ = 1/√208.

Belief State Representation

Physical Bloch Vector [b_x, b_y, b_z]

The belief states are represented as Bloch vectors on the Bloch sphere:

  • b_x, b_y, b_z ∈ [-1, 1]
  • √(b_x² + b_y² + b_z²) ≤ 1 (equality for pure states)
  • Extracted from density matrix ρ via: b_i = tr(ρ σ_i)

Special Structure

Due to the Kraus operators' structure:

  • b_y ≈ 0 (beliefs live in the x-z plane, a 2D slice of the Bloch ball)
  • Symbol 0 → pushes toward +|z⟩ (north pole)
  • Symbol 1 → pushes toward -|z⟩ (south pole)
  • Symbol 2 → pushes toward +|x⟩ (positive x-axis)
  • Symbol 3 → pushes toward -|x⟩ (negative x-axis)

Sampling Process

  1. Initial state: Fully mixed ρ = I/2 (center of Bloch ball)
  2. For each timestep:
    • Compute probabilities: p_n = tr(Kₙ ρ Kₙ†)
    • Sample outcome n ∈ {0,1,2,3} with probabilities (p₀, p₁, p₂, p₃)
    • Update density matrix: ρ ← Kₙ ρ Kₙ† / tr(Kₙ ρ Kₙ†)
    • Convert to Bloch vector for belief state

Code Files Modified

/Users/gkocher/Desktop/RESEARCH/belief-state-geometry/belief_geometry/processes.py

  • make_blochwalk_hmm(): Returns dummy HMM structure (for interface compatibility)
  • _make_blochwalk_kraus_operators(): Creates the 4 Kraus operators with correct normalization
  • _density_matrix_to_bloch(): Converts density matrix to Bloch vector
  • _sample_blochwalk_ghmm(): Samples sequences using Kraus operators
  • _filter_blochwalk_beliefs(): Computes belief states (Bloch vectors) via quantum filtering
  • generate_blochwalk_sequence(): Main interface function

Output Format

generate_blochwalk_sequence(length, rng) returns:

{
    "tokens": np.ndarray,    # shape (L,), dtype int64, values in {0,1,2,3}
    "beliefs": np.ndarray,   # shape (L, 3), dtype float64, Bloch vectors [b_x, b_y, b_z]
}

Verification

Test results confirm:

  • ✅ Kraus operators satisfy Σₙ Kₙ† Kₙ = I
  • ✅ Bloch vectors stay in x-z plane (|b_y| < 10⁻⁶)
  • ✅ Bloch vector radius ≤ 1 for all belief states
  • ✅ Tokens are valid integers in {0, 1, 2, 3}
  • ✅ Belief dynamics match expected push directions

Next Steps

To train a neural network on Bloch Walk:

  1. Use generate_blochwalk_sequence() to create training data
  2. Set vocab_size=4 in training config
  3. The belief states will be 3D Bloch vectors (actually 2D in x-z plane)
  4. Neural network should learn to linearly represent these Bloch vectors in its activations