def energy(self, capacity, n_atoms, states_bin, diag_abs):
    energy = ([0] * ((capacity + n_atoms) + 1))
    for i in range(1, len(states_bin)):
        energy[i] += np.sum(diag_abs[states_bin[i]])
        energy[i] *= i
    return energy
def energy(self, capacity, n_atoms, states_bin, diag_abs):
    energy = ([0] * ((capacity + n_atoms) + 1))
    for i in range(1, len(states_bin)):
        energy[i] += np.sum(diag_abs[states_bin[i]])
        energy[i] *= i
    return energy