Giter VIP home page Giter VIP logo

cornell-shci's Introduction

Python-based Simulations of Chemistry Framework

Build Status codecov

2024-06-19

Installation

  • Install stable release:

      pip install pyscf
    
  • New features developed in recent years are available in the pyscf-forge package:

      pip install pyscf-forge
    
  • Certain modules are maintained as extensions of PySCF, such as dispersion, dmrgscf, fciqmc, icmpspt, properties, semiempirical, shciscf ... (more on https://github.com/pyscf) can be installed using pip:

      pip install pyscf[all]
    

    An individual extension can be installed:

      pip install pyscf[dispersion]
    
  • More details of custom installation can be found in installation manual

Citing PySCF

Base PySCF

The following paper should be cited in publications utilizing the PySCF program package:

Recent developments in the PySCF program package, Qiming Sun, Xing Zhang, Samragni Banerjee, Peng Bao, Marc Barbry, Nick S. Blunt, Nikolay A. Bogdanov, George H. Booth, Jia Chen, Zhi-Hao Cui, Janus J. Eriksen, Yang Gao, Sheng Guo, Jan Hermann, Matthew R. Hermes, Kevin Koh, Peter Koval, Susi Lehtola, Zhendong Li, Junzi Liu, Narbe Mardirossian, James D. McClain, Mario Motta, Bastien Mussard, Hung Q. Pham, Artem Pulkin, Wirawan Purwanto, Paul J. Robinson, Enrico Ronca, Elvira R. Sayfutyarova, Maximilian Scheurer, Henry F. Schurkus, James E. T. Smith, Chong Sun, Shi-Ning Sun, Shiv Upadhyay, Lucas K. Wagner, Xiao Wang, Alec White, James Daniel Whitfield, Mark J. Williamson, Sebastian Wouters, Jun Yang, Jason M. Yu, Tianyu Zhu, Timothy C. Berkelbach, Sandeep Sharma, Alexander Yu. Sokolov, and Garnet Kin-Lic Chan, J. Chem. Phys., 153, 024109 (2020). doi:10.1063/5.0006074

Density functional calculations

As PySCF does not implement density functionals, instead employing external libraries to handle their evaluation, these libraries should also be cited in publications employing PySCF for density functional calculations.

If your calculation employed Libxc, cite

Recent developments in libxc — A comprehensive library of functionals for density functional theory, Susi Lehtola, Conrad Steigemann, Micael J.T. Oliveira, and Miguel A.L. Marques, SoftwareX 7, 1 (2018). doi:10.1016/j.softx.2017.11.002

If your calculation employed XCFun, cite

Arbitrary-order density functional response theory from automatic differentiation, Ulf Ekström, Lucas Visscher, Radovan Bast, Andreas J. Thorvaldsen, and Kenneth Ruud, J. Chem. Theory Comput. 6, 1971 (2010). doi:10.1021/ct100117s

Bug reports and feature requests

Please submit tickets on the issues page.

cornell-shci's People

Contributors

fishjojo avatar ssh2 avatar sunqm avatar zhcui avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

zhcui boegel

cornell-shci's Issues

CASCI/SHCI solver pyscf example & extracting coefficients

Hi,

I'm trying to set up arrow with pyscf, and am getting an error when trying to run the example below:

'''
Use Cornell SHCI program as the active space solver for CASSCF
'''

from pyscf import gto, scf, mcscf, cornell_shci

b = 1.2
mol = gto.M(
atom = 'H 0 0 0; H 0 0 %f'%b,
basis = 'cc-pvdz',
verbose = 4,
symmetry = 1
)
mf = scf.RHF(mol).run()

mc = mcscf.CASCI(mf, 4, 2)
mc.fcisolver = cornell_shci.SHCI(mol)
mc.kernel()

#Error:

ERROR: mpirun -n 1 /mnt/beegfs/home/friesner/jlw2245/shci/shci

CalledProcessError Traceback (most recent call last)
~/.local/lib/python3.7/site-packages/pyscf/cornell_shci/shci.py in execute_shci(shciobj)
446 with open(output, 'w') as f:
--> 447 check_call(cmd.split(), cwd=shciobj.runtimedir, stdout=f, stderr=f)
448 except CalledProcessError as err:

/cm/local/apps/python3/lib/python3.7/subprocess.py in check_call(*popenargs, **kwargs)
362 cmd = popenargs[0]
--> 363 raise CalledProcessError(retcode, cmd)
364 return 0

CalledProcessError: Command '['mpirun', '-n', '1', '/mnt/beegfs/home/friesner/jlw2245/shci/shci']' returned non-zero exit status 139.

During handling of the above exception, another exception occurred:

TypeError Traceback (most recent call last)
in
----> 1 mc.kernel()

~/.local/lib/python3.7/site-packages/pyscf/mcscf/casci_symm.py in kernel(self, mo_coeff, ci0, verbose)
55 # Initialize/overwrite self.fcisolver.orbsym and self.fcisolver.wfnsym
56 mo_coeff = self.mo_coeff = label_symmetry_(self, mo_coeff, ci0)
---> 57 return casci.CASCI.kernel(self, mo_coeff, ci0, verbose)
58
59 def _eig(self, mat, b0, b1, orbsym=None):

~/.local/lib/python3.7/site-packages/pyscf/mcscf/casci.py in kernel(self, mo_coeff, ci0, verbose)
944
945 self.e_tot, self.e_cas, self.ci =
--> 946 kernel(self, mo_coeff, ci0=ci0, verbose=log)
947
948 if self.canonicalization:

~/.local/lib/python3.7/site-packages/pyscf/mcscf/casci.py in kernel(casci, mo_coeff, ci0, verbose, envs)
578 ci0=ci0, verbose=log,
579 max_memory=max_memory,
--> 580 ecore=energy_core)
581
582 t1 = log.timer('FCI solver', *t1)

~/.local/lib/python3.7/site-packages/pyscf/cornell_shci/shci.py in kernel(self, h1e, eri, norb, nelec, ci0, ecore, restart, **kwargs)
278 raise NotImplementedError
279
--> 280 execute_shci(self)
281 if self.verbose >= logger.DEBUG1:
282 with open(os.path.join(self.runtimedir, self.outputfile), 'r') as f:

~/.local/lib/python3.7/site-packages/pyscf/cornell_shci/shci.py in execute_shci(shciobj)
448 except CalledProcessError as err:
449 logger.error(shciobj, cmd)
--> 450 shciobj.stdout.write(check_output(['tail', '-100', output]))
451 raise err
452 return output


Is there anything more I need to do to get this working?

I was also wondering how exactly one would extract the CI coefficients and corresponding determinant structure - when using cornell_shci.SHCISCF to set up a CASSCF calculation it runs ok, but the .ci object is a float rather than an array of CI coefficients as I expected.

Thanks!
Jack

Link in readme is broken

This link at the end of readme no longer works:
http://pyscf.org/pyscf/install.html#extension-modules

extracting the extrapolated energy

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.