本文整理匯總了Python中phonopy.Phonopy.set_force_sets方法的典型用法代碼示例。如果您正苦於以下問題:Python Phonopy.set_force_sets方法的具體用法?Python Phonopy.set_force_sets怎麽用?Python Phonopy.set_force_sets使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phonopy.Phonopy
的用法示例。
在下文中一共展示了Phonopy.set_force_sets方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_frequency
# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import set_force_sets [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: read_vasp
# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import set_force_sets [as 別名]
from phonopy.file_IO import parse_FORCE_SETS, parse_BORN
import numpy as np
cell = read_vasp("POSCAR")
# Initialize phonon. Supercell matrix has to have the shape of (3, 3)
phonon = Phonopy(cell, np.diag([2, 2, 1]))
symmetry = phonon.get_symmetry()
print "Space group:", symmetry.get_international_table()
# Read and convert forces and displacements
force_sets = parse_FORCE_SETS(cell.get_number_of_atoms() * 4)
# Sets of forces have to be set before phonon.set_post_process or
# at phonon.set_post_process(..., sets_of_forces=sets_of_forces, ...).
phonon.set_force_sets(force_sets)
# To activate non-analytical term correction.
phonon.set_post_process(primitive_matrix=[[2./3, -1./3, -1./3],
[1./3, 1./3, -2./3],
[1./3, 1./3, 1./3]])
# Parameters for non-analytical term correction can be set
# also after phonon.set_post_process
born = parse_BORN(phonon.get_primitive())
phonon.set_nac_params(born)
# Example to obtain dynamical matrix
dmat = phonon.get_dynamical_matrix_at_q([0,0,0])
print dmat