| 1 |
from ase import Atoms |
| 2 |
from gpaw import GPAW |
| 3 |
from gpaw.lrtddft import LrTDDFT |
| 4 |
|
| 5 |
# Na2 cluster |
| 6 |
atoms = Atoms(symbols='Na2', |
| 7 |
positions=[(0, 0, 0), (3.0, 0, 0)], |
| 8 |
pbc=False) |
| 9 |
atoms.center(vacuum=6.0) |
| 10 |
|
| 11 |
# Standard ground state calculation with empty states |
| 12 |
calc = GPAW(mode='fd', nbands=100, h=0.4, setups={'Na': '1'}) |
| 13 |
atoms.calc = calc |
| 14 |
energy = atoms.get_potential_energy() |
| 15 |
|
| 16 |
calc = calc.fixed_density( |
| 17 |
convergence={'bands': 90}) |
| 18 |
calc.write('na2_gs_casida.gpw', mode='all') |
| 19 |
|
| 20 |
# Standard Casida calculation |
| 21 |
calc = GPAW('na2_gs_casida.gpw') |
| 22 |
istart = 0 |
| 23 |
jend = 90 |
| 24 |
lr = LrTDDFT(calc, xc='LDA', restrict={'istart': istart, 'jend': jend}) |
| 25 |
lr.diagonalize() |
| 26 |
lr.write('na2_lr.dat.gz') |