Skip to content

Commit

Permalink
fix _from_frag spin
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanwsr committed Dec 5, 2022
1 parent 73b6a31 commit 0e2842d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions automr/guess.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ def _from_frag(mol_or_mf, frags, chgs, spins,
mol1 = mol_or_mf[0].mol
mol2 = mol_or_mf[1].mol
mol = gto.conc_mol(mol1, mol2)
mol.spin = mol1.spin + mol2.spin
if verbose > 4:
print('Frag guess orb alpha')
dump_mat.dump_mo(mol, mo[0])
Expand Down
13 changes: 9 additions & 4 deletions examples/tutorial/03-from_frag_manually.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
from automr import guess
from automr import guess, dump_mat

xyz = '''H 0.0 0.0 0.0; F 0.0 0.0 2.0'''
bas = 'def2-svp'
mf = guess.from_frag_tight(xyz, bas, [[0],[1]], [0,0], [1,-1])
mf.mulliken_pop()
dump_mat.dump_mo(mf.mol, mf.mo_coeff[0], ncol=10)

mf0 = guess.gen('''H 0.0 0.0 0.0''', bas, 0, 1)
#mf0 = guess.apply_field(mf0, (0.0,0.0,0.01)).run() # add field in z direction
#mf0.mulliken_pop() # check odd electron on pz
mf1 = guess.gen('''F 0.0 0.0 2.0''', bas, 0, -1).set(max_cycle=5)
mf1 = guess.apply_field(mf1, (0.0,0.01,0.02)).run() # add field in z direction
#mf1 = guess.apply_field(mf1, (0.0,0.01,0.02)).run() # add field in z direction
mf1.set(symmetry = True)
mf1.irrep_nelec = {'s+0':(2,2),'p-1':(1,1),'p+0':(0,1),'p+1':(1,1)}
mf1.kernel()
mf1.mulliken_pop() # check odd electron on pz
mf = guess._from_frag([mf0, mf1], None, None, None, conv='tight')
mf.mulliken_pop()
dump_mat.dump_mo(mf.mol, mf.mo_coeff[0], ncol=10)

0 comments on commit 0e2842d

Please sign in to comment.