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

Error with large basis sets #1072

Open
Physfock opened this issue Jul 16, 2024 · 0 comments
Open

Error with large basis sets #1072

Physfock opened this issue Jul 16, 2024 · 0 comments
Labels
bug Something isn't working (as expected)

Comments

@Physfock
Copy link

Physfock commented Jul 16, 2024

This code (I run it inside docker):

from future import division
import math
import sys
import numpy as np
import gqcpy
from pyscf import gto, scf, ao2mo

print()

np.set_printoptions(precision=4, linewidth=600)
molecule = gqcpy.Molecule.ReadXYZ("h2.xyz")

basis_set = "cc-pvtz"

N = molecule.numberOfElectrons()

B = gqcpy.HomogeneousMagneticField([0,0,0])

spin_orbital_basis = gqcpy.LondonRSpinOrbitalBasis(molecule, basis_set, B)

S = spin_orbital_basis.quantize(gqcpy.OverlapOperator())
print("S",S.parameters().real)

print("step 1")

hamiltonian = spin_orbital_basis.quantize(gqcpy.FQMolecularMagneticHamiltonian(molecule, B))
print("Hamiltonian quantized successfully:", hamiltonian)

print("step 2")

objective = gqcpy.DiagonalRHFFockMatrixObjective_cd(hamiltonian, 1.0e-03)
print("Objective created successfully:", objective)

print("step 3")

environment = gqcpy.RHFSCFEnvironment_cd.WithCoreGuess(N, hamiltonian, S)
print("Environment set up successfully:", environment)

print("step 4")

solver = gqcpy.RHFSCFSolver_cd.Plain(threshold=1.0e-02, maximum_number_of_iterations=1000)
print("Solver created successfully:", solver)

print("step 5")

try:
qc_structure = gqcpy.RHF_cd.optimize(objective, solver, environment)
print("Optimization completed successfully:", qc_structure)
except Exception as e:
print("Optimization failed with exception:", e)

print("step 6"),

electronic_energy = qc_structure.groundStateEnergy()
nuclear_repulsion = gqcpy.NuclearRepulsionOperator(molecule.nuclearFramework()).value()

RHF_energy = (electronic_energy + n

leads to the error after STEP 5:

python: /usr/local/miniconda3/include/eigen3/Eigen/src/LU/PartialPivLU_LAPACKE.h:76: static int Eigen::internal::partial_lu_impl<std::complex, StorageOrder, int>::blocked_lu(Eigen::Index, Eigen::Index, Eigen::dcomplex*, Eigen::Index, int*, int&, int) [with int StorageOrder = 0; Eigen::Index = long int; Eigen::dcomplex = std::complex]: Assertion `info >= 0' failed.
Aborted (core dumped)

but works with cc-pvdz

@Physfock Physfock added the bug Something isn't working (as expected) label Jul 16, 2024
@xdvriend xdvriend mentioned this issue Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working (as expected)
Projects
None yet
Development

No branches or pull requests

1 participant