doc/tutorialsexercises/magnetic/zfs/plot.py
raw| 1 | import matplotlib.pyplot as plt |
| 2 | |
| 3 | from gpaw import GPAW |
| 4 | from gpaw.zero_field_splitting import zfs, convert_tensor |
| 5 | |
| 6 | |
| 7 | distance = [] |
| 8 | coupling = [] |
| 9 | for n in range(3, 9, 2): |
| 10 | name = f'C{n}H{2 * n}' |
| 11 | calc = GPAW(name + '.gpw') |
| 12 | d = calc.atoms.get_distance(0, -3) |
| 13 | D_vv = zfs(calc) |
| 14 | D, E, axis, D_vv = convert_tensor(D_vv, 'MHz') |
| 15 | print(d, D, E, axis) |
| 16 | print(D_vv) |
| 17 | distance.append(d) |
| 18 | coupling.append(D) |
| 19 | |
| 20 | |
| 21 | plt.plot(distance, coupling) |
| 22 | plt.show() |