Skip to content

Commit

Permalink
Merge pull request #89 from JangidBhavnesh/dev
Browse files Browse the repository at this point in the history
Adding keyword to plot only active space orbitals
  • Loading branch information
MatthewRHermes authored Apr 30, 2024
2 parents 44062f5 + 9196c06 commit ab148b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion my_pyscf/tools/molden.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ def from_si_mcscf (mc, fname, state=None, si=None, cas_natorb=False, cas_mo_ener
return from_sa_mcscf (mc, fname, state=state, cas_natorb=cas_natorb,
cas_mo_energy=cas_mo_energy, **kwargs)

def from_lasscf (las, fname, state=None, natorb_casdm1=None, **kwargs):
def from_lasscf (las, fname, state=None, natorb_casdm1=None, only_as=False, **kwargs):
if state is not None: natorb_casdm1 = las.states_make_casdm1s ()[state].sum (0)
mo_coeff, mo_ene, mo_occ = las.canonicalize (natorb_casdm1=natorb_casdm1)[:3]
if only_as:
mo_coeff = mo_coeff[:, las.ncore:las.ncore+las.ncas]
mo_ene = mo_ene[las.ncore:las.ncore+las.ncas]
mo_occ = mo_occ[las.ncore:las.ncore+las.ncas]
return from_mo (las.mol, fname, mo_coeff, occ=mo_occ, ene=mo_ene, **kwargs)

def from_lassi (lsi, fname, state=0, si=None, opt=1, **kwargs):
Expand Down

0 comments on commit ab148b2

Please sign in to comment.