| 1 |
import numpy as np |
| 2 |
from ase.parallel import paropen |
| 3 |
|
| 4 |
from gpaw.xc.rpa import RPACorrelation |
| 5 |
|
| 6 |
dw = 0.5 |
| 7 |
frequencies = np.array([dw * i for i in range(200)]) |
| 8 |
weights = dw * np.ones(len(frequencies)) |
| 9 |
weights[0] /= 2 |
| 10 |
weights[-1] /= 2 |
| 11 |
|
| 12 |
rpa = RPACorrelation('N2.gpw', |
| 13 |
txt='frequency_equidistant.txt', |
| 14 |
frequencies=frequencies, |
| 15 |
weights=weights, |
| 16 |
ecut=[50]) |
| 17 |
data = rpa.calculate_all_contributions() |
| 18 |
Es_w = data.energy_wi[:, 0] |
| 19 |
|
| 20 |
with paropen('frequency_equidistant.dat', 'w') as fd: |
| 21 |
for w, E in zip(frequencies, Es_w): |
| 22 |
print(w, E, file=fd) |