| 1 |
from gpaw.tddft import TDDFT, photoabsorption_spectrum |
| 2 |
from gpaw.inducedfield.inducedfield_tddft import TDDFTInducedField |
| 3 |
|
| 4 |
# Calculate photoabsorption spectrum as usual |
| 5 |
folding = 'Gauss' |
| 6 |
width = 0.1 |
| 7 |
e_min = 0.0 |
| 8 |
e_max = 4.0 |
| 9 |
photoabsorption_spectrum('na2_td_dm.dat', 'na2_td_spectrum_x.dat', |
| 10 |
folding=folding, width=width, |
| 11 |
e_min=e_min, e_max=e_max, delta_e=1e-2) |
| 12 |
|
| 13 |
# Load TDDFT object |
| 14 |
td_calc = TDDFT('na2_td.gpw') |
| 15 |
|
| 16 |
# Load InducedField object |
| 17 |
ind = TDDFTInducedField(filename='na2_td.ind', |
| 18 |
paw=td_calc) |
| 19 |
|
| 20 |
# Calculate induced electric field |
| 21 |
ind.calculate_induced_field(gridrefinement=2, from_density='comp') |
| 22 |
|
| 23 |
# Save induced electric field |
| 24 |
ind.write('na2_td_field.ind', mode='all') |