print(len(electronic_structure['nato_coefficients_multi'])) # Just for testing # electronic_structure['coefficients'] = electronic_structure['nato_coefficients'] # electronic_structure['mo_energies'] = electronic_structure['nato_occupancies'] print(len(electronic_structure['nato_coefficients_multi'])) print(len(electronic_structure['nato_occupancies_multi'])) print(electronic_structure['nato_occupancies_multi']) # store original fchk info in file es = deepcopy(electronic_structure) es['coefficients'] = electronic_structure['nato_coefficients_multi'][1] es['mo_energies'] = electronic_structure['nato_occupancies_multi'][1] open('test.fchk', 'w').write(build_fchk(es)) # print(electronic_structure['nato_coefficients']) range_f1 = range(0, 6) range_f2 = range(6, 12) mo_coeff_f1 = _set_zero_to_coefficients( electronic_structure['basis'], electronic_structure['nato_coefficients_multi'][1], range_f2) # get symmetry classification electronic_structure['coefficients'] = mo_coeff_f1 electronic_structure['mo_energies'] = electronic_structure['nato_occupancies'] # save test fchk file with new coefficients
molecule = Structure(coordinates=benzene_coordinates, symbols=symbols, charge=0, multiplicity=1) # define Q-Chem parameters parameters = {'jobtype': 'sp', 'exchange': 'hf', 'basis': '6-31G'} # create Q-Chem input qc_input = create_qchem_input(molecule, **parameters) # get data from Q-Chem calculation output, parsed_fchk = get_output_from_qchem(qc_input, processors=4, force_recalculation=False, read_fchk=True, fchk_only=True) # write .fchk file copy on disk (for checking purpose) txt_fchk = build_fchk(parsed_fchk) open('test_benzene.fchk', 'w').write(txt_fchk) # get orbital type orbital_types = get_orbital_classification(parsed_fchk, center=[0.0, 0.0, 0.0], orientation=[0.0, 0.0, 1.0]) # print results print(' {:5} {:5} {:5}'.format('num', 'type', 'overlap')) for i, ot in enumerate(orbital_types): print('{:5}: {:5} {:5.3f}'.format(i + 1, ot[0], ot[1]))
benzene_coordinates = np.array(benzene_coordinates) molecule = Structure(coordinates=benzene_coordinates, symbols=symbols, charge=0) parameters = {'jobtype': 'sp', 'exchange': 'hf', 'basis': '6-31G'} qc_input = create_qchem_input(molecule, **parameters) _, _, fchk_data = get_output_from_qchem(qc_input, processors=4, force_recalculation=True, read_fchk=True) from pyqchem.file_io import build_fchk open('test.fchk', 'w').write(build_fchk(fchk_data)) mo_coeff = _set_zero_to_coefficients(fchk_data['basis'], fchk_data['coefficients'], range(6, 12)) fchk_data['coefficients'] = mo_coeff structure = fchk_data['structure'] print(structure.get_xyz()) txt_fchk = build_fchk(fchk_data) open('test2.fchk', 'w').write(txt_fchk) z_dist = structure.get_coordinates()[0][2] orbital_type = get_orbital_classification(fchk_data,
print(opt_molecule.get_xyz()) basis_custom_repo = get_basis_from_ccRepo(molecule, 'cc-pVTZ') qc_input = QchemInput(opt_molecule, jobtype='sp', exchange='b3lyp', basis='sto-3g', cis_n_roots=5, cis_singlets=True, cis_triplets=True, calc_soc=1, n_frozen_core=0, ) print(qc_input.get_txt()) try: output, electronic_structure = get_output_from_qchem(qc_input, processors=4, # parser=basic_cis, read_fchk=True, store_full_output=True, ) except OutputError as e: print(e.error_lines) exit() print(output) open('benzo_2.fchk', 'w').write(build_fchk(electronic_structure))