def show_phono3py_cells(symmetry, primitive, supercell, phonon_primitive, phonon_supercell, settings): print("Spacegroup: %s" % symmetry.get_international_table()) print("-" * 30 + " primitive cell " + "-" * 30) print_cell(primitive) print("-" * 32 + " super cell " + "-" * 32) print_cell(supercell, mapping=primitive.get_supercell_to_primitive_map()) print("-" * 19 + " ratio (supercell for fc)/(primitive) " + "-" * 19) for vec in np.dot(supercell.get_cell(), np.linalg.inv(primitive.get_cell())): print(("%5.2f" * 3) % tuple(vec)) if settings.get_phonon_supercell_matrix() is not None: print("-" * 19 + " primitive cell for harmonic phonon " + "-" * 20) print_cell(phonon_primitive) print("-" * 21 + " supercell for harmonic phonon " + "-" * 22) print_cell(phonon_supercell, mapping=phonon_primitive.get_supercell_to_primitive_map()) print("-" * 15 + " ratio (phonon supercell)/(phonon primitive) " + "-" * 15) for vec in np.dot(phonon_supercell.get_cell(), np.linalg.inv(phonon_primitive.get_cell())): print(("%5.2f" * 3) % tuple(vec))
def print_cells(phonon, unitcell_filename): print("Crsytal structure is read from \'%s\'." % unitcell_filename) supercell = phonon.get_supercell() unitcell = phonon.get_unitcell() primitive = phonon.get_primitive() p2p_map = primitive.get_primitive_to_primitive_map() mapping = np.array( [p2p_map[x] for x in primitive.get_supercell_to_primitive_map()], dtype='intc') s_indep_atoms = phonon.get_symmetry().get_independent_atoms() p_indep_atoms = mapping[s_indep_atoms] if unitcell.get_number_of_atoms() == primitive.get_number_of_atoms(): print("-" * 32 + " unit cell " + "-" * 33) print_cell(primitive, stars=p_indep_atoms) else: u2s_map = supercell.get_unitcell_to_supercell_map() print("-" * 30 + " primitive cell " + "-" * 30) print_cell(primitive, stars=p_indep_atoms) print("-" * 32 + " unit cell " + "-" * 33) # 32 + 11 + 33 = 76 u2u_map = supercell.get_unitcell_to_unitcell_map() u_indep_atoms = [u2u_map[x] for x in s_indep_atoms] print_cell(unitcell, mapping=mapping[u2s_map], stars=u_indep_atoms) print("-" * 32 + " super cell " + "-" * 32) print_cell(supercell, mapping=mapping, stars=s_indep_atoms) print("-" * 76)
def show_phono3py_cells(symmetry, primitive, supercell, phonon_primitive, phonon_supercell, settings): print("Spacegroup: %s" % symmetry.get_international_table()) print("-" * 30 + " primitive cell " + "-" * 30) print_cell(primitive) print("-" * 32 + " supercell " + "-" * 33) print_cell(supercell, mapping=primitive.get_supercell_to_primitive_map()) if settings.get_phonon_supercell_matrix() is not None: print("-" * 19 + " primitive cell for harmonic phonon " + "-" * 20) print_cell(phonon_primitive) print("-" * 21 + " supercell for harmonic phonon " + "-" * 22) print_cell(phonon_supercell, mapping=phonon_primitive.get_supercell_to_primitive_map()) print("-" * 76)
def show_phono3py_cells(phono3py: Phono3py, settings): """Show crystal structures.""" primitive = phono3py.primitive supercell = phono3py.supercell phonon_primitive = phono3py.phonon_primitive phonon_supercell = phono3py.phonon_supercell print("-" * 30 + " primitive cell " + "-" * 30) print_cell(primitive) print("-" * 32 + " supercell " + "-" * 33) print_cell(supercell, mapping=primitive.s2p_map) if settings.phonon_supercell_matrix is not None: print("-" * 19 + " primitive cell for harmonic phonon " + "-" * 20) print_cell(phonon_primitive) print("-" * 21 + " supercell for harmonic phonon " + "-" * 22) print_cell(phonon_supercell, mapping=phonon_primitive.s2p_map) print("-" * 76)
def show_phono3py_cells(phono3py, settings): symmetry = phono3py.symmetry primitive = phono3py.primitive supercell = phono3py.supercell phonon_primitive = phono3py.phonon_primitive phonon_supercell = phono3py.phonon_supercell print("Spacegroup: %s" % symmetry.get_international_table()) print("-" * 30 + " primitive cell " + "-" * 30) print_cell(primitive) print("-" * 32 + " supercell " + "-" * 33) print_cell(supercell, mapping=primitive.s2p_map) if settings.phonon_supercell_matrix is not None: print("-" * 19 + " primitive cell for harmonic phonon " + "-" * 20) print_cell(phonon_primitive) print("-" * 21 + " supercell for harmonic phonon " + "-" * 22) print_cell(phonon_supercell, mapping=phonon_primitive.s2p_map) print("-" * 76)