Open Koberard opened 1 week ago
could you specify the molecule in a comment like so:
mol = gto.M(
atom=molecule, # <<<< we would need this to debug
basis="sto-3g",
verbose=4,
unit="Angstrom",
)
The bug only works with specific molecules for some reason. I provided the XYZ file of the molecule in the Mols folder which is read in via
import os Dir = os.getcwd()+'/Mols/' Mol = os.listdir(Dir) print(Mol) for i in Mol: molecule = Dir + i
print(molecule)
mol = gto.M(
atom=molecule, ...
The contents of the XYZ file is, 18 p-xylene[B3LYP/aug-cc-pVTZ] C -0.006126 0.695514 1.193928 C 0.006126 -0.695514 1.193928 C -0.005956 0.693932 -1.191741 C 0.005956 -0.693932 -1.191741 C -0.010665 1.417282 0.002438 C 0.010665 -1.417282 0.002438 C 0.005956 2.923660 -0.002240 C -0.005956 -2.923660 -0.002240 H -0.011287 1.226083 2.138293 H 0.011287 -1.226083 2.138293 H -0.010880 1.224834 -2.136140 H 0.010880 -1.224834 -2.136140 H -0.642816 3.326662 -0.780885 H -0.324391 3.327444 0.954402 H 1.012311 3.306699 -0.189982 H 0.642816 -3.326662 -0.780885 H 0.324391 -3.327444 0.954402 H -1.012311 -3.306699 -0.189982 .
My software versions are the following.
OS: Ubuntu 22.04.3 LTS python 3.11.7 Version -e git+https://github.com/linusjoonho/ipie.git@80a2444e19b846516fbf62962b7953e3a5de6137#egg=ipie
From #314 it looks like this is an issue with passing UHF mo coeffs in:
ham = generate_hamiltonian(
mol,
mf.mo_coeff,
mf.get_hcore(),
mf.mo_coeff, # <<< should raise an error if these are UHF
@linusjoonho could someone look at this example and 1) confirm that it's the issue and 2) put in some assertions / raise and error if UHF integrals are found.
More generally we should try to make it as easy as possible to generate from a pyscf molecule from python, one option would be to add another factory method, or just some function which builds the objects from pyscf (trial, hamiltonian etc,) to remove some steps.
Describe the bug When running generate_hamiltonian() I get that the modified Cholesky calculation goes out of bounds.
To Reproduce Perform UHF in pyscf. Then build AFQMC. import numpy as np from pyscf import gto, scf from ipie.analysis.autocorr import reblock_by_autocorr from ipie.config import MPI
We can extract the qmc data as as a pandas data frame like so
from ipie.analysis.extraction import extract_observable from ipie.estimators.energy import EnergyEstimator, local_energy_batch from ipie.qmc.afqmc import AFQMC from ipie.systems.generic import Generic from ipie.trial_wavefunction.single_det import SingleDet from ipie.utils.backend import arraylib as xp from ipie.utils.from_pyscf import generate_hamiltonian, generate_wavefunction_from_mo_coeff from ipie.qmc.calc import build_afqmc_driver from ipie.analysis.extraction import extract_observable from ipie.estimators.estimator_base import EstimatorBase from ipie.estimators.greens_function import greens_function from ipie.estimators.local_energy import local_energy_G import os Dir = os.getcwd()+'/Mols/' Mol = os.listdir(Dir) print(Mol) for i in Mol: molecule = Dir + i
Expected behavior The expected behavior is the Hamiltonian should be built.
Screenshots Output can be seen in Jupiter notebook
Other information:
[e.g. macOS Monterey]
Additional context Add any other context about the problem here. Bug_1.zip