deepqmc / deepqmc

Deep learning quantum Monte Carlo for electrons in real space
MIT License
352 stars 60 forks source link

Need Help: How to add a new element basis to the package? #201

Open BlueDanFan40 opened 6 months ago

BlueDanFan40 commented 6 months ago

Sorry to disturb you! I'm a beginner of this package and get stuck in the following problem: I try to calculate the hamiltonian of molecule GdO, but an error occurred that "pyscf.lib.exceptions.BasisNotFoundError: Basis data not found ". Snipaste_2024-04-12_23-51-01

I have studied the the source code of function "deepqmc.MolecularHamiltonian", and found that its parameter "pp_type" is finally passed into "pyscf.gto.MoleBase.build" as param "ecp". So the problem is caused by the missing of Gd element's ecp and basis in the pyscf basis dat files (and Pyscf seems to ask that the format of ecp and basis content should meet nwchem).

Then I got the needed data from this website "https://pseudopotentiallibrary.org/" , which are "https://pseudopotentiallibrary.org/recipes/Gd/ccECP/Gd.ccECP.nwchem" and "https://pseudopotentiallibrary.org/recipes/Gd/ccECP/Gd.cc-pVDZ.nwchem" ,and respectively pasted them to "ccECP.dat" and "cc-pvdz.dat" in pyscf package's folder. But the problem is not solved.

I have also read pyscf's examples of inputting new basis and ecp "https://github.com/pyscf/pyscf/blob/master/examples/gto/04-input_basis.py", and made some changes on deepqmc.MolecularHamiltonian code hoping to create pyscf molecule instant more freely, but I still failed. T_T

I want to get some help on how to add basis and ecp of elements not appeared in pyscf dat files. Thanks very much!

mmezic commented 2 months ago

Hi BlueDanFan40, I'm sorry for the late answer. It's a bit tricky to load a custom basis in pyscf. It didn't occur to us that the basis sets and ECPs included in the pyscf package would be insufficient. It could be fixed with a little modification of the source code that would pass specific basis and ecp into gto.M().

However, even if you manage to load the correct basis and ECP for Gd, it unfortunately won't work. Our code only supports standard type ccECP expressed as

image

As far as I know, the ccECP for Gd (and any element heavier than Kr) contains extra spin-orbit terms (see e.g. Zhou et al., eq. (5)). These spin-orbit terms are not implemented in DeepQMC yet, so performing calculations for such heavy elements might require you to implement these terms yourself.