#parse force set and calc force constants phonon_scell.set_forces(force_gap_scells) PhonIO.write_FORCE_SETS(phonon_scell.get_displacement_dataset() ) # write forces & displacements to FORCE_SET force_set = PhonIO.parse_FORCE_SETS() # parse force_sets phonon_scell.set_displacement_dataset( force_set) # force_set is a list of forces and displacements if NAC == True: nac_params = PhonIO.get_born_parameters( open("BORN"), phonon_scell.get_primitive(), phonon_scell.get_primitive_symmetry()) if nac_params['factor'] == None: physical_units = get_default_physical_units(interface_mode) nac_params['factor'] = physical_units['nac_factor'] phonon_scell._nac_params = nac_params phonon_scell.produce_force_constants() phonon_scell.symmetrize_force_constants() api_ph.write_ShengBTE_FC2(phonon_scell.get_force_constants(), filename='FORCE_CONSTANTS_2ND') # phonopy 2.7 changed format, ShengBTE won't read, use the file in api_qpv to write. # calc and plot bandstructure bands = api_ph.qpoints_Band_paths(Qpoints, Band_points) phonon_scell.set_band_structure(bands, is_eigenvectors=True, labels=band_labels) phonon_scell.write_yaml_band_structure() bs_plt = phonon_scell.plot_band_structure() bs_plt.xlabel("")