本文整理匯總了Python中phonopy.Phonopy.print_displacements方法的典型用法代碼示例。如果您正苦於以下問題:Python Phonopy.print_displacements方法的具體用法?Python Phonopy.print_displacements怎麽用?Python Phonopy.print_displacements使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phonopy.Phonopy
的用法示例。
在下文中一共展示了Phonopy.print_displacements方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Phonopy
# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import print_displacements [as 別名]
nbands=8*3,
width=0.01,
kpts=(2, 2, 2),
convergence={'eigenstates': 1e-9}
)
# Phonopy pre-process
print "------"
print "Phonon"
print "------"
# 1st arg. is the input unit cell.
# 2nd arg. is the supercell lattice relative to the unit cell.
# 'distance' is the distance of displacements.
# Default symmetry tolerance is 1e-5 in fractional coordinates.
phonon = Phonopy(bulk, [[1,0,0],[0,1,0],[0,0,1]], distance=0.01)
phonon.print_displacements()
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 " ---------------------------------"
print " ", "%11.5f"*3 % tuple(drift_force)
# Simple translational invariance