Skip to main content

ising_energy

Function ising_energy 

Source
pub fn ising_energy(
    h: &[(usize, f64)],
    j: &[((usize, usize), f64)],
    spins: &[i8],
    offset: f64,
) -> f64
Expand description

Compute Ising energy for a spin configuration.

H = Σ h_i·s_i + Σ J_ij·s_i·s_j + offset