def setUp(self): super().setUp() try: driver = GaussianDriver(molecule=TestDriver.MOLECULE) except QiskitNatureError: self.skipTest('GAUSSIAN driver does not appear to be installed') self.qmolecule = driver.run()
def setUp(self): super().setUp() try: driver = GaussianDriver([ '# rhf/sto-3g scf(conventional) geom=nocrowd', '', 'h2 molecule', '', '0 1', 'H 0.0 0.0 0.0', 'H 0.0 0.0 0.735', '' ]) except QiskitNatureError: self.skipTest('GAUSSIAN driver does not appear to be installed') self.qmolecule = driver.run()
def test_cfg_augment(self): """ test input configuration augmentation """ cfg = '# rhf/sto-3g scf(conventional)\n\n' \ 'h2 molecule\n\n0 1\nH 0.0 0.0 0.0\nH 0.0 0.0 0.735\n\n' g16 = GaussianDriver(cfg) aug_cfg = g16._augment_config("mymatfile.mat", cfg) expected = '# rhf/sto-3g scf(conventional)\n' \ '# Window=Full Int=NoRaff Symm=(NoInt,None)' \ ' output=(matrix,i4labels,mo2el) tran=full\n\n' \ 'h2 molecule\n\n0 1\nH 0.0 0.0 0.0\nH 0.0 0.0 0.735' \ '\n\nmymatfile.mat\n\n' self.assertEqual(aug_cfg, expected)
def setUp(self): super().setUp() self.good_check = GaussianDriver._check_valid GaussianDriver._check_valid = _check_valid # We can now create a driver without the installed (check valid) test failing # and create a qmolecule from the saved output matrix file. This will test the # parsing of it into the qmolecule is correct. g16 = GaussianDriver() matfile = self.get_resource_path("test_driver_gaussian_from_mat.mat", "drivers/gaussiand") try: self.qmolecule = g16._parse_matrix_file(matfile) except QiskitNatureError: self.tearDown() self.skipTest("GAUSSIAN qcmatrixio not found")
def setUp(self): super().setUp() try: driver = GaussianDriver([ "# rhf/sto-3g scf(conventional) geom=nocrowd", "", "h2 molecule", "", "0 1", "H 0.0 0.0 0.0", "H 0.0 0.0 0.735", "", ]) except QiskitNatureError: self.skipTest("GAUSSIAN driver does not appear to be installed") self.qmolecule = driver.run()
def test_oh_uhf(self): """oh uhf test""" driver = GaussianDriver(config=self.g16_oh_config.format("uhf")) result = self._run_driver(driver, transformers=[FreezeCoreTransformer()]) self._assert_energy_and_dipole(result, "oh")
def setUp(self): super().setUp() try: GaussianDriver(config=self.g16_lih_config.format("rhf")) except QiskitNatureError: self.skipTest("GAUSSIAN driver does not appear to be installed")
def test_oh_uhf(self): """ oh uhf test """ driver = GaussianDriver(config=self.g16_oh_config.format('uhf')) result = self._run_driver(driver) self._assert_energy_and_dipole(result, 'oh')
def test_lih_rohf(self): """ lih rohf test """ driver = GaussianDriver(config=self.g16_lih_config.format('rohf')) result = self._run_driver(driver) self._assert_energy_and_dipole(result, 'lih')