Open Physfock opened 4 months ago
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
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