Skip to content

wrong hessian and frequencies #552

@akashpg1996

Description

@akashpg1996

hi gpu4pyscf,
I am doing some vibrational frequency calculations using pyscf. I found a significant difference between numerical and analytical frequencies. I checked the Hessians of both and found they have some dissimilarities in values. my settings are

def run_pyscf(xyzfile, charge, mult, do_grad,hess=False):
    import numpy as np
    from pyscf.dft import rks
    from pyscf import  grad

    atoms = read_xyz(xyzfile)

    mol = gto.M(
        atom=atoms,
        basis={
            'C': 'aug-cc-pvdz',
            'N': 'aug-cc-pvdz',
            'H': 'aug-cc-pvdz',
            'Br': 'aug-cc-pvdz',
            'O': 'aug-cc-pvdz',
            'Mn': gto.basis.load('stuttgart_rsc', 'Mn')
        },
        ecp={'Mn': gto.load_ecp('stuttgart_rsc', 'Mn')},
        unit="angstrom",
        charge=charge,
        spin=mult-1,
        verbose=3
    )

    # Create GPU RKS object
    mf = rks.RKS(mol, xc='M06L').density_fit()

    # Optional solvent (may need CPU fallback if not supported on GPU)
    mf = mf.SMD()
    mf.with_solvent.method = 'SMD'
    mf.with_solvent.solvent = '1,4-dioxane'

    mf.max_cycle = 1000
    mf.grids.level = 8
    mf.conv_tol = 1e-8

    # Energy calculation
    energy = mf.kernel()

    # Gradient calculation using GPU4PySCF
    if do_grad:
        grad_calc = mf.nuc_grad_method().kernel()  # GPU-compatible
    else:
        grad_calc = np.zeros((mol.natm, 3))

    if hess:
        hess_matx=mf.Hessian().kernel()
    else:
        hess_matx = np.zeros((3*mol.natm, 3*mol.natm))
    return energy, grad_calc, hess_matx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions