本文整理匯總了Python中phonopy.Phonopy.get_frequencies方法的典型用法代碼示例。如果您正苦於以下問題:Python Phonopy.get_frequencies方法的具體用法?Python Phonopy.get_frequencies怎麽用?Python Phonopy.get_frequencies使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phonopy.Phonopy
的用法示例。
在下文中一共展示了Phonopy.get_frequencies方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_frequency
# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import get_frequencies [as 別名]
def get_frequency(poscar_filename, force_sets_filename):
bulk = read_vasp(poscar_filename)
volume = bulk.get_volume()
phonon = Phonopy(bulk, [[2, 0, 0], [0, 2, 0], [0, 0, 2]],
is_auto_displacements=False)
force_sets = parse_FORCE_SETS(filename=force_sets_filename)
phonon.set_force_sets(force_sets)
phonon.set_post_process([[0, 0.5, 0.5], [0.5, 0, 0.5], [0.5, 0.5, 0]])
return phonon.get_frequencies([0.5, 0.5, 0]), volume
示例2: Atoms
# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import get_frequencies [as 別名]
print "[Phonopy] Atomic displacements:"
disps = phonon.get_displacements()
for d in disps:
print "[Phonopy]", d[0], d[1:]
supercells = phonon.get_supercells_with_displacements()
# Force calculations by calculator
set_of_forces = []
for scell in supercells:
cell = Atoms(symbols=scell.get_chemical_symbols(),
scaled_positions=scell.get_scaled_positions(),
cell=scell.get_cell(),
pbc=True)
cell.set_calculator(calc)
forces = cell.get_forces()
drift_force = forces.sum(axis=0)
print "[Phonopy] Drift force:", "%11.5f"*3 % tuple(drift_force)
# Simple translational invariance
for force in forces:
force -= drift_force / forces.shape[0]
set_of_forces.append(forces)
# Phonopy post-process
phonon.produce_force_constants(forces=set_of_forces)
print
print "[Phonopy] Phonon frequencies at Gamma:"
for i, freq in enumerate(phonon.get_frequencies((0, 0, 0))):
print "[Phonopy] %3d: %10.5f THz" % (i + 1, freq) # THz