3. energies#

3.1. get_Ekin#

Calculate the kinetic energy.

Python

Julia

1F = np.diag(atoms.f)
2T = -0.5 * np.trace(F @ W.conj().T @ op.L(W))
3return np.real(T)
1F = Diagonal(atoms.f)
2T = -0.5 * tr(F * W' * op_L(atoms, W))
3return real(T)

3.2. get_Ecoul#

Calculate the Coulomb energy.

Python

Julia

1Ecoul = 0.5 * n @ op.Jdag(op.O(phi))
2return np.real(Ecoul)
1Ecoul = 0.5 * (n' * op_Jdag(atoms, op_O(atoms, phi)))
2return real(Ecoul[1])

3.3. get_Exc#

Calculate the exchange-correlation energy.

Python

Julia

1Exc = n @ op.Jdag(op.O(op.J(exc)))
2return np.real(Exc)
1Exc = n' * op_Jdag(atoms, op_O(atoms, op_J(atoms, exc)))
2return real(Exc[1])

3.4. get_Een#

Calculate the electron-ion interaction.

Python

Julia

1Een = Vreciproc.conj().T @ n
2return np.real(Een)
1Een = Vreciproc' * n
2return real(Een[1])