本文整理匯總了Python中phonopy.Phonopy.set_post_process方法的典型用法代碼示例。如果您正苦於以下問題:Python Phonopy.set_post_process方法的具體用法?Python Phonopy.set_post_process怎麽用?Python Phonopy.set_post_process使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phonopy.Phonopy
的用法示例。
在下文中一共展示了Phonopy.set_post_process方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_frequency
# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import set_post_process [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: of
# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import set_post_process [as 別名]
# 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
# Example of band structure calculation
bands = []
q_start = np.array([1./3, 1./3, 0])
q_end = np.array([0, 0, 0])
示例3: Phonopy
# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import set_post_process [as 別名]
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
for force in forces:
force -= drift_force / forces.shape[0]
set_of_forces.append(forces)
# Phonopy post-process
# 1st arg. is a relative lattice to the input unit cell.
# 2nd arg. is bunch of the calculated forces.
phonon.set_post_process([[1,0,0],[0,1,0],[0,0,1]], set_of_forces)
print "\nPhonon frequencies at Gamma:"
for i, freq in enumerate(phonon.get_frequencies((0,0,0))):
print "%3d: %10.5f Hz" % (i+1, freq * 15.633) # THz
示例4: read_vasp
# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import set_post_process [as 別名]
import sys
import numpy as np
from phonopy import Phonopy
from phonopy.structure.symmetry import Symmetry
from phonopy.interface.vasp import read_vasp
from phonopy.file_IO import parse_FORCE_SETS, parse_BORN
from phonopy.structure.spglib import get_stabilized_reciprocal_mesh
from phonopy.structure.tetrahedron_method import TetrahedronMethod
from phonopy.phonon.tetrahedron_mesh import TetrahedronMesh
cell = read_vasp(sys.argv[1])
phonon = Phonopy(cell, [[2, 0, 0], [0, 2, 0], [0, 0, 2]], is_auto_displacements=False)
force_sets = parse_FORCE_SETS()
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]])
primitive = phonon.get_primitive()
born = parse_BORN(primitive)
phonon.set_nac_params(born)
symmetry = phonon.get_primitive_symmetry()
mesh = [20, 20, 20]
# phonon.set_mesh(mesh)
# phonon.set_total_DOS(sigma=0.1)
# phonon.plot_total_DOS().show()
rotations = symmetry.get_pointgroup_operations()
thm = TetrahedronMesh(phonon.get_dynamical_matrix(),
mesh,
rotations,
is_gamma_center=True)
thm.run_dos()
示例5: tuple
# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import set_post_process [as 別名]
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
for force in forces:
force -= drift_force / forces.shape[0]
set_of_forces.append(forces)
# Phonopy post-process
# 1st arg. is a relative lattice to the input unit cell.
# 2nd arg. is bunch of the calculated forces.
phonon.set_post_process([[0,0.5,0.5],[0.5,0,0.5],[0.5,0.5,0]], set_of_forces)
# Thermal properties
# mesh: Monkhorst-Pack
# shift: mesh shift relative to the grid distance
mesh = [ 10, 10, 10 ]
shift = [ 0.5, 0.5, 0.5 ]
print "\nThermal properties :"
print "%12s %15s%15s%15s" % ('T [K]',
'F [kJ/mol]',
'S [J/K/mol]',
'C_v [J/K/mol]')
# get_thermal_properties returns numpy array of
#
# [[ temperature, free energy, entropy, heat capacity ],
示例6: read_vasp_from_strings
# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import set_post_process [as 別名]
born_str = """14.400
3.38121106 0 0 0 3.38121106 0 0 0 3.38121106
1.9715466666666668 0 0 0 1.9715466666666668 0 0 0 1.9715466666666668
-1.9721233333333332 0 0 0 -1.9721233333333332 0 0 0 -1.9721233333333332"""
#
# initial settings
#
cell = read_vasp_from_strings(poscar_str)
phonon = Phonopy(cell, np.diag([2, 2, 2]))
force_sets = parse_FORCE_SETS_from_strings(force_sets_str,
cell.get_number_of_atoms() * 8)
phonon.set_force_sets(force_sets)
phonon.set_post_process(primitive_matrix=[[0, 0.5, 0.5],
[0.5, 0, 0.5],
[0.5, 0.5, 0]],
is_nac=True)
born_params = parse_BORN_from_strings(born_str,
phonon.get_primitive())
phonon.set_nac_params(born_params)
print phonon.get_symmetry().get_international_table()
primitive = phonon.get_primitive()
reclat = np.linalg.inv(primitive.get_cell())
print reclat
ndiv = 100
band = get_band([0.0, 0.0, 0.0], [0.5, 0.5, 0.0], ndiv)
bands = [band]
phonon.set_band_structure(bands)
示例7: read_vasp
# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import set_post_process [as 別名]
from phonopy import Phonopy
from phonopy.interface.vasp import read_vasp
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([3, 3, 2]))
symmetry = phonon.get_symmetry()
print "Space group:", symmetry.get_international_table()
# Read forces and displacements
force_sets = parse_FORCE_SETS()
# 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)
phonon.set_post_process()
# Character table
phonon.set_irreps([1.0 / 3, 1.0 / 3, 0], 1e-4)
ct = phonon.get_irreps()
band_indices = ct.get_band_indices()
characters = np.rint(ct.get_characters()).real
for bi, cts in zip(band_indices, characters):
print np.array(bi) + 1, cts
# phonon.show_character_table()