Skip to content

Add support for having ECPs in MM embedding#3172

Open
bogdanoff wants to merge 1 commit into
pyscf:masterfrom
bogdanoff:embedding_ecp
Open

Add support for having ECPs in MM embedding#3172
bogdanoff wants to merge 1 commit into
pyscf:masterfrom
bogdanoff:embedding_ecp

Conversation

@bogdanoff

Copy link
Copy Markdown
Contributor

Make possible to add ECP's to MM embedding. Mostly useful, when a total-ion potential (aka TIP) is available. Previously one has to add those TIP's to the actual molecule without basis functions, which made some modules to behave strange and it is not possible to apply X2C, despite there is no electrons at those ECP's.

Implemented by passing ecp argument to mm_charge, constructing a fakemol and adding fakemol.intor_symmetric('ECPscalar') to h1e. At the moment a warning Warning: Basis not found for atom ... is printed, because of the sys.stderr.write('Warning: Basis not found for atom %d %s\n' % (ia, symb)) printing even verbose=0. Probably, it could be possible to add a special fakemol_for_ecp, but that would lead too much line duplication (at least if I do it).

Small example is implemented showing possible usage of the feature.

Comment thread pyscf/qmmm/itrf.py
if mm_mol.atom_symbol(i) in mm_mol._ecp.keys()]
ecp_atoms = [mm_mol._atom[i] for i in ecp_idx]
fakemol = gto.Mole(verbose=0)
fakemol.build(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _ecp setting will be applied to the atoms in mol. This initialization code seems not working for

mol = pyscf.M(atom='C 0 0 0')
mm_mol = mm_mole.create_mm_mol('C 2 2 2', ecp='stuttgart')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _ecp setting will be applied to the atoms in mol.

I'll investigate how it works if atom labels coincide between mol and fakemol and make a check to forbid any clashes.

mm_mol = mm_mole.create_mm_mol('C 2 2 2', ecp='stuttgart')

I was restricting input to mm_mol = mm_mole.create_mm_mol('C 2 2 2', ecp={"c": 'stuttgart'}), I should then verify a dict is passed as an argument indeed.

@sunqm

sunqm commented Mar 26, 2026

Copy link
Copy Markdown
Collaborator

Please add a few tests for this feature.

ndolin added a commit to ndolin/pyscf that referenced this pull request Jun 9, 2026
…roneous warnings from creating coreless ECPs (see pyscf#3172), but these can be safely ignored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants