class Density: def __init__(self, grid, setups, atoms): self.grid = grid self.rho = _gaussian_density(grid, atoms) self.mixer = Mixer(grid) self.mixer.mix(self.rho) def update(self, wfs): self.rho = wfs.calculate_density() self.mixer.mix(self.rho) def get_total_charge(self): return self.rho.sum() * self.grid.vol
def __init__(self, grid, setups, atoms): self.grid = grid self.rho = _gaussian_density(grid, atoms) self.mixer = Mixer(grid) self.mixer.mix(self.rho)