fn self_energy(&self, configuration: &Configuration) -> f64 {
        let q2 = configuration.particles()
                              .charge
                              .iter()
                              .map(|q| q * q)
                              .sum::<f64>();
        return -self.alpha / f64::sqrt(PI) * q2 / FOUR_PI_EPSILON_0;
    }
/// Self-interaction contribution to the energy
Self-interaction contribution to the energy
Self - interaction contribution to the energy
fn self_energy(&self, configuration: &Configuration) -> f64 {
        let q2 = configuration.particles()
                              .charge
                              .iter()
                              .map(|q| q * q)
                              .sum::<f64>();
        return -self.alpha / f64::sqrt(PI) * q2 / FOUR_PI_EPSILON_0;
    }
fn self_energy ( & self , configuration : & Configuration ) -> f64 { let q2 = configuration . particles ( ) . charge . iter ( ) . map ( | q | q * q ) . sum :: < f64 > ( ) ; return - self . alpha / f64 :: sqrt ( PI ) * q2 / FOUR_PI_EPSILON_0 ; }
Self-interaction contribution to the energy
Self - interaction contribution to the energy
&self
configuration
&Configuration