Skip to content

[BUG] Electron repulsion energy #216

@ohzde

Description

@ohzde

Describe the bug

I was trying to calculate the electron–electron repulsion energy for HCl analytically using electron_repulsion_integral() from gbasis, but the results do not make sense and do not match the Gaussian output.

In Gaussian, the total electron–electron repulsion term is 182.7069747387 Hartree, but with gbasis, the Coulomb term is -2698096.1551624318 Hartree and the exchange term is 741942.5687709596 Hartree.

ee_int = electron_repulsion_integral(self.basis)

# Exchange
exch = np.einsum("mn,mnrs->rs", self.dm, ee_int)
ex_total_analytical = -0.25 * np.trace(self.dm.dot(exch))

# Coulomb
coul = np.einsum("mn,mrns->rs", self.dm, ee_int)
coul_total_analytical = 0.5 * np.trace(self.dm.dot(coul))

System Information:

  • OS: Linux
  • Python version: 3.13.3
  • NumPy version: 2.2.2
  • SciPy version: 1.15.1

Additional context

This is the Gaussian log file, and this is the Gaussian formatted checkpoint.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions