예제 #1
0
 def test_resp_noopt_orient(self, dmso_opt, ref):
     charge_options = psiresp.ChargeOptions(equivalent_methyls=True)
     orientation_options = psiresp.OrientationOptions(n_reorientations=2)
     r = self.cls.from_molecules([dmso_opt],
                                 orientation_options=orientation_options)
     charges = r.run(charge_constraint_options=charge_options)
     assert_allclose(charges, ref, rtol=0.05, atol=1e-4)
예제 #2
0
 def test_resp_opt(self, ref):
     mol = [mol_from_file(self.molfile)]
     orientation_options = psiresp.OrientationOptions(n_reorientations=2)
     charge_options = psiresp.ChargeOptions(equivalent_methyls=True)
     r = self.cls.from_molecules(mol,
                                 optimize_geometry=True,
                                 orientation_options=orientation_options)
     charges = r.run(charge_options=charge_options)
     assert_allclose(charges, ref, rtol=0.05, atol=1e-3)
예제 #3
0
 def test_resp_noopt(self, ref):
     orientation_options = psiresp.OrientationOptions(n_reorientations=2)
     opt = [mol_from_file('{}_c1_ATB_opt.xyz'.format(self.molname))]
     charge_options = psiresp.ChargeOptions(equivalent_methyls=True)
     r = self.cls.from_molecules(opt,
                                 optimize_geometry=False,
                                 orientation_options=orientation_options)
     charges = r.run(charge_options=charge_options)
     # no idea which point density ATB uses
     assert_allclose(charges, ref, rtol=0.05, atol=1e-3)
예제 #4
0
 def nme2ala2(self):
     mols = [mol_from_file(f) for f in self.nme2ala2_names]
     orient = [(5, 18, 19), (19, 18, 5), (6, 19, 20), (20, 19, 6)]
     or_options = psiresp.OrientationOptions(reorientations=orient,
                                             keep_original=False)
     chrconstrs = {0: [20, 21, 22, 23, 24, 25], 0.6163: [18], -0.5722: [19]}
     chrequivs = [[10, 14], [11, 12, 13, 15, 16, 17]]
     ch_options = psiresp.ChargeOptions(charge_equivalences=chrequivs,
                                        charge_constraints=chrconstrs,
                                        equivalent_sp3_hydrogens=False)
     resp = psiresp.Resp.from_molecules(
         mols,
         charge=0,
         orientation_options=or_options,
         charge_constraint_options=ch_options,
         optimize_geometry=self.opt,
         name='nme2ala2')
     return resp
예제 #5
0
 def methylammonium(self):
     mols = [mol_from_file(f) for f in self.methylammonium_names]
     orient = [(1, 5, 7), (7, 5, 1)]
     or_options = psiresp.OrientationOptions(reorientations=orient,
                                             keep_original=False)
     chrconstrs = []
     chrequivs = [[6, 7, 8]]
     ch_options = psiresp.ChargeOptions(charge_equivalences=chrequivs,
                                        charge_constraints=chrconstrs,
                                        equivalent_sp3_hydrogens=False)
     resp = psiresp.Resp.from_molecules(
         mols,
         charge=1,
         multiplicity=1,
         orientation_options=or_options,
         charge_constraint_options=ch_options,
         optimize_geometry=self.opt,
         name='methylammonium')
     return resp