Commit graph

3 commits

Author SHA1 Message Date
03fe2b6c4e feat(bawim): parameter wiring + cached J matrix + grid scan results
Key changes:
  - Wired j_max, h_bias_max into Sudoku evaluation (params now affect result)
  - Cached _SUDOKU_J_BASE (729x729 rebuilt only once)
  - Widened mutation ranges for h_bias_max (0.01→100) and bath_amp (0.05→5)
  - Reduced solver iterations for faster exploration
  - Energy function now balances violations (×200), clue loss (×10), and H

Grid scan results across h_bias_max × bath_oscillation_amplitude:
  - 36 configs tested, 2 Pareto points found
  - h_bias=1: 81 violations, 0 clues (too weak)
  - h_bias=5: 285 violations, 1 clue (too strong — forces bad local minima)
  - h_bias≥10: 285 violations, 0 clues (bias dominates, solver can't explore)
  - bath_amp has negligible effect at this solver depth
2026-07-07 09:59:30 -05:00
ecc294e1ff feat(bawim): sudoku 729-spin encoding + incremental ΔH + 3 solvers
Adds:
- §3: delta_h() — incremental energy change (O(N) per flip, not O(N²))
- §4a: Sudoku encoding — 729 spins with one-hot/row/col/block constraints
  via build_sudoku_couplings() and build_sudoku_biases().
  Clue embedding via bias field (h_clue = -50, h_anti = +10).
- §5: Three solvers — greedy_descent, simulated_annealing, oscillating_bath
  (BAWIM-style acoustic wave modulation of coupling amplitudes)
- §5b: Barkhausen stability criterion (loop_gain > 1, phase_shift = 2πn)
  and thermal stability comparison (BAWIM 780 vs CIM 1.73×10^7 deg/°C)
- §7: evaluate_sudoku() with violation counting and clue preservation

All solvers use incremental ΔH instead of full Hamiltonian recompute.
All arithmetic is exact Fraction.  Float only at the SA acceptance
boundary (exp(-ΔH/T) comparison against random draw).
2026-07-07 09:42:38 -05:00
cdc7d24464 feat(python): BAWIM mutation engine — exact Fraction mutation loop
Sketch of a mutation engine for the Bulk Acoustic Wave Ising Machine
(arXiv 2607.02112). Architecture:

  §1  Mutable parameter budget (n_spins, J_bits, feedback %, encoding)
  §2  Core BAWIM equations as exact Fraction arithmetic (Eq 1-5)
  §3  Spin configuration (random + flip)
  §4  Coupling matrix generators (MAX-CUT, NPP)
  §5  Greedy descent solver (swap target)
  §6  Mutation operators (one param per round)
  §7  Evaluation (MAX-CUT, NPP)
  §8  Mutation engine loop with SA acceptance
  §9  CLI

No float in compute path.  Quantize to Q16_16 at output boundary only.
2026-07-07 09:35:44 -05:00