energy kernel function