Example #1
0
    def test_eth_00_ras22(self):

        rasci = dict(self.rem)
        if do_alpha_beta:
            rasci.update({'ras_elec_alpha': 1,
                          'ras_elec_beta': 1})

        # create qchem input
        txt_input = create_qchem_input(self.molecule, **rasci)

        # calculate and parse qchem output
        output = get_output_from_qchem(txt_input, processors=4)
        print(output)
        data = basic_rasci(output)

        filename = self.__class__.__name__ + '_ras22.yaml'

        # create reference file
        if ctrl_print:
            with open(filename, 'w') as outfile:
                yaml.dump(data, outfile, default_flow_style=False, allow_unicode=True)

        with open(filename, 'r') as stream:
            data_loaded = yaml.safe_load(stream)

        data = standardize_dictionary(data)

        #print(data)

        print(data_loaded)
        data_loaded = standardize_dictionary(data_loaded)

        self.assertDictEqual(data, data_loaded)
Example #2
0
    def test_srdft(self):

        # create qchem input
        txt_input = create_qchem_input(
            self.molecule,
            jobtype='sp',
            exchange='hf',
            correlation='rasci',
            basis='6-31G(d,p)',
            ras_act=4,
            ras_elec=4,
            ras_spin_mult=0,
            ras_roots=6,
            ras_do_hole=True,
            ras_sts_tm=True,
            # rasci sr-dft
            ras_srdft=True,
            ras_omega=300,
            ras_srdft_cor='srpbe',
            ras_srdft_exc='srlsda',
            ras_natorb=False,
            set_iter=30,
            ras_srdft_damp=0.5)

        print(txt_input.get_txt())

        # calculate and parse qchem output
        output = get_output_from_qchem(txt_input,
                                       processors=4,
                                       force_recalculation=recalculate,
                                       store_full_output=True)

        print(output)
        data = basic_rasci(output)

        print(data)

        filename = self.__class__.__name__ + '_srdft.yaml'

        # with open(filename, 'w') as outfile:
        #     yaml.dump(data, outfile, default_flow_style=False, allow_unicode=True)

        data = standardize_dictionary(data)

        with open(filename, 'r') as stream:
            data_loaded = yaml.safe_load(stream)

        print(data_loaded)
        data_loaded = standardize_dictionary(data_loaded)

        self.assertDictEqual(data, data_loaded)
Example #3
0
    def test_rasci(self):
        # create qchem input
        txt_input = create_qchem_input(self.molecule,
                                       jobtype='sp',
                                       exchange='hf',
                                       correlation='rasci',
                                       basis='sto-3g',
                                       ras_act=4,
                                       ras_elec=4,
                                       ras_spin_mult=1,
                                       ras_roots=6,
                                       ras_print=5,
                                       ras_do_hole=True,
                                       ras_sts_tm=True)

        # calculate and parse qchem output
        output = get_output_from_qchem(txt_input,
                                       processors=4,
                                       force_recalculation=recalculate,
                                       store_full_output=True)
        print(output)
        data = basic_rasci(output)

        print(data)

        filename = self.__class__.__name__ + '_rasci.yaml'

        # with open(filename, 'w') as outfile:
        #     yaml.dump(data, outfile, default_flow_style=False, allow_unicode=True)

        data = standardize_dictionary(data)

        with open(filename, 'r') as stream:
            data_loaded = yaml.safe_load(stream)

        print(data_loaded)
        data_loaded = standardize_dictionary(data_loaded)

        self.assertDictEqual(data, data_loaded)