pub fn ising_energy( h: &[(usize, f64)], j: &[((usize, usize), f64)], spins: &[i8], offset: f64, ) -> f64
Compute Ising energy for a spin configuration.
H = Σ h_i·s_i + Σ J_ij·s_i·s_j + offset