當前位置: 首頁>>代碼示例>>Python>>正文


Python Phonopy.get_frequencies方法代碼示例

本文整理匯總了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
開發者ID:Johnson-Wang,項目名稱:phonopy,代碼行數:11,代碼來源:Si.py

示例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


開發者ID:Johnson-Wang,項目名稱:phonopy,代碼行數:30,代碼來源:8Si-phonon.py


注:本文中的phonopy.Phonopy.get_frequencies方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。