Giter Club home page Giter Club logo

phono3py's Introduction

Version Badge Downloads Badge PyPI version PyPI codecov

phono3py

A simulation package of phonon-phonon interaction related properties mainly written in python. Phono3py user documentation is found at http://phonopy.github.io/phono3py/.

Mailing list for questions

Usual phono3py questions should be sent to phonopy mailing list (https://sourceforge.net/p/phonopy/mailman/).

Dependency

See requirements.txt. Optionally symfc and scipy are required for using additional features.

Development

The development of phono3py is managed on the develop branch of github phono3py repository.

  • Github issues is the place to discuss about phono3py issues.

  • Github pull request is the place to request merging source code.

  • Formatting rules are found in pyproject.toml.

  • Not strictly, but VSCode's settings.json may be written like below

    "ruff.lint.args": [
        "--config=${workspaceFolder}/pyproject.toml",
    ],
    "[python]": {
        "editor.defaultFormatter": "charliermarsh.ruff",
        "editor.codeActionsOnSave": {
            "source.organizeImports": "explicit"
        }
    },
  • Use of pre-commit (https://pre-commit.com/) is encouraged.

    • Installed by pip install pre-commit, conda install pre_commit or see https://pre-commit.com/#install.
    • pre-commit hook is installed by pre-commit install.
    • pre-commit hook is run by pre-commit run --all-files.

Documentation

Phono3py user documentation is written using python sphinx. The source files are stored in doc directory. Please see how to write the documentation at doc/README.md.

How to run tests

Tests are written using pytest. To run tests, pytest has to be installed. The tests can be run by

% pytest

phono3py's People

Contributors

anttikarttunen avatar atztogo avatar jan-janssen avatar msimoncelli avatar pre-commit-ci[bot] avatar zerothi avatar zhubonan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phono3py's Issues

kaccum error

Dear Togo
I have installed the recent phono3py update according to new instructions. But I received the following error when calling kaccum (or phono3py-kaccum):

Traceback (most recent call last):
File "/miniconda/envs/phono3py/bin/phono3py-kaccum", line 7, in
exec(compile(f.read(), file, 'exec'))
File "
/run/phono3py/scripts/phono3py-kaccum", line 7, in
from phonopy.interface import read_crystal_structure
ImportError: cannot import name 'read_crystal_structure' from 'phonopy.interface' (~/run/phonopy/phonopy/interface/init.py)

I am completely unfamiliar with conda installation but does this conda installation requires setting $PYTHONPATH? I have noticed it does not copy anything to ~/miniconda/envs/phono3py/lib/python3.7/site-packages just an egg.info referring to ~/run/phonopy/phonopy

Any help would be highly appreciated since I completely removed my older version ;).

Kind regards,
MK

LAPACK library, default to read numpy default?

If one wishes to use other libraries than the standard lapack interface it requires an editing in the setup.py file.

Instead one may use numpy.distutils to retrieve the fields specified in the numpy installation for a correct library.

For instance:

import numpy.distutils.system_info as si
lapack_opt_dict = si.get_info('lapack_opt')

will return the specified options in the site.cfg of the numpy installation. There are various things to query in the dictionary, such as library names, compilation flags, etc.

Help: massive number of POSCAR-xxxxx produced by phono3py

I want to use the phono3py (version 2.6.0) to calculate the lattice thermal conductivity of the hybrid organic-inorganic perovskite, which has 44 atoms, belonging to the space group of Pmma. After relaxing the structure via VASP, I copied the CONTCAR and rename it as POSCAR into a new directory. Then, I tried the code

phono3py -d --dim="2 2 2" -c POSCAR

However, it produced 71907 displacements structure files! I can not imagine how many months the subsequent calculations will finish.

I am new to phono3py. I was wondering if the massive number of POSCAR-xxxxx files is a common occurrence.


The POSCAR file is provided below.

DJ1L_Pmma
   1.0
     9.0736764969368906    0.0000000000000000    0.0000000000000000
     0.0000000000000000    9.9721293685144623    0.0000000000000000
     0.0000000000000000    0.0000000000000000    8.5241021933268151
H C N I Pb
  24    6    4    8    2
Direct
  0.6588694442733071  0.2599351532526649  0.8572357598090808
  0.8478002732898366  0.8704876068486431  0.6137089531036838
  0.8411305557266929  0.7400648467473351  0.8572357598090808
  0.6521997267101634  0.1295123931513569  0.6137089531036838
  0.3411305557266929  0.2599351532526649  0.1427642401909192
  0.1521997267101634  0.8704876068486431  0.3862910468963162
  0.1588694442733072  0.7400648467473351  0.1427642401909192
  0.3478002732898366  0.1295123931513569  0.3862910468963162
  0.3411305557266929  0.7400648467473351  0.1427642401909192
  0.1521997267101634  0.1295123931513569  0.3862910468963162
  0.1588694442733072  0.2599351532526649  0.1427642401909192
  0.3478002732898366  0.8704876068486431  0.3862910468963162
  0.6588694442733071  0.7400648467473351  0.8572357598090808
  0.8478002732898366  0.1295123931513569  0.6137089531036838
  0.8411305557266929  0.2599351532526649  0.8572357598090808
  0.6521997267101634  0.8704876068486431  0.6137089531036838
  0.6524516836056640  0.0000000000000000  0.8698486227754814
  0.8475483163943360  0.0000000000000000  0.8698486227754814
  0.3475483163943360  0.0000000000000000  0.1301513772245186
  0.1524516836056640  0.0000000000000000  0.1301513772245186
  0.7500000000000000  0.3340324783940282  0.7108608812789095
  0.7500000000000000  0.6659675216059717  0.7108608812789095
  0.2500000000000000  0.3340324783940282  0.2891391187210905
  0.2500000000000000  0.6659675216059717  0.2891391187210905
  0.7500000000000000  0.8751939055699482  0.6893422642587961
  0.7500000000000000  0.1248060944300518  0.6893422642587961
  0.2500000000000000  0.8751939055699482  0.3106577357412039
  0.2500000000000000  0.1248060944300518  0.3106577357412039
  0.7500000000000000  0.0000000000000000  0.7929738492951516
  0.2500000000000000  0.0000000000000000  0.2070261507048484
  0.7500000000000000  0.7483134396959018  0.7844534705212637
  0.7500000000000000  0.2516865603040982  0.7844534705212637
  0.2500000000000000  0.7483134396959018  0.2155465294787363
  0.2500000000000000  0.2516865603040982  0.2155465294787363
  0.2500000000000000  0.1864934119484717  0.7888730255668756
  0.2500000000000000  0.8135065880515283  0.7888730255668756
  0.7500000000000000  0.1864934119484717  0.2111269744331244
  0.7500000000000000  0.8135065880515283  0.2111269744331244
  0.5000000000000000  0.5000000000000000  0.0000000000000000
  0.0000000000000000  0.5000000000000000  0.0000000000000000
  0.5000000000000000  0.5000000000000000  0.5000000000000000
  0.0000000000000000  0.5000000000000000  0.5000000000000000
  0.2500000000000000  0.5000000000000000  0.7502717802102575
  0.7500000000000000  0.5000000000000000  0.2497282197897425

phono3py --cf3-file options broken

Dear prof. Togo,

When using --cutoff-pair options in phono3py for generating the force constants step. phono3py version is 1.22.3

phono3py --cf3-file file_list.dat

give me following error.

_ __ | |__ ___ _ __ | / _ __ _ _
| '_ | '_ \ / _ | '_ \ / _ \ |_ | '_ | | | |
| |) | | | | () | | | | () |__) | |) | || |
| .__/|
| ||___/|| ||___//| .__/ _, |
|
| |
| |___/
1.22.3

Python version 3.9.2
Spglib version 1.16.1

Crystal structure was read from "POSCAR".
Supercell matrix (DIM or --dim) information was not found.


/ _ \ '| '/ _ | '|
| / | | | | (_) | |
_|| || _
/|_|

I am following instructions from following page.

https://phonopy.github.io/phono3py/cutoff-pair.html#force-constants-calculation-with-cutoff-pair-distance

Thanks
Alex

Obtaining phonon linewidths/lifetimes along reduced wave vector

Dear Atz Togo,

You have an example at https://atztogo.github.io/phono3py/hdf5_howto.html where you nicely show how to calculate phonon linewidths and lifetimes using phono3py (following the above link, the variable "g" corresponds to the phonon linewidths and the variable "lifetime" to the phonon lifetime). Using g[:,5] one can obtain the phonon linewidths for a certain branch. The given linewidths are, if I understand correctly, given for all the calculated q-points within the first brillouin zone. Now my question: Is it possible to obtain the linewidths for specific q-points which correspond to a certain path along a high symmetry direction of the phonon dispersion? Assuming I would like to plot the linewidths from Gamma to X (the reduced wave vector), which indizes would those points correspond to in the variable "g"? Are there any means to find out also for the other high symmetry pahts? Any help would be sincerely appreciated. Best wishes, yours,

Albert

Phono3py installation issues

Dear Prof. Togo

After installing phono3py using conda I get this issue when I try to use it:

File "path/phono3py/cui/phono3py_script.py", line 498, in get_cell_info
cell_info = collect_cell_info(
TypeError: collect_cell_info() got an unexpected keyword argument 'symprec'

Do you have any suggestion?
Thanks a lot!

AttributeError: 'Phono3py' object has no attribute 'force_constants'

Dear Prof. Atztogo

I installed the Phono3py by "conda install -c atztogo phono3py". But for each Phono3py command, it always ends with the following error:
Traceback (most recent call last):
File "/home/xiangp/anaconda3/envs/python368/bin/phono3py", line 4, in
import('pkg_resources').run_script('phono3py==1.17.0.post1', 'phono3py')
File "/home/xiangp/anaconda3/envs/python368/lib/python3.6/site-packages/pkg_resources/init.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/home/xiangp/anaconda3/envs/python368/lib/python3.6/site-packages/pkg_resources/init.py", line 1453, in run_script
exec(code, namespace, namespace)
File "/home/xiangp/anaconda3/envs/python368/lib/python3.6/site-packages/phono3py-1.17.0.post1-py3.6-linux-x86_64.egg-info/scripts/phono3py", line 477, in
filename="phono3py_disp.yaml")
File "/home/xiangp/anaconda3/envs/python368/lib/python3.6/site-packages/phono3py-1.17.0.post1-py3.6-linux-x86_64.egg-info/scripts/phono3py", line 84, in finalize_phono3py
ph3py_yaml.set_phonon_info(phono3py)
File "/home/xiangp/anaconda3/envs/python368/lib/python3.6/site-packages/phono3py/cui/phono3py_yaml.py", line 81, in set_phonon_info
super(Phono3pyYaml, self).set_phonon_info(phono3py)
File "/home/xiangp/anaconda3/envs/python368/lib/python3.6/site-packages/phonopy/interface/phonopy_yaml.py", line 118, in set_phonon_info
self.force_constants = phonopy.force_constants
AttributeError: 'Phono3py' object has no attribute 'force_constants'

By the way, I tested the case in Example and the results seem to be consistent.

Thank you very much!

Best,
Pan

Feature request for boundary scattering model

Dear Dr. Togo,

I was wondering in the future if it will be possible to allow for several values for length L in boundary scattering model. i.e
--bmfp 1 10 50 100 1000 etc....

something like this exists with --sigma options. This will be helpful when fitting the results with the available experimental data as a function of grain size.

May thanks
Alex

pip install phono3py fails because site.cfg not found

Check the develop branch
Report to the combination of the develop branch of phonopy and the develop branch of phono3py.

Describe the bug
pip install phono3py fails because site.cfg not found

To Reproduce
Steps to reproduce the behavior:

  1. pip install phono3py
  2. it fails

creating this file in directory where command runs has no effect

Identical displacements in displacement dataset

Dear Togo,

I was using phono3py to calculate third order force constants of a set of orthorhombic materials using and noticed that some of the displacements in the dataset were the same (I attached a sample POSCAR of the primitive cell).

Using a 1x1x1 supercell (the issue also appears in larger cells) displacements (syntax [first_atoms_index, second_atoms_index]) [2, 3], [3,3], [4,2] all correspond to moving along the +/- disp along y or z axis for displacement and then moving it -/+ disp along the same axis for displacement 2.
There are also a series of displacements where displacement 1 and displacement 2 are swapped with each other.

This should not affect the force constant calculations, but it does add a bit of computational load.

POSCAR.txt

--write-gamma do not work with the direct solution of LBTE

Dear Prof. Atztogo,

I installed the latest phono3py (version: 1.18.2) to calculate thermal conductivity. Unfortunately, the --write-gamma option do not generate the kappa-mxxx-gx.hdf5 file in case of using the direct solution of LBTE (--lbte option). Do you have any idea?

BTW, if use the RTA method (--br option), it generates the kappa-mxxx-gx.hdf5 file normally.

Best,
Pan

obtaining forces and energies from FORCES_FC3 / fc2.hdf5 / fc3.hdf5

Dear Togo,

having obtained the dynamical matrix in harmonic approximation it is possible to obtain forces and the total energy for any (arbitrary) configuration. Having obtained the FORCES_FC3 / fc2.hdf5 / fc3.hdf5 files (did it for fcc Aluminium), would it be possible to calculate forces and/or the total energy (the vibrational contribution) for randomly displaced atoms? Thank you very much,

Albert Glensk

the frequency range of JDOS question

Dear Togo,
when I use phono3py to plot jdos,I found the code is f_max = np.max(self._frequencies) * 2.
I'm confused why frequency_max multiply by 2 .
Thank you very much!

index # is out of bounds for axis 0 with size #

After setting cutoff_pair_distance, index # is out of bounds for axis 0 with size # error raises.

phono = Phono3py(
        unitcell=atoms,
        supercell_matrix=[2,2,2],
        primitive_matrix=structure[1])

phono.generate_displacements(cutoff_pair_distance=3.0)
...
...
phono.forces = np.array(forces_lst)

image

Cannot pip download source

Describe the bug
The setup.py requires an empty site.cfg. When running pip download phono3py, it crashes since there's no config file.

if not os.path.exists("site.cfg"):

To Reproduce

$ pip download phono3py==2.3.0
Collecting phono3py==2.3.0
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:

Solutions

  • Remove check for an empty site.cfg
  • Provide an empty site.cfg

ImportError: symmetrize_compact_force_constants

Hello,

We have a problem with compilation latest phono3py version. We see problem import symmetrize_compact_force_constants

  File "/apps/all/phono3py/1.12.9.5-Py-2.7/bin/phono3py", line 4, in <module>
    __import__('pkg_resources').run_script('phono3py==1.12.9.5', 'phono3py')
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 750, in run_script
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1534, in run_script
  File "/apps/all/phono3py/1.12.9.5-Py-2.7/lib/python2.7/site-packages/phono3py-1.12.9.5-py2.7-linux-x86_64.egg/EGG-INFO/scripts/phono3py", line 49, in <module>
    
  File "build/bdist.linux-x86_64/egg/phono3py/phonon3/__init__.py", line 6, in <module>
ImportError: cannot import name symmetrize_compact_force_constants
Traceback (most recent call last):
  File "/apps/all/phono3py/1.12.9.5-Py-2.7/bin/phono3py", line 4, in <module>
    __import__('pkg_resources').run_script('phono3py==1.12.9.5', 'phono3py')
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 750, in run_script
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1534, in run_script
  File "/apps/all/phono3py/1.12.9.5-Py-2.7/lib/python2.7/site-packages/phono3py-1.12.9.5-py2.7-linux-x86_64.egg/EGG-INFO/scripts/phono3py", line 49, in <module>
    
  File "build/bdist.linux-x86_64/egg/phono3py/phonon3/__init__.py", line 6, in <module>
ImportError: cannot import name symmetrize_compact_force_constants
Traceback (most recent call last):
  File "/apps/all/phono3py/1.12.9.5-Py-2.7/bin/phono3py", line 4, in <module>
    __import__('pkg_resources').run_script('phono3py==1.12.9.5', 'phono3py')
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 750, in run_script
  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1534, in run_script
  File "/apps/all/phono3py/1.12.9.5-Py-2.7/lib/python2.7/site-packages/phono3py-1.12.9.5-py2.7-linux-x86_64.egg/EGG-INFO/scripts/phono3py", line 49, in <module>
    
  File "build/bdist.linux-x86_64/egg/phono3py/phonon3/__init__.py", line 6, in <module>
ImportError: cannot import name symmetrize_compact_force_constants

Compile with

  • OpenBLAS/0.2.9
  • numpy/1.14.2
  • h5py/2.7.1
  • matplotlib/2.1.1
  • PyYAML/3.12
  • GCC/6.3.0
  • Python/2.7

Any ideas?

Importing fc3 using the Python API

Dear developers,
I have already obtained second and third order force constants by using another numerical tool. I would like to import them in phono3py to compute self-energy and the phonon lifetimes, however, indeed, they are in a file-format that does not match the phono3py.
I would like to write a conversion script.
As far as I understood, phono3py is able to load the third order force constant matrix in several data types, but I have not found a specific documentation on how they should be written.
In particular, I loaded the fc3 in python numpy array (shape = (3nat_sc, 3nat_sc, 3*nat_sc), nat_sc = number of atoms in the supercell), and similarly the fc2
I tried to look a bit into the code and saw the function "write_fc3_to_hdf5" (file_IO.py) but in the docstring it says it requires a numpy array of shape: (n_satom,n_satom,3,3). This seems to me a 2-rank tensor.

How can I convert my python 2rank and 3rank tensors into a file that can be read by phono3py?
What unit is used for the force constant matrices in phono3py?

Thank you for the attention!
Bests

Another problem with pypy conda package

We have a problem with conda-forge pypy build (conda-forge/phono3py-feedstock#9). The version 1.20.0 depends on phonopy 2.7 (<2.8). There is only 2.8.1 for pypy.
How strong is this dependence? Meybe we can broaden it to include higher versions or maybe release a new version synced with new phonopy? Otherwise I will abandon the pypy build for now.

Phono3py Installation Problems

Dear Prof. Atztogo,

I installed the latest version of phonopy and phono3py codes through miniconda process. The installed phonopy 2.5 is good for work, however the phono3py shows the following errors when testing by the examples. Since I am a fresh installer, I have no idea about the problems, can I find the solusion here? Thanks in advance.

The error information:
(phono3py) [axd564@login ~]$ phono3py -d --dim="2 2 1" -c POSCAR-unitcell
_ _____
_ __ | |__ ___ _ __ | / _ __ _ _
| '_ | '_ \ / _ | '_ \ / _ \ |_ | '_ | | | |
| |) | | | | () | | | | () |__) | |) | || |
| .__/|
| ||___/|| ||___//| .__/ _, |
|
| |
| |___/
1.18.2

Python version 3.7.6
Spglib version 1.14.1
Traceback (most recent call last):
File "/home/564/axd564/miniconda/bin/phono3py", line 4, in
import('pkg_resources').run_script('phono3py==1.18.2.post1', 'phono3py')
File "/home/564/axd564/miniconda/lib/python3.7/site-packages/pkg_resources/init.py", line 667, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/home/564/axd564/miniconda/lib/python3.7/site-packages/pkg_resources/init.py", line 1463, in run_script
exec(code, namespace, namespace)
File "/home/564/axd564/.local/lib/python3.7/site-packages/phono3py-1.18.2.post1-py3.7-linux-x86_64.egg/EGG-INFO/scripts/phono3py", line 389, in
interface_mode=get_interface_mode(args),
File "/home/564/axd564/miniconda/lib/python3.7/site-packages/phonopy/interface/calculator.py", line 88, in get_interface_mode
if mode in args_dict and args_dict[mode]:
TypeError: 'Namespace' object is not subscriptable

btw, I changed the installation path for pip isntall -e ., because I have no access to operate the default folder. Is that the reason for such problem? Phonopy is installed with the same process, it works well.

Best regards

Cheng

How to test --sigma and --sigma-cutoff

Dear Prof. Atztogo,

If I want to use the smearing method for BZ integration, how should I test --sigma and --sigma-cutoff parameters? I tried --sigma=0.1 0.001 0.00001 and --sigma-cutoff=0 20 50 80 (0 means no --sigma-cutoff) to calculate the lattice thermal conductivity of graphene. However, the results are very different from the published paper. So, do you have some suggestions for testing these two parameters?

Thank you very much!

Best,
Pan

Mistakes in the doc of hdf5 files

On the webpage about hdf5 files (How to read the results stored in hdf5 files), the physical unit of group velocity seems to be given wrong. And the unit "THz" here ought to be angular instead of ordinal. The same is true for gv_by_gv.

I used phono3py for graphene recently and found that I have to regard the group_velocity as angular to get the correct sound speed, just as below in python code:

sqrt(group_velocity[5,1,:]**2.sum())   
# [5,1,:] ensures the point is near Gamma point(151*151 q-mesh) and in TA branch
# the code above gives 137.17 (THz*Ang), close to the value 12.9 km/s from current \
# research (https://doi.org/10.1016/j.carbon.2019.04.006) only if we consider it angular

Besides, I can deduce the kappa_unit_conversion correctly only when I regard the THz in gv_by_gv angular. So I guess the instructions on the web page may be wrong. Or if it is my mistake, I hope you can point it out.

"disp_fc3.yaml" was not found.

Describe the bug
when i want to create FORCE_SETS from FORCES_FC3 and phono3py_disp.yaml, i get "disp_fc3.yaml" was not found..

To Reproduce

(phono3py) [home]$ phono3py --cfs
        _                      _____
  _ __ | |__   ___  _ __   ___|___ / _ __  _   _
 | '_ \| '_ \ / _ \| '_ \ / _ \ |_ \| '_ \| | | |
 | |_) | | | | (_) | | | | (_) |__) | |_) | |_| |
 | .__/|_| |_|\___/|_| |_|\___/____/| .__/ \__, |
 |_|                                |_|    |___/ 
                                       2.3.0

Python version 3.9.12
Spglib version 1.16.1

"disp_fc3.yaml" was not found.
  ___ _ __ _ __ ___  _ __
 / _ \ '__| '__/ _ \| '__|
|  __/ |  | | | (_) | |
 \___|_|  |_|  \___/|_|

the FORCES_FC3 and phono3py_disp.yaml is in the current directory

phonon lifetime

Dear professor Togo:
The phonon lifetime equals 1/(2X2XPIXgamma) at some temperature in some grid point, such as 300 K and L point at the website http://atztogo.github.io/phono3py/hdf5_howto.html, but in "Distributions of phonon lifetimes in Brillouin zones" paper the gamma(imaginary part of the self-energy) corresponds the formula (11) with omega and phonon ocuupation number two parameters at least. I wonder where does the first mentioned gamma come from. Does the gamma was integrated with respect to omega and phonon occupation number at temperature 300 K? I'm not sure that. Could you give me more details, such as a formula? Thank you so much.
Best wishes!

Question about Phono3py

Dear professor,

Thanks for developing phono3py for science research. As a freshman, i have some questions. In order to avoid disturbing you much time, let me give a brief description.

Firstly, what is the difference between group velocity and gv_by_gv in hdf5 file? I notice they are not the same.

Secondly, how can i get group velocity from phono3py? I tried to use "phono3py-kaccum --pa="0 1/2 1/2 1/2 0 1/2 1/2 1/2 0" -c POSCAR-unitcell kappa-m111111.hdf5 --gv --average |tee kaccum.dat". Is it possible to adjust the X-axis range?

Thanks for showing some lights for me. ^.^

Bests,

Error arises when creating fc2.hdf/fc3.hdf and calculating thermal conductivity

Dear Atz Togo,

I tried the example Si-PBE and I obtained the FORCES_FC3 file successfully. However, when trying to create fc2.hdf and fc3.hdf I got some errors which are shown below.

[chenrf@mic vasprun_xmls]$ phono3py --dim="2 2 2" -c POSCAR-unitcell
/db/home/chenrf/.local/lib/python2.7/site-packages/h5py-2.7.1-py2.7-linux-x86_64.egg/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from .conv import register_converters as register_converters
_ _____
_ __ | |
___ _ __ | / _ __ _ _
| '_ | '_ \ / _ | '_ \ / _ \ |_ | '_ | | | |
| |) | | | | () | | | | () |__) | |) | || |
| .__/|
| ||___/|| ||___//| .__/ _, |
|
| |
| |___/
1.12.9

Spacegroup: Fd-3m (227)
------------------------------ primitive cell ------------------------------
Lattice vectors:
a 5.466262890000000 0.000000000000000 0.000000000000000
b 0.000000000000000 5.466262890000000 0.000000000000000
c 0.000000000000000 0.000000000000000 5.466262890000000
Atomic positions (fractional):
1 Si 0.87500000000000 0.87500000000000 0.87500000000000 28.085
2 Si 0.87500000000000 0.37500000000000 0.37500000000000 28.085
3 Si 0.37500000000000 0.87500000000000 0.37500000000000 28.085
4 Si 0.37500000000000 0.37500000000000 0.87500000000000 28.085
5 Si 0.12500000000000 0.12500000000000 0.12500000000000 28.085
6 Si 0.12500000000000 0.62500000000000 0.62500000000000 28.085
7 Si 0.62500000000000 0.12500000000000 0.62500000000000 28.085
8 Si 0.62500000000000 0.62500000000000 0.12500000000000 28.085
-------------------------------- super cell --------------------------------
Lattice vectors:
a 10.932525780000001 0.000000000000000 0.000000000000000
b 0.000000000000000 10.932525780000001 0.000000000000000
c 0.000000000000000 0.000000000000000 10.932525780000001
Atomic positions (fractional):
1 Si 0.43750000000000 0.43750000000000 0.43750000000000 28.085 > 1
2 Si 0.93750000000000 0.43750000000000 0.43750000000000 28.085 > 1
3 Si 0.43750000000000 0.93750000000000 0.43750000000000 28.085 > 1
4 Si 0.93750000000000 0.93750000000000 0.43750000000000 28.085 > 1
5 Si 0.43750000000000 0.43750000000000 0.93750000000000 28.085 > 1
6 Si 0.93750000000000 0.43750000000000 0.93750000000000 28.085 > 1
7 Si 0.43750000000000 0.93750000000000 0.93750000000000 28.085 > 1
8 Si 0.93750000000000 0.93750000000000 0.93750000000000 28.085 > 1
9 Si 0.43750000000000 0.18750000000000 0.18750000000000 28.085 > 9
10 Si 0.93750000000000 0.18750000000000 0.18750000000000 28.085 > 9
11 Si 0.43750000000000 0.68750000000000 0.18750000000000 28.085 > 9
12 Si 0.93750000000000 0.68750000000000 0.18750000000000 28.085 > 9
13 Si 0.43750000000000 0.18750000000000 0.68750000000000 28.085 > 9
14 Si 0.93750000000000 0.18750000000000 0.68750000000000 28.085 > 9
15 Si 0.43750000000000 0.68750000000000 0.68750000000000 28.085 > 9
16 Si 0.93750000000000 0.68750000000000 0.68750000000000 28.085 > 9
17 Si 0.18750000000000 0.43750000000000 0.18750000000000 28.085 > 17
18 Si 0.68750000000000 0.43750000000000 0.18750000000000 28.085 > 17
19 Si 0.18750000000000 0.93750000000000 0.18750000000000 28.085 > 17
20 Si 0.68750000000000 0.93750000000000 0.18750000000000 28.085 > 17
21 Si 0.18750000000000 0.43750000000000 0.68750000000000 28.085 > 17
22 Si 0.68750000000000 0.43750000000000 0.68750000000000 28.085 > 17
23 Si 0.18750000000000 0.93750000000000 0.68750000000000 28.085 > 17
24 Si 0.68750000000000 0.93750000000000 0.68750000000000 28.085 > 17
25 Si 0.18750000000000 0.18750000000000 0.43750000000000 28.085 > 25
26 Si 0.68750000000000 0.18750000000000 0.43750000000000 28.085 > 25
27 Si 0.18750000000000 0.68750000000000 0.43750000000000 28.085 > 25
28 Si 0.68750000000000 0.68750000000000 0.43750000000000 28.085 > 25
29 Si 0.18750000000000 0.18750000000000 0.93750000000000 28.085 > 25
30 Si 0.68750000000000 0.18750000000000 0.93750000000000 28.085 > 25
31 Si 0.18750000000000 0.68750000000000 0.93750000000000 28.085 > 25
32 Si 0.68750000000000 0.68750000000000 0.93750000000000 28.085 > 25
33 Si 0.06250000000000 0.06250000000000 0.06250000000000 28.085 > 33
34 Si 0.56250000000000 0.06250000000000 0.06250000000000 28.085 > 33
35 Si 0.06250000000000 0.56250000000000 0.06250000000000 28.085 > 33
36 Si 0.56250000000000 0.56250000000000 0.06250000000000 28.085 > 33
37 Si 0.06250000000000 0.06250000000000 0.56250000000000 28.085 > 33
38 Si 0.56250000000000 0.06250000000000 0.56250000000000 28.085 > 33
39 Si 0.06250000000000 0.56250000000000 0.56250000000000 28.085 > 33
40 Si 0.56250000000000 0.56250000000000 0.56250000000000 28.085 > 33
41 Si 0.06250000000000 0.31250000000000 0.31250000000000 28.085 > 41
42 Si 0.56250000000000 0.31250000000000 0.31250000000000 28.085 > 41
43 Si 0.06250000000000 0.81250000000000 0.31250000000000 28.085 > 41
44 Si 0.56250000000000 0.81250000000000 0.31250000000000 28.085 > 41
45 Si 0.06250000000000 0.31250000000000 0.81250000000000 28.085 > 41
46 Si 0.56250000000000 0.31250000000000 0.81250000000000 28.085 > 41
47 Si 0.06250000000000 0.81250000000000 0.81250000000000 28.085 > 41
48 Si 0.56250000000000 0.81250000000000 0.81250000000000 28.085 > 41
49 Si 0.31250000000000 0.06250000000000 0.31250000000000 28.085 > 49
50 Si 0.81250000000000 0.06250000000000 0.31250000000000 28.085 > 49
51 Si 0.31250000000000 0.56250000000000 0.31250000000000 28.085 > 49
52 Si 0.81250000000000 0.56250000000000 0.31250000000000 28.085 > 49
53 Si 0.31250000000000 0.06250000000000 0.81250000000000 28.085 > 49
54 Si 0.81250000000000 0.06250000000000 0.81250000000000 28.085 > 49
55 Si 0.31250000000000 0.56250000000000 0.81250000000000 28.085 > 49
56 Si 0.81250000000000 0.56250000000000 0.81250000000000 28.085 > 49
57 Si 0.31250000000000 0.31250000000000 0.06250000000000 28.085 > 57
58 Si 0.81250000000000 0.31250000000000 0.06250000000000 28.085 > 57
59 Si 0.31250000000000 0.81250000000000 0.06250000000000 28.085 > 57
60 Si 0.81250000000000 0.81250000000000 0.06250000000000 28.085 > 57
61 Si 0.31250000000000 0.31250000000000 0.56250000000000 28.085 > 57
62 Si 0.81250000000000 0.31250000000000 0.56250000000000 28.085 > 57
63 Si 0.31250000000000 0.81250000000000 0.56250000000000 28.085 > 57
64 Si 0.81250000000000 0.81250000000000 0.56250000000000 28.085 > 57
------------------- ratio (supercell for fc)/(primitive) -------------------
2.00 0.00 0.00
0.00 2.00 0.00
0.00 0.00 2.00
----------------------------- Force constants ------------------------------
Imposing translational and index exchange symmetry to fc2: False
Imposing translational and index exchange symmetry to fc3: False
Imposing symmetry of index exchange to fc3 in reciprocal space: False
Displacement dataset is read from disp_fc3.yaml.
Sets of supercell forces are read from FORCES_FC3.
Traceback (most recent call last):
File "/db/home/chenrf/.local/bin/phono3py", line 4, in
import('pkg_resources').run_script('phono3py==1.12.9.22', 'phono3py')
File "build/bdist.linux-x86_64/egg/pkg_resources/init.py", line 765, in run_script
File "build/bdist.linux-x86_64/egg/pkg_resources/init.py", line 1552, in run_script
File "/db/home/chenrf/.local/lib/python2.7/site-packages/phono3py-1.12.9.22-py2.7-linux-x86_64.egg/EGG-INFO/scripts/phono3py", line 527, in

File "build/bdist.linux-x86_64/egg/phono3py/cui/create_force_constants.py", line 122, in create_phono3py_force_constants
File "build/bdist.linux-x86_64/egg/phono3py/cui/create_force_constants.py", line 273, in _create_phono3py_fc3
File "build/bdist.linux-x86_64/egg/phono3py/phonon3/init.py", line 278, in produce_fc3
File "build/bdist.linux-x86_64/egg/phono3py/phonon3/init.py", line 743, in _get_fc3
File "build/bdist.linux-x86_64/egg/phono3py/phonon3/fc3.py", line 28, in get_fc3
File "build/bdist.linux-x86_64/egg/phono3py/phonon3/fc3.py", line 470, in _get_fc3_least_atoms
File "build/bdist.linux-x86_64/egg/phono3py/phonon3/fc3.py", line 503, in _get_fc3_one_atom
File "build/bdist.linux-x86_64/egg/phono3py/phonon3/fc3.py", line 234, in get_delta_fc2
File "build/bdist.linux-x86_64/egg/phono3py/phonon3/fc3.py", line 291, in get_constrained_fc2
TypeError: distribute_force_constants() takes exactly 6 arguments (8 given)

Also, when I tried to do thermal conductivity calculation an error occurs:

[chenrf@mic vasprun_xmls]$ phono3py --fc3 --fc2 --dim="2 2 2" --mesh="11 11 11" -c POSCAR-unitcell --br
/db/home/chenrf/.local/lib/python2.7/site-packages/h5py-2.7.1-py2.7-linux-x86_64.egg/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from .conv import register_converters as register_converters
_ _____
_ __ | |
___ _ __ | / _ __ _ _
| '_ | '_ \ / _ | '_ \ / _ \ |_ | '_ | | | |
| |) | | | | () | | | | () |__) | |) | || |
| .__/|
| ||___/|| ||___//| .__/ _, |
|
| |
| |___/
1.12.9

Run mode: conductivity-RTA
Spacegroup: Fd-3m (227)
------------------------------ primitive cell ------------------------------
Lattice vectors:
a 5.466262890000000 0.000000000000000 0.000000000000000
b 0.000000000000000 5.466262890000000 0.000000000000000
c 0.000000000000000 0.000000000000000 5.466262890000000
Atomic positions (fractional):
1 Si 0.87500000000000 0.87500000000000 0.87500000000000 28.085
2 Si 0.87500000000000 0.37500000000000 0.37500000000000 28.085
3 Si 0.37500000000000 0.87500000000000 0.37500000000000 28.085
4 Si 0.37500000000000 0.37500000000000 0.87500000000000 28.085
5 Si 0.12500000000000 0.12500000000000 0.12500000000000 28.085
6 Si 0.12500000000000 0.62500000000000 0.62500000000000 28.085
7 Si 0.62500000000000 0.12500000000000 0.62500000000000 28.085
8 Si 0.62500000000000 0.62500000000000 0.12500000000000 28.085
-------------------------------- super cell --------------------------------
Lattice vectors:
a 10.932525780000001 0.000000000000000 0.000000000000000
b 0.000000000000000 10.932525780000001 0.000000000000000
c 0.000000000000000 0.000000000000000 10.932525780000001
Atomic positions (fractional):
1 Si 0.43750000000000 0.43750000000000 0.43750000000000 28.085 > 1
2 Si 0.93750000000000 0.43750000000000 0.43750000000000 28.085 > 1
3 Si 0.43750000000000 0.93750000000000 0.43750000000000 28.085 > 1
4 Si 0.93750000000000 0.93750000000000 0.43750000000000 28.085 > 1
5 Si 0.43750000000000 0.43750000000000 0.93750000000000 28.085 > 1
6 Si 0.93750000000000 0.43750000000000 0.93750000000000 28.085 > 1
7 Si 0.43750000000000 0.93750000000000 0.93750000000000 28.085 > 1
8 Si 0.93750000000000 0.93750000000000 0.93750000000000 28.085 > 1
9 Si 0.43750000000000 0.18750000000000 0.18750000000000 28.085 > 9
10 Si 0.93750000000000 0.18750000000000 0.18750000000000 28.085 > 9
11 Si 0.43750000000000 0.68750000000000 0.18750000000000 28.085 > 9
12 Si 0.93750000000000 0.68750000000000 0.18750000000000 28.085 > 9
13 Si 0.43750000000000 0.18750000000000 0.68750000000000 28.085 > 9
14 Si 0.93750000000000 0.18750000000000 0.68750000000000 28.085 > 9
15 Si 0.43750000000000 0.68750000000000 0.68750000000000 28.085 > 9
16 Si 0.93750000000000 0.68750000000000 0.68750000000000 28.085 > 9
17 Si 0.18750000000000 0.43750000000000 0.18750000000000 28.085 > 17
18 Si 0.68750000000000 0.43750000000000 0.18750000000000 28.085 > 17
19 Si 0.18750000000000 0.93750000000000 0.18750000000000 28.085 > 17
20 Si 0.68750000000000 0.93750000000000 0.18750000000000 28.085 > 17
21 Si 0.18750000000000 0.43750000000000 0.68750000000000 28.085 > 17
22 Si 0.68750000000000 0.43750000000000 0.68750000000000 28.085 > 17
23 Si 0.18750000000000 0.93750000000000 0.68750000000000 28.085 > 17
24 Si 0.68750000000000 0.93750000000000 0.68750000000000 28.085 > 17
25 Si 0.18750000000000 0.18750000000000 0.43750000000000 28.085 > 25
26 Si 0.68750000000000 0.18750000000000 0.43750000000000 28.085 > 25
27 Si 0.18750000000000 0.68750000000000 0.43750000000000 28.085 > 25
28 Si 0.68750000000000 0.68750000000000 0.43750000000000 28.085 > 25
29 Si 0.18750000000000 0.18750000000000 0.93750000000000 28.085 > 25
30 Si 0.68750000000000 0.18750000000000 0.93750000000000 28.085 > 25
31 Si 0.18750000000000 0.68750000000000 0.93750000000000 28.085 > 25
32 Si 0.68750000000000 0.68750000000000 0.93750000000000 28.085 > 25
33 Si 0.06250000000000 0.06250000000000 0.06250000000000 28.085 > 33
34 Si 0.56250000000000 0.06250000000000 0.06250000000000 28.085 > 33
35 Si 0.06250000000000 0.56250000000000 0.06250000000000 28.085 > 33
36 Si 0.56250000000000 0.56250000000000 0.06250000000000 28.085 > 33
37 Si 0.06250000000000 0.06250000000000 0.56250000000000 28.085 > 33
38 Si 0.56250000000000 0.06250000000000 0.56250000000000 28.085 > 33
39 Si 0.06250000000000 0.56250000000000 0.56250000000000 28.085 > 33
40 Si 0.56250000000000 0.56250000000000 0.56250000000000 28.085 > 33
41 Si 0.06250000000000 0.31250000000000 0.31250000000000 28.085 > 41
42 Si 0.56250000000000 0.31250000000000 0.31250000000000 28.085 > 41
43 Si 0.06250000000000 0.81250000000000 0.31250000000000 28.085 > 41
44 Si 0.56250000000000 0.81250000000000 0.31250000000000 28.085 > 41
45 Si 0.06250000000000 0.31250000000000 0.81250000000000 28.085 > 41
46 Si 0.56250000000000 0.31250000000000 0.81250000000000 28.085 > 41
47 Si 0.06250000000000 0.81250000000000 0.81250000000000 28.085 > 41
48 Si 0.56250000000000 0.81250000000000 0.81250000000000 28.085 > 41
49 Si 0.31250000000000 0.06250000000000 0.31250000000000 28.085 > 49
50 Si 0.81250000000000 0.06250000000000 0.31250000000000 28.085 > 49
51 Si 0.31250000000000 0.56250000000000 0.31250000000000 28.085 > 49
52 Si 0.81250000000000 0.56250000000000 0.31250000000000 28.085 > 49
53 Si 0.31250000000000 0.06250000000000 0.81250000000000 28.085 > 49
54 Si 0.81250000000000 0.06250000000000 0.81250000000000 28.085 > 49
55 Si 0.31250000000000 0.56250000000000 0.81250000000000 28.085 > 49
56 Si 0.81250000000000 0.56250000000000 0.81250000000000 28.085 > 49
57 Si 0.31250000000000 0.31250000000000 0.06250000000000 28.085 > 57
58 Si 0.81250000000000 0.31250000000000 0.06250000000000 28.085 > 57
59 Si 0.31250000000000 0.81250000000000 0.06250000000000 28.085 > 57
60 Si 0.81250000000000 0.81250000000000 0.06250000000000 28.085 > 57
61 Si 0.31250000000000 0.31250000000000 0.56250000000000 28.085 > 57
62 Si 0.81250000000000 0.31250000000000 0.56250000000000 28.085 > 57
63 Si 0.31250000000000 0.81250000000000 0.56250000000000 28.085 > 57
64 Si 0.81250000000000 0.81250000000000 0.56250000000000 28.085 > 57
------------------- ratio (supercell for fc)/(primitive) -------------------
2.00 0.00 0.00
0.00 2.00 0.00
0.00 0.00 2.00
----------------------------- Force constants ------------------------------
Imposing translational and index exchange symmetry to fc2: False
Imposing translational and index exchange symmetry to fc3: False
Imposing symmetry of index exchange to fc3 in reciprocal space: False
fc3.hdf5 not found.


/ _ \ '| '/ _ | '|
| / | | | | (_) | |
_|| || _
/|_|

It seems that these errors have something to do with python. However, I searched online but found no answer. Any suggestion or hints to deal with these errors would be appreciated.

Thanks,
Chen Ruofan

can not obtain the fc3 in the phono3py

Dear Professor Togo,
When I obtain fc3, I find that there is an error "Number of files to be read don't match to number of displacements in disp_fc3.yaml". But when I count the number of vasprun.xml , I find it can be matched. How can I solve this problem?

Sincerely
Justus liang

create too many displacements

Dear Professor Togo,

I am using Phono3py to calculate thermal conductivity with pwscf interface.

in my case, there is 40 atoms in my material.in file. however, when I use command:
$ phono3py --pwscf -d --dim="1 1 1" -c chg_gao.in
I got Numbers of displacements :28920
I think it is hard to compute every supercell "scf" calculation.

Could you please tell me how to reduce this supercell number? or is there something wrong with my commad?

I am looking forward to your reply.

thanks

Zichang

How to calculate three-phonon scattering phase space in Phono3py ?

The description of phase space for three-phonon processes are given in reference [J. Phys.: Condens. Matter 20 (2008) 165209] by L Lindsay et. al.,which could decide the number (space) of phonon scattering processes.

The calculation of phase space has already been implemented in ShengBTE package. I want to know that if three-phonon scattering phase space calculation can be performed in Phono3py package, and how ?
Thanks !

Can we calculate a band index contributing to intrinsic thermal conductivities at phono3py code?

Dear Togo,
I'm your follower and a graduate. But I have a question puzzling me so long. It is whether we calculate a band index contributing to intrinsic thermal conductivities in phono3py code. Just like at Lindsay, L.; Broido, D. A.; Reinecke, T. L., First-principles determination of ultrahigh thermal conductivity of boron arsenide: a competitor for diamond? Phys Rev Lett 2013, 111 (2), 025901. this article Fig. 3, in which the formula is ref[36] k(v)=1/V.... Excause me, I did not write it out in here. Please read the article Fig. 3 and ref[36](just a formula). How can do it in detail? If it do not, can you give me some adives to solve the problem? Thank you so much! Look forward to your reply! Best wishes!
Your Follower: Nileme

calculation of gruneisen parameters seems to be broken

Dear Prof. Togo,

I am using phonopy2.5.0 and phono3py1.18.3 to compute gruneisen parameter within phono3py.

% phono3py --fc2 --fc3 --dim="4 4 3" --mesh="11 11 11" --gruneisen -c POSCAR

The calculation however fails with the following error:

Supercells used for fc2 and fc3 have to be same.

This is strange because both 2nd and 3rd order force constants are calculated with same size supercell (4x4x3).

I even tested the development branch, and that also fails with same error.

Any hints/guidance will be helpful..

Best,
Alex

Several bugs in the latest version.

I installed the latest version of the package using conda (i.e. conda install -c atztogo phono3py), and got the following:

Traceback (most recent call last):
  File "$HOME/miniconda2/bin/phono3py", line 4, in <module>
    __import__('pkg_resources').run_script('phono3py==1.17.0.post1', 'phono3py')
  File "$HOME/miniconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "$HOME/miniconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1469, in run_script
    exec(script_code, namespace, namespace)
  File "$HOME/miniconda2/lib/python2.7/site-packages/phono3py-1.17.0.post1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/phono3py", line 43, in <module>

ImportError: cannot import name get_force_sets

I modified the scripts/phono3py file and run the thermal conductivity calculation, and it ended up with this error

Traceback (most recent call last):
  File "$HOME/miniconda2/bin/phono3py", line 4, in <module>
    __import__('pkg_resources').run_script('phono3py==1.17.0.post1', 'phono3py')
  File "$HOME/miniconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "$HOME/miniconda2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1469, in run_script
    exec(script_code, namespace, namespace)
  File "$HOME/miniconda2/lib/python2.7/site-packages/phono3py-1.17.0.post1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/phono3py", line 960, in <module>

  File "$HOME/miniconda2/lib/python2.7/site-packages/phono3py-1.17.0.post1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/phono3py", line 84, in finalize_phono3py

  File "build/bdist.linux-x86_64/egg/phono3py/cui/phono3py_yaml.py", line 81, in set_phonon_info
  File "build/bdist.linux-x86_64/egg/phonopy/interface/phonopy_yaml.py", line 118, in set_phonon_info
AttributeError: 'Phono3py' object has no attribute 'force_constants'

Please check, thank you very much.

phonopy and phono3py find different number of phonon displacements

Check the develop branch
phonopy 210509ab99, phono3py 19fc8c7, both should be latest develop branch

Describe the bug
different numbers of phonon displacement configurations are found by phonopy and phono3py

To Reproduce
run

python << EOF
import phonopy
import phono3py

cell = [[5.9479774024925023,    0.0000000000000000,    0.0000000000000000],
        [0.0000000000000000,    5.9479774024925023,    0.0000000000000000],
        [0.0000000000000000,    0.0000000000000000,    5.9479774024925023]]

nums = [55,82,35,35,35]
pos = [[2.9739887012462511,  2.9739887012462511,  2.9739887012462511],
       [0.0000000000000000,  0.0000000000000000,  0.0000000000000000],
       [2.9739887012462511,  0.0000000000000000,  0.0000000000000000],
       [0.0000000000000000,  2.9739887012462511,  0.0000000000000000],
       [0.0000000000000000,  0.0000000000000000,  2.9739887012462511]]

at_ph = phonopy.structure.atoms.PhonopyAtoms(numbers=nums, positions=pos, cell=cell)

ph2 = phonopy.Phonopy(at_ph, supercell_matrix=[2,2,2])
ph2.generate_displacements(distance=0.1)
print("number of phonon displacements found by phonopy", len(ph2.supercells_with_displacements))

ph3 = phono3py.Phono3py(at_ph, supercell_matrix=[2,2,2], phonon_supercell_matrix=[2,2,2])
ph3.generate_displacements(distance=0.1, cutoff_pair_distance=4.0)

print("number of phonon displacements found by phono3py", len(ph3.phonon_supercells_with_displacements))
EOF

I get

number of phonon displacements found by phonopy 3
number of phonon displacements found by phono3py 4

and I expected to get the same number from both codes.

slow speed in generating displacements

I am not really sure this is a bug or not.

I try to generate displacements in a relatively big cells 100-400 atoms, one must assume no symmetry.
I noticed it takes really long, even if I specify --cutoff-pair --cutoff-fc3

I did not do a systematic measuring of time but seems using cutoffs does not affect generation time but only the number of displacements.
Am I wrong?

simulating antiferromagetic structure in phono3py

Dear developers,

I am currently studying different magnetic orderings of a Cr-based material. To model AFM ground state, I use a fake chemical species to differentiate between Cr spin up and spin down atoms. This is needed for phonopy/phono3py to detect the low symmetry of the AFM phase due to constraint on spin. For force calculations I am using proper magmom tags to enforce AFM ordering.

I have two questions on this:

  1. Is this a reasonable approximation for getting IFCs of AFM materials.
  2. I guess the symmetry will also affect the q-points used in lattice thermal conductivity in phonop3py. Should I do same trick will phono3py. I was thinking of supplying mass and mass-variances manually to account for fake elements in the structure.

Your thoughts/suggestion on this will be helpful.

PS> I know that we can pass magmom tag in phonopy to set the magnetic ordering for displaced super-cells. Is this possible in phono3py also?

Best,
Alex

Converting between Phono3py and ShengBTE

Dear Professor Togo,

Have you ever considered writing an interface between Phono3py and other software like ShengBTE? I prefer Phono3py's format, however, if I am not mistaken, Phono3py can only implement the RTA approach (as opposed to a full iterative approach in ShengBTE), which provides some difficulties for researchers of high thermal conductivity materials.

Thanks,
Charles Shi

ImportError of LAPACKE_zheev in starting phono3py

Check the develop branch
The latest phonopy and phono3py

Describe the bug
Whenever I start phono3py it occurs
Traceback (most recent call last): File "/home/kawaiinahida/.local/bin/phono3py", line 45, in <module> main(**argparse_control) File "/home/kawaiinahida/phono3py/phono3py/cui/phono3py_script.py", line 837, in main args, log_level = start_phono3py(**argparse_control) File "/home/kawaiinahida/phono3py/phono3py/cui/phono3py_script.py", line 225, in start_phono3py import phono3py._phono3py as phono3c ImportError: /home/kawaiinahida/phono3py/phono3py/_phono3py.cpython-310-x86_64-linux-gnu.so: undefined symbol: LAPACKE_zheev

To Reproduce
Steps to reproduce the behavior:
Python 3.10, WSL2 Ubuntu 22.02
I installed from source code refering to the instructions. LAPACKE is installed through
sudo apt-get install liblapack-dev liblapacke-dev
And phono3py is installed using
pip install -e . -vvv
I don't know whether LAPACKE is incorrectly imported. Phonopy works fine.

Install phono3py on Mac with Intel ICC and MKL

Dear Professor Togo,

I'm confused on MULTITHREADED_BLAS C macro after reading the installation instruction on phono3py website and your comment in setup.py. Does setting MULTITHREADED_BLAS in setup.py turn on or off multithreading for inner loop calls of BLAS? My current understanding is the following setting in setup.py turns on multithread BLAS (I'm using MKL)? Is that right? Thank you.

`
if os.path.isfile("mkl.py"):
# This supposes that MKL multithread BLAS is used.
# This is invoked when mkl.py exists on the current directory.

print("MKL LAPACKE is to be used.")
print("Use of icc is assumed (CC='icc').")

from mkl import mkl_extra_link_args_lapacke, mkl_include_dirs_lapacke

extra_link_args_lapacke += mkl_extra_link_args_lapacke
include_dirs_lapacke += mkl_include_dirs_lapacke

if use_setuptools:
    extra_compile_args += ['-DMKL_LAPACKE',
                           '-DMULTITHREADED_BLAS']
else:
    define_macros += [('MKL_LAPACKE', None),
                      ('MULTITHREADED_BLAS', None)]

`
Best regards,
Wei

phono3py-kaccum error importing grid methods

System info

Running phonopy 2.10.0 and phono3py 1.22.3 on Arch Linux.

Bug

The phono3py-kaccum script doesn't seem to work in the last versions of phono3py. As far as I can tell it still tries to import some grid-related methods from triplets.py that have been moved to another python module. Simply importing them from grid.py does not solve the problem.

Traceback (most recent call last):
  File "/usr/bin/phono3py-kaccum", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/home/user/phono3py/scripts/phono3py-kaccum", line 8, in <module>
    from phono3py.phonon3.triplets import (get_ir_grid_points,
ImportError: cannot import name 'get_ir_grid_points' from 'phono3py.phonon3.triplets' (/home/user/phono3py/phono3py/phonon3/triplets.py)

To Reproduce

Running phono3py-kaccum at the end of the Si-PBEsol example (or I guess with any input files).

I apologize if this issue is not relevant anymore. If so, is there a newer way to extract the cumulative thermal conductivity?
Thank you in advance.

magetic structure in phono3py

Dear Togo Sensei,

This is more of query not an issue with phono3py. I was wondering if it possible to include symmetry breaking due to non-zero magnetic moments while creating displacements in phono3py. The crystal i am investigating in AFM type, and at least within phonopy I see that inducing magnetic lowers the overall symmetry of the cell.

Thanks
Alex

PS. Sorry about posting this here. I am having trouble with my email.

working phono3py raises error: Symbol not found: __gfortran_concat_string

Dear Atz Togo,

I installed phono3py successfully and tried the example/Si-PBE (in the exaples folder). I obtained the FORCES_FC3 file also successfully. In the next step however (for the calculation of the lattice thermal conductivity) I get an error when running

phono3py --dim="2 2 2" --pa="0 1/2 1/2 1/2 0 1/2 1/2 1/2 0" -c POSCAR-unitcell --mesh="11 11 11" --fc3 --fc2 --br

(see full output at bottom of this message)

"...
ImportError: dlopen(/Users/glensk/Library/Caches/Python-Eggs/phono3py-1.11.11-py2.7-macosx-10.7-x86_64.egg-tmp/phono3py/_lapackepy.so, 2): Symbol not found: __gfortran_concat_string
Referenced from: /Users/glensk/Library/Caches/Python-Eggs/phono3py-1.11.11-py2.7-macosx-10.7-x86_64.egg-tmp/phono3py/_lapackepy.so
Expected in: flat namespace
in /Users/glensk/Library/Caches/Python-Eggs/phono3py-1.11.11-py2.7-macosx-10.7-x86_64.egg-tmp/phono3py/_lapackepy.so
"

This problem seems to be related to gfortran (?). Any help and or hints how to proceed would be appreciated.

System: OS X 10.12.4

Thanks,
Albert

Full output of the skript:
% phono3py --dim="2 2 2" --pa="0 1/2 1/2 1/2 0 1/2 1/2 1/2 0" -c POSCAR-unitcell --mesh="11 11 11" --fc3 --fc2 --br
_ _____
_ __ | |__ ___ _ __ | / _ __ _ _
| '_ | '_ \ / _ | '_ \ / _ \ |_ | '_ | | | |
| |) | | | | () | | | | () |__) | |) | || |
| .__/|
| ||___/|| ||___//| .__/ _, |
|
| |
| |___/
1.11.11

Run mode: conductivity-RTA
Spacegroup: Fd-3m (227)
------------------------------ primitive cell ------------------------------
Lattice vectors:
a 0.000000000000000 2.733131445000000 2.733131445000000
b 2.733131445000000 0.000000000000000 2.733131445000000
c 2.733131445000000 2.733131445000000 0.000000000000000
Atomic positions (fractional):
1 Si 0.87500000000000 0.87500000000000 0.87500000000000 28.085
2 Si 0.12500000000000 0.12500000000000 0.12500000000000 28.085
-------------------------------- super cell --------------------------------
Lattice vectors:
a 10.932525780000001 0.000000000000000 0.000000000000000
b 0.000000000000000 10.932525780000001 0.000000000000000
c 0.000000000000000 0.000000000000000 10.932525780000001
Atomic positions (fractional):
1 Si 0.43750000000000 0.43750000000000 0.43750000000000 28.085 > 1
2 Si 0.93750000000000 0.43750000000000 0.43750000000000 28.085 > 1
3 Si 0.43750000000000 0.93750000000000 0.43750000000000 28.085 > 1
4 Si 0.93750000000000 0.93750000000000 0.43750000000000 28.085 > 1
5 Si 0.43750000000000 0.43750000000000 0.93750000000000 28.085 > 1
6 Si 0.93750000000000 0.43750000000000 0.93750000000000 28.085 > 1
7 Si 0.43750000000000 0.93750000000000 0.93750000000000 28.085 > 1
8 Si 0.93750000000000 0.93750000000000 0.93750000000000 28.085 > 1
9 Si 0.43750000000000 0.18750000000000 0.18750000000000 28.085 > 1
10 Si 0.93750000000000 0.18750000000000 0.18750000000000 28.085 > 1
11 Si 0.43750000000000 0.68750000000000 0.18750000000000 28.085 > 1
12 Si 0.93750000000000 0.68750000000000 0.18750000000000 28.085 > 1
13 Si 0.43750000000000 0.18750000000000 0.68750000000000 28.085 > 1
14 Si 0.93750000000000 0.18750000000000 0.68750000000000 28.085 > 1
15 Si 0.43750000000000 0.68750000000000 0.68750000000000 28.085 > 1
16 Si 0.93750000000000 0.68750000000000 0.68750000000000 28.085 > 1
17 Si 0.18750000000000 0.43750000000000 0.18750000000000 28.085 > 1
18 Si 0.68750000000000 0.43750000000000 0.18750000000000 28.085 > 1
19 Si 0.18750000000000 0.93750000000000 0.18750000000000 28.085 > 1
20 Si 0.68750000000000 0.93750000000000 0.18750000000000 28.085 > 1
21 Si 0.18750000000000 0.43750000000000 0.68750000000000 28.085 > 1
22 Si 0.68750000000000 0.43750000000000 0.68750000000000 28.085 > 1
23 Si 0.18750000000000 0.93750000000000 0.68750000000000 28.085 > 1
24 Si 0.68750000000000 0.93750000000000 0.68750000000000 28.085 > 1
25 Si 0.18750000000000 0.18750000000000 0.43750000000000 28.085 > 1
26 Si 0.68750000000000 0.18750000000000 0.43750000000000 28.085 > 1
27 Si 0.18750000000000 0.68750000000000 0.43750000000000 28.085 > 1
28 Si 0.68750000000000 0.68750000000000 0.43750000000000 28.085 > 1
29 Si 0.18750000000000 0.18750000000000 0.93750000000000 28.085 > 1
30 Si 0.68750000000000 0.18750000000000 0.93750000000000 28.085 > 1
31 Si 0.18750000000000 0.68750000000000 0.93750000000000 28.085 > 1
32 Si 0.68750000000000 0.68750000000000 0.93750000000000 28.085 > 1
33 Si 0.06250000000000 0.06250000000000 0.06250000000000 28.085 > 33
34 Si 0.56250000000000 0.06250000000000 0.06250000000000 28.085 > 33
35 Si 0.06250000000000 0.56250000000000 0.06250000000000 28.085 > 33
36 Si 0.56250000000000 0.56250000000000 0.06250000000000 28.085 > 33
37 Si 0.06250000000000 0.06250000000000 0.56250000000000 28.085 > 33
38 Si 0.56250000000000 0.06250000000000 0.56250000000000 28.085 > 33
39 Si 0.06250000000000 0.56250000000000 0.56250000000000 28.085 > 33
40 Si 0.56250000000000 0.56250000000000 0.56250000000000 28.085 > 33
41 Si 0.06250000000000 0.31250000000000 0.31250000000000 28.085 > 33
42 Si 0.56250000000000 0.31250000000000 0.31250000000000 28.085 > 33
43 Si 0.06250000000000 0.81250000000000 0.31250000000000 28.085 > 33
44 Si 0.56250000000000 0.81250000000000 0.31250000000000 28.085 > 33
45 Si 0.06250000000000 0.31250000000000 0.81250000000000 28.085 > 33
46 Si 0.56250000000000 0.31250000000000 0.81250000000000 28.085 > 33
47 Si 0.06250000000000 0.81250000000000 0.81250000000000 28.085 > 33
48 Si 0.56250000000000 0.81250000000000 0.81250000000000 28.085 > 33
49 Si 0.31250000000000 0.06250000000000 0.31250000000000 28.085 > 33
50 Si 0.81250000000000 0.06250000000000 0.31250000000000 28.085 > 33
51 Si 0.31250000000000 0.56250000000000 0.31250000000000 28.085 > 33
52 Si 0.81250000000000 0.56250000000000 0.31250000000000 28.085 > 33
53 Si 0.31250000000000 0.06250000000000 0.81250000000000 28.085 > 33
54 Si 0.81250000000000 0.06250000000000 0.81250000000000 28.085 > 33
55 Si 0.31250000000000 0.56250000000000 0.81250000000000 28.085 > 33
56 Si 0.81250000000000 0.56250000000000 0.81250000000000 28.085 > 33
57 Si 0.31250000000000 0.31250000000000 0.06250000000000 28.085 > 33
58 Si 0.81250000000000 0.31250000000000 0.06250000000000 28.085 > 33
59 Si 0.31250000000000 0.81250000000000 0.06250000000000 28.085 > 33
60 Si 0.81250000000000 0.81250000000000 0.06250000000000 28.085 > 33
61 Si 0.31250000000000 0.31250000000000 0.56250000000000 28.085 > 33
62 Si 0.81250000000000 0.31250000000000 0.56250000000000 28.085 > 33
63 Si 0.31250000000000 0.81250000000000 0.56250000000000 28.085 > 33
64 Si 0.81250000000000 0.81250000000000 0.56250000000000 28.085 > 33
------------------- ratio (supercell for fc)/(primitive) -------------------
-2.00 2.00 2.00
2.00-2.00 2.00
2.00 2.00-2.00
----------------------------- Force constants ------------------------------
Reading fc3 from fc3.hdf5
max drift of fc3: -0.000000 (xxx) -0.000000 (xxx) -0.000000 (xxx)
Reading fc2 from fc2.hdf5
max drift of fc2: 0.000000 (yy) 0.000000 (xx)
--------------------------------- Settings ---------------------------------
Mesh sampling: [ 11 11 11 ]
BZ integration: Tetrahedron-method
Temperature: 0.0 10.0 20.0 30.0 40.0 ... 1000.0
Cutoff frequency: 0.01
Traceback (most recent call last):
File "/Users/glensk/.local/bin/phono3py", line 4, in
import('pkg_resources').run_script('phono3py==1.11.11', 'phono3py')
File "/Users/glensk/anaconda2/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg/pkg_resources/init.py", line 744, in run_script

File "/Users/glensk/anaconda2/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg/pkg_resources/init.py", line 1506, in run_script

File "/Users/glensk/.local/lib/python2.7/site-packages/phono3py-1.11.11-py2.7-macosx-10.7-x86_64.egg/EGG-INFO/scripts/phono3py", line 627, in

File "build/bdist.macosx-10.7-x86_64/egg/phono3py/phonon3/init.py", line 155, in set_phph_interaction

File "build/bdist.macosx-10.7-x86_64/egg/phono3py/phonon3/interaction.py", line 262, in set_dynamical_matrix
File "build/bdist.macosx-10.7-x86_64/egg/phono3py/phonon3/interaction.py", line 292, in set_phonons
File "build/bdist.macosx-10.7-x86_64/egg/phono3py/phonon3/interaction.py", line 343, in _set_phonon_c
File "build/bdist.macosx-10.7-x86_64/egg/phono3py/phonon/solver.py", line 48, in set_phonon_c
File "build/bdist.macosx-10.7-x86_64/egg/phono3py/_lapackepy.py", line 7, in
File "build/bdist.macosx-10.7-x86_64/egg/phono3py/_lapackepy.py", line 6, in bootstrap
ImportError: dlopen(/Users/glensk/Library/Caches/Python-Eggs/phono3py-1.11.11-py2.7-macosx-10.7-x86_64.egg-tmp/phono3py/_lapackepy.so, 2): Symbol not found: __gfortran_concat_string
Referenced from: /Users/glensk/Library/Caches/Python-Eggs/phono3py-1.11.11-py2.7-macosx-10.7-x86_64.egg-tmp/phono3py/_lapackepy.so
Expected in: flat namespace
in /Users/glensk/Library/Caches/Python-Eggs/phono3py-1.11.11-py2.7-macosx-10.7-x86_64.egg-tmp/phono3py/_lapackepy.so

15:07:25 glensk@mac /Users/glensk/Dropbox/scripts/phonons/phono3py/example/Si-PBE/redo_phono3py_redo_as_in_README

%ls
FORCES_FC3 POSCAR-unitcell SPOSCAR disp_fc3.yaml fc2.hdf5 fc3.hdf5 phono3py.yaml phono3py_disp.yaml
15:42:12 glensk@mac /Users/glensk/Dropbox/scripts/phonons/phono3py/example/Si-PBE/redo_phono3py_redo_as_in_README
%

Scattering rate between two phonon modes.

Dear Prof. Togo,

I have recently started to explore some of the features of phono3py, but I admit that I am still a relatively new user. I am trying to compute the scattering rate (integrated over all momenta) between two phonons using phono3py, namely, the rate at which a phonon \nu_1 is excited by the decay of a phonon \nu_2 and viceversa.

If my understanding of the theory is correct, this scattering rate should be closely related to the \Omega' (or equivalently \Omega) quantity defined right below Eq. (2) in Chaput, Phys. Rev. Lett. (2013) https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.110.265506 .
However, the collision matrix printed out by phono3py in the file collision-m111111.hdf5 seems to be rather the \tilde\Omega quantity defined at the bottom of the right column of page 2 of Chaput's paper (based on what I can deduce from the number of indices).

The transformation that yields \tilde\Omega from \Omega' involves some symmetry operation which acts only on momentum space. Therefore, my question is whether it is legitimate to interpret the matrix \tilde\Omega stored in collision-m111111.hdf5 as a two-phonon scattering rate.

Thank you in advance for you help.

Sincerely,
Fabio Caruso

(Humboldt University Berlin, Germany)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.