MilaimKas / Teaching_project

Set of quantum chemistry exercises sheets using the Jupyter Notebook environment and the PySCF quantum chemistry package
1 stars 0 forks source link

Possible Error in MOM with k-Edge. #1

Closed pwborthwick closed 2 years ago

pwborthwick commented 2 years ago

Hi, I think there may be an issue with the k-edge project. In the MOM routine because you are not using mo_occ.copy() and mo_coeff.copy() you are inadvertently modifying the ground state parameters. For example, when you have mo_coeff = self.mf.mo_coeff Python does not pass the value of self.mf.mo_coeff to mo_coeff rather assigns the name (reference) to mo_coeff. There is an example in 'Computational Chemistry from Laptop to HPC' which shows using mom with pyscf where the use of copy() is shown. If you do separate i->a computations you get different results to the mom in a loop because of the redefining of the ground state in the latter case. You certainly get different (lower) values using copy() so something is going on. These are very good articles BTW.

MilaimKas commented 2 years ago

Hello, thank you very much for pointing out this error. Also, many thanks for the provided link, this is indeed great work!