Skip to content

Commit

Permalink
Update mcscf addons
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Sep 11, 2023
1 parent ed0611c commit 38e458a
Show file tree
Hide file tree
Showing 8 changed files with 590 additions and 608 deletions.
1 change: 0 additions & 1 deletion pyscf/ci/cisd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,6 @@ def _cp(a):


if __name__ == '__main__':
from pyscf import gto
from pyscf import ao2mo

mol = gto.Mole()
Expand Down
1 change: 0 additions & 1 deletion pyscf/df/grad/casscf.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ def _finalize(self):


if __name__ == '__main__':
from pyscf import gto
from pyscf import scf
from pyscf import mcscf
from pyscf import df
Expand Down
2 changes: 2 additions & 0 deletions pyscf/fci/direct_spin1_symm.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,8 @@ def sym_allowed_indices(nelec, orbsym, wfnsym):

class FCISolver(direct_spin1.FCISolver):

_keys = {'wfnsym', 'sym_allowed_idx'}

pspace_size = getattr(__config__, 'fci_direct_spin1_symm_FCI_pspace_size', 400)

def __init__(self, mol=None, **kwargs):
Expand Down
14 changes: 8 additions & 6 deletions pyscf/gto/basis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,20 +669,20 @@ def load_ecp(filename_or_basisname, symb):

try:
return parse_nwchem_ecp.parse(filename_or_basisname, symb)
except IndexError:
raise BasisNotFoundError(filename_or_basisname)
except BasisNotFoundError as basis_err:
pass
except Exception:
raise BasisNotFoundError(filename_or_basisname)

try:
return parse_nwchem_ecp.parse(filename_or_basisname)
except IndexError:
raise BasisNotFoundError(f'Invalid ECP {filename_or_basisname}')
except BasisNotFoundError:
pass
except Exception:
raise BasisNotFoundError(f'Invalid ECP {filename_or_basisname}')

# Last, a trial to access Basis Set Exchange database
from pyscf.basis import bse
from pyscf.gto.basis import bse
if bse.basis_set_exchange is not None:
try:
bse_obj = bse.basis_set_exchange.api.get_basis(
Expand All @@ -708,7 +708,9 @@ def load_pseudo(filename_or_basisname, symb):

try:
return parse_cp2k_pp.parse(filename_or_basisname)
except IndexError:
except BasisNotFoundError:
raise
except Exception:
raise BasisNotFoundError(f'Invalid PP {filename_or_basisname}')

def _load_external(module, filename_or_basisname, symb, **kwargs):
Expand Down
6 changes: 1 addition & 5 deletions pyscf/gto/basis/parse_molpro.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import re
import numpy
import numpy as np

try:
from pyscf.gto.basis.parse_nwchem import optimize_contraction
Expand Down Expand Up @@ -155,10 +154,7 @@ def parse_terms(terms):
try:
coef = [float(x) for x in line[1:]]
except ValueError:
if DISABLE_EVAL:
raise ValueError('Failed to parse ecp %s' % line)
else:
coef = list(eval(','.join(line[1:])))
raise ValueError('Failed to parse ecp %s' % line)
r_orders[order].append(coef)
return r_orders

Expand Down
Loading

0 comments on commit 38e458a

Please sign in to comment.