Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Singular Matrix Error in 03,04-dmet-nio-afm,fm Example #19

Open
chemsm opened this issue Mar 29, 2024 · 4 comments
Open

Singular Matrix Error in 03,04-dmet-nio-afm,fm Example #19

chemsm opened this issue Mar 29, 2024 · 4 comments

Comments

@chemsm
Copy link

chemsm commented Mar 29, 2024

Hello, I am a researcher trying to reproduce the 03-dmet-nio-afm, 04-dmet-nio-fm problem example provided in your library as I explore using DMET for my studies.

nio_afm_output.txt

nio_fm_output.txt

Reproducing the both code the example 03-dmet-nio-afm and 04-dmet-nio-fm example as provided leads to a UICCSD calculation error displaying the following message:

1) 03-nio-afm case (2 hours running)

******* WARN: diis singular, eigh(h) [-9.2521e-07 4.0011e-09 1.4570e-07 1.9689e-07 2.0508e+06 4.3446e+06 4.0183e+09]


This causes the computation to halt. The traceback is as follows:

Traceback (most recent call last):
File "/home/chemsm/programs/anaconda3/lib/python3.11/site-packages/numpy/linalg/linalg.py", line 112, in _raise_linalgerror_singular
raise LinAlgError("Singular matrix")
numpy.linalg.LinAlgError: Singular matrix

2) 04-nio-fm case (20 minutes running)

******* WARN: diis singular, eigh(h) [ -0.0001 -0. 0. 0. 202.2266 32164.7754 13988017.9382]


This causes the computation to halt. The traceback is as follows:

Traceback (most recent call last):
File "/home/chemsm/programs/anaconda3/lib/python3.11/site-packages/numpy/linalg/linalg.py", line 112, in _raise_linalgerror_singular
raise LinAlgError("Singular matrix")
numpy.linalg.LinAlgError: Singular matrix

@chemsm chemsm changed the title Singular Matrix Error in 04-dmet-nio-fm Example Singular Matrix Error in 03,04-dmet-nio-afm,fm Example Apr 2, 2024
@zhcui
Copy link
Member

zhcui commented Apr 2, 2024

Hello chemsm,

Thanks for reporting this.

From the output, the UHF-in-UHF embedding is exact. However, the UCCSD based on the UHF looks weird. The t amplitudes becomes diverge after a few CC iterations.
This example has been tested before (with pyscf 2.0) and gives typical results. I will try to reproduce your error based on the latest version.

I will get back to you after I re-run it.

@chemsm
Copy link
Author

chemsm commented Apr 3, 2024

Thank you for your reply.

Since I am unable to fix the code on my own, I will await further communication from the developer regarding updates or improvements that will render the code executable in the latest version of PySCF.

Thank you,

chemsm

@zhcui
Copy link
Member

zhcui commented Apr 8, 2024

Hi chemsm,

I rerun the example scripts.

However, I can't reproduce your error when using the latest version of pyscf.
Here is my output:
03-dmet-nio-afm.txt

It looks like we can get the same periodic HF solution, and in the CC solver, HF energy is the same. However, MP2 energy is different. This is strange. Can you try to use the latest version of pyscf?

@chemsm
Copy link
Author

chemsm commented Apr 12, 2024

Thank you for rerunning the example scripts. I also tried running my previous code(That is made a little modification where lines[877] = 'class CIAHMinimizer(ciah.CIAHOptimizerMixin):\n'.) again.
Additionally, I've been using pyscf version 2.5.0 all along.

I also tried running the code exactly as in your 03-dmet-nio-afm.txt output file, but I'm still getting the same singular matrix error.

Interestingly, when I download and run the nio_afm DMET code directly from its directory, I encounter an error that says "array must not contain infs or NaNs". I have attached the relevant files below.

In a nutshell,
I rerun

  1. initial error code (a little modification ver) -> singular matrix error
  2. your successful recent attached code -> singular matrix error
  3. 03-afm original code & original path -> valueError: array must not contain infs or NaNs
  4. 04-fm original code & original path -> singular matrix error

I attached 3, 4 output file.
nio_afm.txt
nio_fm.txt

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

No branches or pull requests

2 participants