diff --git a/automr/guess.py b/automr/guess.py index 477b87d..2936b09 100644 --- a/automr/guess.py +++ b/automr/guess.py @@ -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]) diff --git a/examples/tutorial/03-from_frag_manually.py b/examples/tutorial/03-from_frag_manually.py index d853701..5073e11 100644 --- a/examples/tutorial/03-from_frag_manually.py +++ b/examples/tutorial/03-from_frag_manually.py @@ -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)