grimme-lab / xtb

Semiempirical Extended Tight-Binding Program Package
https://xtb-docs.readthedocs.io/
GNU Lesser General Public License v3.0
574 stars 144 forks source link

External charges only couple to atomic monopoles #820

Open bhourahine opened 1 year ago

bhourahine commented 1 year ago

Describe the bug External charges do not correctly couple to states which by symmetry should be affected by atomic dipole (and presumably quadrupole) terms.

To Reproduce Simulate a planar molecule, and place a point charge a long distance above the plane andover the centre of the molecule. The resulting field will closely approximate a constant electric field normal to the plane containing the molecule. Note, this example is somewhat contrived, but is simple to analyse compared to a charge close to the molecule.

The Orbital Energies will show a nearly constant shift, but not the individual level shifts consistent with the field gradient couping with the atomic dipoles (In the example below the difference between the lowest 2 orbital energies is sensitive to the dipole coupling, and for this large field, shows a ~0.4 eV discrepancy).

xtb mol.xyz --gfn 1 or xtb mol.xyz --gfn 1 -I ./pcem.input

pcem.input: $embedding input=charge.pc $end

charge.pc: 1 10000000 0 0 10000 10000

mol.xyz: 6

C -0.6581805 0.0000000 0.00000000000000 C 0.6581805 -0.0000000 -0.00000000000000 H -1.2293468 0.9140146 -0.00000000000000 H -1.2293468 -0.9140146 0.00000000000000 H 1.2293468 0.9140146 0.00000000000000 H 1.2293468 -0.9140146 0.00000000000000

Expected behaviour Symmetry appropriate changes in the orbital energies and the total energy of the system (the atomic dipoles should be polarisable due to this field, so also produce an energy shift).

Additional context Looking at the source for the embedding.f90 suggests the terms are missing. Numerical testing this against an equivalent constant electric field for the GFN1 model, using the DFTB+ code, shows it is the atomic dipole term that is missing (and surpressing it returns an equivalent result to the xtb current output, allowing for a gauge shift).

awvwgk commented 1 year ago

The interaction of multipoles with external point charges is currently not implemented in xtb. The multipole moments basically ignore the existence of the external charge field and are only indirectly affected from the response of the density via the charges.

The point charges are already available as container and only have to be passed to the multipole module to add the potential shift and the gradient contribution from the interaction of the higher moments with the external point charge field.