Add support for having ECPs in MM embedding#3172
Open
bogdanoff wants to merge 1 commit into
Open
Conversation
sunqm
reviewed
Mar 26, 2026
| 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( |
Collaborator
There was a problem hiding this comment.
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')
Contributor
Author
There was a problem hiding this comment.
The
_ecpsetting will be applied to the atoms inmol.
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ecpargument tomm_charge, constructing afakemoland addingfakemol.intor_symmetric('ECPscalar')toh1e. At the moment a warningWarning: Basis not found for atom ...is printed, because of thesys.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 specialfakemol_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.