def test_read_negative(self): str_molecule = """$molecule -1 1 S -1.1516880000 0.8568110000 -0.0787470000 S 1.1527500000 -0.8580450000 -0.0786430000 O -1.6523520000 1.8607750000 -1.0252100000 O -0.9052880000 1.2448490000 1.3156410000 O 0.9072410000 -1.2461780000 1.3158760000 O 1.6543670000 -1.8616640000 -1.0249090000 C -2.5841130000 -0.3746500000 0.0297340000 C 2.5833220000 0.3755850000 0.0296900000 F -3.6480730000 0.2204040000 0.6112110000 F -2.2609850000 -1.4531020000 0.7616580000 F -2.9656640000 -0.7966010000 -1.1900330000 F 3.6467050000 -0.2152590000 0.6163310000 F 2.2560700000 1.4560310000 0.7568190000 F 2.9672080000 0.7933560000 -1.1908790000 N -0.0001900000 -0.0016540000 -0.8250640000 $end $rem job_type = opt basis = 6-311++g* max_scf_cycles = 200 gen_scfman = true scf_algorithm = diis method = wb97xd geom_opt_max_cycles = 200 $end """ qcinp = QCInput.from_string(str_molecule) self.assertEqual(str_molecule, str(qcinp))
def test_read_negative(self): str_molecule = """$molecule -1 1 S -1.1516880000 0.8568110000 -0.0787470000 S 1.1527500000 -0.8580450000 -0.0786430000 O -1.6523520000 1.8607750000 -1.0252100000 O -0.9052880000 1.2448490000 1.3156410000 O 0.9072410000 -1.2461780000 1.3158760000 O 1.6543670000 -1.8616640000 -1.0249090000 C -2.5841130000 -0.3746500000 0.0297340000 C 2.5833220000 0.3755850000 0.0296900000 F -3.6480730000 0.2204040000 0.6112110000 F -2.2609850000 -1.4531020000 0.7616580000 F -2.9656640000 -0.7966010000 -1.1900330000 F 3.6467050000 -0.2152590000 0.6163310000 F 2.2560700000 1.4560310000 0.7568190000 F 2.9672080000 0.7933560000 -1.1908790000 N -0.0001900000 -0.0016540000 -0.8250640000 $end $rem job_type = opt basis = 6-311++g* max_scf_cycles = 200 gen_scfman = true scf_algorithm = diis method = wb97xd geom_opt_max_cycles = 200 $end """ qcinp = QCInput.from_string(str_molecule) self.assertEqual(str_molecule,str(qcinp))
def test_read_plots(self): str_molecule = """$molecule 0 2 O 1.6159947668 0.3522275191 0.3343192028 O -0.5921658045 1.4368355787 1.2632324885 C 0.4160355545 -0.4617433561 0.2180766834 C -0.7655230468 0.4776728409 0.1826587618 C 2.8437090411 -0.3853724291 0.0935770045 C -1.7918488579 2.2003569978 1.5593659974 H 0.4649228147 -1.0347597878 -0.7097270414 H 3.6714833661 0.3051154983 0.2509025369 H 2.8395611019 -0.7401009356 -0.9372741555 H -2.1017802975 2.7482577804 0.6678359687 H -1.5445030956 2.8894960726 2.3658396091 Mg 1.2856817013 1.9249743897 1.4285694502 $end $rem job_type = sp basis = def2-tzvppd max_scf_cycles = 200 gen_scfman = true xc_grid = 3 scf_algorithm = gdm resp_charges = true symmetry = false sym_ignore = true method = wb97xv solvent_method = smd ideriv = 1 thresh = 14 scf_guess_always = true plots = true make_cube_files = true $end $smx solvent thf $end $plots grid_spacing 0.05 total_density 0 $end """ qcinp = QCInput.from_string(str_molecule) self.assertEqual(str_molecule, str(qcinp))
def test_from_string(self): string = """$molecule 0 1 S -0.00250959 -0.05817469 -0.02921636 C 1.70755408 -0.03033788 -0.01382912 H 2.24317221 -0.05215019 0.92026728 C 2.21976393 0.01718014 -1.27293235 H 3.27786220 0.04082146 -1.48539646 C 1.20867399 0.04478540 -2.27007793 H 1.40292257 0.10591684 -3.33110912 C -0.05341046 0.01577217 -1.74839343 C -1.32843436 0.03545064 -2.45531187 C -1.55195156 0.08743920 -3.80184635 H -0.75245172 0.10267657 -4.52817967 C -2.93293778 0.08408786 -4.13352169 H -3.31125108 0.11340328 -5.14405819 C -3.73173288 0.02741365 -3.03412864 H -4.80776535 0.00535688 -2.99564645 S -2.81590978 -0.00516172 -1.58990580 $end $rem jobtype = opt method = wb97m-v basis = def2-tzvppd gen_scfman = true geom_opt_max_cycles = 75 max_scf_cycles = 300 scf_algorithm = diis scf_guess = sad sym_ignore = true symmetry = false thresh = 14 $end $opt CONSTRAINT tors 6 8 9 10 0.0 ENDCONSTRAINT $end """ qcinput_test = QCInput.from_string(string) species = [ "S", "C", "H", "C", "H", "C", "H", "C", "C", "C", "H", "C", "H", "C", "H", "S", ] coords = [ [-0.00250959, -0.05817469, -0.02921636], [1.70755408, -0.03033788, -0.01382912], [2.24317221, -0.05215019, 0.92026728], [2.21976393, 0.01718014, -1.27293235], [3.27786220, 0.04082146, -1.48539646], [1.20867399, 0.04478540, -2.27007793], [1.40292257, 0.10591684, -3.33110912], [-0.05341046, 0.01577217, -1.74839343], [-1.32843436, 0.03545064, -2.45531187], [-1.55195156, 0.08743920, -3.80184635], [-0.75245172, 0.10267657, -4.52817967], [-2.93293778, 0.08408786, -4.13352169], [-3.31125108, 0.11340328, -5.14405819], [-3.73173288, 0.02741365, -3.03412864], [-4.80776535, 0.00535688, -2.99564645], [-2.81590978, -0.00516172, -1.58990580], ] molecule_actual = Molecule(species, coords) self.assertEqual(molecule_actual, qcinput_test.molecule) rem_actual = { "job_type": "opt", "method": "wb97m-v", "basis": "def2-tzvppd", "gen_scfman": "true", "geom_opt_max_cycles": "75", "max_scf_cycles": "300", "scf_algorithm": "diis", "scf_guess": "sad", "sym_ignore": "true", "symmetry": "false", "thresh": "14", } self.assertDictEqual(rem_actual, qcinput_test.rem) opt_actual = {"CONSTRAINT": ["tors 6 8 9 10 0.0"]} self.assertDictEqual(opt_actual, qcinput_test.opt)
def test_read_nbo(self): str_molecule = """$molecule 0 2 C -2.0338520000 0.0865500000 -1.4158570000 C -1.2819580000 0.3850830000 -0.1564990000 C -2.0067300000 1.1271820000 0.9225950000 C 0.1219120000 -0.0366190000 0.0148810000 C 0.6767790000 -1.0507090000 -0.7802400000 C 2.0072450000 -1.4517610000 -0.6185380000 C 2.8079970000 -0.8434840000 0.3427930000 C 2.2778880000 0.1645690000 1.1416530000 C 0.9468200000 0.5630060000 0.9784410000 H -1.3919850000 0.1591240000 -2.2995570000 H -2.4671570000 -0.9174600000 -1.3722490000 H -2.8505080000 0.8017250000 -1.5613060000 H -3.0889210000 0.9823990000 0.8362370000 H -1.7216740000 0.7761670000 1.9194500000 H -1.8021560000 2.1999010000 0.8510710000 H 0.0793240000 -1.5592640000 -1.5324310000 H 2.4136820000 -2.2421190000 -1.2440900000 H 3.8415290000 -1.1539430000 0.4689660000 H 2.8984450000 0.6464300000 1.8925800000 H 0.5733200000 1.3632210000 1.6120990000 $end $rem job_type = sp max_scf_cycles = 200 gen_scfman = true xc_grid = 3 scf_algorithm = diis method = wb97xv basis = def2-tzvp symmetry = false sym_ignore = true nbo = true $end $nbo $end """ qcinp = QCInput.from_string(str_molecule) self.assertEqual(str_molecule, str(qcinp)) str_molecule = """$molecule 0 2 C -2.0338520000 0.0865500000 -1.4158570000 C -1.2819580000 0.3850830000 -0.1564990000 C -2.0067300000 1.1271820000 0.9225950000 C 0.1219120000 -0.0366190000 0.0148810000 C 0.6767790000 -1.0507090000 -0.7802400000 C 2.0072450000 -1.4517610000 -0.6185380000 C 2.8079970000 -0.8434840000 0.3427930000 C 2.2778880000 0.1645690000 1.1416530000 C 0.9468200000 0.5630060000 0.9784410000 H -1.3919850000 0.1591240000 -2.2995570000 H -2.4671570000 -0.9174600000 -1.3722490000 H -2.8505080000 0.8017250000 -1.5613060000 H -3.0889210000 0.9823990000 0.8362370000 H -1.7216740000 0.7761670000 1.9194500000 H -1.8021560000 2.1999010000 0.8510710000 H 0.0793240000 -1.5592640000 -1.5324310000 H 2.4136820000 -2.2421190000 -1.2440900000 H 3.8415290000 -1.1539430000 0.4689660000 H 2.8984450000 0.6464300000 1.8925800000 H 0.5733200000 1.3632210000 1.6120990000 $end $rem job_type = sp max_scf_cycles = 200 gen_scfman = true xc_grid = 3 scf_algorithm = diis method = wb97xv basis = def2-tzvp symmetry = false sym_ignore = true nbo = true $end $nbo print = 1 $end """ qcinp = QCInput.from_string(str_molecule) self.assertEqual(str_molecule, str(qcinp))
def test_from_string(self): string = """$molecule 0 1 S -0.00250959 -0.05817469 -0.02921636 C 1.70755408 -0.03033788 -0.01382912 H 2.24317221 -0.05215019 0.92026728 C 2.21976393 0.01718014 -1.27293235 H 3.27786220 0.04082146 -1.48539646 C 1.20867399 0.04478540 -2.27007793 H 1.40292257 0.10591684 -3.33110912 C -0.05341046 0.01577217 -1.74839343 C -1.32843436 0.03545064 -2.45531187 C -1.55195156 0.08743920 -3.80184635 H -0.75245172 0.10267657 -4.52817967 C -2.93293778 0.08408786 -4.13352169 H -3.31125108 0.11340328 -5.14405819 C -3.73173288 0.02741365 -3.03412864 H -4.80776535 0.00535688 -2.99564645 S -2.81590978 -0.00516172 -1.58990580 $end $rem jobtype = opt method = wb97m-v basis = def2-tzvppd gen_scfman = true geom_opt_max_cycles = 75 max_scf_cycles = 300 scf_algorithm = diis scf_guess = sad sym_ignore = true symmetry = false thresh = 14 $end $opt CONSTRAINT tors 6 8 9 10 0.0 ENDCONSTRAINT $end """ qcinput_test = QCInput.from_string(string) species = ["S", "C", "H", "C", "H", "C", "H", "C", "C", "C", "H", "C", "H", "C", "H", "S"] coords = [[-0.00250959, -0.05817469, -0.02921636], [1.70755408, -0.03033788, -0.01382912], [2.24317221, -0.05215019, 0.92026728], [2.21976393, 0.01718014, -1.27293235], [3.27786220, 0.04082146, -1.48539646], [1.20867399, 0.04478540, -2.27007793], [1.40292257, 0.10591684, -3.33110912], [-0.05341046, 0.01577217, -1.74839343], [-1.32843436, 0.03545064, -2.45531187], [-1.55195156, 0.08743920, -3.80184635], [-0.75245172, 0.10267657, -4.52817967], [-2.93293778, 0.08408786, -4.13352169], [-3.31125108, 0.11340328, -5.14405819], [-3.73173288, 0.02741365, -3.03412864], [-4.80776535, 0.00535688, -2.99564645], [-2.81590978, -0.00516172, -1.58990580]] molecule_actual = Molecule(species, coords) self.assertEqual(molecule_actual, qcinput_test.molecule) rem_actual = { "job_type": "opt", "method": "wb97m-v", "basis": "def2-tzvppd", "gen_scfman": "true", "geom_opt_max_cycles": "75", "max_scf_cycles": "300", "scf_algorithm": "diis", "scf_guess": "sad", "sym_ignore": "true", "symmetry": "false", "thresh": "14" } self.assertDictEqual(rem_actual, qcinput_test.rem) opt_actual = {"CONSTRAINT": ["tors 6 8 9 10 0.0"]} self.assertDictEqual(opt_actual, qcinput_test.opt)