mirror of https://github.com/phonopy/phonopy.git
Update document toward release v2.0
This commit is contained in:
parent
c4af78babe
commit
6394f041fe
|
@ -16,6 +16,74 @@ Jan-16-2019: Version 2.0
|
||||||
automatic k-mesh generation (see :ref:`mp_tag`).
|
automatic k-mesh generation (see :ref:`mp_tag`).
|
||||||
* For plotting DOS, it is changed to choose linear tetrahedron method
|
* For plotting DOS, it is changed to choose linear tetrahedron method
|
||||||
as default, but not smearing method.
|
as default, but not smearing method.
|
||||||
|
* Output file name of projected DOS was renamed from
|
||||||
|
``partial_dos.dat`` to ``projected_dos.dat``.
|
||||||
|
|
||||||
|
API change at version 2.0
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
* ``Phonopy.get_band_structure()`` is deprecated. Instead use
|
||||||
|
``Phonopy.get_band_structure_dict()``.
|
||||||
|
* ``Phonopy.get_mesh()`` is deprecated. Instead use
|
||||||
|
``Phonopy.get_mesh_dict()``.
|
||||||
|
* ``Phonopy.set_band_structure()`` is deprecated. Instead use
|
||||||
|
``Phonopy.run_band_structure()`` where ``is_eigenvectors`` keyword
|
||||||
|
argument is replaced by ``with_eigenvectors``.
|
||||||
|
* ``Phonopy.set_mesh()`` is deprecated. Instead use
|
||||||
|
``Phonopy.run_mesh()`` where ``is_eigenvectors`` keyword argument is
|
||||||
|
replaced by ``with_eigenvectors``.
|
||||||
|
* Previous behaviour of ``Phonopy.run_mesh()`` is achieved by
|
||||||
|
``phonopy.mesh.run()``.
|
||||||
|
* ``Phonopy.set_qpoints_phonon()`` is deprecated. Use
|
||||||
|
``Phonopy.run_qpoints()`` where ``is_eigenvectors`` keyword
|
||||||
|
argument is replaced by ``with_eigenvectors``.
|
||||||
|
* ``Phonopy.get_qpoints_phonon()`` is deprecated. Instead use
|
||||||
|
``Phonopy.get_qpoints_dict()``.
|
||||||
|
* ``Phonopy.get_group_velocity()`` is deprecated. Use
|
||||||
|
``Phonopy.mode.group_velocities`` attribute or
|
||||||
|
``Phonopy.get_*mode*_dict()['group_velocities']``, where ``*mode*`` is
|
||||||
|
``band_structure``, ``mesh``, or ``qpoints``.
|
||||||
|
* ``Phonopy.get_group_velocities_on_bands()`` is deprecated.
|
||||||
|
* ``Phonopy.get_mesh_grid_info()`` is deprecated.
|
||||||
|
* ``Phonopy.set_iter_mesh()`` is deprecated. Use ``Phonopy.mesh()`` with
|
||||||
|
``use_iter_mesh=True``.
|
||||||
|
* ``Phonopy.itermesh`` was removed. IterMesh instance is stored in
|
||||||
|
phonopy.mesh.
|
||||||
|
* ``Phonopy.set_group_velocity()`` is deprecated. No need to call.
|
||||||
|
``gv_delta_q`` can be set at ``Phonopy.__init__()``.
|
||||||
|
* ``Phonopy.set_unitcell()`` is deprecated.
|
||||||
|
* ``Phonopy.set_total_DOS()`` is deprecated. Use
|
||||||
|
``Phonopy.run_total_dos()``.
|
||||||
|
* ``Phonopy.get_total_DOS()`` is deprecated. Use
|
||||||
|
``Phonopy.get_total_dos_dict()``.
|
||||||
|
* ``Phonopy.write_total_DOS()`` is deprecated. Use
|
||||||
|
``Phonopy.write_total_dos()``.
|
||||||
|
* ``Phonopy.plot_total_DOS()`` is deprecated. Use
|
||||||
|
``Phonopy.plot_total_dos()``.
|
||||||
|
* ``Phonopy.set_partial_DOS()`` is deprecated. Use
|
||||||
|
``Phonopy.run_projected_dos()``.
|
||||||
|
* ``Phonopy.get_partial_DOS()`` is deprecated. Use
|
||||||
|
``Phonopy.get_projected_dos_dict()``.
|
||||||
|
* ``Phonopy.write_partial_DOS()`` is deprecated. Use
|
||||||
|
``Phonopy.write_projected_dos()``.
|
||||||
|
* ``Phonopy.plot_partial_DOS()`` is deprecated. Use
|
||||||
|
``Phonopy.plot_projected_dos()``.
|
||||||
|
* ``Phonopy.partial_dos`` attribute is
|
||||||
|
deprecated. Use ``Phonopy.projected_dos`` attribute.
|
||||||
|
* ``Phonopy.set_thermal_properties()`` is deprecated. Use
|
||||||
|
``Phonopy.run_thermal_properties()``.
|
||||||
|
* ``Phonopy.get_thermal_properties()`` is deprecated. Use
|
||||||
|
``Phonopy.get_thermal_properties_dict()``.
|
||||||
|
* ``Phonopy.set_thermal_displacements()`` is deprecated. Use
|
||||||
|
``Phonopy.run_thermal_displacements()``.
|
||||||
|
* ``Phonopy.get_thermal_displacements()`` is deprecated. Use
|
||||||
|
``Phonopy.get_thermal_displacements_dict()``.
|
||||||
|
* ``Phonopy.set_thermal_displacement_matrices()`` is deprecated. Use
|
||||||
|
``Phonopy.run_thermal_displacement_matrices()``.
|
||||||
|
* ``Phonopy.get_thermal_displacement_matrices()`` is deprecated. Use
|
||||||
|
``Phonopy.get_thermal_displacements_matrices_dict()``.
|
||||||
|
* New ``Phonopy.auto_total_dos()``.
|
||||||
|
* New ``Phonopy.auto_partial_dos()``.
|
||||||
|
|
||||||
Nov-22-2018: Version 1.14.2
|
Nov-22-2018: Version 1.14.2
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
|
@ -77,139 +77,127 @@ runs with the input files in ``example/NaCl``.
|
||||||
from phonopy import load
|
from phonopy import load
|
||||||
from phonopy.spectrum.dynamic_structure_factor import atomic_form_factor_WK1995
|
from phonopy.spectrum.dynamic_structure_factor import atomic_form_factor_WK1995
|
||||||
from phonopy.phonon.degeneracy import degenerate_sets
|
from phonopy.phonon.degeneracy import degenerate_sets
|
||||||
|
from phonopy.units import THzToEv
|
||||||
|
|
||||||
|
|
||||||
def get_func_AFF(f_params):
|
def get_AFF_func(f_params):
|
||||||
def func(symbol, Q):
|
def func(symbol, Q):
|
||||||
return atomic_form_factor_WK1995(Q, f_params[symbol])
|
return atomic_form_factor_WK1995(Q, f_params[symbol])
|
||||||
return func
|
return func
|
||||||
|
|
||||||
|
|
||||||
def run(phonon,
|
def run(phonon,
|
||||||
G_points_cubic,
|
Qpoints,
|
||||||
directions,
|
|
||||||
temperature,
|
temperature,
|
||||||
func_AFF=None,
|
atomic_form_factor_func=None,
|
||||||
scattering_lengths=None,
|
scattering_lengths=None):
|
||||||
n_points=51,
|
# Transformation to the Q-points in reciprocal primitive basis vectors
|
||||||
verbose=False):
|
Q_prim = np.dot(Qpoints, phonon.primitive_matrix)
|
||||||
P = phonon.primitive_matrix
|
# Q_prim must be passed to the phonopy dynamical structure factor code.
|
||||||
|
phonon.run_dynamic_structure_factor(
|
||||||
|
Q_prim,
|
||||||
|
temperature,
|
||||||
|
atomic_form_factor_func=atomic_form_factor_func,
|
||||||
|
scattering_lengths=scattering_lengths,
|
||||||
|
freq_min=1e-3)
|
||||||
|
dsf = phonon.dynamic_structure_factor
|
||||||
|
q_cartesian = np.dot(dsf.qpoints,
|
||||||
|
np.linalg.inv(phonon.primitive.get_cell()).T)
|
||||||
|
distances = np.sqrt((q_cartesian ** 2).sum(axis=1))
|
||||||
|
|
||||||
for G_cubic in np.array(G_points_cubic):
|
print("# [1] Distance from Gamma point,")
|
||||||
G_prim = np.dot(G_cubic, P)
|
print("# [2-4] Q-points in cubic reciprocal space, ")
|
||||||
for direction in directions:
|
print("# [5-8] 4 band frequencies in meV (becaues of degeneracy), ")
|
||||||
direction_prim = np.dot(direction, P)
|
print("# [9-12] 4 dynamic structure factors.")
|
||||||
|
print("# For degenerate bands, dynamic structure factors are summed.")
|
||||||
|
print("")
|
||||||
|
|
||||||
if verbose:
|
# Use as iterator
|
||||||
print("# %s to %s (Primitive: %s to %s)"
|
for Q, d, f, S in zip(Qpoints, distances, dsf.frequencies,
|
||||||
% (G_cubic, G_cubic + direction,
|
dsf.dynamic_structure_factors):
|
||||||
G_prim, G_prim + direction_prim))
|
bi_sets = degenerate_sets(f) # to treat for band degeneracy
|
||||||
|
text = "%f " % d
|
||||||
qpoints = np.array(
|
text += "%f %f %f " % tuple(Q)
|
||||||
[direction_prim * x
|
text += " ".join(["%f" % (f[bi].sum() * THzToEv * 1000 / len(bi))
|
||||||
for x in np.arange(n_points) / float(n_points - 1)])
|
for bi in bi_sets])
|
||||||
phonon.set_band_structure([qpoints])
|
text += " "
|
||||||
_, distances, frequencies, _ = phonon.get_band_structure()
|
text += " ".join(["%f" % (S[bi].sum()) for bi in bi_sets])
|
||||||
# Remove Gamma point because number of bands is different.
|
print(text)
|
||||||
qpoints = qpoints[1:]
|
|
||||||
distances = distances[0][1:]
|
|
||||||
frequencies = frequencies[0][1:]
|
|
||||||
|
|
||||||
if func_AFF is not None:
|
|
||||||
phonon.set_dynamic_structure_factor(
|
|
||||||
qpoints,
|
|
||||||
G_prim,
|
|
||||||
temperature,
|
|
||||||
func_atomic_form_factor=func_AFF,
|
|
||||||
freq_min=1e-3,
|
|
||||||
run_immediately=False)
|
|
||||||
elif scattering_lengths is not None:
|
|
||||||
phonon.set_dynamic_structure_factor(
|
|
||||||
qpoints,
|
|
||||||
G_prim,
|
|
||||||
temperature,
|
|
||||||
scattering_lengths=scattering_lengths,
|
|
||||||
freq_min=1e-3,
|
|
||||||
run_immediately=False)
|
|
||||||
else:
|
|
||||||
raise SyntaxError
|
|
||||||
dsf = phonon.dynamic_structure_factor
|
|
||||||
for i, S in enumerate(dsf): # Use as iterator
|
|
||||||
Q_cubic = np.dot(dsf.Qpoints[i], np.linalg.inv(P))
|
|
||||||
|
|
||||||
if verbose:
|
|
||||||
f = frequencies[i]
|
|
||||||
bi_sets = degenerate_sets(f)
|
|
||||||
text = "%f " % distances[i]
|
|
||||||
text += "%f %f %f " % tuple(Q_cubic)
|
|
||||||
text += " ".join(["%f" % (f[bi].sum() / len(bi))
|
|
||||||
for bi in bi_sets])
|
|
||||||
text += " "
|
|
||||||
text += " ".join(["%f" % (S[bi].sum()) for bi in bi_sets])
|
|
||||||
print(text)
|
|
||||||
|
|
||||||
if verbose:
|
|
||||||
print("")
|
|
||||||
print("")
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
phonon = load(np.diag([2, 2, 2]),
|
phonon = load(supercell_matrix=[2, 2, 2],
|
||||||
primitive_matrix=[[0, 0.5, 0.5],
|
primitive_matrix='F',
|
||||||
[0.5, 0, 0.5],
|
unitcell_filename="POSCAR")
|
||||||
[0.5, 0.5, 0]],
|
|
||||||
unitcell_filename="POSCAR",
|
|
||||||
force_sets_filename="FORCE_SETS",
|
|
||||||
born_filename="BORN")
|
|
||||||
phonon.symmetrize_force_constants()
|
|
||||||
|
|
||||||
# Mesh sampling calculation is needed for Debye-Waller factor
|
# Q-points in reduced coordinates wrt cubic reciprocal space
|
||||||
# This must be done with is_mesh_symmetry=False and is_eigenvectors=True.
|
Qpoints = [[2.970000, -2.970000, 2.970000],
|
||||||
|
[2.950000, 2.950000, -2.950000],
|
||||||
|
[2.930000, -2.930000, 2.930000],
|
||||||
|
[2.905000, -2.905000, 2.905000],
|
||||||
|
[2.895000, -2.895000, 2.895000],
|
||||||
|
[2.880000, -2.880000, 2.880000],
|
||||||
|
[2.850000, -2.850000, 2.850000],
|
||||||
|
[2.810000, -2.810000, 2.810000],
|
||||||
|
[2.735000, -2.735000, 2.735000],
|
||||||
|
[2.660000, -2.660000, 2.660000],
|
||||||
|
[2.580000, -2.580000, 2.580000],
|
||||||
|
[2.500000, -2.500000, 2.500000]]
|
||||||
|
|
||||||
|
# Mesh sampling phonon calculation is needed for Debye-Waller factor.
|
||||||
|
# This must be done with is_mesh_symmetry=False and with_eigenvectors=True.
|
||||||
mesh = [11, 11, 11]
|
mesh = [11, 11, 11]
|
||||||
phonon.set_mesh(mesh,
|
phonon.run_mesh(mesh,
|
||||||
is_mesh_symmetry=False,
|
is_mesh_symmetry=False,
|
||||||
is_eigenvectors=True)
|
with_eigenvectors=True)
|
||||||
|
|
||||||
# Gamma-L path i FCC conventional basis
|
|
||||||
directions_to_L = [[0.5, 0.5, 0.5],
|
|
||||||
[-0.5, 0.5, 0.5]]
|
|
||||||
G_points_cubic = ([3, 3, 3], )
|
|
||||||
n_points = 51
|
|
||||||
temperature = 300
|
temperature = 300
|
||||||
|
|
||||||
print("# Distance from Gamma point, 4 band frequencies in meV, "
|
IXS = True
|
||||||
"4 dynamic structure factors")
|
|
||||||
print("# For degenerate bands, summations are made.")
|
|
||||||
print("# Gamma point is omitted due to different number of bands.")
|
|
||||||
print("")
|
|
||||||
|
|
||||||
# With scattering lengths
|
if IXS:
|
||||||
print("# Running with scattering lengths")
|
# For IXS, atomic form factor is needed and given as a function as
|
||||||
run(phonon,
|
# a parameter.
|
||||||
G_points_cubic,
|
# D. Waasmaier and A. Kirfel, Acta Cryst. A51, 416 (1995)
|
||||||
directions_to_L,
|
# f(Q) = \sum_i a_i \exp((-b_i Q^2) + c
|
||||||
temperature,
|
# Q is in angstron^-1
|
||||||
scattering_lengths={'Na': 3.63, 'Cl': 9.5770},
|
# a1, b1, a2, b2, a3, b3, a4, b4, a5, b5, c
|
||||||
n_points=n_points,
|
f_params = {'Na': [3.148690, 2.594987, 4.073989, 6.046925,
|
||||||
verbose=True)
|
0.767888, 0.070139, 0.995612, 14.1226457,
|
||||||
print("")
|
0.968249, 0.217037, 0.045300], # 1+
|
||||||
|
'Cl': [1.061802, 0.144727, 7.139886, 1.171795,
|
||||||
|
6.524271, 19.467656, 2.355626, 60.320301,
|
||||||
|
35.829404, 0.000436, -34.916604]} # 1-
|
||||||
|
AFF_func = get_AFF_func(f_params)
|
||||||
|
run(phonon,
|
||||||
|
Qpoints,
|
||||||
|
temperature,
|
||||||
|
atomic_form_factor_func=AFF_func)
|
||||||
|
else:
|
||||||
|
# For INS, scattering length has to be given.
|
||||||
|
# The following values is obtained at (Coh b)
|
||||||
|
# https://www.nist.gov/ncnr/neutron-scattering-lengths-list
|
||||||
|
run(phonon,
|
||||||
|
Qpoints,
|
||||||
|
temperature,
|
||||||
|
scattering_lengths={'Na': 3.63, 'Cl': 9.5770})
|
||||||
|
|
||||||
# With atomic form factor
|
The output of the script is::
|
||||||
print("# Running with atomic form factor")
|
|
||||||
# D. Waasmaier and A. Kirfel, Acta Cryst. A51, 416 (1995)
|
# [1] Distance from Gamma point,
|
||||||
# f(Q) = \sum_i a_i \exp((-b_i Q^2) + c
|
# [2-4] Q-points in cubic reciprocal space,
|
||||||
# Q is in angstron^-1
|
# [5-8] 4 band frequencies in meV (becaues of degeneracy),
|
||||||
# a1, b1, a2, b2, a3, b3, a4, b4, a5, b5, c
|
# [9-12] 4 dynamic structure factors.
|
||||||
f_params = {'Na': [3.148690, 2.594987, 4.073989, 6.046925,
|
# For degenerate bands, dynamic structure factors are summed.
|
||||||
0.767888, 0.070139, 0.995612, 14.1226457,
|
|
||||||
0.968249, 0.217037, 0.045300], # 1+
|
0.009132 2.970000 -2.970000 2.970000 0.977517 1.648183 19.035705 30.535702 0.000000 706.475380 0.000000 16.137386
|
||||||
'Cl': [1.061802, 0.144727, 7.139886, 1.171795,
|
0.015219 2.950000 2.950000 -2.950000 1.640522 2.747087 18.994893 30.479078 0.000000 262.113412 0.000000 16.366740
|
||||||
6.524271, 19.467656, 2.355626, 60.320301,
|
0.021307 2.930000 -2.930000 2.930000 2.298710 3.841226 18.935185 30.395654 0.000000 138.116831 0.000000 16.619581
|
||||||
35.829404, 0.000436, -34.916604]} # 1-
|
0.028917 2.905000 -2.905000 2.905000 3.116160 5.200214 18.836546 30.256295 0.000000 78.225945 0.000000 16.965983
|
||||||
run(phonon,
|
0.031961 2.895000 -2.895000 2.895000 3.441401 5.740457 18.790421 30.190463 0.000000 65.174556 0.000000 17.112970
|
||||||
G_points_cubic,
|
0.036526 2.880000 -2.880000 2.880000 3.927209 6.546550 18.714922 30.081791 0.000000 51.288627 0.000000 17.341206
|
||||||
directions_to_L,
|
0.045658 2.850000 -2.850000 2.850000 4.890522 8.140492 18.544488 29.832346 0.000000 34.845699 0.000000 17.819327
|
||||||
temperature,
|
0.057833 2.810000 -2.810000 2.810000 6.154512 10.217882 18.286153 29.444246 0.000000 23.864605 0.000000 18.476926
|
||||||
func_AFF=get_func_AFF(f_params),
|
0.080662 2.735000 -2.735000 2.735000 8.440068 13.902951 17.731951 28.589254 0.000000 15.762830 0.000000 19.591803
|
||||||
n_points=n_points,
|
0.103491 2.660000 -2.660000 2.660000 10.559231 17.071210 17.175478 27.602958 0.000000 0.000000 14.349345 20.000676
|
||||||
verbose=True)
|
0.127842 2.580000 -2.580000 2.580000 12.497611 16.203093 19.926659 26.474218 0.000000 0.000000 18.814845 17.496644
|
||||||
|
0.152193 2.500000 -2.500000 2.500000 13.534679 15.548262 21.156819 25.813428 0.000000 0.000000 34.134746 6.765951
|
||||||
|
|
|
@ -197,40 +197,73 @@ More detailed configuration can be given as follows::
|
||||||
phonon = phonopy.load(supercell_matrix=[2, 2, 2],
|
phonon = phonopy.load(supercell_matrix=[2, 2, 2],
|
||||||
primitive_matrix='auto',
|
primitive_matrix='auto',
|
||||||
unitcell_filename="POSCAR",
|
unitcell_filename="POSCAR",
|
||||||
force_constants_filename="force_constants.hdf5",
|
force_constants_filename="force_constants.hdf5")
|
||||||
is_nac=True)
|
|
||||||
|
|
||||||
With ``is_nac=True``, ``BORN`` file in the current directory is read.
|
With ``is_nac=True`` (default), ``BORN`` file in the current directory
|
||||||
If supercell is passed and ``primitive matrix`` and
|
is read if it exists. If supercell is passed and ``primitive matrix``
|
||||||
``supercell_matrix`` are not set, the primitive cell is automatically
|
and ``supercell_matrix`` are not set, the primitive cell is
|
||||||
searched::
|
automatically searched::
|
||||||
|
|
||||||
phonon = phonopy.load(supercell_filename="SPOSCAR",
|
phonon = phonopy.load(supercell_filename="SPOSCAR",
|
||||||
force_constants_filename="force_constants.hdf5",
|
force_constants_filename="force_constants.hdf5")
|
||||||
is_nac=True)
|
|
||||||
|
|
||||||
If ``FORCE_SETS`` exists in the current directory, this below works::
|
If ``FORCE_SETS`` exists in the current directory, this below works to
|
||||||
|
be ready for post-process calculation with automatic choice of
|
||||||
|
primitive matrix::
|
||||||
|
|
||||||
phonon = phonopy.load(supercell_filename="SPOSCAR", is_nac=True)
|
phonon = phonopy.load(supercell_filename="SPOSCAR")
|
||||||
|
|
||||||
|
For example, in the ``example/NaCl`` directory, phonon band structure
|
||||||
|
of NaCl is easily plotted by
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
In [1]: import phonopy
|
||||||
|
|
||||||
|
In [2]: ph = phonopy.load(supercell_filename="SPOSCAR")
|
||||||
|
|
||||||
|
In [3]: print(ph.primitive)
|
||||||
|
lattice:
|
||||||
|
- [ 0.000000000000000, 2.845150738087836, 2.845150738087836 ] # a
|
||||||
|
- [ 2.845150738087836, 0.000000000000000, 2.845150738087836 ] # b
|
||||||
|
- [ 2.845150738087836, 2.845150738087836, 0.000000000000000 ] # c
|
||||||
|
points:
|
||||||
|
- symbol: Na # 1
|
||||||
|
coordinates: [ 0.000000000000000, 0.000000000000000, 0.000000000000000 ]
|
||||||
|
mass: 22.989769
|
||||||
|
- symbol: Cl # 2
|
||||||
|
coordinates: [ 0.500000000000000, 0.500000000000000, 0.500000000000000 ]
|
||||||
|
mass: 35.453000
|
||||||
|
|
||||||
|
In [4]: print(ph.nac_params)
|
||||||
|
{'born': array([[[ 1.08703, 0. , 0. ],
|
||||||
|
[ 0. , 1.08703, 0. ],
|
||||||
|
[ 0. , 0. , 1.08703]],
|
||||||
|
|
||||||
|
[[-1.08672, 0. , 0. ],
|
||||||
|
[ 0. , -1.08672, 0. ],
|
||||||
|
[ 0. , 0. , -1.08672]]]), 'factor': 14.4, 'dielectric': array([[2.43533967, 0. , 0. ],
|
||||||
|
[0. , 2.43533967, 0. ],
|
||||||
|
[0. , 0. , 2.43533967]])}
|
||||||
|
|
||||||
|
In [5]: ph.auto_band_structure(plot=True).show()
|
||||||
|
|
||||||
Band structure
|
Band structure
|
||||||
^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Set band paths (``set_band_structure``) and get the results
|
Set band paths (``run_band_structure()``) and get the results
|
||||||
(``get_band_structure``).
|
(``get_band_structure_dict()``).
|
||||||
|
|
||||||
A tuple of (q-points, distances, frequencies, eigenvectors) is
|
A dictionary with ``qpoints``, ``distances``, ``frequencies``,
|
||||||
returned by ``get_band_structure()``. When group velocity calculation
|
``eigenvectors``, ``group_velocities`` is returned by
|
||||||
is set (see :ref:`phonopy_module_group_velocity`), (q-points,
|
``get_band_structure_dict()``. Eigenvectors can be obtained when
|
||||||
distances, frequencies, eigenvectors, group velocities) are returned.
|
``with_eigenvectors=True`` at ``run_band_structure()``. See the
|
||||||
Eigenvectors can be obtained when ``is_eigenvectors=True`` at
|
details at docstring of ``Phonopy.get_band_structure_dict``. Phonon
|
||||||
``set_band_structure()``. Eigenvalues are stored in a numpy array with
|
frequency is sqrt(eigenvalue). A negative eigenvalue has to correspond
|
||||||
the shape of (number_of_bands, len(distances)). Phonon frequency is
|
to the imaginary frequency, but for the plotting, it is set as the
|
||||||
sqrt(eigenvalue). A negative eigenvalue has to correspond to the
|
negative value in the above example. In addition, you need to multiply
|
||||||
imaginary frequency, but for the plotting, it is set as the negative
|
by your unit conversion factor. In the case of VASP to transform to
|
||||||
value in the above example. In addition, you need to multiply by your
|
THz, the factor is 15.633302.
|
||||||
unit conversion factor. In the case of VASP to transform to THz, the
|
|
||||||
factor is 15.633302.
|
|
||||||
|
|
||||||
In ``example/NaCl``, the phonopy is executed from python script, e.g.,
|
In ``example/NaCl``, the phonopy is executed from python script, e.g.,
|
||||||
|
|
||||||
|
@ -241,21 +274,32 @@ In ``example/NaCl``, the phonopy is executed from python script, e.g.,
|
||||||
|
|
||||||
path = [[[0, 0, 0], [0.5, 0, 0.5], [0.625, 0.25, 0.625]],
|
path = [[[0, 0, 0], [0.5, 0, 0.5], [0.625, 0.25, 0.625]],
|
||||||
[[0.375, 0.375, 0.75], [0, 0, 0], [0.5, 0.5, 0.5], [0.5, 0.25, 0.75]]]
|
[[0.375, 0.375, 0.75], [0, 0, 0], [0.5, 0.5, 0.5], [0.5, 0.25, 0.75]]]
|
||||||
labels = ["$\Gamma$", "X", "U", "K", "$\Gamma$", "L", "W"]
|
labels = ["$\\Gamma$", "X", "U", "K", "$\\Gamma$", "L", "W"]
|
||||||
qpoints, connections = get_band_qpoints_and_path_connections(path, npoints=51)
|
qpoints, connections = get_band_qpoints_and_path_connections(path, npoints=51)
|
||||||
phonon = phonopy.load(unitcell_filename="POSCAR",
|
phonon = phonopy.load(unitcell_filename="POSCAR",
|
||||||
supercell_matrix=[2, 2, 2],
|
supercell_matrix=[2, 2, 2],
|
||||||
primitive_matrix='F',
|
primitive_matrix='F')
|
||||||
is_nac=True)
|
phonon.run_band_structure(qpoints, path_connections=connections, labels=labels)
|
||||||
phonon.set_band_structure(qpoints, path_connections=connections, labels=labels)
|
phonon.plot_band_structure().show()
|
||||||
phonon.set_mesh([20, 20, 20], is_gamma_center=True)
|
|
||||||
|
# To plot DOS next to band structure
|
||||||
|
phonon.run_mesh([20, 20, 20])
|
||||||
|
phonon.run_total_dos()
|
||||||
phonon.plot_band_structure_and_dos().show()
|
phonon.plot_band_structure_and_dos().show()
|
||||||
|
|
||||||
|
# To plot PDOS next to band structure
|
||||||
|
phonon.run_mesh([20, 20, 20], with_eigenvectors=True, is_mesh_symmetry=False)
|
||||||
|
phonon.plot_band_structure_and_dos(pdos_indices=[[0], [1]]).show()
|
||||||
|
|
||||||
``path_connections`` and ``labels`` are unnecessary to set unless nice
|
``path_connections`` and ``labels`` are unnecessary to set unless nice
|
||||||
looking plotting is needed. To obtain eigenvectors, it is necessary to
|
looking plotting is needed. To obtain eigenvectors, it is necessary to
|
||||||
inform to store eigenvectors by::
|
inform to store eigenvectors by::
|
||||||
|
|
||||||
phonon.set_band_structure(bands, is_eigenvectors=True)
|
phonon.run_band_structure(bands, with_eigenvectors=True)
|
||||||
|
|
||||||
|
To obtain group velocities::
|
||||||
|
|
||||||
|
phonon.run_band_structure(bands, with_group_velocities=True)
|
||||||
|
|
||||||
Automatic selection of band paths using `SeeK-path
|
Automatic selection of band paths using `SeeK-path
|
||||||
<https://seekpath.readthedocs.io/en/latest/>`_ is invoked by
|
<https://seekpath.readthedocs.io/en/latest/>`_ is invoked by
|
||||||
|
@ -264,42 +308,86 @@ Automatic selection of band paths using `SeeK-path
|
||||||
|
|
||||||
phonon.auto_band_structure()
|
phonon.auto_band_structure()
|
||||||
|
|
||||||
|
and to plot
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
phonon.auto_band_structure(plot=True).show()
|
||||||
|
|
||||||
To use this method, ``seekpath`` python module is needed.
|
To use this method, ``seekpath`` python module is needed.
|
||||||
|
|
||||||
|
|
||||||
Mesh sampling
|
Mesh sampling
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
Set sampling mesh (``set_mesh``) in reciprocal space. The irreducible
|
Set sampling mesh (``set_mesh``) in reciprocal space. The irreducible
|
||||||
*q*-points and corresponding *q*-point weights, eigenvalues, and
|
*q*-points and corresponding *q*-point weights, eigenvalues, and
|
||||||
eigenvectors are obtained by ``get_mesh``. ``mesh`` gives the
|
eigenvectors are obtained by ``get_mesh_dict()``. ``mesh`` gives the
|
||||||
sampling mesh with Monkhorst-Pack scheme. The keyword ``shift`` gives
|
sampling mesh with Monkhorst-Pack scheme. The keyword ``shift`` gives
|
||||||
the fractional mesh shift with respect to the neighboring grid points.
|
the fractional mesh shift with respect to the neighboring grid points.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
mesh = [20, 20, 20]
|
mesh = [20, 20, 20]
|
||||||
phonon.set_mesh(mesh)
|
phonon.run_mesh(mesh)
|
||||||
qpoints, weights, frequencies, eigvecs = phonon.get_mesh()
|
mesh_dict = phonon.get_mesh_dict()
|
||||||
|
qpoints = mesh_dict['qpoints']
|
||||||
|
weights = mesh_dict['weights']
|
||||||
|
frequencies = mesh_dict['frequencies']
|
||||||
|
eigenvectors = mesh_dict['eigenvectors']
|
||||||
|
group_velocities = mesh_dict['group_velocities']
|
||||||
|
|
||||||
To obtain eigenvectors, it is necessary to inform to store
|
To obtain eigenvectors, it is necessary to inform to store
|
||||||
eigenvectors by::
|
eigenvectors by::
|
||||||
|
|
||||||
phonon.set_mesh([20, 20, 20], is_eigenvectors=True)
|
phonon.run_mesh([20, 20, 20], with_eigenvectors=True)
|
||||||
|
|
||||||
|
and for group velocities::
|
||||||
|
|
||||||
|
phonon.run_mesh([20, 20, 20], with_group_velocities=True)
|
||||||
|
|
||||||
|
The first argument of ``run_mesh()`` can be a float value, which is a
|
||||||
|
length measure as explained at :ref:`mp_tag`, for example::
|
||||||
|
|
||||||
|
phonon.run_mesh(100.0)
|
||||||
|
|
||||||
DOS and PDOS
|
DOS and PDOS
|
||||||
^^^^^^^^^^^^^
|
^^^^^^^^^^^^^
|
||||||
|
|
||||||
Before starting mesh sampling has to be finished. Then set parameters
|
Before starting mesh sampling has to be finished. Then set parameters
|
||||||
(``set_total_DOS`` or ``set_partial_DOS``) and write the results into
|
(``run_total_dos()`` or ``run_projected_dos()``) and write the results into
|
||||||
files (``write_total_DOS`` and ``write_partial_DOS``). In the case of
|
files (``write_total_dos()`` and ``write_projected_dos()``). In the case of
|
||||||
PDOS, the eigenvectors have to be calculated in the mesh
|
PDOS, the eigenvectors have to be calculated in the mesh
|
||||||
sampling. ``get_total_DOS`` and ``get_partial_DOS`` are under preparation.
|
sampling. To get the results ``get_total_dos_dict()`` and
|
||||||
|
``get_projected_dos_dict()`` can be used.
|
||||||
|
|
||||||
|
To plot total DOS,
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
phonon.set_total_DOS()
|
phonon.run_mesh([20, 20, 20])
|
||||||
phonon.plot_total_DOS().show()
|
phonon.run_total_dos()
|
||||||
|
phonon.plot_total_dos().show()
|
||||||
|
|
||||||
|
and projected DOS
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
phonon.run_mesh([20, 20, 20], with_eigenvectors=True, is_mesh_symmetry=False)
|
||||||
|
phonon.run_projected_dos()
|
||||||
|
phonon.plot_projected_dos().show()
|
||||||
|
|
||||||
|
Convenient shortcuts exist as follows::
|
||||||
|
|
||||||
|
|
||||||
|
phonon.auto_total_dos(plot=True).show()
|
||||||
|
|
||||||
|
and
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
phonon.auto_projected_dos(plot=True).show()
|
||||||
|
|
||||||
|
|
||||||
Thermal properties
|
Thermal properties
|
||||||
^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -308,18 +396,27 @@ Before starting the thermal property calculation, the mesh sampling
|
||||||
calclation has to be done in the **THz unit**. The unit conversion
|
calclation has to be done in the **THz unit**. The unit conversion
|
||||||
factor for phonon frequency is set in the pre-process of Phonopy with
|
factor for phonon frequency is set in the pre-process of Phonopy with
|
||||||
the ``factor`` keyword. Calculation range of temperature is set by the
|
the ``factor`` keyword. Calculation range of temperature is set by the
|
||||||
parameters ``set_thermal_properties``. Helmholtz free energy, entropy,
|
parameters ``run_thermal_properties``. Helmholtz free energy, entropy,
|
||||||
heat capacity at contant volume at temperaturs are obtained by
|
heat capacity at contant volume at temperaturs are obtained by
|
||||||
``get_thermal_properties``, where the results are given as a tuple of
|
``get_thermal_properties_dict``, where the results are given as a
|
||||||
temperaturs, Helmholtz free energy, entropy, and heat capacity.
|
dictionary of temperaturs, Helmholtz free energy, entropy, and heat
|
||||||
|
capacity with keys ``temperatures``, ``free_energy``, ``entropy``, and
|
||||||
|
``heat_capacity``, respectively.
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
phonon.set_thermal_properties(t_step=10,
|
phonon.run_mesh([20, 20, 20])
|
||||||
|
phonon.run_thermal_properties(t_step=10,
|
||||||
t_max=1000,
|
t_max=1000,
|
||||||
t_min=0)
|
t_min=0)
|
||||||
for t, free_energy, entropy, cv in np.array(phonon.get_thermal_properties()).T:
|
tp_dict = phonon.get_thermal_properties_dict()
|
||||||
print ("%12.3f " + "%15.7f" * 3) % ( t, free_energy, entropy, cv )
|
temperatures = tp_dict['temperatures']
|
||||||
|
free_energy = tp_dict['free_energy']
|
||||||
|
entropy = tp_dict['entropy']
|
||||||
|
heat_capacity = tp_dict['heat_capacity']
|
||||||
|
|
||||||
|
for t, F, S, cv in zip(temperatures, free_energy, entropy, heat_capacity):
|
||||||
|
print(("%12.3f " + "%15.7f" * 3) % ( t, F, S, cv ))
|
||||||
|
|
||||||
phonon.plot_thermal_properties().show()
|
phonon.plot_thermal_properties().show()
|
||||||
|
|
||||||
|
@ -350,29 +447,6 @@ given in Cartesian coordinates.
|
||||||
'dielectric': epsilon})
|
'dielectric': epsilon})
|
||||||
|
|
||||||
|
|
||||||
.. _phonopy_module_group_velocity:
|
|
||||||
|
|
||||||
Group velocity
|
|
||||||
^^^^^^^^^^^^^^^
|
|
||||||
|
|
||||||
A group velocity at a q-point is obtained by::
|
|
||||||
|
|
||||||
phonon.get_group_velocity_at_q(q_point)
|
|
||||||
|
|
||||||
Group velocities with mesh sampling, band structure, or q-points
|
|
||||||
calculations are given as follows.
|
|
||||||
|
|
||||||
First inform phonopy object to calculate group velocity::
|
|
||||||
|
|
||||||
phonon.set_group_velocity()
|
|
||||||
|
|
||||||
Then the respective group velocities are obtained by::
|
|
||||||
|
|
||||||
phonon.get_group_velocity()
|
|
||||||
|
|
||||||
The shape of group velocity array is to follow those array shapes of
|
|
||||||
calculation modes.
|
|
||||||
|
|
||||||
Data structure
|
Data structure
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
|
|
|
@ -999,7 +999,16 @@ P1 symmetry is enforced to the input unit cell by setting ``SYMMETRY = .FALSE``.
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Symmetry search on the reciprocal sampling mesh is disabled by setting
|
Symmetry search on the reciprocal sampling mesh is disabled by setting
|
||||||
``MESH_SYMMETRY = .FALSE.``.
|
``MESH_SYMMETRY = .FALSE.``. In some case such as hexagonal systems or
|
||||||
|
primitive cells of cubic systems having F and I-centrings, the results
|
||||||
|
with and without mesh symmetry give slightly different values for
|
||||||
|
those proprerties that can employ mesh symmetry. This happens when the
|
||||||
|
uniform sampling mesh made along basis vectors desn't have the same
|
||||||
|
crystallographic point group as the crystal itself. This symmetry
|
||||||
|
breaking may be also seen by the fact that ``weight`` written in
|
||||||
|
``mesh.yaml`` can be different from possible order of product group of
|
||||||
|
site-symmetry group and time revesal symmetry. Generally the
|
||||||
|
difference becomes smaller when increasing the sampling mesh numbers.
|
||||||
|
|
||||||
|
|
||||||
.. _fc_symmetry_tag:
|
.. _fc_symmetry_tag:
|
||||||
|
|
Loading…
Reference in New Issue