Exemple #1
0
 def test_level(self):
     """Test setting up Level"""
     level_1 = Level(method='b3lyp',
                     basis='def2tzvp',
                     auxiliary_basis='aug-def2-svp',
                     dispersion='gd3bj',
                     software='gaussian')
     self.assertEqual(level_1.method, 'b3lyp')
     self.assertEqual(level_1.basis, 'def2tzvp')
     self.assertEqual(level_1.auxiliary_basis, 'aug-def2-svp')
     self.assertEqual(level_1.dispersion, 'gd3bj')
     self.assertEqual(level_1.software, 'gaussian')
     self.assertEqual(
         str(level_1),
         "b3lyp/def2tzvp, auxiliary_basis: aug-def2-svp, dispersion: gd3bj, software: gaussian (dft)"
     )
     self.assertEqual(level_1.simple(), "b3lyp/def2tzvp")
Exemple #2
0
 def test_build(self):
     """Test bulding a Level object from a string or dict representation"""
     level_1 = Level(repr='wB97xd/def2-tzvp')
     self.assertEqual(level_1.method, 'wb97xd')
     self.assertEqual(level_1.basis, 'def2-tzvp')
     self.assertEqual(level_1.method_type, 'dft')
     self.assertEqual(str(level_1),
                      'wb97xd/def2-tzvp, software: gaussian (dft)')
     level_2 = Level(repr='CBS-QB3')
     self.assertEqual(level_2.method, 'cbs-qb3')
     self.assertIsNone(level_2.basis)
     self.assertEqual(level_2.software, 'gaussian')
     self.assertEqual(level_2.method_type, 'composite')
     self.assertEqual(str(level_2),
                      'cbs-qb3, software: gaussian (composite)')
     self.assertEqual(level_2.simple(), 'cbs-qb3')
     level_3 = Level(
         repr={
             'method': 'DLPNO-CCSD(T)',
             'basis': 'def2-TZVp',
             'auxiliary_basis': 'def2-tzvp/c',
             'solvation_method': 'SMD',
             'solvent': 'water',
             'solvation_scheme_level': 'APFD/def2-TZVp'
         })
     self.assertEqual(level_3.method, 'dlpno-ccsd(t)')
     self.assertEqual(level_3.basis, 'def2-tzvp')
     self.assertEqual(level_3.auxiliary_basis, 'def2-tzvp/c')
     self.assertEqual(level_3.solvation_method, 'smd')
     self.assertEqual(level_3.solvent, 'water')
     self.assertIsInstance(level_3.solvation_scheme_level, Level)
     self.assertEqual(level_3.solvation_scheme_level.method, 'apfd')
     self.assertEqual(level_3.solvation_scheme_level.basis, 'def2-tzvp')
     self.assertEqual(
         str(level_3),
         "dlpno-ccsd(t)/def2-tzvp, auxiliary_basis: def2-tzvp/c, solvation_method: smd, "
         "solvent: water, solvation_scheme_level: 'apfd/def2-tzvp, software: gaussian (dft)', "
         "software: orca (wavefunction)")