pyscf / cornell-shci

An interface to the SHCI program developed by Umrigar group at Cornell
Apache License 2.0
1 stars 2 forks source link

extracting the extrapolated energy #3

Open mkrompiec opened 8 months ago

mkrompiec commented 8 months ago

The current parser extracts the first value of the energy, rather than the extrapolated one (if extrapolation is performed). To get the extrapolated energy, extrapolate.py must be run after SHCI and the parser would have to be modified, e.g.:

def read_energy(shciobj, state_id=None):
    result = get_result(shciobj)

    if state_id is None:
        state_id = '%.2e' % (min(shciobj.config['eps_vars']))

    if 'energy_total' in result:
        if 'extrapolated' in result['energy_total']:
            e= result['energy_total']['extrapolated']['value']
        else:
            e = list(list(result["energy_total"].values())[0].values())[0]["value"]
    else:
        e = result['energy_var'][state_id]
    return e
mkrompiec commented 8 months ago

Alternatively, extrapolation could be moved from extrapolate.py into the SHCISCF class