mirror of https://github.com/phonopy/phono3py.git
Add a figure for document
This commit is contained in:
parent
f1ab975cc8
commit
1ccc7a4c4c
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
|
@ -128,3 +128,5 @@ def create_phono3py_supercells(unitcell,
|
|||
|
||||
if log_level:
|
||||
print("Number of displacements for special fc2: %d" % num_disps)
|
||||
|
||||
return phono3py
|
||||
|
|
|
@ -8,6 +8,7 @@ from phonopy.harmonic.force_constants import (get_fc2, set_permutation_symmetry,
|
|||
from phonopy.harmonic.displacement import get_least_displacements
|
||||
from phonopy.harmonic.displacement import direction_to_displacement as \
|
||||
direction_to_displacement_fc2
|
||||
from phono3py.version import __version__
|
||||
from phono3py.phonon3.imag_self_energy import (get_imag_self_energy,
|
||||
write_imag_self_energy,
|
||||
get_linewidth,
|
||||
|
@ -105,6 +106,7 @@ class Phono3py(object):
|
|||
# Other variables
|
||||
self._fc2 = None
|
||||
self._fc3 = None
|
||||
self._nac_params = None
|
||||
|
||||
# Setup interaction
|
||||
self._interaction = None
|
||||
|
@ -129,6 +131,7 @@ class Phono3py(object):
|
|||
constant_averaged_interaction=None,
|
||||
frequency_scale_factor=None,
|
||||
unit_conversion=None):
|
||||
self._nac_params = nac_params
|
||||
self._interaction = Interaction(
|
||||
self._supercell,
|
||||
self._primitive,
|
||||
|
@ -147,7 +150,7 @@ class Phono3py(object):
|
|||
self._fc2,
|
||||
self._phonon_supercell,
|
||||
self._phonon_primitive,
|
||||
nac_params=nac_params,
|
||||
nac_params=self._nac_params,
|
||||
frequency_scale_factor=frequency_scale_factor)
|
||||
self._interaction.set_nac_q_direction(nac_q_direction=nac_q_direction)
|
||||
|
||||
|
@ -294,6 +297,9 @@ class Phono3py(object):
|
|||
self._fc3,
|
||||
translational_symmetry_type=translational_symmetry_type)
|
||||
|
||||
def get_version(self):
|
||||
return __version__
|
||||
|
||||
def get_interaction_strength(self):
|
||||
return self._interaction
|
||||
|
||||
|
@ -309,6 +315,9 @@ class Phono3py(object):
|
|||
def set_fc3(self, fc3):
|
||||
self._fc3 = fc3
|
||||
|
||||
def get_nac_params(self):
|
||||
return self._nac_params
|
||||
|
||||
def get_primitive(self):
|
||||
return self._primitive
|
||||
|
||||
|
@ -334,6 +343,12 @@ class Phono3py(object):
|
|||
def get_phonon_supercell_symmetry(self):
|
||||
return self._phonon_supercell_symmetry
|
||||
|
||||
def get_supercell_matrix(self):
|
||||
return self._supercell_matrix
|
||||
|
||||
def get_primitive_matrix(self):
|
||||
return self._primitive_matrix
|
||||
|
||||
def set_displacement_dataset(self, dataset):
|
||||
self._displacement_dataset = dataset
|
||||
|
||||
|
|
|
@ -57,6 +57,21 @@ from phono3py.cui.triplets_info import write_grid_points, show_num_triplets
|
|||
from phono3py.cui.translate_settings import get_phono3py_configurations
|
||||
from phono3py.cui.create_supercells import create_phono3py_supercells
|
||||
from phono3py.cui.create_force_constants import create_phono3py_force_constants
|
||||
from phono3py.cui.phono3py_yaml import Phono3pyYaml
|
||||
|
||||
def finalize_phono3py(log_level,
|
||||
phonop3y_conf,
|
||||
phono3py,
|
||||
interface_mode,
|
||||
filename="phono3py.yaml"):
|
||||
if log_level > 0:
|
||||
ph3py_yaml = Phono3pyYaml(configuration=phono3py_conf.get_configures(),
|
||||
calculator=interface_mode)
|
||||
ph3py_yaml.set_phonon_info(phono3py)
|
||||
with open(filename, 'w') as w:
|
||||
w.write(str(ph3py_yaml))
|
||||
print_end()
|
||||
sys.exit(0)
|
||||
|
||||
phono3py_version = __version__
|
||||
|
||||
|
@ -208,12 +223,14 @@ if options.force_sets_mode:
|
|||
# Parse settings #
|
||||
##################
|
||||
if len(args) > 0:
|
||||
settings = Phono3pyConfParser(filename=args[0],
|
||||
options=options,
|
||||
option_list=option_list).get_settings()
|
||||
phono3py_conf = Phono3pyConfParser(filename=args[0],
|
||||
options=options,
|
||||
option_list=option_list)
|
||||
settings = phono3py_conf.get_settings()
|
||||
else:
|
||||
settings = Phono3pyConfParser(options=options,
|
||||
option_list=option_list).get_settings()
|
||||
phono3py_conf = Phono3pyConfParser(options=options,
|
||||
option_list=option_list)
|
||||
settings = phono3py_conf.get_settings()
|
||||
|
||||
#############
|
||||
# Run modes #
|
||||
|
@ -295,22 +312,26 @@ symprec = options.symprec
|
|||
# Create supercells with displacements and exit #
|
||||
#################################################
|
||||
if settings.get_create_displacements():
|
||||
create_phono3py_supercells(unitcell,
|
||||
supercell_matrix,
|
||||
phonon_supercell_matrix,
|
||||
settings.get_displacement_distance(),
|
||||
settings.get_is_plusminus_displacement(),
|
||||
settings.get_is_diagonal_displacement(),
|
||||
settings.get_cutoff_pair_distance(),
|
||||
write_supercells_with_displacements,
|
||||
optional_structure_file_information,
|
||||
symprec,
|
||||
output_filename=output_filename,
|
||||
interface_mode=interface_mode,
|
||||
log_level=log_level)
|
||||
if log_level:
|
||||
print_end()
|
||||
sys.exit(0)
|
||||
phono3py = create_phono3py_supercells(
|
||||
unitcell,
|
||||
supercell_matrix,
|
||||
phonon_supercell_matrix,
|
||||
settings.get_displacement_distance(),
|
||||
settings.get_is_plusminus_displacement(),
|
||||
settings.get_is_diagonal_displacement(),
|
||||
settings.get_cutoff_pair_distance(),
|
||||
write_supercells_with_displacements,
|
||||
optional_structure_file_information,
|
||||
symprec,
|
||||
output_filename=output_filename,
|
||||
interface_mode=interface_mode,
|
||||
log_level=log_level)
|
||||
|
||||
finalize_phono3py(log_level,
|
||||
phono3py_conf,
|
||||
phono3py,
|
||||
interface_mode,
|
||||
filename="phono3py_disp.yaml")
|
||||
|
||||
#################################################
|
||||
# Change unit of lattice parameters to Angstrom #
|
||||
|
@ -663,5 +684,4 @@ else:
|
|||
print("*" * 15 + " None of ph-ph interaction was calculated. " +
|
||||
"*" * 16)
|
||||
|
||||
if log_level:
|
||||
print_end()
|
||||
finalize_phono3py(log_level, phono3py_conf, phono3py, interface_mode)
|
||||
|
|
Loading…
Reference in New Issue