diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..6a044c56 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,31 @@ +# See https://pre-commit.com for more informatio +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + exclude: ^conda/ + - id: check-added-large-files + +- repo: https://github.com/pycqa/flake8 + rev: 4.0.1 + hooks: + - id: flake8 + args: + - "--max-line-length=88" + - "--ignore=E203,W503" + +- repo: https://github.com/psf/black + rev: 21.9b0 + hooks: + - id: black + args: + - --line-length=88 + +- repo: https://github.com/pycqa/pydocstyle + rev: 6.0.0 + hooks: + - id: pydocstyle diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 562960e3..00000000 --- a/.travis.yml +++ /dev/null @@ -1,93 +0,0 @@ -matrix: - include: - - python: '3.6' - env: TRAVIS_PYTHON_VERSION='3.6' - - python: '3.7' - env: TRAVIS_PYTHON_VERSION='3.7' - - python: '3.8' - env: TRAVIS_PYTHON_VERSION='3.8' - -before_install: - - wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - - echo $TRAVIS_PYTHON_VERSION - - bash miniconda.sh -b -p ${HOME}/.miniconda - - export PATH=$HOME/.miniconda/bin:$PATH - - conda update --yes conda - - conda init bash - - source $(conda info --root)/etc/profile.d/conda.sh - - conda install --yes -c conda-forge python=$TRAVIS_PYTHON_VERSION - - export CONDA_PREFIX=$HOME/.miniconda - - export C_INCLUDE_PATH=$CONDA_PREFIX/include - - export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH - -install: - - conda install --yes -c conda-forge matplotlib-base pyyaml openblas libgfortran gcc_linux-64 gxx_linux-64 h5py scipy pytest spglib - - echo $TRAVIS_BRANCH - - if [[ "$TRAVIS_BRANCH" == "master" ]]; then - pip install https://github.com/phonopy/phonopy/archive/master.zip --user; - elif [[ "$TRAVIS_BRANCH" == "rc" ]]; then - pip install https://github.com/phonopy/phonopy/archive/rc.zip --user; - else - pip install https://github.com/phonopy/phonopy/archive/develop.zip --user; - fi - - pwd - - ./get_nanoversion.sh - - cat __nanoversion__.txt - - python setup.py build - - pip install -e . - -script: - - pytest - - cd example/Si-PBE - - tar xf vasprun_xmls.tar.lzma --lzma - - phono3py --cf3 vasprun_xmls/disp-{00001..00111}/vasprun.xml - - cd ../.. - - cd example/Si-QE - - tar xf supercell_out.tar.lzma --lzma - - phono3py --qe --cf3 supercell_out/disp-{00001..00111}/Si.out - - cd ../.. - -deploy: - # testing pypi - - provider: pypi - server: https://test.pypi.org/legacy/ - skip_existing: true - skip_cleanup: true - cleanup: false - distributions: sdist - user: atztogo - password: - secure: "NiGCFUvUZALME/raOyq5AspTc0sCBA+G7frAIAWLsNOk7JL25UIu/T4ufWHEpvssvXZ/zntEVKEnQo8kQYQfsfDtLccdVFKJ6jzKtqbL4s2+m8d61b+Ezu9mK1XM/ImiIkvhCD+j8jtzUbN24/qYhGgR8YeXxwfCJWU7SKNueTiyBT+xOoO4gswoRpA4Ztutzows0rKX1K/MBaKF9RGotIHCIay4ryWJUg9KWcp2rKGJeDiuTK81kSyZA1MV3x05PgnPH+gxTy8XbBP0Bk71FZUpkpQ7+UsmsUSLB9dlSgkhziYuDHb4Y48YO2XqHU7bi+pElUs660eez8m8IC5dUhjY3RPDQOSb3gpc1N56/RqfMugUyelEqfXaSCPBrXfhsvutwibA4ITNh4f86jylWFUQukHiK95NCVrvMDkNcFyNZVNHsWUIBWfCXPu4fmykOb4PR1eC1kZsuo0h3VTSzMn7vtFXbedt3VtaZMNEdbBMgKxoPwcE2DPBzZDZdSbVA8QuvmbwjGpxHNISssNzLhCVWbXSbjo2BntHzMIodz36rKQwqHqw58yUBNRZKLT1/0D2qGSSWQ/r4W6w2y7XoJXyJOIGRaAzTEWmGMZ7OHO1XON9cT8zOmikC9XhmC34mhzRrKmPx/5VMyzvM05wkCpNynx0SZc6w9wmIxhFl3Q=" - on: - repo: phonopy/phono3py - branch: rc - tags: false - - # testing anaconda - - provider: script - script: conda/anaconda_deploy.sh rc $ANACONDA_TOKEN2 $TRAVIS_BRANCH - on: - repo: phonopy/phono3py - branch: rc - tags: false - - # production pypi - - provider: pypi - skip_existing: true - skip_cleanup: true - cleanup: false - distributions: sdist - user: atztogo - password: - secure: "lqT3bcoiVePhx642M/dZBsnd8WUsYush58IGB2EiCu60FOhwfFJtSNEoJoKicGy54QiQ/Ho6xTcshf398CFSE2cVfW+YrTUtUaObOzFNLbmbvy5tnuvDgK/56T5jTCAVQaD68qDNR0O5qlnw/Xe8ZKoKTpoFwfnIv3brpokUFyMFcECuCtv2sNrVSF3d89S7jd9ahpjkvu0udA4jXKdwLMbjOmrpK7v7jkCtNXdJFLzprB4Y8tNX08TMovWzmrHk8YOx6v2YgNxW4/bqJbe+oGofpj9RcXfYdiXY797nz7D9b7BcRi1NMWoiMqOzpnlPEccQqhqOOxddkajiXHCyJPYJ9zWj3xuC2D50KdtGb5tm+qDI3EqzIiQv0akXE3nvMPinOQkjlUN/1/HmS5s99YMSg9GvmL4bPnu3phBjoND23IMPED4rra9IToeozPHaQGRoBvLNGAl28aAzuIP0JHmHQ26BNmOvOa+CQs1SbMytv570FMi6pN/vMgaMT71uXJWsIDb9aDG6V1snsTLIbwM/TYTLFM+2OGBN86nlmWQs0V46K2kPHcUbEv8GD148j1DTS4H0wDmc8pJSHqeSI2h35pbVbZJa6bk68V3Bhre/xo+zjxwJIkOATELbQCeFXIA059+hF+tsoQ0Jnd6RrbzP3tISdVThs3u7oSoddIE=" - on: - branch: master - tags: false - - # production anaconda - - provider: script - script: conda/anaconda_deploy.sh main $ANACONDA_TOKEN2 $TRAVIS_BRANCH - on: - repo: phonopy/phono3py - branch: master - tags: false diff --git a/.vscode/settings.json b/.vscode/settings.json index a4877b23..5e337ba7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,4 +5,4 @@ "python.testing.unittestEnabled": false, "python.testing.nosetestsEnabled": false, "python.testing.pytestEnabled": true -} \ No newline at end of file +} diff --git a/README.md b/README.md index 1b98015e..d3d698cb 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,51 @@ +[![Version Badge](https://anaconda.org/conda-forge/phono3py/badges/version.svg)](https://anaconda.org/conda-forge/phono3py) +[![Downloads Badge](https://anaconda.org/conda-forge/phono3py/badges/downloads.svg)](https://anaconda.org/conda-forge/phono3py) +[![PyPI version](https://badge.fury.io/py/phono3py.svg)](https://badge.fury.io/py/phono3py) +[![PyPI](https://img.shields.io/pypi/dm/phono3py.svg?maxAge=2592000)](https://pypi.python.org/pypi/phono3py) +[![codecov](https://codecov.io/gh/phonopy/phono3py/branch/develop/graph/badge.svg)](https://codecov.io/gh/phonopy/phono3py) + # phono3py -A simulation package of phonon-phonon interaction related properties. Phono3py user documetation is found at http://phonopy.github.io/phono3py/. + +A simulation package of phonon-phonon interaction related properties. 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/). +Usual phono3py questions should be sent to phonopy mailing list +(https://sourceforge.net/p/phonopy/mailman/). ## Development -The development of phono3py is managed on the `develop` branch of github phono3py repository. +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. +- Github issues is the place to discuss about phono3py issues. +- Github pull request is the place to request merging source code. +- Python 3.7 will be the minimum requirement soon. +- Formatting is written in `pyproject.toml`. +- Not strictly, but VSCode's `settings.json` may be written like + + ```json + "python.linting.flake8Enabled": true, + "python.linting.flake8Args": ["--max-line-length=88", "--ignore=E203,W503"], + "python.linting.enabled": true, + "python.linting.pylintEnabled": false, + "python.linting.mypyEnabled": true, + "python.linting.pycodestyleEnabled": false, + "python.linting.pydocstyleEnabled": true, + "python.formatting.provider": "black", + ``` ## Documentation -Phono3py user documetation is written using python sphinx. The source files are stored in `doc` directory. Please see how to write the documentation at `doc/README.md`. +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 + +You need pytest. At home directory of phono3py after setup, + +```bash +% pytest +``` diff --git a/doc/citation.md b/doc/citation.md index a7864ce3..c86c027b 100644 --- a/doc/citation.md +++ b/doc/citation.md @@ -47,4 +47,4 @@ following article: doi = {10.1103/PhysRevLett.110.265506}, url = {https://link.aps.org/doi/10.1103/PhysRevLett.110.265506} } - ``` \ No newline at end of file + ``` diff --git a/doc/conf.py b/doc/conf.py index 887d292a..c6f75408 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -12,9 +12,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys -import os - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -28,33 +25,33 @@ import os # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # extensions = ['sphinx.ext.imgmath'] -extensions = ['sphinx.ext.mathjax', 'myst_parser'] +extensions = ["sphinx.ext.mathjax", "myst_parser"] myst_enable_extensions = ["linkify", "dollarmath", "amsmath"] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix of source filenames. -source_suffix = '.rst' +source_suffix = ".rst" # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. -project = u'phono3py' -copyright = u'2015, Atsushi Togo' +project = u"phono3py" +copyright = u"2015, Atsushi Togo" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '2.0' +version = "2.0" # The full version, including alpha/beta/rc tags. -release = '2.0.0' +release = "2.0.0" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -68,7 +65,7 @@ release = '2.0.0' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build'] +exclude_patterns = ["_build"] # The reST default role (used for this markup: `text`) to use for all # documents. @@ -86,7 +83,7 @@ exclude_patterns = ['_build'] # show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] @@ -149,12 +146,12 @@ pygments_style = 'sphinx' # # "globaltoc_includehidden": False, # } -html_theme = 'sphinx_book_theme' +html_theme = "sphinx_book_theme" # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". # html_title = None -html_title = 'Phono3py v.%s' % release +html_title = "Phono3py v.%s" % release # A shorter title for the navigation bar. Default is the same as html_title. # html_short_title = None @@ -171,7 +168,7 @@ html_title = 'Phono3py v.%s' % release # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ["_static"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. @@ -215,7 +212,7 @@ html_static_path = ['_static'] # html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'phono3pydoc' +htmlhelp_basename = "phono3pydoc" # -- Options for LaTeX output ------------------------------------------------- @@ -223,20 +220,17 @@ htmlhelp_basename = 'phono3pydoc' latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - 'preamble': '', + "preamble": "", } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]) # . latex_documents = [ - ('index', 'phono3py.tex', u'phono3py manual', - u'Atsushi Togo', 'manual'), + ("index", "phono3py.tex", u"phono3py manual", u"Atsushi Togo", "manual"), ] # The name of an image file (relative to this directory) to place at the top of @@ -264,10 +258,7 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'phono3py', u'phono3py Documentation', - [u'Atsushi Togo'], 1) -] +man_pages = [("index", "phono3py", u"phono3py Documentation", [u"Atsushi Togo"], 1)] # If true, show URL addresses after external links. # man_show_urls = False @@ -279,9 +270,15 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'phono3py', u'phono3py Documentation', - u'Atsushi Togo', 'phono3py', 'One line description of project.', - 'Miscellaneous'), + ( + "index", + "phono3py", + u"phono3py Documentation", + u"Atsushi Togo", + "phono3py", + "One line description of project.", + "Miscellaneous", + ), ] # Documents to append as an appendix to all manuals. diff --git a/doc/cutoff-pair.md b/doc/cutoff-pair.md index 0e1e9ac5..d06b62f7 100644 --- a/doc/cutoff-pair.md +++ b/doc/cutoff-pair.md @@ -426,4 +426,4 @@ number_of_pairs_in_cutoff: 1248 300.0 235.887 235.887 219.301 0.000 -0.000 -0.000 300.0 235.642 235.642 219.348 0.000 -0.000 -0.000 300.0 235.728 235.728 219.102 0.000 -0.000 -0.000 -``` \ No newline at end of file +``` diff --git a/doc/interfaces.md b/doc/interfaces.md index 5f318776..4fc78fbd 100644 --- a/doc/interfaces.md +++ b/doc/interfaces.md @@ -71,4 +71,4 @@ Default displacement distances created by `-d` option without | CRYSTAL | 0.03 Angstrom | | Abinit | 0.06 au (bohr) | | TURBOMOLE | 0.06 au (bohr) | -``` \ No newline at end of file +``` diff --git a/doc/workload-distribution.md b/doc/workload-distribution.md index 48224467..4c7a8341 100644 --- a/doc/workload-distribution.md +++ b/doc/workload-distribution.md @@ -139,4 +139,4 @@ with `job.sh` (here for grid-engine): #$ -o std-phono3py-num.log phono3py --dim="2 2 2" --pa="F" -c POSCAR-unitcell --mesh="19 19 19" --fc3 --fc2 --br --gp="gps" --write-gamma -``` \ No newline at end of file +``` diff --git a/example/AlN-LDA/FORCES_FC2 b/example/AlN-LDA/FORCES_FC2 index 178f8346..7ec8c015 100644 --- a/example/AlN-LDA/FORCES_FC2 +++ b/example/AlN-LDA/FORCES_FC2 @@ -1,4 +1,4 @@ -# File: 1 +# File: 1 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.6484336900 0.0222671200 -0.0143461700 0.0736627500 0.0104173100 -0.0064302500 @@ -300,7 +300,7 @@ -0.0015703700 -0.0006418500 -0.0005758600 -0.0004825200 -0.0010922200 -0.0024545000 0.0040571700 -0.0000110700 0.0000039000 -# File: 2 +# File: 2 # 1 0.0000000000000000 0.0000000000000000 0.0300000000000000 0.0000000000 0.0000000000 -0.5557350900 0.0062250200 0.0092421200 -0.0203076300 @@ -602,7 +602,7 @@ -0.0005740400 -0.0003314200 -0.0002882300 -0.0020293600 -0.0025852000 -0.0014466500 0.0000000000 -0.0041471800 -0.0020932700 -# File: 3 +# File: 3 # 1 0.0000000000000000 0.0000000000000000 -0.0300000000000000 0.0000000000 0.0000000000 0.6160949400 -0.0070590800 -0.0093557300 0.0205786800 @@ -904,7 +904,7 @@ 0.0005759000 0.0003325000 0.0002754700 0.0020376100 0.0025736200 0.0014443900 0.0000000000 0.0041401500 0.0020869200 -# File: 4 +# File: 4 # 151 0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0204935100 -0.0000909100 0.0000019100 -0.0057412400 -0.0035612800 0.0073760100 @@ -1206,7 +1206,7 @@ 0.0009926100 0.0003849600 -0.0000351000 0.0000951900 0.0007041200 -0.0001422100 -0.0022182300 0.0000026900 -0.0000015100 -# File: 5 +# File: 5 # 151 0.0000000000000000 0.0000000000000000 0.0300000000000000 0.0000000000 0.0000000000 -0.0403186900 0.0150281200 0.0091882100 -0.0018635900 @@ -1508,7 +1508,7 @@ 0.0000345500 0.0000199500 0.0012992500 0.0001358800 0.0000710700 0.0029583400 0.0000000000 0.0001492100 0.0045891900 -# File: 6 +# File: 6 # 151 0.0000000000000000 0.0000000000000000 -0.0300000000000000 0.0000000000 0.0000000000 0.0413813900 -0.0150668500 -0.0092748700 0.0017799700 diff --git a/example/AlN-LDA/POSCAR-unitcell b/example/AlN-LDA/POSCAR-unitcell index f13349c4..818d8ba2 100644 --- a/example/AlN-LDA/POSCAR-unitcell +++ b/example/AlN-LDA/POSCAR-unitcell @@ -9,4 +9,4 @@ Direct 0.3333333333333333 0.6666666666666665 0.0009488200000000 0.6666666666666667 0.3333333333333333 0.5009488200000001 0.3333333333333333 0.6666666666666665 0.6190511800000000 - 0.6666666666666667 0.3333333333333333 0.1190511800000000 \ No newline at end of file + 0.6666666666666667 0.3333333333333333 0.1190511800000000 diff --git a/example/AlN-LDA/README b/example/AlN-LDA/README index 8a35a8d3..5ba60b15 100644 --- a/example/AlN-LDA/README +++ b/example/AlN-LDA/README @@ -41,7 +41,7 @@ k_zz=219.1. The shape of phonon band structure is important to fullfill energy and momentum conservations. Use of larger supercell of fc2 may change the shape of phonon band structure. -To see it, first regenerate phono3py_disp.yaml with --dim-fc2 option, +To see it, first regenerate phono3py_disp.yaml with --dim-fc2 option, % phono3py --dim="3 3 2" --dim-fc2="5 5 3" -c POSCAR-unitcell -d diff --git a/example/Si-CRYSTAL/FORCES_FC2 b/example/Si-CRYSTAL/FORCES_FC2 index 916fd28d..04fff7d9 100644 --- a/example/Si-CRYSTAL/FORCES_FC2 +++ b/example/Si-CRYSTAL/FORCES_FC2 @@ -1,4 +1,4 @@ -# File: 1 +# File: 1 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.0150976605 -0.3163819396 -0.3163819277 -0.0054602591 0.0087171452 0.0087171442 diff --git a/example/Si-CRYSTAL/FORCES_FC3 b/example/Si-CRYSTAL/FORCES_FC3 index e9c5afcd..87fe4f87 100644 --- a/example/Si-CRYSTAL/FORCES_FC3 +++ b/example/Si-CRYSTAL/FORCES_FC3 @@ -1,4 +1,4 @@ -# File: 1 +# File: 1 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.0152594970 -0.3211511680 -0.3211509706 -0.0001435085 0.0219927829 0.0219925626 @@ -16,7 +16,7 @@ 0.0001331050 -0.0055277344 -0.0053741157 -0.0057637037 0.0002712181 0.0002708504 0.0055534276 0.0001117032 0.0001114381 -# File: 2 +# File: 2 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 1 0.0212132034355964 0.0000000000000000 0.0212132034355964 -0.2915830406 -0.2915827297 -0.6267860517 @@ -35,7 +35,7 @@ 0.0002973816 -0.0110605876 -0.0052885305 -0.0110601987 0.0002976322 -0.0052887309 0.0054615894 0.0054615452 0.0000190373 -# File: 3 +# File: 3 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 1 -0.0212132034355964 0.0000000000000000 -0.0212132034355964 0.3211479920 -0.3211513093 -0.0152621589 @@ -54,7 +54,7 @@ -0.0001097860 0.0001116313 -0.0055511616 -0.0002684320 0.0002711970 0.0057659419 0.0053755648 -0.0055279210 -0.0001315307 -# File: 4 +# File: 4 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.0607208411 -0.6426014876 -0.6426016649 @@ -73,7 +73,7 @@ 0.0002335625 -0.0108857049 -0.0110189043 -0.0112282566 0.0004024542 0.0004019167 0.0108236885 -0.0001056704 -0.0001058760 -# File: 5 +# File: 5 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 1 0.0000000000000000 -0.0212132034355964 -0.0212132034355964 -0.0000009817 -0.0000010866 -0.0000009461 @@ -92,7 +92,7 @@ 0.0000012799 0.0000010706 0.0000007773 0.0000009165 0.0000010127 0.0000008509 0.0000010604 0.0000009847 0.0000008692 -# File: 6 +# File: 6 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 2 0.0212132034355964 0.0000000000000000 0.0212132034355964 -0.0044402241 -0.3100170076 -0.3107578808 @@ -111,7 +111,7 @@ 0.0277477410 -0.0066981645 0.0236783541 -0.0056534328 0.0058287134 0.0003825742 0.0000322018 0.0002440270 -0.0052585282 -# File: 7 +# File: 7 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 2 -0.0212132034355964 0.0000000000000000 -0.0212132034355964 0.0347404871 -0.3320822726 -0.3315779932 @@ -130,7 +130,7 @@ -0.0289290207 -0.0066944813 -0.0329837327 -0.0060382115 -0.0054979528 -0.0000001670 0.0109208828 0.0002438843 0.0056384786 -# File: 8 +# File: 8 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 2 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.0152286518 -0.2990938262 -0.2990938072 @@ -149,7 +149,7 @@ -0.0010157867 0.0220827585 0.0236702310 -0.0002026923 0.0003819592 0.0003819492 -0.0002027130 0.0003819478 0.0003819828 -# File: 9 +# File: 9 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 2 0.0000000000000000 -0.0212132034355964 -0.0212132034355964 0.0149287171 -0.3429703545 -0.3429700900 @@ -168,7 +168,7 @@ -0.0010604463 -0.0345558816 -0.0329761904 -0.0115440948 0.0000010644 0.0000009115 0.0111011485 0.0000011505 0.0000011269 -# File: 10 +# File: 10 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 3 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.0268075451 -0.3407067497 -0.3107684189 @@ -187,7 +187,7 @@ 0.0056797288 -0.0054343936 -0.0052534276 -0.0069594615 0.0278752642 0.0293363152 0.0056795496 -0.0054345663 -0.0052534671 -# File: 11 +# File: 11 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 3 0.0000000000000000 -0.0212132034355964 -0.0212132034355964 0.0041758774 -0.3016067538 -0.3317748142 @@ -206,7 +206,7 @@ -0.0056459234 -0.0058072124 -0.0056333221 -0.0068355352 -0.0287516455 -0.0274134432 0.0056696487 0.0054813402 0.0056529505 -# File: 12 +# File: 12 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 3 0.0212132034355964 0.0000000000000000 0.0212132034355964 0.0374367371 -0.3212101694 -0.2989610185 @@ -225,7 +225,7 @@ 0.0002439140 0.0000318128 -0.0052585180 0.0218302035 -0.0008959854 0.0293173115 0.0058288536 -0.0056536729 0.0003824074 -# File: 13 +# File: 13 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 3 -0.0212132034355964 0.0000000000000000 -0.0212132034355964 -0.0066743470 -0.3213106384 -0.3430608970 @@ -244,7 +244,7 @@ -0.0001364428 -0.0113081882 -0.0056483077 -0.0347924591 -0.0009193135 -0.0273224900 0.0054391115 0.0056687705 0.0000020573 -# File: 14 +# File: 14 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 3 0.0212132034355964 0.0212132034355964 0.0000000000000000 0.0258331232 -0.3407360577 -0.3097939478 @@ -263,7 +263,7 @@ 0.0002439476 -0.0054133260 0.0001823249 0.1335285993 0.1395544364 -0.1125849783 0.0001823138 -0.0054133110 0.0002439356 -# File: 15 +# File: 15 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 3 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 0.0046739689 -0.3018023578 -0.3322910711 @@ -282,7 +282,7 @@ -0.0001365123 -0.0058053942 -0.0111427823 -0.1352641482 -0.1292499640 0.0998249186 0.0110792052 0.0054851095 0.0002433439 -# File: 16 +# File: 16 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 4 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.0040880746 -0.3100529400 -0.3408724414 @@ -301,7 +301,7 @@ -0.0056359057 -0.0052670470 -0.0050878342 -0.0056360093 -0.0052669832 -0.0050878275 0.0043602894 0.0277007812 0.0291663253 -# File: 17 +# File: 17 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 4 0.0000000000000000 -0.0212132034355964 -0.0212132034355964 0.0263442055 -0.3319366695 -0.3013107170 @@ -320,7 +320,7 @@ 0.0056699090 -0.0056510496 -0.0054787857 -0.0056460853 0.0056349492 0.0058094908 0.0042430551 -0.0290637005 -0.0276252811 -# File: 18 +# File: 18 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 4 0.0212132034355964 0.0000000000000000 0.0212132034355964 0.0260368501 -0.3319897664 -0.3407972776 @@ -339,7 +339,7 @@ -0.0054008117 -0.0054008102 -0.0107250628 -0.0055027211 -0.0055026753 0.0005598253 0.0331401863 -0.0010853512 0.0291767075 -# File: 19 +# File: 19 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 4 -0.0212132034355964 0.0000000000000000 -0.0212132034355964 0.0045206517 -0.3101426423 -0.3014161824 @@ -358,7 +358,7 @@ 0.0054931409 -0.0054108202 0.0001509796 -0.0058875886 0.0058122207 0.0001694714 -0.0236399359 -0.0011818566 -0.0276362899 -# File: 20 +# File: 20 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 4 0.0212132034355964 0.0212132034355964 0.0000000000000000 0.0148676009 -0.3215306550 -0.3208769657 @@ -377,7 +377,7 @@ -0.0053996649 -0.0109089977 -0.0052202745 -0.0111482654 -0.0052658778 0.0004239404 0.1448030745 0.1393852560 -0.1127455500 -# File: 21 +# File: 21 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 4 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 0.0155383005 -0.3208527551 -0.3212435940 @@ -396,7 +396,7 @@ 0.0055030629 -0.0000041260 -0.0052151709 -0.0002363760 0.0056449118 0.0004281880 -0.1239859593 -0.1294459102 0.0997239436 -# File: 22 +# File: 22 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 7 0.0212132034355964 0.0000000000000000 0.0212132034355964 -0.0043203881 -0.3322574331 -0.3101454253 @@ -415,7 +415,7 @@ -0.0052207069 -0.0054000030 -0.0109085789 0.1239436364 0.0997513012 0.1296882363 0.0345792825 -0.0010649748 0.0277212335 -# File: 23 +# File: 23 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 7 -0.0212132034355964 0.0000000000000000 -0.0212132034355964 0.0345774055 -0.3100193587 -0.3320395899 @@ -434,7 +434,7 @@ 0.0056832509 -0.0053991297 -0.0000035861 -0.1448866553 -0.1127514119 -0.1391485415 -0.0219818773 -0.0011038210 -0.0289905817 -# File: 24 +# File: 24 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 7 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.0154984453 -0.3217672151 -0.3217674511 @@ -453,7 +453,7 @@ 0.0003063257 -0.0109015652 -0.0109017325 0.0939766085 0.1296859539 0.1296862441 -0.1071473783 0.1394933130 0.1394933545 -# File: 25 +# File: 25 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 7 0.0000000000000000 -0.0212132034355964 -0.0212132034355964 0.0149441918 -0.3206728595 -0.3206723495 @@ -472,7 +472,7 @@ 0.0002919565 0.0000015622 0.0000010779 -0.1184416208 -0.1391628674 -0.1391627646 0.1051898959 -0.1294474387 -0.1294477630 -# File: 26 +# File: 26 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 8 0.0212132034355964 0.0000000000000000 0.0212132034355964 0.0178987903 -0.3211620759 -0.3185125167 @@ -491,7 +491,7 @@ 0.1394250548 -0.1183785245 0.1339024332 0.0233157466 -0.0008940012 0.0278814388 0.1350605830 0.0996863172 0.1296363883 -# File: 27 +# File: 27 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 8 -0.0212132034355964 0.0000000000000000 -0.0212132034355964 0.0126146687 -0.3210838297 -0.3238163247 @@ -510,7 +510,7 @@ -0.1293890458 0.0940260121 -0.1348784921 -0.0333963806 -0.0009153373 -0.0287888975 -0.1337197485 -0.1127569076 -0.1391773640 -# File: 28 +# File: 28 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 8 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.0152175545 -0.3184817266 -0.3184817374 @@ -529,7 +529,7 @@ -0.0010122801 0.0235394430 0.0222168690 -0.1186046129 0.1395502635 0.1395500693 0.1051354721 0.1296226417 0.1296227234 -# File: 29 +# File: 29 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 8 0.0000000000000000 -0.0212132034355964 -0.0212132034355964 0.0153652388 -0.3238488728 -0.3238490063 @@ -548,7 +548,7 @@ -0.0010580877 -0.0331549439 -0.0344068839 0.0937898270 -0.1292518331 -0.1292517037 -0.1073279705 -0.1391689292 -0.1391688687 -# File: 30 +# File: 30 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 9 0.0212132034355964 0.0000000000000000 0.0212132034355964 0.1423450012 -0.2205821574 -0.1926710296 @@ -567,7 +567,7 @@ -0.0004889308 -0.0058121692 -0.0059617917 -0.0255217406 -0.0111072283 0.0109237760 0.0082353165 0.0000819405 0.0027746183 -# File: 31 +# File: 31 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 9 -0.0212132034355964 0.0000000000000000 -0.0212132034355964 -0.1028039845 -0.4094250037 -0.4403521962 @@ -586,7 +586,7 @@ 0.0007450835 -0.0058668327 -0.0047828976 0.0137885489 0.0115784779 -0.0105392031 0.0028818949 0.0000865178 -0.0025411371 -# File: 32 +# File: 32 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 9 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.1146780673 -0.1916061338 -0.1916062893 @@ -605,7 +605,7 @@ -0.0112639668 -0.0252760811 0.0053051659 -0.0060483464 -0.0003515865 -0.0003519135 0.0055218689 0.0027909169 0.0027909838 -# File: 33 +# File: 33 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 9 0.0000000000000000 -0.0212132034355964 -0.0212132034355964 -0.0719842260 -0.4411151738 -0.4411148050 @@ -624,7 +624,7 @@ 0.0114627684 0.0140013707 -0.0162022170 -0.0060864429 0.0008867342 0.0008868604 0.0055261070 -0.0025603898 -0.0025602488 -# File: 34 +# File: 34 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 10 0.0212132034355964 0.0000000000000000 0.0212132034355964 0.0415712930 -0.3210562121 -0.2946983820 @@ -643,7 +643,7 @@ 0.0109273884 0.0057752666 -0.0248875997 -0.0030837545 0.0002237073 0.0029533906 -0.0141559520 -0.0112597623 0.0107678407 -# File: 35 +# File: 35 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 10 -0.0212132034355964 0.0000000000000000 -0.0212132034355964 -0.0128583715 -0.3184989801 -0.3458769505 @@ -662,7 +662,7 @@ -0.0104928394 -0.0169056738 0.0143465042 -0.0084410738 0.0002590701 -0.0024089846 0.0250640861 0.0114214031 -0.0107055616 -# File: 36 +# File: 36 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 10 0.0000000000000000 0.0212132034355964 0.0212132034355964 -0.0977384048 -0.1819623776 -0.1819623570 @@ -681,7 +681,7 @@ 0.0114280970 0.0052507596 -0.0249092956 -0.0057950203 0.0029527957 0.0029524980 0.0052656740 -0.0005057819 -0.0005057761 -# File: 37 +# File: 37 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 10 0.0000000000000000 -0.0212132034355964 -0.0212132034355964 0.1427533662 -0.4704179484 -0.4704175032 @@ -700,7 +700,7 @@ -0.0112319693 -0.0161306670 0.0143694573 -0.0057832498 -0.0024154276 -0.0024149113 0.0052201955 0.0007351581 0.0007358405 -# File: 38 +# File: 38 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 11 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.0142587300 -0.2922422201 -0.2934496235 @@ -719,7 +719,7 @@ 0.0000649770 -0.0028485245 -0.0026908137 0.0055575990 0.0110620460 -0.0192734744 -0.0058275738 -0.0196264000 0.0107721818 -# File: 39 +# File: 39 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 11 0.0000000000000000 -0.0212132034355964 -0.0212132034355964 0.0186583734 -0.3515549399 -0.3474279481 @@ -738,7 +738,7 @@ 0.0001416549 -0.0082040995 -0.0080528906 -0.0171447079 -0.0103515527 0.0200238796 0.0168632681 0.0196454432 -0.0107263245 -# File: 40 +# File: 40 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 11 0.0212132034355964 0.0000000000000000 0.0212132034355964 0.1436714629 -0.4218497459 -0.1941136773 @@ -757,7 +757,7 @@ 0.0027951237 -0.0055599389 -0.0026917737 0.0050209982 0.0115704175 -0.0192800347 0.0049650991 -0.0002060819 -0.0005023009 -# File: 41 +# File: 41 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 11 -0.0212132034355964 0.0000000000000000 -0.0212132034355964 -0.1225787167 -0.2071494981 -0.4573934030 @@ -776,7 +776,7 @@ -0.0025272683 -0.0055515909 -0.0080492337 -0.0163744612 -0.0110905091 0.0200287609 0.0061403690 -0.0001979406 0.0007333103 -# File: 42 +# File: 42 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 11 0.0212132034355964 0.0212132034355964 0.0000000000000000 0.0432153136 -0.2933226157 -0.3210775252 @@ -795,7 +795,7 @@ 0.0027979216 -0.0028668275 -0.0054211991 0.0162155598 0.0222692238 0.0004145929 0.0162164019 -0.0196221437 -0.0112544847 -# File: 43 +# File: 43 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 11 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.0112000794 -0.3504775085 -0.3188323496 @@ -814,7 +814,7 @@ -0.0025262651 -0.0081831346 -0.0053867608 -0.0277461010 -0.0217171682 0.0004116788 -0.0052728822 0.0196434281 0.0114109308 -# File: 44 +# File: 44 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 12 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.0152483020 -0.3267442195 -0.3264610198 @@ -833,7 +833,7 @@ -0.0001800756 -0.0061547639 -0.0059854645 -0.0171540360 -0.0194694998 0.0109227700 0.0168545557 0.0109165924 -0.0194304460 -# File: 45 +# File: 45 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 12 0.0000000000000000 -0.0212132034355964 -0.0212132034355964 0.0150138353 -0.3157081600 -0.3156936768 @@ -852,7 +852,7 @@ -0.0001660372 -0.0049014507 -0.0047545657 0.0055549189 0.0198198829 -0.0105403880 -0.0058170385 -0.0105264717 0.0198527835 -# File: 46 +# File: 46 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 12 0.0212132034355964 0.0000000000000000 0.0212132034355964 0.0097912366 -0.3212138884 -0.3263967205 @@ -871,7 +871,7 @@ -0.0196092218 -0.0169179831 0.0052692701 -0.0063853825 -0.0000350558 -0.0003417367 0.0163534354 0.0114209522 -0.0194357189 -# File: 47 +# File: 47 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 12 -0.0212132034355964 0.0000000000000000 -0.0212132034355964 0.0205735101 -0.3213350436 -0.3157552086 @@ -890,7 +890,7 @@ 0.0196809348 0.0057888707 -0.0161745787 -0.0051446687 -0.0000286141 0.0008900977 -0.0050835190 -0.0112678291 0.0198552888 -# File: 48 +# File: 48 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 12 0.0212132034355964 0.0212132034355964 0.0000000000000000 0.0154371741 -0.3210711123 -0.3266682311 @@ -909,7 +909,7 @@ -0.0196107269 0.0051133745 -0.0167478902 0.0048756987 -0.0194638366 -0.0110995779 0.0275400673 0.0221060299 0.0002584058 -# File: 49 +# File: 49 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 12 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 0.0149311970 -0.3213669834 -0.3154179849 @@ -928,7 +928,7 @@ 0.0196808690 -0.0163351046 0.0059361530 -0.0165708822 0.0198133735 0.0115775132 -0.0164330851 -0.0218804765 0.0002501712 -# File: 50 +# File: 50 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 15 0.0212132034355964 0.0000000000000000 0.0212132034355964 0.0099184526 -0.3212126194 -0.3266920407 @@ -947,7 +947,7 @@ 0.0107831614 -0.0169173976 -0.0251186166 -0.3269383169 -0.0150508552 -0.3208434254 -0.0139906912 0.0114204540 0.0109195207 -# File: 51 +# File: 51 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 15 -0.0212132034355964 0.0000000000000000 -0.0212132034355964 0.0207251585 -0.3213416237 -0.3157479787 @@ -966,7 +966,7 @@ -0.0106824135 0.0057905169 0.0141728722 0.3154181047 -0.0149316541 0.3213671199 0.0253009355 -0.0112683054 -0.0105326012 -# File: 52 +# File: 52 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 15 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.0096635017 -0.3209706287 -0.3209705585 @@ -985,7 +985,7 @@ -0.0112444660 0.0051172736 -0.0251108686 -0.0209689696 -0.3209382930 -0.3209385590 0.0056938867 0.0221084901 0.0221084504 -# File: 53 +# File: 53 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 15 0.0000000000000000 -0.0212132034355964 -0.0212132034355964 0.0210400347 -0.3214630706 -0.3214632639 @@ -1004,7 +1004,7 @@ 0.0114410894 -0.0163388013 0.0141643266 -0.0210399489 0.3214630537 0.3214632440 0.0057002617 -0.0218826229 -0.0218828342 -# File: 54 +# File: 54 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 16 0.0212132034355964 0.0000000000000000 0.0212132034355964 0.0154172860 -0.3154636736 -0.3208795584 @@ -1023,7 +1023,7 @@ 0.0221248215 -0.0053942124 0.0166102385 -0.0253120419 0.0115762128 0.0110745756 -0.3155111472 -0.0150597306 -0.3210296326 -# File: 55 +# File: 55 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 16 -0.0212132034355964 0.0000000000000000 -0.0212132034355964 0.0152298852 -0.3266395654 -0.3212776311 @@ -1042,7 +1042,7 @@ -0.0218576148 -0.0053769007 -0.0273614947 0.0139786056 -0.0111080196 -0.0103765236 0.3266396831 -0.0152299036 0.3212775233 -# File: 56 +# File: 56 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 16 0.0000000000000000 0.0212132034355964 0.0212132034355964 0.0209683493 -0.3209405075 -0.3209404024 @@ -1061,7 +1061,7 @@ 0.0114468887 -0.0250769097 0.0054350830 -0.0056267951 0.0222590743 0.0222591097 -0.0096636052 -0.3209681471 -0.3209681710 -# File: 57 +# File: 57 # 1 0.0000000000000000 0.0212132034355964 0.0212132034355964 # 16 0.0000000000000000 -0.0212132034355964 -0.0212132034355964 0.0097255863 -0.3212294883 -0.3212295526 diff --git a/example/Si-CRYSTAL/README b/example/Si-CRYSTAL/README index 9c380ecc..d8f15907 100644 --- a/example/Si-CRYSTAL/README +++ b/example/Si-CRYSTAL/README @@ -34,4 +34,3 @@ for the CRYSTAL interface, so the -c crystal.o parameter is not needed Add --isotope for isotope scattering Check the effect of --nac for polar systems - diff --git a/example/Si-CRYSTAL/crystal.o b/example/Si-CRYSTAL/crystal.o index 776c6f6f..8e4df4e8 100644 --- a/example/Si-CRYSTAL/crystal.o +++ b/example/Si-CRYSTAL/crystal.o @@ -79,7 +79,7 @@ SCF wavefunction si_cF8_alpha_pbe0_svp_fq.w is available as /chemtemp/CRY_6960/f PROCESS 10 OF 12 WORKING PROCESS 11 OF 12 WORKING - + ******************************************************************************* * * * CRYSTAL14 * @@ -119,14 +119,14 @@ SCF wavefunction si_cF8_alpha_pbe0_svp_fq.w is available as /chemtemp/CRY_6960/f * * ******************************************************************************** EEEEEEEEEE STARTING DATE 03 02 2017 TIME 23:03:41.1 - si_cF8_alpha + si_cF8_alpha CRYSTAL CALCULATION (INPUT ACCORDING TO THE INTERNATIONAL TABLES FOR X-RAY CRYSTALLOGRAPHY) - CRYSTAL FAMILY : CUBIC - CRYSTAL CLASS (GROTH - 1921) : CUBIC HEXAKISOCTAHEDRAL + CRYSTAL FAMILY : CUBIC + CRYSTAL CLASS (GROTH - 1921) : CUBIC HEXAKISOCTAHEDRAL - SPACE GROUP (CENTROSYMMETRIC) : F D 3 M + SPACE GROUP (CENTROSYMMETRIC) : F D 3 M LATTICE PARAMETERS (ANGSTROMS AND DEGREES) - CONVENTIONAL CELL A B C ALPHA BETA GAMMA @@ -159,7 +159,7 @@ SCF wavefunction si_cF8_alpha_pbe0_svp_fq.w is available as /chemtemp/CRY_6960/f NUMBER OF SYMMETRY OPERATORS : 48 ******************************************************************************* - * GEOMETRY EDITING - INPUT COORDINATES ARE GIVEN IN ANGSTROM + * GEOMETRY EDITING - INPUT COORDINATES ARE GIVEN IN ANGSTROM ******************************************************************************* GEOMETRY NOW FULLY CONSISTENT WITH THE GROUP @@ -179,11 +179,11 @@ SCF wavefunction si_cF8_alpha_pbe0_svp_fq.w is available as /chemtemp/CRY_6960/f ******************************************************************************* LATTICE PARAMETERS (ANGSTROMS AND DEGREES) - BOHR = 0.5291772083 ANGSTROM PRIMITIVE CELL - CENTRING CODE 5/0 VOLUME= 40.446798 - DENSITY 2.297 g/cm^3 - A B C ALPHA BETA GAMMA + A B C ALPHA BETA GAMMA 3.85300625 3.85300625 3.85300625 60.000000 60.000000 60.000000 ******************************************************************************* ATOMS IN THE ASYMMETRIC UNIT 1 - ATOMS IN THE UNIT CELL: 2 - ATOM X/A Y/B Z/C + ATOM X/A Y/B Z/C ******************************************************************************* 1 T 14 SI 1.250000000000E-01 1.250000000000E-01 1.250000000000E-01 2 F 14 SI -1.250000000000E-01 -1.250000000000E-01 -1.250000000000E-01 @@ -193,11 +193,11 @@ SCF wavefunction si_cF8_alpha_pbe0_svp_fq.w is available as /chemtemp/CRY_6960/f ******************************************************************************* CRYSTALLOGRAPHIC CELL (VOLUME= 161.78719119) - A B C ALPHA BETA GAMMA + A B C ALPHA BETA GAMMA 5.44897370 5.44897370 5.44897370 90.000000 90.000000 90.000000 COORDINATES IN THE CRYSTALLOGRAPHIC CELL - ATOM X/A Y/B Z/C + ATOM X/A Y/B Z/C ******************************************************************************* 1 T 14 SI 1.250000000000E-01 1.250000000000E-01 1.250000000000E-01 2 F 14 SI -1.250000000000E-01 -1.250000000000E-01 -1.250000000000E-01 @@ -276,29 +276,29 @@ SCF wavefunction si_cF8_alpha_pbe0_svp_fq.w is available as /chemtemp/CRY_6960/f ATOM X(AU) Y(AU) Z(AU) N. TYPE EXPONENT S COEF P COEF D/F/G COEF ******************************************************************************* 1 SI 1.287 1.287 1.287 - 1 S + 1 S 6.904E+03 1.337E-03 0.000E+00 0.000E+00 1.038E+03 9.997E-03 0.000E+00 0.000E+00 2.359E+02 4.491E-02 0.000E+00 0.000E+00 6.607E+01 1.146E-01 0.000E+00 0.000E+00 2.025E+01 1.028E-01 0.000E+00 0.000E+00 - 2 S + 2 S 3.435E+01 7.084E-02 0.000E+00 0.000E+00 3.637E+00-4.303E-01 0.000E+00 0.000E+00 1.400E+00-4.138E-01 0.000E+00 0.000E+00 - 3 S + 3 S 2.594E-01 1.000E+00 0.000E+00 0.000E+00 - 4- 7 SP + 4- 7 SP 1.200E-01 1.000E+00 1.000E+00 0.000E+00 - 8- 10 P + 8- 10 P 1.798E+02 0.000E+00 6.192E-03 0.000E+00 4.191E+01 0.000E+00 4.340E-02 0.000E+00 1.296E+01 0.000E+00 1.563E-01 0.000E+00 4.438E+00 0.000E+00 2.942E-01 0.000E+00 1.546E+00 0.000E+00 2.354E-01 0.000E+00 - 11- 13 P + 11- 13 P 4.098E-01 0.000E+00 1.000E+00 0.000E+00 - 14- 18 D + 14- 18 D 3.500E-01 0.000E+00 0.000E+00 1.000E+00 2 SI -1.287 -1.287 -1.287 INFORMATION **** SET_MPP **** PCRYSTAL CALCULATION @@ -360,7 +360,7 @@ SCF wavefunction si_cF8_alpha_pbe0_svp_fq.w is available as /chemtemp/CRY_6960/f 25-C( 4 3 1) 26-C( 5 3 1) 27-C( 6 3 1) 28-C( 5 4 1) 29-C( 6 4 2) - DIRECT LATTICE VECTORS COMPON. (A.U.) RECIP. LATTICE VECTORS COMPON. (A.U.) + DIRECT LATTICE VECTORS COMPON. (A.U.) RECIP. LATTICE VECTORS COMPON. (A.U.) X Y Z X Y Z 0.0000000 5.1485340 5.1485340 -0.6101917 0.6101917 0.6101917 5.1485340 0.0000000 5.1485340 0.6101917 -0.6101917 0.6101917 @@ -447,7 +447,7 @@ SCF wavefunction si_cF8_alpha_pbe0_svp_fq.w is available as /chemtemp/CRY_6960/f - ATOMS ISOTOPIC MASS (AMU) FOR FREQUENCY CALCULATION + ATOMS ISOTOPIC MASS (AMU) FOR FREQUENCY CALCULATION 1 SI 27.9769 2 SI 27.9769 @@ -455,10 +455,10 @@ SCF wavefunction si_cF8_alpha_pbe0_svp_fq.w is available as /chemtemp/CRY_6960/f GENERATING FREQUENCIES. IN PRINCIPLE 3N+1 SCF + GRADIENT CALCULATIONS ARE REQUIRED; FOR EACH OF THEM THE REMAINING POINT SYMMETRY IS INDICATED. - POINT SYMMETRY PERMITS TO GENERATE GRADIENTS FOR DISPLACEMENT B + POINT SYMMETRY PERMITS TO GENERATE GRADIENTS FOR DISPLACEMENT B STARTING FROM THE GRADIENT GENERATED BY DISPLACEMENT A. - N LABEL SYMBOL DISPLACEMENT SYM. + N LABEL SYMBOL DISPLACEMENT SYM. 1 EQUILIBRIUM GEOMETRY 48 @@ -519,7 +519,7 @@ SCF wavefunction si_cF8_alpha_pbe0_svp_fq.w is available as /chemtemp/CRY_6960/f TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT INT_CALC TELAPSE 0.21 TCPU 0.14 ******************************************************************************* - si_cF8_alpha + si_cF8_alpha CRYSTAL - SCF - TYPE OF CALCULATION : RESTRICTED CLOSED SHELL ******************************************************************************* @@ -784,7 +784,7 @@ SCF wavefunction si_cF8_alpha_pbe0_svp_fq.w is available as /chemtemp/CRY_6960/f (2) ONLY RELEVANT CLASSES ARE CONSIDERED IN THE CHARACTER TABLE (3) SYMBOLS MAY NOT FULLY COINCIDE WITH THOSE FROM TEXT BOOKS.] - (P, D, RP, RD, STAND FOR PAIRING, DOUBLING, REAL PAIRING AND REAL DOUBLING + (P, D, RP, RD, STAND FOR PAIRING, DOUBLING, REAL PAIRING AND REAL DOUBLING OF THE IRREPS (SEE MANUAL)) CLASS | GROUP OPERATORS (SEE SYMMOPS KEYWORD) @@ -805,7 +805,7 @@ SCF wavefunction si_cF8_alpha_pbe0_svp_fq.w is available as /chemtemp/CRY_6960/f ------------------------------------------------------------------------------- F2g | 3.00 -1.00 0.00 1.00 -1.00 3.00 -1.00 0.00 1.00 -1.00 F1u | 3.00 -1.00 0.00 -1.00 1.00 -3.00 1.00 0.00 1.00 -1.00 - + F2g-(3, 1); F1u-(3, 1); @@ -902,4 +902,4 @@ SCF wavefunction fort.9 saved as /home/antti/work/crypho/phonopy-aalto-tests/si_ FREQCALC RESTART data FREQINFO.DAT saved as /home/antti/work/crypho/phonopy-aalto-tests/si_pbe0_svp/opt/si_cF8_alpha_pbe0_svp_fq.freqinfo Additional FREQCALC RESTART data fort.13 saved as /home/antti/work/crypho/phonopy-aalto-tests/si_pbe0_svp/opt/si_cF8_alpha_pbe0_svp_fq.f13 Temporary directory /chemtemp/CRY_6960 removed from node compute-0-6.local -Date: 2017-02-03 23:06:31 \ No newline at end of file +Date: 2017-02-03 23:06:31 diff --git a/example/Si-LDA/FORCES_FC3 b/example/Si-LDA/FORCES_FC3 index b782181f..6c2e98ab 100644 --- a/example/Si-LDA/FORCES_FC3 +++ b/example/Si-LDA/FORCES_FC3 @@ -1,4 +1,4 @@ -# File: 1 +# File: 1 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4048203000 0.0000000000 0.0000000000 0.0006218800 0.0000000000 0.0000000000 @@ -64,7 +64,7 @@ -0.0003516900 0.0009946800 -0.0009946800 -0.0015020600 0.0009793700 -0.0011994900 0.0007013600 0.0007746100 -0.0007891700 -# File: 2 +# File: 2 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 1 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.6908798200 -0.2876254800 -0.0368033800 @@ -131,7 +131,7 @@ 0.0000969100 0.0006039100 -0.0025355900 -0.0018578500 0.0014006000 -0.0027708900 0.0018214200 0.0018880400 -0.0019300800 -# File: 3 +# File: 3 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 1 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.1187255500 0.2863799600 0.0063107000 @@ -198,7 +198,7 @@ -0.0008159700 0.0013860800 0.0005377300 -0.0011499300 0.0005340700 0.0003587100 -0.0003306000 -0.0002550100 0.0003030300 -# File: 4 +# File: 4 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 2 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.4043807300 0.0009450800 0.0000353600 @@ -265,7 +265,7 @@ 0.1138381400 0.1151817300 -0.0928526700 -0.0004470300 0.0020344200 -0.0023071200 0.0003306200 0.0012234400 -0.0023354500 -# File: 5 +# File: 5 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 2 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.4052606200 -0.0009425000 -0.0000050800 @@ -332,7 +332,7 @@ -0.1244087000 -0.1230628800 0.1042817800 -0.0024784900 0.0000052500 -0.0001525100 0.0010772000 0.0003044300 0.0007481400 -# File: 6 +# File: 6 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 3 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.4038761900 0.0004429700 0.0000242300 @@ -399,7 +399,7 @@ 0.0007065800 0.0020542700 -0.0020973300 0.1126892300 0.1151657600 -0.0930514700 0.0011523500 0.0004042200 -0.0023350400 -# File: 7 +# File: 7 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 3 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.4057656500 -0.0004403200 0.0000067400 @@ -466,7 +466,7 @@ -0.0013223400 0.0000189800 0.0000510800 -0.1255692600 -0.1230802400 0.1040694300 0.0002349200 0.0011443500 0.0007477000 -# File: 8 +# File: 8 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 3 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.4048194600 0.0000303700 0.0013351100 @@ -533,7 +533,7 @@ -0.0011208600 0.0002234500 0.0052176300 -0.0738671300 -0.0713943100 0.0989761100 -0.0003137500 -0.0003955700 -0.0023368800 -# File: 9 +# File: 9 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 4 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.4048674100 -0.0000455400 0.0000113600 @@ -600,7 +600,7 @@ -0.0007228600 0.0014467300 -0.0025443600 -0.0010572600 0.0006059900 -0.0027523400 0.1148887100 0.1149656000 -0.0926232000 -# File: 10 +# File: 10 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 4 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.4047708000 0.0000512100 0.0000202200 @@ -667,7 +667,7 @@ 0.0000245800 0.0005233600 0.0005430800 -0.0019711200 0.0013515100 0.0003377100 -0.1233525000 -0.1232885200 0.1044680900 -# File: 11 +# File: 11 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 4 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.4048167100 0.0000313400 -0.0117451700 @@ -734,7 +734,7 @@ -0.0015198200 -0.0000161200 -0.0025431200 -0.0025225400 -0.0001901300 -0.0027488300 -0.0716719800 -0.0716151200 0.0993872900 -# File: 12 +# File: 12 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 7 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.4131153500 -0.0000450500 -0.0000062900 @@ -801,7 +801,7 @@ -0.0002135000 0.0011306500 -0.0020978500 -0.0017558800 0.0007257100 -0.0026093800 0.0017247700 0.0056690400 -0.0018804000 -# File: 13 +# File: 13 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 7 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.3965157000 0.0000490200 0.0000018100 @@ -868,7 +868,7 @@ -0.0005004100 0.0008441100 0.0001069200 -0.0012692800 0.0012142500 0.0002073300 -0.0003040300 -0.0041363800 0.0002694000 -# File: 14 +# File: 14 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 8 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.4043543400 0.0004688300 0.0000142700 @@ -935,7 +935,7 @@ 0.0045456200 0.0020230100 -0.0020865000 -0.0004763700 0.0058762100 -0.0022910500 0.0004513800 0.0005231200 -0.0021979100 -# File: 15 +# File: 15 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 8 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.4052874700 -0.0004658100 -0.0000016900 @@ -1002,7 +1002,7 @@ -0.0052597500 -0.0000192900 0.0000609900 -0.0025189900 -0.0039341900 -0.0001477300 0.0009391900 0.0010080400 0.0006238700 -# File: 16 +# File: 16 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4018514500 0.0060049500 0.0057824100 @@ -1069,7 +1069,7 @@ -0.0011201200 0.0072114400 -0.0017613200 -0.0022389100 0.0016361800 -0.0019383900 -0.0000822000 0.0001979900 -0.0015780300 -# File: 17 +# File: 17 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4076669500 -0.0058529600 -0.0056620500 @@ -1136,7 +1136,7 @@ 0.0004086100 -0.0051454800 -0.0002408900 -0.0007172400 0.0002746700 -0.0004244500 0.0014789200 0.0013481500 -0.0000079600 -# File: 18 +# File: 18 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4179138400 -0.0028628200 -0.0028628200 @@ -1203,7 +1203,7 @@ 0.0003535600 0.0002110000 -0.0002215100 0.0046345000 0.0002171600 -0.0004481600 0.0001193700 -0.0000024000 -0.0000115700 -# File: 19 +# File: 19 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3918188400 0.0027451300 0.0027451300 @@ -1270,7 +1270,7 @@ -0.0010110000 0.0017240700 -0.0017264400 -0.0077171600 0.0017526800 -0.0019652600 0.0012874000 0.0015625000 -0.0015762000 -# File: 20 +# File: 20 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4045796400 0.0010711100 -0.0018561800 @@ -1337,7 +1337,7 @@ -0.0015159100 -0.0005554900 -0.0020117900 -0.0022919500 0.0003992100 -0.0019891600 -0.0000298300 0.0014328000 -0.0015242200 -# File: 21 +# File: 21 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4050617200 -0.0010643500 0.0018718500 @@ -1404,7 +1404,7 @@ 0.0008496400 0.0025003200 -0.0000159000 -0.0007274400 0.0015565200 -0.0004238600 0.0014898600 0.0000689100 -0.0000112400 -# File: 22 +# File: 22 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4048901500 -0.0002387700 -0.0002387700 @@ -1471,7 +1471,7 @@ -0.0018532900 -0.0002059600 -0.0000118800 -0.0020806800 0.0002036100 -0.0004232900 0.0068395100 0.0000186500 -0.0000320700 -# File: 23 +# File: 23 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4047771300 0.0002461600 0.0002461600 @@ -1538,7 +1538,7 @@ 0.0011978900 0.0021643500 -0.0020128300 -0.0009233700 0.0017659600 -0.0019885300 -0.0055094800 0.0015417800 -0.0015573700 -# File: 24 +# File: 24 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4021791200 0.0057045700 -0.0057807800 @@ -1605,7 +1605,7 @@ -0.0011369300 0.0004161700 -0.0017843600 -0.0026752800 -0.0005673400 -0.0022247500 -0.0000563800 0.0069858300 -0.0015559300 -# File: 25 +# File: 25 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4075484600 -0.0058549800 0.0059063800 @@ -1672,7 +1672,7 @@ 0.0004275800 0.0015728900 -0.0002158100 -0.0003000100 0.0024792300 -0.0002161500 0.0014504200 -0.0053618400 -0.0000310800 -# File: 26 +# File: 26 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4176447700 -0.0027580400 0.0027580400 @@ -1739,7 +1739,7 @@ -0.0009325100 0.0002176400 -0.0002176400 -0.0029957700 -0.0002187200 -0.0002187200 0.0014023200 -0.0000179200 -0.0000179200 -# File: 27 +# File: 27 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3919080200 0.0028639600 -0.0028639600 @@ -1806,7 +1806,7 @@ 0.0002315300 0.0017816500 -0.0017816500 0.0000352000 0.0021463000 -0.0022173800 0.0000444600 0.0015127200 -0.0015208900 -# File: 28 +# File: 28 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4045685500 0.0010970200 0.0018690400 @@ -1873,7 +1873,7 @@ -0.0010855600 0.0016521800 -0.0017291400 -0.0022716600 0.0071872500 -0.0019717300 -0.0004648900 -0.0007749300 -0.0018038300 -# File: 29 +# File: 29 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4050730800 -0.0010984500 -0.0018531900 @@ -1940,7 +1940,7 @@ 0.0004394100 0.0002918100 -0.0002206100 -0.0007497500 -0.0051534900 -0.0004431900 0.0019046800 0.0022774200 0.0001910700 -# File: 30 +# File: 30 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4048157100 -0.0002523000 0.0002523000 @@ -2007,7 +2007,7 @@ 0.0057865900 0.0002378900 -0.0002378900 -0.0008027600 0.0001914200 -0.0004229500 -0.0008027600 -0.0004229500 0.0001914200 -# File: 31 +# File: 31 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4048023100 0.0002462700 -0.0002462700 @@ -2074,7 +2074,7 @@ -0.0065643500 0.0017626900 -0.0017626900 -0.0021585200 0.0017139500 -0.0019375100 0.0022515100 0.0019393100 -0.0018065700 -# File: 32 +# File: 32 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3990408400 0.0029281300 0.0056664200 @@ -2141,7 +2141,7 @@ 0.0003053900 0.0002647100 -0.0017267900 0.0047027900 0.0002088700 -0.0019766800 0.0001283700 -0.0000090600 -0.0015726400 -# File: 33 +# File: 33 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4104351100 -0.0028224100 -0.0055354700 @@ -2208,7 +2208,7 @@ -0.0010503500 0.0017792400 -0.0002227100 -0.0076358600 0.0017362700 -0.0004371400 0.0012759900 0.0015457700 -0.0000142500 -# File: 34 +# File: 34 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4075631700 -0.0130137600 -0.0028484200 @@ -2275,7 +2275,7 @@ -0.0011036200 0.0071358700 -0.0002375100 -0.0022802700 0.0016754800 -0.0004254600 -0.0000671500 0.0002030700 -0.0000242700 -# File: 35 +# File: 35 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4021720100 0.0129214900 0.0027564100 @@ -2342,7 +2342,7 @@ 0.0004171900 -0.0052229300 -0.0017638500 -0.0007813600 0.0003275200 -0.0019370100 0.0014849800 0.0013463600 -0.0015611600 -# File: 36 +# File: 36 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3990957300 0.0027959400 0.0057509900 @@ -2409,7 +2409,7 @@ -0.0011222400 0.0017827100 -0.0002946900 -0.0023070000 0.0017567600 -0.0004914800 -0.0000719800 0.0015516000 -0.0013586700 -# File: 37 +# File: 37 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.4104167400 -0.0026919500 -0.0055889200 @@ -2476,7 +2476,7 @@ 0.0003848300 0.0002566900 -0.0016459600 -0.0007548000 0.0002403700 -0.0018615100 0.0014887000 -0.0000118200 -0.0002181000 -# File: 38 +# File: 38 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3988884000 0.0026740400 -0.0059103400 @@ -2543,7 +2543,7 @@ -0.0018983100 -0.0001699200 -0.0020116000 -0.0020855300 0.0001889500 -0.0019887600 0.0069180200 -0.0000001500 -0.0015499300 -# File: 39 +# File: 39 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4108850600 -0.0027776700 0.0060201200 @@ -2610,7 +2610,7 @@ 0.0011554900 0.0021912000 -0.0000147100 -0.0009255100 0.0017573400 -0.0004232700 -0.0054368500 0.0015356000 -0.0000387600 -# File: 40 +# File: 40 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4076611300 -0.0129310600 0.0027268900 @@ -2677,7 +2677,7 @@ -0.0015479400 -0.0005109000 -0.0000136600 -0.0022790700 0.0004027900 -0.0004225400 -0.0000921100 0.0014728300 -0.0000100700 -# File: 41 +# File: 41 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4018479800 0.0130187300 -0.0028562000 @@ -2744,7 +2744,7 @@ 0.0008168600 0.0025468000 -0.0020144100 -0.0007194000 0.0015553700 -0.0019908000 0.0014466200 0.0001205000 -0.0015250000 -# File: 42 +# File: 42 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.4107756800 -0.0029170600 0.0061046700 @@ -2811,7 +2811,7 @@ -0.0013397000 0.0019939500 -0.0013397000 -0.0022793600 0.0017557200 -0.0017742600 -0.0000886900 0.0015489700 -0.0000886900 -# File: 43 +# File: 43 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3989744600 0.0028123300 -0.0059643900 @@ -2878,7 +2878,7 @@ 0.0006496600 -0.0000111200 -0.0006520000 -0.0007183200 0.0001900400 -0.0006245300 0.0014413700 0.0000377700 -0.0014429500 -# File: 44 +# File: 44 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4037398300 0.0002329500 -0.0018452900 @@ -2945,7 +2945,7 @@ -0.0009279400 0.0002089000 -0.0017815900 -0.0030532300 -0.0001887800 -0.0022182400 0.0013606600 0.0000371000 -0.0015252000 -# File: 45 +# File: 45 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4058938000 -0.0002307600 0.0018599700 @@ -3012,7 +3012,7 @@ 0.0002267800 0.0017710000 -0.0002184400 -0.0000008800 0.0021787700 -0.0002218900 -0.0000002200 0.0015636500 -0.0000109100 -# File: 46 +# File: 46 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4050669200 -0.0000413500 -0.0002455500 @@ -3079,7 +3079,7 @@ -0.0011271800 0.0004189900 -0.0002176100 -0.0027023600 -0.0005246600 -0.0002224600 -0.0000506700 0.0069097900 -0.0000321000 -# File: 47 +# File: 47 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4045704400 0.0000185900 0.0002523000 @@ -3146,7 +3146,7 @@ 0.0004387800 0.0015723100 -0.0017819500 -0.0003383100 0.0025274700 -0.0022187800 0.0014703300 -0.0054386900 -0.0015553600 -# File: 48 +# File: 48 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.4066898400 0.0002454100 0.0010967200 @@ -3213,7 +3213,7 @@ -0.0011260100 0.0017715000 -0.0015707900 -0.0024994200 0.0019732200 -0.0015509800 -0.0000709800 0.0015686900 -0.0000831800 -# File: 49 +# File: 49 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.4029375700 -0.0002434800 -0.0010925700 @@ -3280,7 +3280,7 @@ 0.0004376900 0.0002079900 -0.0004164800 -0.0005025400 -0.0000219800 -0.0008565300 0.0014377700 0.0000319500 -0.0014462500 -# File: 50 +# File: 50 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4037357800 0.0002633000 0.0018826900 @@ -3347,7 +3347,7 @@ 0.0058661000 0.0002254200 -0.0017608600 -0.0008471500 0.0002447300 -0.0019367400 -0.0008467100 -0.0003945400 -0.0018061300 -# File: 51 +# File: 51 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4059058600 -0.0002617400 -0.0018667700 @@ -3414,7 +3414,7 @@ -0.0064897800 0.0017527300 -0.0002407100 -0.0022069800 0.0017658800 -0.0004257300 0.0022079300 0.0019743500 0.0001921200 -# File: 52 +# File: 52 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4050666500 -0.0000221000 0.0002477100 @@ -3481,7 +3481,7 @@ -0.0011372000 0.0016994900 -0.0002218000 -0.0022590000 0.0071129100 -0.0004441800 -0.0004993500 -0.0007320900 0.0001910300 -# File: 53 +# File: 53 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4045796300 0.0000498400 -0.0002396200 @@ -3548,7 +3548,7 @@ 0.0003852300 0.0003371200 -0.0017283700 -0.0007369300 -0.0052327400 -0.0019711100 0.0018736800 0.0023247100 -0.0018033200 -# File: 54 +# File: 54 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.4029765200 -0.0002472800 0.0010743900 @@ -3615,7 +3615,7 @@ -0.0011391700 0.0017689500 -0.0002904100 -0.0022777000 0.0017704000 -0.0004977400 -0.0002904100 0.0017689500 -0.0011391700 -# File: 55 +# File: 55 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.4066760000 0.0002489300 -0.0010694800 @@ -3682,7 +3682,7 @@ 0.0003873800 0.0002597300 -0.0016532300 -0.0007709500 0.0002404300 -0.0018590900 0.0017049200 -0.0002278900 -0.0004411900 -# File: 56 +# File: 56 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4040336800 -0.0005657000 0.0007647900 @@ -3749,7 +3749,7 @@ 0.0015069300 0.0020802900 -0.0007485700 0.0003661000 0.0020593700 -0.0014468700 -0.0011663900 0.0018555000 -0.0005405900 -# File: 57 +# File: 57 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4056184200 0.0005688600 -0.0007743400 @@ -3816,7 +3816,7 @@ -0.0022221600 -0.0000866200 -0.0012414000 -0.0033590600 -0.0001054700 -0.0009539000 0.0025584800 -0.0003120700 -0.0010337800 -# File: 58 +# File: 58 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4054008600 0.0007878700 0.0007878700 @@ -3883,7 +3883,7 @@ 0.0007288900 0.0028661900 -0.0012407100 -0.0004187600 0.0028337400 -0.0009567500 0.0017849700 -0.0010970600 -0.0005400800 -# File: 59 +# File: 59 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4042389900 -0.0007966100 -0.0007966100 @@ -3950,7 +3950,7 @@ -0.0014353400 -0.0008613600 -0.0007474500 -0.0025825800 -0.0008916700 -0.0014466800 -0.0003819900 0.0026315200 -0.0010352800 -# File: 60 +# File: 60 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4040182200 0.0007077800 0.0007532000 @@ -4017,7 +4017,7 @@ -0.0022065500 0.0020812200 -0.0012399900 -0.0033734600 0.0020586000 -0.0009539800 0.0025759100 0.0018568200 -0.0010323500 -# File: 61 +# File: 61 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4055657000 -0.0006592800 -0.0007124900 @@ -4084,7 +4084,7 @@ 0.0015223700 -0.0000877500 -0.0007492900 0.0003510200 -0.0001061500 -0.0014482500 -0.0011544700 -0.0003130900 -0.0005427800 -# File: 62 +# File: 62 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3986122300 0.0007614100 0.0007614100 @@ -4151,7 +4151,7 @@ 0.0007295000 -0.0008622700 -0.0012429900 -0.0004198100 -0.0008892600 -0.0009549100 0.0017901100 0.0026353100 -0.0005455600 -# File: 63 +# File: 63 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4111043700 -0.0007716000 -0.0007716000 @@ -4218,7 +4218,7 @@ -0.0014279000 0.0028667200 -0.0007450800 -0.0025909900 0.0028312900 -0.0014473600 -0.0003771500 -0.0011007800 -0.0010306000 -# File: 64 +# File: 64 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4041595900 0.0007930400 0.0007386000 @@ -4285,7 +4285,7 @@ 0.0007311200 -0.0008759300 -0.0007476800 -0.0004211900 -0.0008785400 -0.0014494300 0.0017842700 0.0026447800 -0.0010317700 -# File: 65 +# File: 65 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4054311500 -0.0007383300 -0.0006941300 @@ -4352,7 +4352,7 @@ -0.0014345700 0.0028520300 -0.0012409300 -0.0025824800 0.0028502000 -0.0009527800 -0.0003811600 -0.0010818900 -0.0005442100 -# File: 66 +# File: 66 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4041169000 0.0061365400 0.0007526000 @@ -4419,7 +4419,7 @@ -0.0022209900 0.0020747700 -0.0007506400 -0.0033644100 0.0020654300 -0.0014456900 0.0025583600 0.0018578300 -0.0005360400 -# File: 67 +# File: 67 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4055313000 -0.0062107600 -0.0007587800 @@ -4486,7 +4486,7 @@ 0.0015078400 -0.0000888500 -0.0012387200 0.0003708400 -0.0001044400 -0.0009564300 -0.0011655900 -0.0003058900 -0.0010393800 -# File: 68 +# File: 68 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.4040833800 0.0007680500 0.0006656900 @@ -4553,7 +4553,7 @@ -0.0005970900 0.0007450900 -0.0010142100 -0.0012551900 0.0012287000 -0.0012185900 0.0009483400 0.0005315400 -0.0008314300 -# File: 69 +# File: 69 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.4055116100 -0.0007128300 -0.0006151200 @@ -4620,7 +4620,7 @@ -0.0001074500 0.0012396900 -0.0009497700 -0.0017471800 0.0007339200 -0.0011590200 0.0004521200 0.0010234600 -0.0007686600 -# File: 70 +# File: 70 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4063692000 0.0012580600 0.0009996500 @@ -4687,7 +4687,7 @@ 0.0007336500 0.0028512300 -0.0007485500 -0.0004231700 0.0028492200 -0.0014458500 0.0017882800 -0.0010843600 -0.0010313600 -# File: 71 +# File: 71 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4032239500 -0.0012220200 -0.0010365900 @@ -4754,7 +4754,7 @@ -0.0014287900 -0.0008759100 -0.0012416600 -0.0025897600 -0.0008774100 -0.0009559800 -0.0003770100 0.0026477000 -0.0005434300 -# File: 72 +# File: 72 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4036498400 -0.0014453600 0.0009797700 @@ -4821,7 +4821,7 @@ 0.0015227700 0.0020760300 -0.0012422200 0.0003533800 0.0020641200 -0.0009537000 -0.0011526600 0.0018589100 -0.0010348200 -# File: 73 +# File: 73 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4059601100 0.0014943000 -0.0010173100 @@ -4888,7 +4888,7 @@ -0.0022057500 -0.0000899000 -0.0007473100 -0.0033770300 -0.0001017100 -0.0014471700 0.0025749900 -0.0003061300 -0.0005408700 -# File: 74 +# File: 74 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.4037866000 0.0009569700 -0.0003515600 @@ -4955,7 +4955,7 @@ -0.0005925900 0.0012382800 -0.0010420800 -0.0012628700 0.0007358100 -0.0012476700 0.0009523700 0.0010223400 -0.0008072800 -# File: 75 +# File: 75 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.4058592600 -0.0009633700 0.0003485200 @@ -5022,7 +5022,7 @@ -0.0001003100 0.0007459600 -0.0009721300 -0.0017515800 0.0012271100 -0.0011798300 0.0004606000 0.0005313900 -0.0007425500 -# File: 76 +# File: 76 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4038339100 -0.0014841000 0.0012005300 @@ -5089,7 +5089,7 @@ 0.0053735000 0.0067719500 0.0017640100 0.0043424100 0.0069066400 -0.0040539700 -0.0051398200 0.0067024800 0.0020702000 -# File: 77 +# File: 77 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4058451000 0.0015309400 -0.0011672900 @@ -5156,7 +5156,7 @@ -0.0061941300 -0.0049338000 -0.0038575600 -0.0072312400 -0.0047999500 0.0015460600 0.0064268800 -0.0050041900 -0.0035396300 -# File: 78 +# File: 78 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4051684400 0.0009937100 0.0009937100 @@ -5223,7 +5223,7 @@ 0.0054263500 0.0067178100 0.0017596600 0.0044257300 0.0068195300 -0.0040589700 0.0064797800 -0.0049501200 -0.0035391400 -# File: 79 +# File: 79 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4044790100 -0.0009992800 -0.0009992800 @@ -5290,7 +5290,7 @@ -0.0062793500 -0.0048479300 -0.0038536400 -0.0072804300 -0.0047411600 0.0015511900 -0.0052221200 0.0066189400 0.0020679800 -# File: 80 +# File: 80 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3325372600 0.1030977700 0.0746091500 @@ -5357,7 +5357,7 @@ -0.0060645400 0.0067737800 -0.0037717800 -0.0073784200 0.0069263000 0.0016630000 0.0065476500 0.0067293200 -0.0036984800 -# File: 81 +# File: 81 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4829997500 -0.1060619800 -0.0807080700 @@ -5424,7 +5424,7 @@ 0.0054838500 -0.0049353400 0.0018868000 0.0042482300 -0.0048160800 -0.0039626400 -0.0050184400 -0.0050273700 0.0020175000 -# File: 82 +# File: 82 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3046512300 0.0724377800 0.0724377800 @@ -5491,7 +5491,7 @@ 0.0055671400 -0.0048435700 0.0018544400 0.0042743700 -0.0047482300 -0.0039265000 0.0065947700 0.0066367100 -0.0036208600 -# File: 83 +# File: 83 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.5075082400 -0.0781452500 -0.0781452500 @@ -5558,7 +5558,7 @@ -0.0061182400 0.0067144100 -0.0037371500 -0.0074307400 0.0068271200 0.0016264500 -0.0050365700 -0.0049690700 0.0019386100 -# File: 84 +# File: 84 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4063236200 -0.0009971600 0.0011131900 @@ -5625,7 +5625,7 @@ -0.0003700000 0.0012411100 -0.0007454800 -0.0145239400 0.0038384700 -0.0040606400 0.0006576400 0.0010169600 -0.0010270500 -# File: 85 +# File: 85 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4033629600 0.0009615000 -0.0011432600 @@ -5692,7 +5692,7 @@ -0.0003052800 0.0007545300 -0.0012377100 0.0114265200 -0.0017687200 0.0015453500 0.0007246000 0.0005249200 -0.0005433800 -# File: 86 +# File: 86 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4057781100 -0.0003474400 -0.0010333800 @@ -5759,7 +5759,7 @@ -0.0005934200 0.0020791600 -0.0028503100 -0.0042580100 0.0067520200 -0.0069228300 0.0004577000 0.0018526500 0.0010808700 -# File: 87 +# File: 87 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4038554300 0.0003453200 0.0010392500 @@ -5826,7 +5826,7 @@ -0.0001046700 -0.0000857000 0.0008760600 0.0013538500 -0.0049455200 0.0046403000 0.0009496400 -0.0003090600 -0.0026417300 -# File: 88 +# File: 88 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.4036189100 -0.0010139000 -0.0016030500 @@ -5893,7 +5893,7 @@ -0.0005941600 -0.0008620200 0.0000897900 0.0013531900 -0.0048631600 0.0047240400 0.0009488000 0.0026275100 0.0002967200 -# File: 89 +# File: 89 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.4060561100 0.0009804000 0.0015593200 @@ -5960,7 +5960,7 @@ -0.0001050100 0.0028667500 -0.0020739400 -0.0042569800 0.0067001300 -0.0069756400 0.0004580100 -0.0010953400 -0.0018669200 -# File: 90 +# File: 90 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4041141900 -0.0007766500 0.0007333600 @@ -6027,7 +6027,7 @@ -0.0132808500 0.0037415300 0.0017474700 -0.0015504900 0.0012215100 -0.0014435700 -0.0123126600 0.0036339100 -0.0036498900 -# File: 91 +# File: 91 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4055677200 0.0008152700 -0.0007851400 @@ -6094,7 +6094,7 @@ 0.0126723900 -0.0018636000 -0.0038493200 -0.0014826800 0.0007293100 -0.0009531200 0.0136302400 -0.0019738600 0.0019621400 -# File: 92 +# File: 92 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4056309200 0.0007431900 -0.0008125000 @@ -6161,7 +6161,7 @@ -0.0032156800 0.0069231700 0.0048433000 -0.0017508900 0.0020584000 0.0006671100 -0.0020508100 0.0065509100 -0.0065113500 -# File: 93 +# File: 93 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4040450100 -0.0006980800 0.0007591600 @@ -6228,7 +6228,7 @@ 0.0024097500 -0.0047831700 -0.0067128400 -0.0012584200 -0.0001043200 -0.0030542100 0.0035626200 -0.0051535900 0.0050569900 -# File: 94 +# File: 94 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.4040003800 -0.0007729500 0.0062067100 @@ -6295,7 +6295,7 @@ -0.0032099200 0.0068355300 0.0049346600 -0.0012620200 0.0028317800 -0.0001172800 0.0035647100 -0.0050712300 0.0051418900 -# File: 95 +# File: 95 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.4056224100 0.0007583300 -0.0061282200 @@ -6362,7 +6362,7 @@ 0.0024065500 -0.0047231500 -0.0067722500 -0.0017474100 -0.0008895200 -0.0022817900 -0.0020531400 0.0064964300 -0.0065646200 -# File: 96 +# File: 96 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4662241300 0.0919136500 -0.0594493100 @@ -6429,7 +6429,7 @@ -0.0005989900 0.0020835400 0.0008750100 -0.0043629900 0.0069073400 0.0046267000 0.0004449800 0.0018510100 -0.0026269100 -# File: 97 +# File: 97 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3381213400 -0.0946172300 0.0645655900 @@ -6496,7 +6496,7 @@ -0.0001014500 -0.0000984100 -0.0028477600 0.0012505400 -0.0048019500 -0.0069075600 0.0009581400 -0.0002987600 0.0010625200 -# File: 98 +# File: 98 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3074782900 -0.0667141300 0.0667141300 @@ -6563,7 +6563,7 @@ -0.0003875600 0.0012366600 -0.0012366600 -0.0144397700 0.0037427800 0.0015663200 0.0006699300 0.0010136800 -0.0005331900 -# File: 99 +# File: 99 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4990518600 0.0612594900 -0.0612594900 @@ -6630,7 +6630,7 @@ -0.0003398900 0.0007445000 -0.0007445000 0.0115207300 -0.0018940700 -0.0040745800 0.0007574200 0.0005409300 -0.0010392700 -# File: 100 +# File: 100 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4057940000 -0.0015210300 -0.0011996600 @@ -6697,7 +6697,7 @@ -0.0031022000 0.0067758100 -0.0067187700 -0.0017465800 0.0020625500 -0.0030577500 -0.0021532000 0.0067036800 0.0050529900 -# File: 101 +# File: 101 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4038076200 0.0015701900 0.0011672800 @@ -6764,7 +6764,7 @@ 0.0025084900 -0.0049357800 0.0048488000 -0.0012611700 -0.0001020700 0.0006699100 0.0034563100 -0.0050034300 -0.0065059200 -# File: 102 +# File: 102 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4051699900 -0.0010029900 0.0010029900 @@ -6831,7 +6831,7 @@ -0.0133659500 0.0038530200 -0.0038530200 -0.0015230400 0.0012263900 -0.0009519800 -0.0122301800 0.0035273500 0.0019606400 -# File: 103 +# File: 103 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4044659500 0.0009962100 -0.0009962100 @@ -6898,7 +6898,7 @@ 0.0125737900 -0.0017521300 0.0017521300 -0.0014574700 0.0007380300 -0.0014410200 0.0137228600 -0.0020903500 -0.0036504200 -# File: 104 +# File: 104 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4055940500 0.0007014600 -0.0007969600 @@ -6965,7 +6965,7 @@ -0.0001037600 0.0020770900 0.0008594700 0.0012481200 0.0067504400 0.0045203200 0.0009469100 0.0018549200 -0.0026631000 -# File: 105 +# File: 105 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4040955200 -0.0006530900 0.0007586100 @@ -7032,7 +7032,7 @@ -0.0005954200 -0.0000828600 -0.0028632900 -0.0043617400 -0.0049443300 -0.0070437600 0.0004609600 -0.0003109200 0.0010736200 -# File: 106 +# File: 106 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3986906600 -0.0007669500 0.0007669500 @@ -7099,7 +7099,7 @@ -0.0003974600 0.0007522100 -0.0007522100 -0.0144332800 -0.0017735900 -0.0039534900 0.0006795900 0.0005250100 -0.0010290000 -# File: 107 +# File: 107 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4108696800 0.0007543300 -0.0007543300 @@ -7166,7 +7166,7 @@ -0.0003290300 0.0012416200 -0.0012416200 0.0115146800 0.0038459000 0.0016675300 0.0007492600 0.0010176400 -0.0005555100 -# File: 108 +# File: 108 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4055853900 -0.0005862600 -0.0007885800 @@ -7233,7 +7233,7 @@ 0.0025098400 0.0069238500 -0.0068359300 -0.0012571000 0.0020586600 -0.0030695000 0.0034545800 0.0065466700 0.0049300700 -# File: 109 +# File: 109 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4040449600 0.0005907400 0.0008006200 @@ -7300,7 +7300,7 @@ -0.0031039500 -0.0047845200 0.0047284300 -0.0017498600 -0.0001049000 0.0006547000 -0.0021537300 -0.0051492500 -0.0066289600 -# File: 110 +# File: 110 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4053964000 -0.0007771900 0.0007771900 @@ -7367,7 +7367,7 @@ -0.0133649300 -0.0018698900 0.0018698900 -0.0015225300 0.0007303600 -0.0014483500 -0.0122234800 -0.0019798900 -0.0035452200 -# File: 111 +# File: 111 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4042435900 0.0007654400 -0.0007654400 diff --git a/example/Si-LDA/POSCAR-unitcell b/example/Si-LDA/POSCAR-unitcell index 113179e4..9ed0e5fc 100644 --- a/example/Si-LDA/POSCAR-unitcell +++ b/example/Si-LDA/POSCAR-unitcell @@ -13,4 +13,4 @@ Direct 0.1250000000000000 0.1250000000000000 0.1250000000000000 0.1250000000000000 0.6250000000000000 0.6250000000000000 0.6250000000000000 0.1250000000000000 0.6250000000000000 - 0.6250000000000000 0.6250000000000000 0.1250000000000000 \ No newline at end of file + 0.6250000000000000 0.6250000000000000 0.1250000000000000 diff --git a/example/Si-LDA/phono3py_disp.yaml b/example/Si-LDA/phono3py_disp.yaml index 4ff13fb0..0ecad25b 100644 --- a/example/Si-LDA/phono3py_disp.yaml +++ b/example/Si-LDA/phono3py_disp.yaml @@ -849,4 +849,4 @@ displacement_pairs: displacement_pair_info: number_of_singles: 1 - number_of_pairs: 110 \ No newline at end of file + number_of_pairs: 110 diff --git a/example/Si-PBE/FORCES_FC3 b/example/Si-PBE/FORCES_FC3 index af75bc50..7234188f 100644 --- a/example/Si-PBE/FORCES_FC3 +++ b/example/Si-PBE/FORCES_FC3 @@ -1,4 +1,4 @@ -# File: 1 +# File: 1 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3871386400 0.0000000000 0.0000000000 0.0005494400 0.0000000000 0.0000000000 @@ -64,7 +64,7 @@ -0.0002769400 0.0009038800 -0.0009038800 -0.0014327100 0.0008891400 -0.0012465000 0.0006623300 0.0006388400 -0.0007069700 -# File: 2 +# File: 2 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 1 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.6607453600 -0.2750030800 -0.0340348000 @@ -131,7 +131,7 @@ 0.0001573500 0.0005027100 -0.0024150800 -0.0017969100 0.0012991000 -0.0027872600 0.0016537300 0.0016242300 -0.0017348000 -# File: 3 +# File: 3 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 1 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.1135216400 0.2738477000 0.0058339700 @@ -198,7 +198,7 @@ -0.0007315300 0.0013081200 0.0005947800 -0.0010638700 0.0004596800 0.0002811500 -0.0002479500 -0.0002660600 0.0002682500 -# File: 4 +# File: 4 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 2 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.3867494600 0.0009304200 0.0000309000 @@ -265,7 +265,7 @@ 0.1069218400 0.1081008500 -0.0847210200 -0.0005016500 0.0018194600 -0.0022382500 0.0002762800 0.0010754300 -0.0022229000 -# File: 5 +# File: 5 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 2 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.3875260900 -0.0009306700 -0.0000051800 @@ -332,7 +332,7 @@ -0.1166478000 -0.1154647700 0.0953019000 -0.0022848000 0.0000377200 -0.0003153900 0.0010501700 0.0001839800 0.0007953900 -# File: 6 +# File: 6 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 3 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.3862050100 0.0003877100 0.0000212100 @@ -399,7 +399,7 @@ 0.0006537700 0.0018362600 -0.0018929100 0.1057718100 0.1080879800 -0.0850566000 0.0010977900 0.0002553700 -0.0022227400 -# File: 7 +# File: 7 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 3 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.3880702400 -0.0003888900 0.0000046800 @@ -466,7 +466,7 @@ -0.0011285500 0.0000503300 0.0000240500 -0.1178078100 -0.1154805700 0.0949533900 0.0002081800 0.0010239000 0.0007948500 -# File: 8 +# File: 8 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 3 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3871387000 0.0000256200 0.0013168200 @@ -533,7 +533,7 @@ -0.0009645100 0.0002155400 0.0053077000 -0.0675367500 -0.0652255000 0.0945514900 -0.0002627300 -0.0005723100 -0.0021826100 -# File: 9 +# File: 9 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 4 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.3872589100 -0.0001235400 0.0000148400 @@ -600,7 +600,7 @@ -0.0006630800 0.0013421600 -0.0024207100 -0.0009982500 0.0005037800 -0.0027649500 0.1078593900 0.1078425000 -0.0845045900 -# File: 10 +# File: 10 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 4 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.3870114500 0.0001266900 0.0000199700 @@ -667,7 +667,7 @@ 0.0001111000 0.0004474500 0.0005996400 -0.0018852300 0.0012765000 0.0002585600 -0.1157061000 -0.1157360400 0.0954806300 -# File: 11 +# File: 11 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 4 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3871340700 0.0000345800 -0.0115469500 @@ -734,7 +734,7 @@ -0.0014907700 -0.0000161000 -0.0023786600 -0.0023582400 -0.0003230400 -0.0027202400 -0.0654532400 -0.0654900600 0.0950904600 -# File: 12 +# File: 12 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 7 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.3952936400 -0.0001234600 -0.0000043900 @@ -801,7 +801,7 @@ -0.0001324700 0.0010483400 -0.0019629600 -0.0015987900 0.0007211800 -0.0025276900 0.0015983600 0.0054771600 -0.0016459300 -# File: 13 +# File: 13 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 7 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.3789725900 0.0001247000 0.0000008500 @@ -868,7 +868,7 @@ -0.0004348500 0.0007458400 0.0001533100 -0.0012797600 0.0010437700 0.0000340000 -0.0002595800 -0.0042154300 0.0001978900 -# File: 14 +# File: 14 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 8 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.3867296900 0.0004081400 0.0000117900 @@ -935,7 +935,7 @@ 0.0045601100 0.0018455500 -0.0018412400 -0.0004910000 0.0057290200 -0.0021820100 0.0004946800 0.0004722700 -0.0019901600 -# File: 15 +# File: 15 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 8 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.3875467400 -0.0004077200 -0.0000019100 @@ -1002,7 +1002,7 @@ -0.0051295000 -0.0000235200 -0.0000003500 -0.0023601700 -0.0039662200 -0.0003448700 0.0008164200 0.0007917400 0.0005751200 -# File: 16 +# File: 16 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3842647300 0.0058789300 0.0056309100 @@ -1069,7 +1069,7 @@ -0.0009635000 0.0071207400 -0.0015867900 -0.0020847200 0.0015074600 -0.0018493400 -0.0000909500 0.0001054800 -0.0014643400 -# File: 17 +# File: 17 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3898969200 -0.0057255100 -0.0055037500 @@ -1136,7 +1136,7 @@ 0.0003995900 -0.0052374400 -0.0002309000 -0.0007276400 0.0002262500 -0.0006055400 0.0014063800 0.0011712300 0.0000408000 -# File: 18 +# File: 18 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4001151700 -0.0027773400 -0.0027773400 @@ -1203,7 +1203,7 @@ 0.0003884700 0.0002027600 -0.0002671600 0.0047038800 0.0002085600 -0.0005767600 0.0001236100 -0.0001074100 0.0000397600 -# File: 19 +# File: 19 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3742682300 0.0026666300 0.0026666300 @@ -1270,7 +1270,7 @@ -0.0008977000 0.0015516900 -0.0015025000 -0.0076466100 0.0015793700 -0.0019261000 0.0012009300 0.0013941000 -0.0014632400 -# File: 20 +# File: 20 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3869151600 0.0010072300 -0.0018485800 @@ -1337,7 +1337,7 @@ -0.0014875500 -0.0005729300 -0.0018289700 -0.0021875500 0.0003530300 -0.0020019100 0.0000108800 0.0012578600 -0.0013092700 -# File: 21 +# File: 21 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3873613500 -0.0010034100 0.0018635900 @@ -1404,7 +1404,7 @@ 0.0009685400 0.0023377900 -0.0000143100 -0.0006871100 0.0014247200 -0.0005002900 0.0013668900 -0.0000248600 -0.0000667900 -# File: 22 +# File: 22 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3871848700 -0.0002230700 -0.0002230700 @@ -1471,7 +1471,7 @@ -0.0017102000 -0.0003437000 -0.0000122400 -0.0019679400 0.0001442000 -0.0005011900 0.0067997000 -0.0000353800 -0.0000310300 -# File: 23 +# File: 23 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3871132400 0.0002303800 0.0002303800 @@ -1538,7 +1538,7 @@ 0.0011986900 0.0021167400 -0.0018309000 -0.0008966800 0.0016437100 -0.0020009200 -0.0055518100 0.0013230500 -0.0013930600 -# File: 24 +# File: 24 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3845739500 0.0055726400 -0.0056168400 @@ -1605,7 +1605,7 @@ -0.0010322600 0.0003681600 -0.0016606800 -0.0026471100 -0.0005838600 -0.0021775200 -0.0000151000 0.0068516900 -0.0013914000 -# File: 25 +# File: 25 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3897815500 -0.0057288000 0.0057481100 @@ -1672,7 +1672,7 @@ 0.0004691100 0.0014391200 -0.0001563600 -0.0001826300 0.0023195900 -0.0003511500 0.0013292400 -0.0054982500 -0.0000320500 -# File: 26 +# File: 26 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3997973800 -0.0026699800 0.0026699800 @@ -1739,7 +1739,7 @@ -0.0008164600 0.0001578900 -0.0001578900 -0.0028554300 -0.0003563400 -0.0003563400 0.0013254100 -0.0000704600 -0.0000704600 -# File: 27 +# File: 27 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3743745900 0.0027713400 -0.0027713400 @@ -1806,7 +1806,7 @@ 0.0002628200 0.0016588600 -0.0016588600 0.0000326300 0.0021001200 -0.0021719400 0.0000435400 0.0012950200 -0.0013056600 -# File: 28 +# File: 28 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3869003300 0.0010309600 0.0018586100 @@ -1873,7 +1873,7 @@ -0.0009309200 0.0015218700 -0.0015042200 -0.0021161000 0.0070992700 -0.0019333000 -0.0005498200 -0.0008366000 -0.0016313200 -# File: 29 +# File: 29 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3873748000 -0.0010352300 -0.0018435500 @@ -1940,7 +1940,7 @@ 0.0004302100 0.0002413700 -0.0002656900 -0.0007589500 -0.0052445400 -0.0005693500 0.0019090300 0.0020711400 0.0001818600 -# File: 30 +# File: 30 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3871125900 -0.0002367000 0.0002367000 @@ -2007,7 +2007,7 @@ 0.0058594300 0.0002284700 -0.0002284700 -0.0007717300 0.0001832000 -0.0006050300 -0.0007717300 -0.0006050300 0.0001832000 -# File: 31 +# File: 31 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3871373600 0.0002298000 -0.0002298000 @@ -2074,7 +2074,7 @@ -0.0064899300 0.0015890300 -0.0015890300 -0.0020496500 0.0015418100 -0.0018498100 0.0021388500 0.0018481200 -0.0016328900 -# File: 32 +# File: 32 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3814869600 0.0028382700 0.0055085300 @@ -2141,7 +2141,7 @@ 0.0003392100 0.0002548600 -0.0015020500 0.0047762000 0.0002025800 -0.0019381700 0.0001297400 -0.0001120800 -0.0014600500 -# File: 33 +# File: 33 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3926216300 -0.0027427100 -0.0053709000 @@ -2208,7 +2208,7 @@ -0.0009376900 0.0016062700 -0.0002677300 -0.0075651700 0.0015661400 -0.0005642200 0.0011942000 0.0013803000 0.0000368000 -# File: 34 +# File: 34 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3897996400 -0.0128822100 -0.0027526500 @@ -2275,7 +2275,7 @@ -0.0009502500 0.0070455500 -0.0002277700 -0.0021281600 0.0015461100 -0.0006063500 -0.0000784500 0.0001094800 0.0000262500 -# File: 35 +# File: 35 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3845650200 0.0127713200 0.0026642200 @@ -2342,7 +2342,7 @@ 0.0004060800 -0.0053142800 -0.0015895700 -0.0007906400 0.0002766600 -0.0018486200 0.0014122100 0.0011685400 -0.0014492700 -# File: 36 +# File: 36 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3815721700 0.0027082700 0.0056206600 @@ -2409,7 +2409,7 @@ -0.0009148100 0.0016095300 -0.0002452300 -0.0021539800 0.0015313600 -0.0005795000 -0.0000817300 0.0013851100 -0.0012352800 -# File: 37 +# File: 37 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3925662200 -0.0026132700 -0.0054574600 @@ -2476,7 +2476,7 @@ 0.0003230900 0.0002514100 -0.0015180600 -0.0007643700 0.0002846400 -0.0018689700 0.0014155600 -0.0001167000 -0.0001781100 -# File: 38 +# File: 38 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3813320900 0.0025897900 -0.0057518000 @@ -2543,7 +2543,7 @@ -0.0017525200 -0.0003047600 -0.0018282000 -0.0019702700 0.0001323400 -0.0020015700 0.0068769500 -0.0000508900 -0.0013869700 -# File: 39 +# File: 39 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3930845900 -0.0026881100 0.0058717100 @@ -2610,7 +2610,7 @@ 0.0011558400 0.0021470800 -0.0000150700 -0.0008954800 0.0016366400 -0.0005005300 -0.0054757400 0.0013183200 -0.0000367200 -# File: 40 +# File: 40 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3898874000 -0.0127750500 0.0026528200 @@ -2677,7 +2677,7 @@ -0.0015216600 -0.0005319900 -0.0000125000 -0.0021763700 0.0003559700 -0.0004988000 -0.0000511300 0.0012973600 -0.0000657600 -# File: 41 +# File: 41 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3842648600 0.0128760800 -0.0027770200 @@ -2744,7 +2744,7 @@ 0.0009329800 0.0023824400 -0.0018308500 -0.0006797800 0.0014227300 -0.0020035100 0.0013226000 0.0000241900 -0.0013101800 -# File: 42 +# File: 42 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3929529800 -0.0028255500 0.0059837600 @@ -2811,7 +2811,7 @@ -0.0011780800 0.0018132300 -0.0011780800 -0.0021767400 0.0016350900 -0.0017785100 -0.0000471000 0.0012787800 -0.0000471000 -# File: 43 +# File: 43 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3814430100 0.0027264100 -0.0058383500 @@ -2878,7 +2878,7 @@ 0.0006307100 -0.0000118100 -0.0006305500 -0.0006792300 0.0001338800 -0.0007140200 0.0013179800 0.0000365500 -0.0013224100 -# File: 44 +# File: 44 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3861213800 0.0002162000 -0.0018376600 @@ -2945,7 +2945,7 @@ -0.0008124300 0.0001498200 -0.0016586100 -0.0029075700 -0.0003218800 -0.0021710500 0.0012802700 -0.0000161400 -0.0013100000 -# File: 45 +# File: 45 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3881504200 -0.0002170000 0.0018522900 @@ -3012,7 +3012,7 @@ 0.0002580100 0.0016484900 -0.0001582400 -0.0000005800 0.0021349800 -0.0003576500 -0.0000002400 0.0013471300 -0.0000660800 -# File: 46 +# File: 46 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3873647800 -0.0000219600 -0.0002291900 @@ -3079,7 +3079,7 @@ -0.0010232900 0.0003696200 -0.0001579300 -0.0026778400 -0.0005432200 -0.0003569700 -0.0000119700 0.0067752800 -0.0000321600 -# File: 47 +# File: 47 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3869040500 -0.0000021700 0.0002359600 @@ -3146,7 +3146,7 @@ 0.0004787700 0.0014385700 -0.0016589500 -0.0002222900 0.0023643700 -0.0021716300 0.0013463700 -0.0055741600 -0.0013914600 -# File: 48 +# File: 48 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3889995100 0.0002268300 0.0010312400 @@ -3213,7 +3213,7 @@ -0.0010226000 0.0016495700 -0.0014379400 -0.0023362900 0.0017924200 -0.0015226100 0.0000233900 0.0013506000 -0.0000435700 -# File: 49 +# File: 49 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3852599800 -0.0002276000 -0.0010275900 @@ -3280,7 +3280,7 @@ 0.0004778100 0.0001492600 -0.0003692700 -0.0005230700 -0.0000202400 -0.0009714200 0.0012631800 -0.0000195900 -0.0013264100 -# File: 50 +# File: 50 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3861173900 0.0002446100 0.0018716100 @@ -3347,7 +3347,7 @@ 0.0059386600 0.0002175200 -0.0015874800 -0.0008144100 0.0002375000 -0.0018477100 -0.0008146800 -0.0005731200 -0.0016331400 -# File: 51 +# File: 51 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3881608200 -0.0002441300 -0.0018559300 @@ -3414,7 +3414,7 @@ -0.0064163800 0.0015802000 -0.0002301500 -0.0020955700 0.0015947500 -0.0006076500 0.0020959500 0.0018852900 0.0001832900 -# File: 52 +# File: 52 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3873685200 -0.0000046900 0.0002315200 @@ -3481,7 +3481,7 @@ -0.0009828600 0.0015666500 -0.0002663400 -0.0021071000 0.0070243800 -0.0005699100 -0.0005867000 -0.0007960200 0.0001820500 -# File: 53 +# File: 53 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3869124200 0.0000284900 -0.0002239200 @@ -3548,7 +3548,7 @@ 0.0003754700 0.0002852100 -0.0015034200 -0.0007484700 -0.0053224600 -0.0019329200 0.0018759500 0.0021161800 -0.0016314900 -# File: 54 +# File: 54 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3853055600 -0.0002317100 0.0010128000 @@ -3615,7 +3615,7 @@ -0.0009847200 0.0015427000 -0.0002410400 -0.0020698700 0.0015977600 -0.0005839300 -0.0002410400 0.0015427000 -0.0009847200 -# File: 55 +# File: 55 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3889845200 0.0002324300 -0.0010081000 @@ -3682,7 +3682,7 @@ 0.0003776700 0.0003026500 -0.0015225000 -0.0008331600 0.0002337700 -0.0018645500 0.0015718800 -0.0002713500 -0.0004301500 -# File: 56 +# File: 56 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3863818600 -0.0005262500 0.0007344700 @@ -3749,7 +3749,7 @@ 0.0015699900 0.0019254200 -0.0006735000 0.0004286400 0.0019070800 -0.0014764900 -0.0011993600 0.0016568700 -0.0004764400 -# File: 57 +# File: 57 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3879028100 0.0005264100 -0.0007439500 @@ -3816,7 +3816,7 @@ -0.0021388200 -0.0001136700 -0.0011345500 -0.0032794000 -0.0001321400 -0.0010173500 0.0025087500 -0.0003831500 -0.0009368300 -# File: 58 +# File: 58 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3876740300 0.0007541600 0.0007541600 @@ -3883,7 +3883,7 @@ 0.0007401100 0.0027659500 -0.0011347500 -0.0004117400 0.0027351800 -0.0010174600 0.0016799800 -0.0012236600 -0.0004760700 -# File: 59 +# File: 59 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3866006700 -0.0007638500 -0.0007638500 @@ -3950,7 +3950,7 @@ -0.0012983900 -0.0009431500 -0.0006736000 -0.0024496300 -0.0009713100 -0.0014767600 -0.0003598500 0.0024863900 -0.0009381900 -# File: 60 +# File: 60 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3864190200 0.0006656900 0.0006192500 @@ -4017,7 +4017,7 @@ -0.0021246300 0.0019263500 -0.0011331300 -0.0032928100 0.0019058000 -0.0010149100 0.0025251800 0.0016579200 -0.0009361300 -# File: 61 +# File: 61 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3877987000 -0.0006213500 -0.0005814100 @@ -4084,7 +4084,7 @@ 0.0015857800 -0.0001151000 -0.0006740200 0.0004128100 -0.0001316900 -0.0014773000 -0.0011858900 -0.0003845200 -0.0004783500 -# File: 62 +# File: 62 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3809293000 0.0006799000 0.0006799000 @@ -4151,7 +4151,7 @@ 0.0007412400 -0.0009440800 -0.0011361800 -0.0004132300 -0.0009698200 -0.0010154500 0.0016846600 0.0024893300 -0.0004809100 -# File: 63 +# File: 63 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3934199400 -0.0006899700 -0.0006899700 @@ -4218,7 +4218,7 @@ -0.0012913300 0.0027665200 -0.0006712400 -0.0024557000 0.0027333700 -0.0014770500 -0.0003560600 -0.0012264500 -0.0009340500 -# File: 64 +# File: 64 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3865173600 0.0007097200 0.0006036200 @@ -4285,7 +4285,7 @@ 0.0007401100 -0.0009584300 -0.0006730800 -0.0004128000 -0.0009583300 -0.0014781500 0.0016794300 0.0025007000 -0.0009357000 -# File: 65 +# File: 65 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3877101200 -0.0006566300 -0.0005624700 @@ -4352,7 +4352,7 @@ -0.0012979800 0.0027512600 -0.0011340100 -0.0024486000 0.0027516400 -0.0010138900 -0.0003589900 -0.0012082200 -0.0004789200 -# File: 66 +# File: 66 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3865144500 0.0061372400 0.0006681700 @@ -4419,7 +4419,7 @@ -0.0021397600 0.0019201100 -0.0006754500 -0.0032833000 0.0019121500 -0.0014748800 0.0025075100 0.0016592400 -0.0004717200 -# File: 67 +# File: 67 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3877662600 -0.0062136000 -0.0006737600 @@ -4486,7 +4486,7 @@ 0.0015710300 -0.0001165500 -0.0011316200 0.0004331200 -0.0001299900 -0.0010173700 -0.0011977900 -0.0003775500 -0.0009429200 -# File: 68 +# File: 68 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3865344000 0.0006871300 0.0006262400 @@ -4553,7 +4553,7 @@ -0.0005099800 0.0006694200 -0.0009045200 -0.0011988100 0.0011240500 -0.0012451100 0.0008900000 0.0004125900 -0.0007309200 -# File: 69 +# File: 69 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3876998100 -0.0006340500 -0.0005784300 @@ -4620,7 +4620,7 @@ -0.0000508900 0.0011312300 -0.0008791000 -0.0016594800 0.0006612200 -0.0012236700 0.0004274200 0.0008721900 -0.0007070800 -# File: 70 +# File: 70 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3886130400 0.0012989700 0.0009065000 @@ -4687,7 +4687,7 @@ 0.0007430100 0.0027504900 -0.0006743100 -0.0004148900 0.0027508000 -0.0014754200 0.0016837000 -0.0012097700 -0.0009351900 -# File: 71 +# File: 71 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3856180300 -0.0012628200 -0.0009431200 @@ -4754,7 +4754,7 @@ -0.0012931300 -0.0009576000 -0.0011341500 -0.0024543900 -0.0009572700 -0.0010177700 -0.0003559400 0.0025020800 -0.0004780700 -# File: 72 +# File: 72 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3859265400 -0.0013797000 0.0008889700 @@ -4821,7 +4821,7 @@ 0.0015858200 0.0019207700 -0.0011344500 0.0004156900 0.0019106000 -0.0010157700 -0.0011845600 0.0016601200 -0.0009374400 -# File: 73 +# File: 73 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3883136000 0.0014236700 -0.0009261400 @@ -4888,7 +4888,7 @@ -0.0021243800 -0.0001173300 -0.0006734000 -0.0032956100 -0.0001280100 -0.0014781200 0.0025232600 -0.0003783100 -0.0004760100 -# File: 74 +# File: 74 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3861980900 0.0008659800 -0.0002779800 @@ -4955,7 +4955,7 @@ -0.0005032000 0.0011306600 -0.0009311900 -0.0012074000 0.0006630200 -0.0012728300 0.0008959200 0.0008715600 -0.0007075300 -# File: 75 +# File: 75 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3880827600 -0.0008741600 0.0002767600 @@ -5022,7 +5022,7 @@ -0.0000435700 0.0006699300 -0.0009005800 -0.0016648400 0.0011222300 -0.0012442300 0.0004356300 0.0004130400 -0.0006822200 -# File: 76 +# File: 76 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3862414400 -0.0014170400 0.0012458700 @@ -5089,7 +5089,7 @@ 0.0052838900 0.0065513300 0.0017717300 0.0042604800 0.0066917200 -0.0040095600 -0.0050274000 0.0064415600 0.0020607000 -# File: 77 +# File: 77 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3880687100 0.0014589100 -0.0012122600 @@ -5156,7 +5156,7 @@ -0.0059670400 -0.0048984900 -0.0036766400 -0.0069966500 -0.0047588400 0.0014194800 0.0062227500 -0.0050093600 -0.0033773900 -# File: 78 +# File: 78 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3874141000 0.0009029600 0.0009029600 @@ -5223,7 +5223,7 @@ 0.0053707300 0.0064643000 0.0017679900 0.0043696100 0.0065762200 -0.0040139200 0.0063081900 -0.0049228100 -0.0033764100 -# File: 79 +# File: 79 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3868619100 -0.0009094200 -0.0009094200 @@ -5290,7 +5290,7 @@ -0.0060795000 -0.0047858400 -0.0036729000 -0.0070800600 -0.0046688300 0.0014239100 -0.0051382300 0.0063296700 0.0020597900 -# File: 80 +# File: 80 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3211005800 0.0983802600 0.0681944700 @@ -5357,7 +5357,7 @@ -0.0058284400 0.0065524200 -0.0035989100 -0.0071496900 0.0067087300 0.0015349700 0.0063506500 0.0064627000 -0.0035248000 -# File: 81 +# File: 81 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4586056000 -0.1012365500 -0.0738186000 @@ -5424,7 +5424,7 @@ 0.0054033900 -0.0049003500 0.0018883500 0.0041555200 -0.0047752100 -0.0039329200 -0.0048972000 -0.0050287000 0.0020126400 -# File: 82 +# File: 82 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.2913478900 0.0661853000 0.0661853000 @@ -5491,7 +5491,7 @@ 0.0055173300 -0.0047832600 0.0018558400 0.0042153600 -0.0046763900 -0.0038892000 0.0064293000 0.0063452500 -0.0034525200 -# File: 83 +# File: 83 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4853727000 -0.0714499400 -0.0714499400 @@ -5558,7 +5558,7 @@ -0.0059156800 0.0064617100 -0.0035662600 -0.0072338300 0.0065833700 0.0014926000 -0.0049494500 -0.0049385400 0.0019403800 -# File: 84 +# File: 84 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3885702100 -0.0009092700 0.0011596100 @@ -5625,7 +5625,7 @@ -0.0002778200 0.0011347300 -0.0006699400 -0.0143158300 0.0036601700 -0.0040169000 0.0006363400 0.0008652600 -0.0009305500 -# File: 85 +# File: 85 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3857465300 0.0008743800 -0.0011932500 @@ -5692,7 +5692,7 @@ -0.0002520000 0.0006797200 -0.0011307000 0.0113446000 -0.0017760200 0.0014182900 0.0006636600 0.0004054600 -0.0004769600 -# File: 86 +# File: 86 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3880050000 -0.0002770600 -0.0009414100 @@ -5759,7 +5759,7 @@ -0.0005049300 0.0019247100 -0.0027502400 -0.0041040500 0.0065335400 -0.0068057100 0.0004320300 0.0016544400 0.0011529700 -# File: 87 +# File: 87 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3862632000 0.0002762500 0.0009458900 @@ -5826,7 +5826,7 @@ -0.0000482600 -0.0001131200 0.0009575200 0.0013356500 -0.0049100000 0.0044416900 0.0008918500 -0.0003810200 -0.0025520200 -# File: 88 +# File: 88 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3858913900 -0.0009234500 -0.0015271400 @@ -5893,7 +5893,7 @@ -0.0005056200 -0.0009435800 0.0001169200 0.0013349100 -0.0047989100 0.0045538300 0.0008912700 0.0024833800 0.0003138500 -# File: 89 +# File: 89 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3884200000 0.0008891100 0.0014854500 @@ -5960,7 +5960,7 @@ -0.0000477000 0.0027659900 -0.0019204300 -0.0041034800 0.0064484000 -0.0068922100 0.0004325400 -0.0012207500 -0.0017236200 -# File: 90 +# File: 90 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3864728300 -0.0006416600 0.0006504400 @@ -6027,7 +6027,7 @@ -0.0130553100 0.0035682300 0.0017564400 -0.0014586200 0.0011156000 -0.0014723400 -0.0122188600 0.0034099500 -0.0034805500 -# File: 91 +# File: 91 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3878434300 0.0006760100 -0.0007035700 @@ -6094,7 +6094,7 @@ 0.0126078200 -0.0018665200 -0.0036703700 -0.0014308900 0.0006556800 -0.0010134700 0.0134373400 -0.0020262700 0.0019604500 -# File: 92 +# File: 92 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3878116200 0.0006981100 -0.0007273500 @@ -6161,7 +6161,7 @@ -0.0030503900 0.0067069300 0.0047813300 -0.0016629600 0.0019053900 0.0006129500 -0.0020098900 0.0062850000 -0.0062672500 -# File: 93 +# File: 93 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3864966900 -0.0006575700 0.0006738200 @@ -6228,7 +6228,7 @@ 0.0023991700 -0.0047448400 -0.0064606500 -0.0012029700 -0.0001306200 -0.0030911000 0.0034310000 -0.0051621700 0.0049830000 -# File: 94 +# File: 94 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3863981600 -0.0006931100 0.0062060800 @@ -6295,7 +6295,7 @@ -0.0030472200 0.0065909100 0.0048991900 -0.0012059600 0.0027342100 -0.0002257400 0.0034331700 -0.0050511800 0.0050955100 -# File: 95 +# File: 95 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3878630400 0.0006792800 -0.0061293100 @@ -6362,7 +6362,7 @@ 0.0023960300 -0.0046542400 -0.0065522700 -0.0016599800 -0.0009707500 -0.0022631300 -0.0020116500 0.0061994200 -0.0063544700 -# File: 96 +# File: 96 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4431401500 0.0880460900 -0.0541813800 @@ -6429,7 +6429,7 @@ -0.0005094300 0.0019291800 0.0009563400 -0.0042029900 0.0066921500 0.0044279700 0.0004246500 0.0016526800 -0.0025358900 -# File: 97 +# File: 97 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3262487300 -0.0906604000 0.0588956600 @@ -6496,7 +6496,7 @@ -0.0000454100 -0.0001253700 -0.0027498300 0.0012412200 -0.0047600400 -0.0067927200 0.0009008800 -0.0003713100 0.0011358000 -# File: 98 +# File: 98 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.2940771700 -0.0608832600 0.0608832600 @@ -6563,7 +6563,7 @@ -0.0002923700 0.0011314200 -0.0011314200 -0.0142159600 0.0035675800 0.0014337200 0.0006519900 0.0008623100 -0.0004661800 -# File: 99 +# File: 99 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4772149200 0.0558590700 -0.0558590700 @@ -6630,7 +6630,7 @@ -0.0002860100 0.0006694100 -0.0006694100 0.0114545300 -0.0018949100 -0.0040316700 0.0006967200 0.0004222600 -0.0009412000 -# File: 100 +# File: 100 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3880204000 -0.0014488000 -0.0012459200 @@ -6697,7 +6697,7 @@ -0.0029475100 0.0065539800 -0.0064650100 -0.0016597400 0.0019100300 -0.0030938100 -0.0021054100 0.0064426100 0.0049802900 -# File: 101 +# File: 101 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3862166000 0.0014924900 0.0012097600 @@ -6764,7 +6764,7 @@ 0.0024908700 -0.0049007500 0.0047856000 -0.0012048400 -0.0001276200 0.0006156000 0.0033326200 -0.0050095600 -0.0062642000 -# File: 102 +# File: 102 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3874151800 -0.0009099000 0.0009099000 @@ -6831,7 +6831,7 @@ -0.0131545000 0.0036741100 -0.0036741100 -0.0014335500 0.0011210400 -0.0010138000 -0.0121162800 0.0033085900 0.0019596200 -# File: 103 +# File: 103 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3868570300 0.0009038300 -0.0009038300 @@ -6898,7 +6898,7 @@ 0.0124946500 -0.0017608400 0.0017608400 -0.0014079300 0.0006645500 -0.0014714900 0.0135465500 -0.0021376800 -0.0034807400 -# File: 104 +# File: 104 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3878324600 0.0006596900 -0.0006590900 @@ -6965,7 +6965,7 @@ -0.0000471500 0.0019228400 0.0009415500 0.0012373600 0.0065322500 0.0043130900 0.0008901600 0.0016570600 -0.0025729300 -# File: 105 +# File: 105 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3864915800 -0.0006150800 0.0006212900 @@ -7032,7 +7032,7 @@ -0.0005074400 -0.0001110600 -0.0027639700 -0.0042000200 -0.0049085000 -0.0069350200 0.0004350300 -0.0003834500 0.0011442200 -# File: 106 +# File: 106 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3810058900 -0.0006825900 0.0006825900 @@ -7099,7 +7099,7 @@ -0.0003021900 0.0006784400 -0.0006784400 -0.0142093300 -0.0017819600 -0.0039173300 0.0006597600 0.0004048800 -0.0009323600 -# File: 107 +# File: 107 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3931887400 0.0006721900 -0.0006721900 @@ -7166,7 +7166,7 @@ -0.0002759000 0.0011359200 -0.0011359200 0.0114484900 0.0036672200 0.0015314900 0.0006889400 0.0008657000 -0.0004891300 -# File: 108 +# File: 108 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3878723300 -0.0005436600 -0.0007568800 @@ -7233,7 +7233,7 @@ 0.0024919900 0.0067073200 -0.0065926700 -0.0012018900 0.0019057400 -0.0031075100 0.0033321700 0.0062821400 0.0048512500 -# File: 109 +# File: 109 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3863927700 0.0005447200 0.0007660900 @@ -7300,7 +7300,7 @@ -0.0029492700 -0.0047455900 0.0046571200 -0.0016622200 -0.0001311500 0.0006000500 -0.0021050200 -0.0051594200 -0.0063954500 -# File: 110 +# File: 110 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3876735600 -0.0007454400 0.0007454400 @@ -7367,7 +7367,7 @@ -0.0131544200 -0.0018697900 0.0018697900 -0.0014333600 0.0006548200 -0.0014805000 -0.0121095900 -0.0020325500 -0.0033792900 -# File: 111 +# File: 111 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3866021800 0.0007360500 -0.0007360500 diff --git a/example/Si-PBE/POSCAR-unitcell b/example/Si-PBE/POSCAR-unitcell index beec05e2..0f6fbe2f 100644 --- a/example/Si-PBE/POSCAR-unitcell +++ b/example/Si-PBE/POSCAR-unitcell @@ -13,4 +13,4 @@ Direct 0.1250000000000000 0.1250000000000000 0.1250000000000000 0.1250000000000000 0.6250000000000000 0.6250000000000000 0.6250000000000000 0.1250000000000000 0.6250000000000000 - 0.6250000000000000 0.6250000000000000 0.1250000000000000 \ No newline at end of file + 0.6250000000000000 0.6250000000000000 0.1250000000000000 diff --git a/example/Si-PBE/phono3py_disp.yaml b/example/Si-PBE/phono3py_disp.yaml index b736c863..967b9ae4 100644 --- a/example/Si-PBE/phono3py_disp.yaml +++ b/example/Si-PBE/phono3py_disp.yaml @@ -849,4 +849,4 @@ displacement_pairs: displacement_pair_info: number_of_singles: 1 - number_of_pairs: 110 \ No newline at end of file + number_of_pairs: 110 diff --git a/example/Si-PBEsol/FORCES_FC3 b/example/Si-PBEsol/FORCES_FC3 index ad46ce0b..963ff91b 100644 --- a/example/Si-PBEsol/FORCES_FC3 +++ b/example/Si-PBEsol/FORCES_FC3 @@ -1,4 +1,4 @@ -# File: 1 +# File: 1 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3968201400 0.0000000000 0.0000000000 0.0005878300 0.0000000000 0.0000000000 @@ -64,7 +64,7 @@ -0.0003760000 0.0009874300 -0.0009874300 -0.0014775900 0.0009712500 -0.0011918000 0.0006882300 0.0007423100 -0.0007584100 -# File: 2 +# File: 2 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 1 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.6772678900 -0.2819277000 -0.0358889800 @@ -131,7 +131,7 @@ 0.0000464900 0.0006116300 -0.0025198500 -0.0018160900 0.0013707700 -0.0027515600 0.0017720700 0.0018204600 -0.0018547700 -# File: 3 +# File: 3 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 1 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.1163652300 0.2806988700 0.0061513100 @@ -198,7 +198,7 @@ -0.0008199100 0.0013657300 0.0005330100 -0.0011352000 0.0005498300 0.0003556500 -0.0003131800 -0.0002539400 0.0002896400 -# File: 4 +# File: 4 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 2 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.3964039100 0.0009276500 0.0000337600 @@ -265,7 +265,7 @@ 0.1117584500 0.1131205300 -0.0911710900 -0.0004548000 0.0019931600 -0.0022553100 0.0003279600 0.0011691400 -0.0022945600 -# File: 5 +# File: 5 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 2 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.3972353300 -0.0009280600 -0.0000057100 @@ -332,7 +332,7 @@ -0.1221147600 -0.1207500000 0.1022652300 -0.0024204800 0.0000286000 -0.0001849800 0.0010493100 0.0002964800 0.0007646800 -# File: 6 +# File: 6 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 3 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.3958914300 0.0004157000 0.0000229300 @@ -399,7 +399,7 @@ 0.0006464300 0.0020121900 -0.0020474300 0.1106625200 0.1131050100 -0.0913683000 0.0011139600 0.0003857000 -0.0022942900 -# File: 7 +# File: 7 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 3 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.3977497000 -0.0004160400 0.0000051800 @@ -466,7 +466,7 @@ -0.0013180300 0.0000427700 0.0000157800 -0.1232211600 -0.1207674400 0.1020544100 0.0002429800 0.0011004000 0.0007644300 -# File: 8 +# File: 8 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 3 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3968203900 0.0000278800 0.0013129200 @@ -533,7 +533,7 @@ -0.0011163900 0.0002459000 0.0051490500 -0.0724609700 -0.0700235500 0.0971595300 -0.0003210400 -0.0004160600 -0.0022806600 -# File: 9 +# File: 9 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 4 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.3968876300 -0.0000693300 0.0000115000 @@ -600,7 +600,7 @@ -0.0007362400 0.0014161800 -0.0025251600 -0.0010537100 0.0006116500 -0.0027311800 0.1128203000 0.1128809000 -0.0909203700 -# File: 10 +# File: 10 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 4 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.3967475700 0.0000724300 0.0000190700 @@ -667,7 +667,7 @@ -0.0000142400 0.0005395400 0.0005371300 -0.0019208800 0.0013313900 0.0003344600 -0.1210479300 -0.1210000400 0.1024740800 -# File: 11 +# File: 11 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 4 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3968156800 0.0000303700 -0.0116038000 @@ -734,7 +734,7 @@ -0.0015371900 -0.0000160000 -0.0025086400 -0.0024877400 -0.0001889900 -0.0027123500 -0.0703073500 -0.0702668900 0.0975909800 -# File: 12 +# File: 12 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 7 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.4050146400 -0.0000691500 -0.0000064300 @@ -801,7 +801,7 @@ -0.0002384800 0.0011246300 -0.0020716000 -0.0017161900 0.0007312100 -0.0025890200 0.0016780500 0.0055644300 -0.0018076600 -# File: 13 +# File: 13 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 7 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.3886148600 0.0000702800 0.0000012200 @@ -868,7 +868,7 @@ -0.0005280300 0.0008352400 0.0000950800 -0.0012547600 0.0011947300 0.0002065900 -0.0002881700 -0.0040945700 0.0002556100 -# File: 14 +# File: 14 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 8 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.3963724100 0.0004475500 0.0000131500 @@ -935,7 +935,7 @@ 0.0044454200 0.0019837800 -0.0020355600 -0.0004812200 0.0057953700 -0.0022382200 0.0004486900 0.0005045100 -0.0021577900 -# File: 15 +# File: 15 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 8 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.3972681100 -0.0004471900 -0.0000021500 @@ -1002,7 +1002,7 @@ -0.0052118400 0.0000048600 0.0000254700 -0.0024603000 -0.0038683800 -0.0001805700 0.0009116500 0.0009644200 0.0006421200 -# File: 16 +# File: 16 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3939519800 0.0058183400 0.0055670600 @@ -1069,7 +1069,7 @@ -0.0011158200 0.0071295100 -0.0017236700 -0.0021824700 0.0016148900 -0.0018983100 -0.0000840200 0.0001823900 -0.0015351500 -# File: 17 +# File: 17 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3995693700 -0.0056732700 -0.0054537400 @@ -1136,7 +1136,7 @@ 0.0003523300 -0.0050800000 -0.0002632500 -0.0007213000 0.0002821600 -0.0004471400 0.0014498900 0.0013010900 0.0000075200 -# File: 18 +# File: 18 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4096762700 -0.0027672400 -0.0027672400 @@ -1203,7 +1203,7 @@ 0.0003150300 0.0002352300 -0.0002470100 0.0045852800 0.0002387800 -0.0004704200 0.0001221800 -0.0000216700 0.0000057500 -# File: 19 +# File: 19 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3840574800 0.0026527000 0.0026527000 @@ -1270,7 +1270,7 @@ -0.0010215900 0.0016873400 -0.0016892500 -0.0076171900 0.0017148000 -0.0019246100 0.0012551900 0.0015167100 -0.0015331800 -# File: 20 +# File: 20 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3965841300 0.0010517400 -0.0018379200 @@ -1337,7 +1337,7 @@ -0.0015335700 -0.0005359400 -0.0019966100 -0.0022513500 0.0004076500 -0.0019663500 -0.0000156900 0.0013874300 -0.0014644100 -# File: 21 +# File: 21 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3970558800 -0.0010481300 0.0018526200 @@ -1404,7 +1404,7 @@ 0.0008148100 0.0024666500 -0.0000159900 -0.0007144900 0.0015330300 -0.0004278200 0.0014437700 0.0000528000 -0.0000142700 -# File: 22 +# File: 22 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3968794600 -0.0002355700 -0.0002355700 @@ -1471,7 +1471,7 @@ -0.0018535900 -0.0002057500 -0.0000138000 -0.0020395200 0.0002080800 -0.0004291800 0.0067518800 0.0000166500 -0.0000310300 -# File: 23 +# File: 23 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3967852100 0.0002417800 0.0002417800 @@ -1538,7 +1538,7 @@ 0.0011463600 0.0021476500 -0.0019986700 -0.0009144400 0.0017446200 -0.0019649800 -0.0054512100 0.0014794600 -0.0014974700 -# File: 24 +# File: 24 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3942721300 0.0055232600 -0.0055693500 @@ -1605,7 +1605,7 @@ -0.0011499800 0.0004245700 -0.0017635200 -0.0026397000 -0.0005482000 -0.0022072200 -0.0000416200 0.0068803000 -0.0014963400 -# File: 25 +# File: 25 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3994511000 -0.0056719200 0.0056871700 @@ -1672,7 +1672,7 @@ 0.0003878200 0.0015493200 -0.0002221700 -0.0002819400 0.0024461600 -0.0002141500 0.0014056300 -0.0053204600 -0.0000317000 -# File: 26 +# File: 26 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4094040500 -0.0026590200 0.0026590200 @@ -1739,7 +1739,7 @@ -0.0009416200 0.0002241800 -0.0002241800 -0.0029449200 -0.0002196900 -0.0002196900 0.0013761300 -0.0000185400 -0.0000185400 -# File: 27 +# File: 27 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3841483200 0.0027636500 -0.0027636500 @@ -1806,7 +1806,7 @@ 0.0001909600 0.0017614800 -0.0017614800 0.0000339600 0.0021291800 -0.0022017700 0.0000443400 0.0014513300 -0.0014599500 -# File: 28 +# File: 28 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3965713400 0.0010774600 0.0018488900 @@ -1873,7 +1873,7 @@ -0.0010825200 0.0016309700 -0.0016914100 -0.0022139600 0.0071054400 -0.0019318800 -0.0004716000 -0.0007792000 -0.0017669400 -# File: 29 +# File: 29 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3970678900 -0.0010817900 -0.0018342900 @@ -1940,7 +1940,7 @@ 0.0003826600 0.0002992900 -0.0002457100 -0.0007528800 -0.0050880700 -0.0004633000 0.0018805300 0.0022197700 0.0002127400 -# File: 30 +# File: 30 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3968055600 -0.0002485000 0.0002485000 @@ -2007,7 +2007,7 @@ 0.0056869600 0.0002605900 -0.0002605900 -0.0007907600 0.0002139400 -0.0004468000 -0.0007907600 -0.0004468000 0.0002139400 -# File: 31 +# File: 31 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3968098400 0.0002423000 -0.0002423000 @@ -2074,7 +2074,7 @@ -0.0065142400 0.0017257200 -0.0017257200 -0.0021197300 0.0016763700 -0.0018990300 0.0022111400 0.0018986500 -0.0017684800 -# File: 32 +# File: 32 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3912195600 0.0028279300 0.0054555400 @@ -2141,7 +2141,7 @@ 0.0002656400 0.0002862400 -0.0016890300 0.0046556100 0.0002316900 -0.0019368100 0.0001290900 -0.0000268600 -0.0015301000 -# File: 33 +# File: 33 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4022598900 -0.0027286100 -0.0053310000 @@ -2208,7 +2208,7 @@ -0.0010619900 0.0017406700 -0.0002478100 -0.0075354300 0.0016990100 -0.0004580200 0.0012456800 0.0015011500 0.0000026100 -# File: 34 +# File: 34 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3994687700 -0.0127760000 -0.0027506100 @@ -2275,7 +2275,7 @@ -0.0011004300 0.0070552500 -0.0002603300 -0.0022238500 0.0016535300 -0.0004484400 -0.0000694700 0.0001870000 -0.0000080800 -# File: 35 +# File: 35 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3942633300 0.0126801700 0.0026584600 @@ -2342,7 +2342,7 @@ 0.0003603700 -0.0051557700 -0.0017261500 -0.0007833600 0.0003330800 -0.0018971100 0.0014562500 0.0012990700 -0.0015190500 -# File: 36 +# File: 36 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3913025800 0.0026982300 0.0055713200 @@ -2409,7 +2409,7 @@ -0.0011172800 0.0017446000 -0.0003033800 -0.0022495100 0.0017173300 -0.0004984200 -0.0000734500 0.0015063600 -0.0013129100 -# File: 37 +# File: 37 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.4022123900 -0.0025993400 -0.0054154600 @@ -2476,7 +2476,7 @@ 0.0003277600 0.0002820900 -0.0016269400 -0.0007572900 0.0002624200 -0.0018406900 0.0014602000 -0.0000321000 -0.0002026000 -# File: 38 +# File: 38 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3910727700 0.0025787300 -0.0056932700 @@ -2543,7 +2543,7 @@ -0.0018978800 -0.0001687600 -0.0019961700 -0.0020425100 0.0001951200 -0.0019656400 0.0068282400 -0.0000010700 -0.0014910300 -# File: 39 +# File: 39 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4026992700 -0.0026814200 0.0057988800 @@ -2610,7 +2610,7 @@ 0.0011020100 0.0021762000 -0.0000163700 -0.0009140200 0.0017362800 -0.0004283900 -0.0053761900 0.0014741000 -0.0000373600 -# File: 40 +# File: 40 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3995611300 -0.0126866900 0.0026337500 @@ -2677,7 +2677,7 @@ -0.0015659200 -0.0004928900 -0.0000141500 -0.0022390100 0.0004112000 -0.0004265700 -0.0000770100 0.0014263300 -0.0000135700 -# File: 41 +# File: 41 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3939515700 0.0127725200 -0.0027612100 @@ -2744,7 +2744,7 @@ 0.0007814900 0.0025119400 -0.0019984800 -0.0007057500 0.0015317400 -0.0019676600 0.0014017500 0.0001028200 -0.0014650400 -# File: 42 +# File: 42 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.4025581500 -0.0028185000 0.0059146900 @@ -2811,7 +2811,7 @@ -0.0013599000 0.0019795600 -0.0013599000 -0.0022392200 0.0017345700 -0.0017501200 -0.0000726800 0.0014863900 -0.0000726800 -# File: 43 +# File: 43 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3911868900 0.0027150800 -0.0057777000 @@ -2878,7 +2878,7 @@ 0.0006137700 -0.0000098100 -0.0006209000 -0.0007054500 0.0001968400 -0.0006323400 0.0013966300 0.0000364600 -0.0013995100 -# File: 44 +# File: 44 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3957578500 0.0002274500 -0.0018267400 @@ -2945,7 +2945,7 @@ -0.0009382200 0.0002145700 -0.0017610700 -0.0029989000 -0.0001875700 -0.0022004400 0.0013316800 0.0000350700 -0.0014653000 -# File: 45 +# File: 45 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3978777000 -0.0002281400 0.0018408600 @@ -3012,7 +3012,7 @@ 0.0001853400 0.0017497100 -0.0002243400 -0.0000005100 0.0021623500 -0.0002207700 -0.0000001900 0.0015017300 -0.0000135900 -# File: 46 +# File: 46 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3970584800 -0.0000318200 -0.0002415400 @@ -3079,7 +3079,7 @@ -0.0011399000 0.0004271000 -0.0002240900 -0.0026680000 -0.0005064400 -0.0002201300 -0.0000368000 0.0068050900 -0.0000324700 -# File: 47 +# File: 47 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3965748200 0.0000071500 0.0002474000 @@ -3146,7 +3146,7 @@ 0.0003989800 0.0015490900 -0.0017614400 -0.0003200500 0.0024925400 -0.0022011000 0.0014248400 -0.0053955600 -0.0014958800 -# File: 48 +# File: 48 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3986710000 0.0002397000 0.0010777700 @@ -3213,7 +3213,7 @@ -0.0011390900 0.0017506800 -0.0015479900 -0.0024647200 0.0019577600 -0.0015665900 -0.0000541300 0.0015064000 -0.0000691200 -# File: 49 +# File: 49 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3949538600 -0.0002400900 -0.0010741900 @@ -3280,7 +3280,7 @@ 0.0003980400 0.0002134600 -0.0004256000 -0.0004852800 -0.0000208000 -0.0008231000 0.0013923400 0.0000303700 -0.0014030900 -# File: 50 +# File: 50 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3957538500 0.0002575200 0.0018623500 @@ -3347,7 +3347,7 @@ 0.0057651900 0.0002479800 -0.0017238900 -0.0008339700 0.0002666500 -0.0018965600 -0.0008351500 -0.0004170400 -0.0017689100 -# File: 51 +# File: 51 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3978896800 -0.0002574400 -0.0018471800 @@ -3414,7 +3414,7 @@ -0.0064414000 0.0017154000 -0.0002624400 -0.0021658300 0.0017271400 -0.0004489800 0.0021669000 0.0019346300 0.0002144700 -# File: 52 +# File: 52 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3970639900 -0.0000139500 0.0002432500 @@ -3481,7 +3481,7 @@ -0.0011329900 0.0016764500 -0.0002466300 -0.0022029900 0.0070319200 -0.0004637600 -0.0005058800 -0.0007372000 0.0002124300 -# File: 53 +# File: 53 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3965817100 0.0000384800 -0.0002364200 @@ -3548,7 +3548,7 @@ 0.0003294700 0.0003431500 -0.0016904400 -0.0007406600 -0.0051656500 -0.0019314200 0.0018493400 0.0022663500 -0.0017666800 -# File: 54 +# File: 54 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3949971800 -0.0002435100 0.0010573300 @@ -3615,7 +3615,7 @@ -0.0011350900 0.0017299500 -0.0002985900 -0.0022181900 0.0017312900 -0.0005033900 -0.0002985900 0.0017299500 -0.0011350900 -# File: 55 +# File: 55 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3986565100 0.0002437500 -0.0010526900 @@ -3682,7 +3682,7 @@ 0.0003317500 0.0002827400 -0.0016319700 -0.0007749800 0.0002623800 -0.0018356300 0.0016801100 -0.0002501300 -0.0003876000 -# File: 56 +# File: 56 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3960466400 -0.0005514700 0.0007511800 @@ -3749,7 +3749,7 @@ 0.0014612500 0.0020547600 -0.0007450400 0.0003737100 0.0020338600 -0.0014332700 -0.0011628000 0.0018062700 -0.0005156800 -# File: 57 +# File: 57 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3976044600 0.0005523200 -0.0007620200 @@ -3816,7 +3816,7 @@ -0.0022271400 -0.0000759100 -0.0012301000 -0.0033142800 -0.0000959500 -0.0009505800 0.0025244000 -0.0003252900 -0.0010008000 -# File: 58 +# File: 58 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3973832200 0.0007730100 0.0007730100 @@ -3883,7 +3883,7 @@ 0.0006868500 0.0028392200 -0.0012303600 -0.0004113300 0.0028070900 -0.0009506800 0.0017514700 -0.0011097900 -0.0005153300 -# File: 59 +# File: 59 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3962559000 -0.0007839200 -0.0007839200 @@ -3950,7 +3950,7 @@ -0.0014424000 -0.0008500600 -0.0007447900 -0.0025399700 -0.0008793300 -0.0014333300 -0.0003791400 0.0025800100 -0.0010013400 -# File: 60 +# File: 60 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3960474100 0.0006911400 0.0007209100 @@ -4017,7 +4017,7 @@ -0.0022137400 0.0020558900 -0.0012289800 -0.0033275400 0.0020334800 -0.0009482100 0.0025408700 0.0018076200 -0.0009994900 -# File: 61 +# File: 61 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3975352400 -0.0006467500 -0.0006829900 @@ -4084,7 +4084,7 @@ 0.0014767300 -0.0000775100 -0.0007459100 0.0003580500 -0.0000957300 -0.0014349500 -0.0011502200 -0.0003267200 -0.0005175100 -# File: 62 +# File: 62 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3906880500 0.0007307200 0.0007307200 @@ -4151,7 +4151,7 @@ 0.0006876000 -0.0008504400 -0.0012322800 -0.0004124500 -0.0008775100 -0.0009489100 0.0017561600 0.0025834700 -0.0005201800 -# File: 63 +# File: 63 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4030255700 -0.0007421700 -0.0007421700 @@ -4218,7 +4218,7 @@ -0.0014352900 0.0028393000 -0.0007422000 -0.0025465100 0.0028048100 -0.0014342400 -0.0003758000 -0.0011128400 -0.0009969400 -# File: 64 +# File: 64 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3961737000 0.0007608300 0.0007064700 @@ -4285,7 +4285,7 @@ 0.0006869100 -0.0008643700 -0.0007447400 -0.0004121500 -0.0008667400 -0.0014358000 0.0017510000 0.0025938900 -0.0009986600 -# File: 65 +# File: 65 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3974171700 -0.0007093400 -0.0006649700 @@ -4352,7 +4352,7 @@ -0.0014422600 0.0028247900 -0.0012299900 -0.0025392100 0.0028234400 -0.0009471900 -0.0003789200 -0.0010944000 -0.0005185200 -# File: 66 +# File: 66 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3961433300 0.0060622000 0.0007220800 @@ -4419,7 +4419,7 @@ -0.0022283500 0.0020495000 -0.0007472100 -0.0033182900 0.0020399000 -0.0014323700 0.0025234800 0.0018086300 -0.0005108600 -# File: 67 +# File: 67 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3975026300 -0.0061376400 -0.0007293900 @@ -4486,7 +4486,7 @@ 0.0014622900 -0.0000786500 -0.0012274900 0.0003778600 -0.0000942100 -0.0009508600 -0.0011616400 -0.0003196100 -0.0010063200 -# File: 68 +# File: 68 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3961125800 0.0007366000 0.0006512200 @@ -4553,7 +4553,7 @@ -0.0006203200 0.0007414600 -0.0009974600 -0.0012321100 0.0012175300 -0.0011995500 0.0009286100 0.0005039100 -0.0007920700 -# File: 69 +# File: 69 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3974849600 -0.0006850500 -0.0006030900 @@ -4620,7 +4620,7 @@ -0.0001374800 0.0012272100 -0.0009528800 -0.0017169200 0.0007305900 -0.0011594300 0.0004412000 0.0009873200 -0.0007494500 -# File: 70 +# File: 70 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3983412100 0.0012465100 0.0009906200 @@ -4687,7 +4687,7 @@ 0.0006894700 0.0028241900 -0.0007455800 -0.0004142700 0.0028222400 -0.0014325600 0.0017550100 -0.0010964100 -0.0009985600 -# File: 71 +# File: 71 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3952542700 -0.0012124900 -0.0010290400 @@ -4754,7 +4754,7 @@ -0.0014370900 -0.0008636900 -0.0012297100 -0.0025449300 -0.0008658100 -0.0009514600 -0.0003748500 0.0025960700 -0.0005177300 -# File: 72 +# File: 72 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3956611600 -0.0014223600 0.0009709800 @@ -4821,7 +4821,7 @@ 0.0014767500 0.0020501100 -0.0012302400 0.0003607500 0.0020380100 -0.0009486600 -0.0011486200 0.0018093900 -0.0010012400 -# File: 73 +# File: 73 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3979468600 0.0014677600 -0.0010099800 @@ -4888,7 +4888,7 @@ -0.0022135500 -0.0000793100 -0.0007448500 -0.0033301500 -0.0000922000 -0.0014350500 0.0025393600 -0.0003204400 -0.0005152800 -# File: 74 +# File: 74 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3957947400 0.0009494800 -0.0003788600 @@ -4955,7 +4955,7 @@ -0.0006146600 0.0012267600 -0.0010249800 -0.0012401100 0.0007324300 -0.0012281200 0.0009333200 0.0009868900 -0.0007684300 -# File: 75 +# File: 75 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3978485800 -0.0009568600 0.0003728800 @@ -5022,7 +5022,7 @@ -0.0001307100 0.0007419500 -0.0009746000 -0.0017211600 0.0012155700 -0.0011800900 0.0004491400 0.0005042700 -0.0007237000 -# File: 76 +# File: 76 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3958428300 -0.0014597800 0.0011913500 @@ -5089,7 +5089,7 @@ 0.0051363000 0.0065841100 0.0016759800 0.0041531900 0.0067145400 -0.0039459300 -0.0049390600 0.0064864900 0.0020007300 -# File: 77 +# File: 77 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3978331200 0.0015031600 -0.0011598500 @@ -5156,7 +5156,7 @@ -0.0060033500 -0.0047559900 -0.0037523000 -0.0069926400 -0.0046258300 0.0014612500 0.0061995600 -0.0048546800 -0.0034162600 -# File: 78 +# File: 78 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3971898300 0.0009842300 0.0009842300 @@ -5223,7 +5223,7 @@ 0.0052211100 0.0064986700 0.0016718500 0.0042657900 0.0065951800 -0.0039506000 0.0062829300 -0.0047702600 -0.0034153900 -# File: 79 +# File: 79 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3964552900 -0.0009894900 -0.0009894900 @@ -5290,7 +5290,7 @@ -0.0061194500 -0.0046397000 -0.0037478200 -0.0070741500 -0.0045377600 0.0014659400 -0.0050535900 0.0063708400 0.0019997700 -# File: 80 +# File: 80 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3259103400 0.1011996400 0.0731806400 @@ -5357,7 +5357,7 @@ -0.0058795400 0.0065857300 -0.0036704000 -0.0071339400 0.0067334700 0.0015759200 0.0063148700 0.0065112900 -0.0035701800 -# File: 81 +# File: 81 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4734658100 -0.1040813600 -0.0791169700 @@ -5424,7 +5424,7 @@ 0.0052433600 -0.0047589300 0.0017964300 0.0040636400 -0.0046444700 -0.0038603700 -0.0048236300 -0.0048780500 0.0019509300 -# File: 82 +# File: 82 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.2984766100 0.0710577600 0.0710577600 @@ -5491,7 +5491,7 @@ 0.0053588800 -0.0046358300 0.0017625400 0.0041196900 -0.0045453800 -0.0038215100 0.0063960300 0.0063885700 -0.0034945400 -# File: 83 +# File: 83 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4976123500 -0.0766133800 -0.0766133800 @@ -5558,7 +5558,7 @@ -0.0059625600 0.0064947800 -0.0036361700 -0.0072202000 0.0066026400 0.0015382500 -0.0048723100 -0.0047884200 0.0018754700 -# File: 84 +# File: 84 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3982967000 -0.0009912600 0.0011047900 @@ -5625,7 +5625,7 @@ -0.0003861000 0.0012296000 -0.0007420400 -0.0142556800 0.0037332000 -0.0039533800 0.0006523100 0.0009814200 -0.0009941000 -# File: 85 +# File: 85 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3953871700 0.0009543800 -0.0011362300 @@ -5692,7 +5692,7 @@ -0.0003409200 0.0007513500 -0.0012266200 0.0112097700 -0.0016815100 0.0014600600 0.0006993500 0.0004973300 -0.0005166000 -# File: 86 +# File: 86 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3977680500 -0.0003737100 -0.0010249400 @@ -5759,7 +5759,7 @@ -0.0006158000 0.0020540300 -0.0028240100 -0.0041367100 0.0065638900 -0.0067019100 0.0004458700 0.0018036100 0.0010909200 -# File: 87 +# File: 87 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3958649400 0.0003677000 0.0010280600 @@ -5826,7 +5826,7 @@ -0.0001354800 -0.0000752000 0.0008634600 0.0012823500 -0.0047689200 0.0044337500 0.0009299700 -0.0003226500 -0.0025931000 -# File: 88 +# File: 88 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3956283600 -0.0010072400 -0.0015755800 @@ -5893,7 +5893,7 @@ -0.0006164800 -0.0008500300 0.0000787900 0.0012815900 -0.0046546400 0.0045491100 0.0009292800 0.0025766100 0.0003078600 -# File: 89 +# File: 89 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3980447900 0.0009709500 0.0015326000 @@ -5960,7 +5960,7 @@ -0.0001347700 0.0028393800 -0.0020496500 -0.0041361100 0.0064811000 -0.0067859400 0.0004465800 -0.0011061500 -0.0018207500 -# File: 90 +# File: 90 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3961290100 -0.0007461200 0.0007035400 @@ -6027,7 +6027,7 @@ -0.0130642100 0.0036392300 0.0016600700 -0.0015134800 0.0012098800 -0.0014300000 -0.0120873000 0.0035048700 -0.0035231100 -# File: 91 +# File: 91 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3975508200 0.0007802300 -0.0007553200 @@ -6094,7 +6094,7 @@ 0.0124038900 -0.0017737800 -0.0037449400 -0.0014663200 0.0007260400 -0.0009473900 0.0133726000 -0.0019103800 0.0018967700 -# File: 92 +# File: 92 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3975983900 0.0007250100 -0.0007806300 @@ -6161,7 +6161,7 @@ -0.0031411700 0.0067321800 0.0046355100 -0.0017199600 0.0020321600 0.0006568900 -0.0019710500 0.0063380300 -0.0062707700 -# File: 93 +# File: 93 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3960745200 -0.0006841200 0.0007287500 @@ -6228,7 +6228,7 @@ 0.0022884800 -0.0046101200 -0.0064947300 -0.0012356000 -0.0000941900 -0.0030259800 0.0034486000 -0.0049998600 0.0048693800 -# File: 94 +# File: 94 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3960282200 -0.0007435200 0.0061319300 @@ -6295,7 +6295,7 @@ -0.0031380800 0.0066111300 0.0047564300 -0.0012389000 0.0028057700 -0.0001255700 0.0034507000 -0.0048853100 0.0049856600 -# File: 95 +# File: 95 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3975945300 0.0007276400 -0.0060560800 @@ -6362,7 +6362,7 @@ 0.0022851100 -0.0045208400 -0.0065847600 -0.0017166900 -0.0008783300 -0.0022540700 -0.0019734900 0.0062546000 -0.0063553200 -# File: 96 +# File: 96 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4571417700 0.0903113000 -0.0584047600 @@ -6429,7 +6429,7 @@ -0.0006199600 0.0020587400 0.0008626400 -0.0042382900 0.0067158000 0.0044205900 0.0004377500 0.0018017100 -0.0025776600 -# File: 97 +# File: 97 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3313446300 -0.0929414100 0.0633816100 @@ -6496,7 +6496,7 @@ -0.0001322600 -0.0000878000 -0.0028235700 0.0011829100 -0.0046276200 -0.0066884100 0.0009391500 -0.0003134200 0.0010745000 -# File: 98 +# File: 98 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3012259200 -0.0654834700 0.0654834700 @@ -6563,7 +6563,7 @@ -0.0004016400 0.0012272000 -0.0012272000 -0.0141716700 0.0036370400 0.0014766100 0.0006679400 0.0009776600 -0.0005061300 -# File: 99 +# File: 99 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4893953100 0.0601783600 -0.0601783600 @@ -6630,7 +6630,7 @@ -0.0003750300 0.0007416000 -0.0007416000 0.0113051700 -0.0018040000 -0.0039688600 0.0007326300 0.0005130700 -0.0010050100 -# File: 100 +# File: 100 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3977851900 -0.0014959500 -0.0011912300 @@ -6697,7 +6697,7 @@ -0.0030341100 0.0065870500 -0.0064997600 -0.0017166400 0.0020374900 -0.0030292900 -0.0020709400 0.0064873400 0.0048654500 -# File: 101 +# File: 101 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3958154300 0.0015410800 0.0011570700 @@ -6764,7 +6764,7 @@ 0.0023835100 -0.0047589600 0.0046404200 -0.0012382300 -0.0000916700 0.0006601800 0.0033463000 -0.0048550600 -0.0062665500 -# File: 102 +# File: 102 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3971955700 -0.0009945400 0.0009945400 @@ -6831,7 +6831,7 @@ -0.0131484300 0.0037489900 -0.0037489900 -0.0014878100 0.0012141900 -0.0009478800 -0.0120006500 0.0034003000 0.0018962100 -# File: 103 +# File: 103 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3964374700 0.0009893800 -0.0009893800 @@ -6898,7 +6898,7 @@ 0.0123058700 -0.0016643900 0.0016643900 -0.0014426300 0.0007341800 -0.0014293800 0.0134673900 -0.0020249000 -0.0035227600 -# File: 104 +# File: 104 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3975639300 0.0006856700 -0.0007647500 @@ -6965,7 +6965,7 @@ -0.0001338000 0.0020517400 0.0008476000 0.0011797800 0.0065625300 0.0043187600 0.0009275700 0.0018060100 -0.0026144500 -# File: 105 +# File: 105 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3961222400 -0.0006409100 0.0007267500 @@ -7032,7 +7032,7 @@ -0.0006182500 -0.0000728200 -0.0028369600 -0.0042363200 -0.0047672600 -0.0068177700 0.0004490500 -0.0003249000 0.0010833000 -# File: 106 +# File: 106 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3907636100 -0.0007364400 0.0007364400 @@ -7099,7 +7099,7 @@ -0.0004116000 0.0007497500 -0.0007497500 -0.0141648000 -0.0016873900 -0.0038507500 0.0006760000 0.0004967400 -0.0009949100 -# File: 107 +# File: 107 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4027991200 0.0007246700 -0.0007246700 @@ -7166,7 +7166,7 @@ -0.0003647100 0.0012310600 -0.0012310600 0.0112994900 0.0037392300 0.0015765200 0.0007248500 0.0009818600 -0.0005281800 -# File: 108 +# File: 108 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3975728200 -0.0005715000 -0.0007755800 @@ -7233,7 +7233,7 @@ 0.0023849800 0.0067329400 -0.0066149700 -0.0012355600 0.0020327400 -0.0030428100 0.0033458600 0.0063346900 0.0047515800 -# File: 109 +# File: 109 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3960568400 0.0005730200 0.0007858600 @@ -7300,7 +7300,7 @@ -0.0030356600 -0.0046112600 0.0045244600 -0.0017194500 -0.0000949000 0.0006448100 -0.0020706100 -0.0049964900 -0.0063836800 -# File: 110 +# File: 110 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3973817100 -0.0007631700 0.0007631700 @@ -7367,7 +7367,7 @@ -0.0131488400 -0.0017770900 0.0017770900 -0.0014875200 0.0007249800 -0.0014376700 -0.0119935800 -0.0019169100 -0.0034188000 -# File: 111 +# File: 111 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3962594500 0.0007529500 -0.0007529500 diff --git a/example/Si-PBEsol/POSCAR-unitcell b/example/Si-PBEsol/POSCAR-unitcell index 54a20471..0773cbdb 100644 --- a/example/Si-PBEsol/POSCAR-unitcell +++ b/example/Si-PBEsol/POSCAR-unitcell @@ -13,4 +13,4 @@ Direct 0.1250000000000000 0.1250000000000000 0.1250000000000000 0.1250000000000000 0.6250000000000000 0.6250000000000000 0.6250000000000000 0.1250000000000000 0.6250000000000000 - 0.6250000000000000 0.6250000000000000 0.1250000000000000 \ No newline at end of file + 0.6250000000000000 0.6250000000000000 0.1250000000000000 diff --git a/example/Si-PBEsol/Si.py b/example/Si-PBEsol/Si.py index f6dc1954..6e359605 100644 --- a/example/Si-PBEsol/Si.py +++ b/example/Si-PBEsol/Si.py @@ -1,5 +1,4 @@ -#!/usr/bin/env python - +"""Example to run thermal conductivity of Si.""" import numpy as np from phonopy.interface.vasp import read_vasp from phono3py import Phono3py @@ -11,24 +10,20 @@ def run_thermal_conductivity(): ph3 = phono3py.load("phono3py_disp.yaml", log_level=2) ph3.mesh_numbers = [11, 11, 11] ph3.init_phph_interaction() - ph3.run_thermal_conductivity( - temperatures=range(0, 1001, 10), - write_kappa=True) + ph3.run_thermal_conductivity(temperatures=range(0, 1001, 10), write_kappa=True) # Conductivity_RTA object - cond_rta = ph3.thermal_conductivity + print(ph3.thermal_conductivity.kappa) def create_supercells_with_displacements(): """Create supercells with displacements.""" cell = read_vasp("POSCAR-unitcell") - ph3 = Phono3py(cell, - np.diag([2, 2, 2]), - primitive_matrix='F') + ph3 = Phono3py(cell, np.diag([2, 2, 2]), primitive_matrix="F") ph3.generate_displacements(distance=0.03) - scells_with_disps = ph3.supercells_with_displacements + print(ph3.supercells_with_displacements) # List of PhonopyAtoms print(ph3.displacements.shape) # (supercells, atoms, xyz) -if __name__ == '__main__': +if __name__ == "__main__": create_supercells_with_displacements() run_thermal_conductivity() diff --git a/example/Si-PBEsol/phono3py_disp.yaml b/example/Si-PBEsol/phono3py_disp.yaml index bca67284..ad71d0cf 100644 --- a/example/Si-PBEsol/phono3py_disp.yaml +++ b/example/Si-PBEsol/phono3py_disp.yaml @@ -849,4 +849,4 @@ displacement_pairs: displacement_pair_info: number_of_singles: 1 - number_of_pairs: 110 \ No newline at end of file + number_of_pairs: 110 diff --git a/example/Si-QE/FORCES_FC3 b/example/Si-QE/FORCES_FC3 index fb7ea849..7da51a61 100644 --- a/example/Si-QE/FORCES_FC3 +++ b/example/Si-QE/FORCES_FC3 @@ -1,4 +1,4 @@ -# File: 1 +# File: 1 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158902702 0.0000000000 0.0000000000 0.0000216298 0.0000000000 0.0000000000 @@ -64,7 +64,7 @@ -0.0000126802 0.0000380200 -0.0000380200 -0.0000583502 0.0000373600 -0.0000513800 0.0000277798 0.0000267700 -0.0000290700 -# File: 2 +# File: 2 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 1 0.0424264068711929 0.0424264068711929 0.0000000000000000 -0.0270710495 -0.0113236900 -0.0014670197 @@ -131,7 +131,7 @@ 0.0000046605 0.0000224300 -0.0001005497 -0.0000734495 0.0000541800 -0.0001154697 0.0000694705 0.0000692100 -0.0000708997 -# File: 3 +# File: 3 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 1 -0.0424264068711929 -0.0424264068711929 0.0000000000000000 -0.0046710003 0.0112507700 0.0002498402 @@ -198,7 +198,7 @@ -0.0000318103 0.0000541100 0.0000248102 -0.0000434103 0.0000192100 0.0000132002 -0.0000103603 -0.0000111000 0.0000108602 -# File: 4 +# File: 4 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 2 0.0424264068711929 0.0424264068711929 0.0000000000000000 -0.0158746402 0.0000386706 0.0000013500 @@ -265,7 +265,7 @@ 0.0043645098 0.0044150006 -0.0034451700 -0.0000191302 0.0000767706 -0.0000924600 0.0000132198 0.0000439206 -0.0000928600 -# File: 5 +# File: 5 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 2 -0.0424264068711929 -0.0424264068711929 0.0000000000000000 -0.0159077603 -0.0000386200 -0.0000004803 @@ -332,7 +332,7 @@ -0.0047851503 -0.0047353000 0.0039052197 -0.0000941703 0.0000009700 -0.0000130003 0.0000429197 0.0000086000 0.0000342297 -# File: 6 +# File: 6 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 3 0.0424264068711929 0.0424264068711929 0.0000000000000000 -0.0158514405 0.0000162498 0.0000008102 @@ -399,7 +399,7 @@ 0.0000269895 0.0000775498 -0.0000786198 0.0043180995 0.0044139398 -0.0034587598 0.0000462495 0.0000118398 -0.0000923598 -# File: 7 +# File: 7 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 3 -0.0424264068711929 -0.0424264068711929 0.0000000000000000 -0.0159296302 -0.0000167394 -0.0000005900 @@ -466,7 +466,7 @@ -0.0000486902 0.0000016106 -0.0000002900 -0.0048315102 -0.0047351394 0.0038910800 0.0000096998 0.0000419306 0.0000334700 -# File: 8 +# File: 8 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 3 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0158899895 0.0000012897 0.0000542705 @@ -533,7 +533,7 @@ -0.0000400695 0.0000106597 0.0002186905 -0.0027637395 -0.0026677803 0.0038780305 -0.0000099995 -0.0000229703 -0.0000886895 -# File: 9 +# File: 9 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 4 0.0424264068711929 0.0424264068711929 0.0000000000000000 -0.0158951398 -0.0000039597 0.0000001600 @@ -600,7 +600,7 @@ -0.0000275298 0.0000560703 -0.0001011600 -0.0000403798 0.0000221303 -0.0001145800 0.0044046202 0.0044034403 -0.0034348800 -# File: 10 +# File: 10 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 4 -0.0424264068711929 -0.0424264068711929 0.0000000000000000 -0.0158851897 0.0000054505 0.0000003898 @@ -667,7 +667,7 @@ 0.0000028603 0.0000197605 0.0000240498 -0.0000773897 0.0000518505 0.0000103098 -0.0047442097 -0.0047468095 0.0039118198 -# File: 11 +# File: 11 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 4 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0158909398 0.0000012105 -0.0004742191 @@ -734,7 +734,7 @@ -0.0000618798 -0.0000011895 -0.0000977391 -0.0000982698 -0.0000122095 -0.0001109491 -0.0026761598 -0.0026785695 0.0039005609 -# File: 12 +# File: 12 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 7 0.0424264068711929 0.0424264068711929 0.0000000000000000 -0.0162249700 -0.0000055000 0.0000000200 @@ -801,7 +801,7 @@ -0.0000061800 0.0000442900 -0.0000805700 -0.0000641600 0.0000316500 -0.0001040300 0.0000667400 0.0002265900 -0.0000669500 -# File: 13 +# File: 13 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 7 -0.0424264068711929 -0.0424264068711929 0.0000000000000000 -0.0155550398 0.0000049203 -0.0000002495 @@ -868,7 +868,7 @@ -0.0000193598 0.0000309703 0.0000054005 -0.0000529898 0.0000425703 0.0000019805 -0.0000102098 -0.0001737397 0.0000082405 -# File: 14 +# File: 14 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 8 0.0424264068711929 0.0424264068711929 0.0000000000000000 -0.0158733302 0.0000170794 0.0000001997 @@ -935,7 +935,7 @@ 0.0001875598 0.0000769994 -0.0000762903 -0.0000195402 0.0002373494 -0.0000902003 0.0000224498 0.0000205994 -0.0000825203 -# File: 15 +# File: 15 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 8 -0.0424264068711929 -0.0424264068711929 0.0000000000000000 -0.0159075898 -0.0000174308 -0.0000000403 @@ -1002,7 +1002,7 @@ -0.0002124098 -0.0000009008 -0.0000003703 -0.0000978698 -0.0001627808 -0.0000136703 0.0000341702 0.0000324092 0.0000247697 -# File: 16 +# File: 16 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0157717697 0.0002409398 0.0002297398 @@ -1069,7 +1069,7 @@ -0.0000401997 0.0002944898 -0.0000655002 -0.0000855997 0.0000635698 -0.0000762302 -0.0000027597 0.0000053298 -0.0000597102 -# File: 17 +# File: 17 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0160026598 -0.0002341200 -0.0002248905 @@ -1136,7 +1136,7 @@ 0.0000148102 -0.0002146200 -0.0000113505 -0.0000287698 0.0000093500 -0.0000237805 0.0000585902 0.0000485100 0.0000008595 -# File: 18 +# File: 18 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0164229508 -0.0001147202 -0.0001147202 @@ -1203,7 +1203,7 @@ 0.0000156692 0.0000094798 -0.0000110102 0.0001941892 0.0000092098 -0.0000239502 0.0000067992 -0.0000042102 0.0000021798 -# File: 19 +# File: 19 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 9 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0153630698 0.0001094202 0.0001094202 @@ -1270,7 +1270,7 @@ -0.0000386098 0.0000641702 -0.0000626498 -0.0003150098 0.0000658702 -0.0000793498 0.0000500502 0.0000582902 -0.0000603198 -# File: 20 +# File: 20 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0158817500 0.0000427506 -0.0000759803 @@ -1337,7 +1337,7 @@ -0.0000621900 -0.0000230694 -0.0000765003 -0.0000901000 0.0000159406 -0.0000824303 0.0000019800 0.0000532206 -0.0000537003 -# File: 21 +# File: 21 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0158999998 -0.0000424597 0.0000776603 @@ -1404,7 +1404,7 @@ 0.0000389502 0.0000968803 -0.0000000497 -0.0000275098 0.0000588703 -0.0000195997 0.0000566702 -0.0000020897 -0.0000018397 -# File: 22 +# File: 22 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158926795 -0.0000094397 -0.0000094397 @@ -1471,7 +1471,7 @@ -0.0000709995 -0.0000141997 -0.0000007897 -0.0000801195 0.0000065003 -0.0000204997 0.0002809105 -0.0000003397 -0.0000008097 -# File: 23 +# File: 23 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 10 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158882491 0.0000091600 0.0000091600 @@ -1538,7 +1538,7 @@ 0.0000474609 0.0000884500 -0.0000768000 -0.0000370891 0.0000688900 -0.0000836600 -0.0002278391 0.0000557100 -0.0000577700 -# File: 24 +# File: 24 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0157852403 0.0002281900 -0.0002298800 @@ -1605,7 +1605,7 @@ -0.0000440803 0.0000164000 -0.0000689000 -0.0001091303 -0.0000238000 -0.0000908300 0.0000011097 0.0002828700 -0.0000569600 -# File: 25 +# File: 25 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0159987202 -0.0002350997 0.0002348594 @@ -1672,7 +1672,7 @@ 0.0000185298 0.0000596503 -0.0000065006 -0.0000062802 0.0000959003 -0.0000140506 0.0000547798 -0.0002261997 -0.0000011006 -# File: 26 +# File: 26 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0164094797 -0.0001098602 0.0001099698 @@ -1739,7 +1739,7 @@ -0.0000333597 0.0000075898 -0.0000071502 -0.0001170497 -0.0000137102 -0.0000139202 0.0000567503 -0.0000022802 -0.0000015402 -# File: 27 +# File: 27 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 11 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0153672202 0.0001140995 -0.0001140995 @@ -1806,7 +1806,7 @@ 0.0000094498 0.0000692195 -0.0000692195 0.0000013598 0.0000873295 -0.0000900395 0.0000020098 0.0000533495 -0.0000535095 -# File: 28 +# File: 28 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0158801602 0.0000428203 0.0000776202 @@ -1873,7 +1873,7 @@ -0.0000400502 0.0000642103 -0.0000621998 -0.0000852602 0.0002933403 -0.0000787898 -0.0000230102 -0.0000337997 -0.0000673498 -# File: 29 +# File: 29 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0159006098 -0.0000436200 -0.0000759900 @@ -1940,7 +1940,7 @@ 0.0000160602 0.0000095100 -0.0000108800 -0.0000313798 -0.0002151000 -0.0000234800 0.0000801202 0.0000852400 0.0000080400 -# File: 30 +# File: 30 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158883897 -0.0000101408 0.0000098800 @@ -2007,7 +2007,7 @@ 0.0002403703 0.0000105392 -0.0000099400 -0.0000297997 0.0000092192 -0.0000244000 -0.0000307697 -0.0000250308 0.0000086600 -# File: 31 +# File: 31 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 12 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158923205 0.0000089098 -0.0000089098 @@ -2074,7 +2074,7 @@ -0.0002676605 0.0000652898 -0.0000652898 -0.0000855005 0.0000642798 -0.0000764098 0.0000895295 0.0000769698 -0.0000675598 -# File: 32 +# File: 32 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0156590200 0.0001166398 0.0002251303 @@ -2141,7 +2141,7 @@ 0.0000137100 0.0000111298 -0.0000625997 0.0001976800 0.0000100198 -0.0000790397 0.0000065000 -0.0000039102 -0.0000598397 -# File: 33 +# File: 33 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 17 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0161157198 -0.0001126798 -0.0002199098 @@ -2208,7 +2208,7 @@ -0.0000403198 0.0000659502 -0.0000116198 -0.0003113298 0.0000649602 -0.0000236098 0.0000500202 0.0000577702 0.0000018502 -# File: 34 +# File: 34 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0160000398 -0.0005282602 -0.0001139297 @@ -2275,7 +2275,7 @@ -0.0000398898 0.0002910198 -0.0000100197 -0.0000863398 0.0000655898 -0.0000248597 -0.0000027498 0.0000052598 0.0000017403 -# File: 35 +# File: 35 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0157851900 0.0005238703 0.0001091300 @@ -2342,7 +2342,7 @@ 0.0000158500 -0.0002188697 -0.0000662200 -0.0000330200 0.0000112503 -0.0000773400 0.0000597400 0.0000484403 -0.0000600000 -# File: 36 +# File: 36 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0156627006 0.0001107600 0.0002300900 @@ -2409,7 +2409,7 @@ -0.0000388306 0.0000666900 -0.0000098300 -0.0000882706 0.0000641500 -0.0000236200 -0.0000023806 0.0000576100 -0.0000507400 -# File: 37 +# File: 37 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0161128000 -0.0001079405 -0.0002234609 @@ -2476,7 +2476,7 @@ 0.0000128300 0.0000111595 -0.0000645709 -0.0000318700 0.0000123795 -0.0000785809 0.0000597800 -0.0000045005 -0.0000081409 -# File: 38 +# File: 38 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0156525506 0.0001068695 -0.0002356298 @@ -2543,7 +2543,7 @@ -0.0000728806 -0.0000128605 -0.0000764598 -0.0000804206 0.0000061995 -0.0000825398 0.0002847694 -0.0000005805 -0.0000564198 -# File: 39 +# File: 39 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 18 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0161342800 -0.0001111600 0.0002403300 @@ -2610,7 +2610,7 @@ 0.0000459600 0.0000892700 -0.0000003400 -0.0000367000 0.0000688800 -0.0000200100 -0.0002249500 0.0000547800 -0.0000015100 -# File: 40 +# File: 40 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0160033698 -0.0005230203 0.0001083900 @@ -2677,7 +2677,7 @@ -0.0000641398 -0.0000206503 -0.0000008600 -0.0000893098 0.0000159697 -0.0000207300 -0.0000010898 0.0000547897 -0.0000025500 -# File: 41 +# File: 41 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0157721903 0.0005281095 -0.0001144397 @@ -2744,7 +2744,7 @@ 0.0000373997 0.0000986495 -0.0000769597 -0.0000269503 0.0000588995 -0.0000822397 0.0000547197 0.0000003395 -0.0000534397 -# File: 42 +# File: 42 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0161274102 -0.0001166997 0.0002454498 @@ -2811,7 +2811,7 @@ -0.0000499102 0.0000770003 -0.0000499102 -0.0000900002 0.0000680503 -0.0000725002 -0.0000001702 0.0000541903 -0.0000001702 -# File: 43 +# File: 43 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0156582102 0.0001118602 -0.0002393603 @@ -2878,7 +2878,7 @@ 0.0000259998 -0.0000006298 -0.0000245703 -0.0000276702 0.0000062602 -0.0000295303 0.0000552298 0.0000017702 -0.0000545703 -# File: 44 +# File: 44 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158486600 0.0000083603 -0.0000759200 @@ -2945,7 +2945,7 @@ -0.0000334000 0.0000069103 -0.0000684600 -0.0001196000 -0.0000125397 -0.0000897700 0.0000551400 -0.0000001097 -0.0000536300 -# File: 45 +# File: 45 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 19 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0159321598 -0.0000091900 0.0000769105 @@ -3012,7 +3012,7 @@ 0.0000084902 0.0000689400 -0.0000066895 0.0000011102 0.0000887800 -0.0000146295 -0.0000011498 0.0000553800 -0.0000022895 -# File: 46 +# File: 46 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0159000400 -0.0000004698 -0.0000097292 @@ -3079,7 +3079,7 @@ -0.0000434500 0.0000162502 -0.0000069292 -0.0001103100 -0.0000211098 -0.0000147192 0.0000009600 0.0002796902 -0.0000010192 -# File: 47 +# File: 47 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0158803300 -0.0000013191 0.0000099998 @@ -3146,7 +3146,7 @@ 0.0000180800 0.0000595009 -0.0000688602 -0.0000075300 0.0000980409 -0.0000903102 0.0000551700 -0.0002294991 -0.0000568302 -# File: 48 +# File: 48 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0159669205 0.0000090803 0.0000430105 @@ -3213,7 +3213,7 @@ -0.0000434805 0.0000688603 -0.0000589895 -0.0000961705 0.0000751403 -0.0000636995 0.0000012495 0.0000557703 -0.0000002695 -# File: 49 +# File: 49 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0158127794 -0.0000094205 -0.0000431603 @@ -3280,7 +3280,7 @@ 0.0000187806 0.0000069195 -0.0000157403 -0.0000204094 -0.0000010505 -0.0000388403 0.0000532006 -0.0000003805 -0.0000549903 -# File: 50 +# File: 50 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158475202 0.0000103894 0.0000778597 @@ -3347,7 +3347,7 @@ 0.0002435498 0.0000101194 -0.0000657703 -0.0000315302 0.0000101994 -0.0000763703 -0.0000331102 -0.0000235306 -0.0000687203 -# File: 51 +# File: 51 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 20 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0159339408 -0.0000101900 -0.0000766802 @@ -3414,7 +3414,7 @@ -0.0002655608 0.0000651900 -0.0000097502 -0.0000870808 0.0000659600 -0.0000243002 0.0000872092 0.0000786100 0.0000084998 -# File: 52 +# File: 52 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0159000098 0.0000003800 0.0000098097 @@ -3481,7 +3481,7 @@ -0.0000412898 0.0000663200 -0.0000113703 -0.0000860598 0.0002903000 -0.0000231203 -0.0000234998 -0.0000318400 0.0000084897 -# File: 53 +# File: 53 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0158811408 0.0000006903 -0.0000094603 @@ -3548,7 +3548,7 @@ 0.0000141292 0.0000116303 -0.0000630203 -0.0000312408 -0.0002190697 -0.0000793903 0.0000789292 0.0000876903 -0.0000681103 -# File: 54 +# File: 54 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0158145295 -0.0000092000 0.0000419005 @@ -3615,7 +3615,7 @@ -0.0000410195 0.0000653900 -0.0000088795 -0.0000860495 0.0000666800 -0.0000228795 -0.0000088795 0.0000653900 -0.0000410195 -# File: 55 +# File: 55 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0159658197 0.0000095494 -0.0000420103 @@ -3682,7 +3682,7 @@ 0.0000135203 0.0000125994 -0.0000641003 -0.0000330597 0.0000110794 -0.0000778103 0.0000658703 -0.0000109606 -0.0000165803 -# File: 56 +# File: 56 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0158595005 -0.0000216592 0.0000306103 @@ -3749,7 +3749,7 @@ 0.0000644495 0.0000806808 -0.0000284997 0.0000175595 0.0000800508 -0.0000612497 -0.0000480005 0.0000694108 -0.0000193897 -# File: 57 +# File: 57 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0159221695 0.0000217195 -0.0000305900 @@ -3816,7 +3816,7 @@ -0.0000896995 -0.0000045705 -0.0000475500 -0.0001343195 -0.0000060805 -0.0000420800 0.0001041405 -0.0000163105 -0.0000385900 -# File: 58 +# File: 58 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0159120605 0.0000313500 0.0000313500 @@ -3883,7 +3883,7 @@ 0.0000304295 0.0001151600 -0.0000479700 -0.0000155505 0.0001140900 -0.0000414200 0.0000712995 -0.0000490200 -0.0000203100 -# File: 59 +# File: 59 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 33 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158689600 -0.0000315600 -0.0000315600 @@ -3950,7 +3950,7 @@ -0.0000553000 -0.0000380300 -0.0000285300 -0.0001009700 -0.0000401900 -0.0000609200 -0.0000145200 0.0001026900 -0.0000386100 -# File: 60 +# File: 60 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0158608602 0.0000280394 0.0000251806 @@ -4017,7 +4017,7 @@ -0.0000892102 0.0000810794 -0.0000476194 -0.0001347002 0.0000800894 -0.0000417194 0.0001045198 0.0000691294 -0.0000381894 -# File: 61 +# File: 61 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0159165102 -0.0000258298 -0.0000244106 @@ -4084,7 +4084,7 @@ 0.0000642498 -0.0000047198 -0.0000280706 0.0000172798 -0.0000054698 -0.0000611206 -0.0000476002 -0.0000160298 -0.0000194606 -# File: 62 +# File: 62 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0156345787 0.0000281705 0.0000281705 @@ -4151,7 +4151,7 @@ 0.0000298013 -0.0000380595 -0.0000470695 -0.0000154787 -0.0000399095 -0.0000416395 0.0000708813 0.0001028405 -0.0000195595 -# File: 63 +# File: 63 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 34 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0161495600 -0.0000284100 -0.0000284100 @@ -4218,7 +4218,7 @@ -0.0000553000 0.0001150200 -0.0000281400 -0.0001017400 0.0001132600 -0.0000611800 -0.0000141400 -0.0000503100 -0.0000380900 -# File: 64 +# File: 64 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158639902 0.0000281794 0.0000252705 @@ -4285,7 +4285,7 @@ 0.0000298898 -0.0000393506 -0.0000275395 -0.0000152302 -0.0000382206 -0.0000610495 0.0000703398 0.0001038194 -0.0000382695 -# File: 65 +# File: 65 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 35 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0159143100 -0.0000267900 -0.0000236500 @@ -4352,7 +4352,7 @@ -0.0000545600 0.0001142700 -0.0000464300 -0.0001016500 0.0001140900 -0.0000424300 -0.0000142600 -0.0000489300 -0.0000190300 -# File: 66 +# File: 66 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0158648998 0.0002526200 0.0000270298 @@ -4419,7 +4419,7 @@ -0.0000898898 0.0000807500 -0.0000281602 -0.0001340198 0.0000808100 -0.0000609402 0.0001035302 0.0000693300 -0.0000192302 -# File: 67 +# File: 67 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0159165698 -0.0002561400 -0.0000275397 @@ -4486,7 +4486,7 @@ 0.0000640402 -0.0000048700 -0.0000474997 0.0000182202 -0.0000053300 -0.0000423097 -0.0000483298 -0.0000159400 -0.0000389297 -# File: 68 +# File: 68 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0158656398 0.0000280602 0.0000266106 @@ -4553,7 +4553,7 @@ -0.0000217898 0.0000280802 -0.0000369794 -0.0000488998 0.0000474902 -0.0000508394 0.0000376602 0.0000172302 -0.0000291394 -# File: 69 +# File: 69 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0159138705 -0.0000256600 -0.0000244195 @@ -4620,7 +4620,7 @@ -0.0000032105 0.0000470800 -0.0000377895 -0.0000679905 0.0000277200 -0.0000510095 0.0000184095 0.0000364500 -0.0000293195 -# File: 70 +# File: 70 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0159513295 0.0000539603 0.0000379402 @@ -4687,7 +4687,7 @@ 0.0000304205 0.0001130803 -0.0000284298 -0.0000160895 0.0001142803 -0.0000604298 0.0000713305 -0.0000485597 -0.0000385598 -# File: 71 +# File: 71 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 36 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158275700 -0.0000517100 -0.0000397700 @@ -4754,7 +4754,7 @@ -0.0000543100 -0.0000398200 -0.0000466000 -0.0001023900 -0.0000396000 -0.0000417800 -0.0000138200 0.0001047600 -0.0000195900 -# File: 72 +# File: 72 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0158406700 -0.0000560505 0.0000373702 @@ -4821,7 +4821,7 @@ 0.0000650900 0.0000799195 -0.0000467998 0.0000168400 0.0000806395 -0.0000421498 -0.0000469800 0.0000701895 -0.0000382998 -# File: 73 +# File: 73 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0159388897 0.0000580497 -0.0000393300 @@ -4888,7 +4888,7 @@ -0.0000889197 -0.0000042503 -0.0000283800 -0.0001354697 -0.0000051503 -0.0000611300 0.0001049103 -0.0000165803 -0.0000196800 -# File: 74 +# File: 74 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0158513205 0.0000363398 -0.0000127897 @@ -4955,7 +4955,7 @@ -0.0000214305 0.0000474298 -0.0000377397 -0.0000490005 0.0000281398 -0.0000518597 0.0000376595 0.0000364698 -0.0000282397 -# File: 75 +# File: 75 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0159299302 -0.0000361998 0.0000123508 @@ -5022,7 +5022,7 @@ -0.0000030302 0.0000285602 -0.0000386492 -0.0000682202 0.0000466502 -0.0000523292 0.0000191498 0.0000170202 -0.0000283792 -# File: 76 +# File: 76 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0158536002 -0.0000573602 0.0000510698 @@ -5089,7 +5089,7 @@ 0.0002158698 0.0002690598 0.0000719598 0.0001739098 0.0002754498 -0.0001651802 -0.0002039502 0.0002652798 0.0000849498 -# File: 77 +# File: 77 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0159293702 0.0000601305 -0.0000501698 @@ -5156,7 +5156,7 @@ -0.0002457902 -0.0001999495 -0.0001513498 -0.0002853002 -0.0001946295 0.0000586802 0.0002549198 -0.0002051395 -0.0001380698 -# File: 78 +# File: 78 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0159024700 0.0000381603 0.0000381603 @@ -5223,7 +5223,7 @@ 0.0002190600 0.0002651703 0.0000714403 0.0001796800 0.0002696603 -0.0001650697 0.0002593200 -0.0001996497 -0.0001377797 -# File: 79 +# File: 79 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 39 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158783800 -0.0000381600 -0.0000381600 @@ -5290,7 +5290,7 @@ -0.0002503200 -0.0001952200 -0.0001519800 -0.0002899300 -0.0001898100 0.0000583500 -0.0002100500 0.0002598500 0.0000849700 -# File: 80 +# File: 80 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0131886002 0.0040410291 0.0027933905 @@ -5357,7 +5357,7 @@ -0.0002401002 0.0002700091 -0.0001487095 -0.0002919702 0.0002760691 0.0000626305 0.0002602398 0.0002651491 -0.0001450395 -# File: 81 +# File: 81 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0188283302 -0.0041643098 -0.0030393100 @@ -5424,7 +5424,7 @@ 0.0002196998 -0.0001994898 0.0000773500 0.0001703498 -0.0001954398 -0.0001617700 -0.0001998402 -0.0002063998 0.0000836300 -# File: 82 +# File: 82 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0119619700 0.0027067800 0.0027067800 @@ -5491,7 +5491,7 @@ 0.0002252900 -0.0001948900 0.0000756400 0.0001733900 -0.0001900000 -0.0001609400 0.0002643900 0.0002603400 -0.0001427000 -# File: 83 +# File: 83 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 40 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0199236100 -0.0029359800 -0.0029359800 @@ -5558,7 +5558,7 @@ -0.0002433300 0.0002648000 -0.0001474100 -0.0002969700 0.0002707200 0.0000612300 -0.0002017500 -0.0002010000 0.0000797600 -# File: 84 +# File: 84 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0159493205 -0.0000385297 0.0000481100 @@ -5625,7 +5625,7 @@ -0.0000118605 0.0000473403 -0.0000275600 -0.0005871305 0.0001517203 -0.0001659100 0.0000280395 0.0000360003 -0.0000381800 -# File: 85 +# File: 85 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 49 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158342600 0.0000362800 -0.0000496700 @@ -5692,7 +5692,7 @@ -0.0000119500 0.0000281800 -0.0000471600 0.0004654200 -0.0000720500 0.0000579900 0.0000273200 0.0000175300 -0.0000189700 -# File: 86 +# File: 86 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0159262500 -0.0000128595 -0.0000398098 @@ -5759,7 +5759,7 @@ -0.0000222900 0.0000806105 -0.0001145498 -0.0001683400 0.0002689805 -0.0002800398 0.0000185400 0.0000693305 0.0000473602 -# File: 87 +# File: 87 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0158539995 0.0000122003 0.0000390097 @@ -5826,7 +5826,7 @@ -0.0000031195 -0.0000045297 0.0000394897 0.0000553805 -0.0002007097 0.0001813997 0.0000379005 -0.0000160097 -0.0001047803 -# File: 88 +# File: 88 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0158383909 -0.0000391303 -0.0000631305 @@ -5893,7 +5893,7 @@ -0.0000219809 -0.0000377403 0.0000053295 0.0000558091 -0.0001952403 0.0001865895 0.0000373491 0.0001022197 0.0000140395 -# File: 89 +# File: 89 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0159435197 0.0000373000 0.0000606997 @@ -5960,7 +5960,7 @@ -0.0000031897 0.0001152800 -0.0000804303 -0.0001686997 0.0002643200 -0.0002831803 0.0000190503 -0.0000503900 -0.0000710503 -# File: 90 +# File: 90 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158626102 -0.0000266494 0.0000268597 @@ -6027,7 +6027,7 @@ -0.0005365002 0.0001469206 0.0000721097 -0.0000583902 0.0000464106 -0.0000606003 -0.0005005402 0.0001411706 -0.0001427903 -# File: 91 +# File: 91 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 50 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0159207500 0.0000285700 -0.0000281700 @@ -6094,7 +6094,7 @@ 0.0005158600 -0.0000758800 -0.0001516000 -0.0000597200 0.0000271800 -0.0000422700 0.0005523500 -0.0000829800 0.0000807000 -# File: 92 +# File: 92 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0159187994 0.0000301100 -0.0000293098 @@ -6161,7 +6161,7 @@ -0.0001263394 0.0002762600 0.0001965702 -0.0000678794 0.0000804200 0.0000245302 -0.0000808394 0.0002588300 -0.0002558098 -# File: 93 +# File: 93 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0158633403 -0.0000277297 0.0000276202 @@ -6228,7 +6228,7 @@ 0.0000973597 -0.0001933897 -0.0002657898 -0.0000487203 -0.0000056197 -0.0001278598 0.0001417497 -0.0002117397 0.0002030302 -# File: 94 +# File: 94 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0158609897 -0.0000277397 0.0002556705 @@ -6295,7 +6295,7 @@ -0.0001260397 0.0002704203 0.0002005205 -0.0000498297 0.0001131003 -0.0000086695 0.0001428703 -0.0002060097 0.0002096005 -# File: 95 +# File: 95 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0159206097 0.0000276597 -0.0002519405 @@ -6362,7 +6362,7 @@ 0.0000975003 -0.0001894103 -0.0002693305 -0.0000675997 -0.0000396603 -0.0000939205 -0.0000819997 0.0002542897 -0.0002604105 -# File: 96 +# File: 96 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0181591608 0.0035953192 -0.0021905800 @@ -6429,7 +6429,7 @@ -0.0000222208 0.0000809092 0.0000396400 -0.0001726808 0.0002751492 0.0001808700 0.0000185992 0.0000692592 -0.0001042100 -# File: 97 +# File: 97 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0134110203 -0.0037075602 0.0023932206 @@ -6496,7 +6496,7 @@ -0.0000024803 -0.0000052102 -0.0001140794 0.0000508797 -0.0001945502 -0.0002786194 0.0000385797 -0.0000154102 0.0000471206 -# File: 98 +# File: 98 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0120798198 -0.0024803103 0.0024803103 @@ -6563,7 +6563,7 @@ -0.0000122098 0.0000468997 -0.0000468997 -0.0005830298 0.0001474297 0.0000587403 0.0000286602 0.0000360497 -0.0000188997 -# File: 99 +# File: 99 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 51 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0195722400 0.0022614800 -0.0022614800 @@ -6630,7 +6630,7 @@ -0.0000138200 0.0000280200 -0.0000280200 0.0004698000 -0.0000775800 -0.0001665800 0.0000283400 0.0000197700 -0.0000382800 -# File: 100 +# File: 100 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0159280197 -0.0000595000 -0.0000514000 @@ -6697,7 +6697,7 @@ -0.0001219697 0.0002698200 -0.0002648200 -0.0000683497 0.0000801300 -0.0001270700 -0.0000853897 0.0002648000 0.0002037600 -# File: 101 +# File: 101 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0158524100 0.0000616495 0.0000501400 @@ -6764,7 +6764,7 @@ 0.0001013100 -0.0002005205 0.0001951800 -0.0000488100 -0.0000050705 0.0000261700 0.0001377300 -0.0002047305 -0.0002557700 -# File: 102 +# File: 102 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0159029005 -0.0000381405 0.0000381405 @@ -6831,7 +6831,7 @@ -0.0005407605 0.0001520595 -0.0001520595 -0.0000579305 0.0000465195 -0.0000419095 -0.0004956405 0.0001362295 0.0000809405 -# File: 103 +# File: 103 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 52 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158786000 0.0000377600 -0.0000377600 @@ -6898,7 +6898,7 @@ 0.0005112500 -0.0000714200 0.0000714200 -0.0000583700 0.0000280400 -0.0000607400 0.0005564900 -0.0000876900 -0.0001430400 -# File: 104 +# File: 104 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0159193297 0.0000271103 -0.0000276697 @@ -6965,7 +6965,7 @@ -0.0000027697 0.0000806203 0.0000392603 0.0000509603 0.0002690403 0.0001766003 0.0000377403 0.0000695403 -0.0001054097 -# File: 105 +# File: 105 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0158639700 -0.0000260405 0.0000257295 @@ -7032,7 +7032,7 @@ -0.0000216500 -0.0000046505 -0.0001151505 -0.0001729400 -0.0002004805 -0.0002846005 0.0000190400 -0.0000162205 0.0000473595 -# File: 106 +# File: 106 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0156382502 -0.0000282400 0.0000282400 @@ -7099,7 +7099,7 @@ -0.0000127402 0.0000281300 -0.0000281300 -0.0005827002 -0.0000722000 -0.0001614000 0.0000290298 0.0000176600 -0.0000382100 -# File: 107 +# File: 107 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 53 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0161397102 0.0000268897 -0.0000274805 @@ -7166,7 +7166,7 @@ -0.0000126302 0.0000470797 -0.0000471405 0.0004696398 0.0001524697 0.0000629895 0.0000287898 0.0000362997 -0.0000193105 -# File: 108 +# File: 108 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0159209908 -0.0000221100 -0.0000312998 @@ -7233,7 +7233,7 @@ 0.0001017792 0.0002754700 -0.0002709098 -0.0000493408 0.0000800300 -0.0001282398 0.0001381192 0.0002585800 0.0001983202 -# File: 109 +# File: 109 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0158595598 0.0000220106 0.0000319203 @@ -7300,7 +7300,7 @@ -0.0001226698 -0.0001941594 0.0001902803 -0.0000683398 -0.0000055294 0.0000253503 -0.0000855498 -0.0002104994 -0.0002615297 -# File: 110 +# File: 110 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0159118592 -0.0000307298 0.0000307298 @@ -7367,7 +7367,7 @@ -0.0005406992 -0.0000762098 0.0000762098 -0.0000577792 0.0000270902 -0.0000618102 -0.0004953492 -0.0000833298 -0.0001391002 -# File: 111 +# File: 111 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 54 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0158689000 0.0000308500 -0.0000305302 diff --git a/example/Si-QE/phono3py_disp.yaml b/example/Si-QE/phono3py_disp.yaml index f0be1069..e80eec0a 100644 --- a/example/Si-QE/phono3py_disp.yaml +++ b/example/Si-QE/phono3py_disp.yaml @@ -851,4 +851,4 @@ displacement_pairs: displacement_pair_info: number_of_singles: 1 - number_of_pairs: 110 \ No newline at end of file + number_of_pairs: 110 diff --git a/example/Si-TURBOMOLE/FORCES_FC2 b/example/Si-TURBOMOLE/FORCES_FC2 index d1341d77..ae97ad62 100644 --- a/example/Si-TURBOMOLE/FORCES_FC2 +++ b/example/Si-TURBOMOLE/FORCES_FC2 @@ -1,4 +1,4 @@ -# File: 1 +# File: 1 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081048897 -0.0000000073 -0.0000000073 0.0000021030 -0.0000000064 -0.0000000065 diff --git a/example/Si-TURBOMOLE/FORCES_FC3 b/example/Si-TURBOMOLE/FORCES_FC3 index 8c25c9ef..721855c1 100644 --- a/example/Si-TURBOMOLE/FORCES_FC3 +++ b/example/Si-TURBOMOLE/FORCES_FC3 @@ -1,4 +1,4 @@ -# File: 1 +# File: 1 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081155391 -0.0000000096 -0.0000000095 0.0000079303 -0.0000000099 -0.0000000100 @@ -64,7 +64,7 @@ 0.0000130880 -0.0000150108 -0.0000077490 0.0001290470 -0.0000142987 -0.0000142988 -0.0000105152 -0.0000133962 -0.0000133962 -# File: 2 +# File: 2 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 1 0.0424264068711929 0.0424264068711929 0.0000000000000000 -0.0138525073 -0.0057683669 0.0007423657 @@ -131,7 +131,7 @@ 0.0000125442 0.0000658495 -0.0000028382 0.0002090655 -0.0000154119 -0.0000186496 -0.0000274866 -0.0000302377 -0.0000128809 -# File: 3 +# File: 3 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 1 -0.0424264068711929 -0.0424264068711929 0.0000000000000000 -0.0023801020 0.0057408591 -0.0001272804 @@ -198,7 +198,7 @@ 0.0000138718 -0.0000957648 -0.0000124295 0.0000484362 -0.0000134242 -0.0000097209 0.0000063675 0.0000034590 -0.0000134878 -# File: 4 +# File: 4 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 2 0.0424264068711929 0.0424264068711929 0.0000000000000000 -0.0081100003 0.0000185129 -0.0000004832 @@ -265,7 +265,7 @@ -0.0000222138 -0.0000519045 -0.0000074958 0.0001121705 -0.0000311858 -0.0000140853 0.0000708946 -0.0000148230 -0.0000182909 -# File: 5 +# File: 5 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 2 -0.0424264068711929 -0.0424264068711929 0.0000000000000000 -0.0081213662 -0.0000187337 0.0000000716 @@ -332,7 +332,7 @@ 0.0000497563 0.0000201965 -0.0000075542 0.0001458117 0.0000025768 -0.0000140913 -0.0000922048 -0.0000120268 -0.0000083359 -# File: 6 +# File: 6 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 3 0.0424264068711929 0.0424264068711929 0.0000000000000000 -0.0080969807 0.0000056027 -0.0000003152 @@ -399,7 +399,7 @@ -0.0000038679 -0.0000318321 -0.0000075296 0.0000938229 -0.0000510828 -0.0000140871 -0.0000117431 0.0000682357 -0.0000082690 -# File: 7 +# File: 7 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 3 -0.0424264068711929 -0.0424264068711929 0.0000000000000000 -0.0081342392 -0.0000056877 -0.0000000938 @@ -466,7 +466,7 @@ 0.0000299447 0.0000018499 -0.0000075239 0.0001657938 0.0000209246 -0.0000140382 -0.0000090628 -0.0000947505 -0.0000182819 -# File: 8 +# File: 8 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 3 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0081156848 -0.0000003890 0.0000263044 @@ -533,7 +533,7 @@ -0.0000004136 -0.0000015522 -0.0000181667 0.0001067189 0.0000080817 -0.0000210139 -0.0000175360 0.0000005568 -0.0000013976 -# File: 9 +# File: 9 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 4 0.0424264068711929 0.0424264068711929 0.0000000000000000 -0.0081171001 -0.0000015652 -0.0000005573 @@ -600,7 +600,7 @@ 0.0000942601 -0.0000163254 -0.0000128249 0.0001278333 0.0000671637 -0.0000090088 -0.0000458151 -0.0000502742 -0.0000131699 -# File: 10 +# File: 10 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 4 -0.0424264068711929 -0.0424264068711929 0.0000000000000000 -0.0081139644 0.0000015614 -0.0000002466 @@ -667,7 +667,7 @@ -0.0000684922 -0.0000138706 -0.0000025134 0.0001304738 -0.0000957054 -0.0000192457 0.0000263790 0.0000219561 -0.0000131368 -# File: 11 +# File: 11 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 4 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0081154203 -0.0000007186 -0.0002407769 @@ -734,7 +734,7 @@ -0.0000008489 -0.0000078540 0.0000042360 0.0001221282 -0.0000003935 -0.0000024120 -0.0000329223 0.0000089637 -0.0000201987 -# File: 12 +# File: 12 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 7 0.0424264068711929 0.0424264068711929 0.0000000000000000 -0.0082857181 -0.0000014481 -0.0000002797 @@ -801,7 +801,7 @@ 0.0000167539 -0.0000114783 -0.0000080982 0.0005817752 0.0004097433 -0.0000377665 -0.0000301063 -0.0000492589 -0.0000132791 -# File: 13 +# File: 13 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 7 -0.0424264068711929 -0.0424264068711929 0.0000000000000000 -0.0079455444 0.0000019250 0.0000000290 @@ -868,7 +868,7 @@ 0.0000097906 -0.0000183060 -0.0000081484 -0.0002944012 -0.0004679395 -0.0000366726 0.0000093955 0.0000221615 -0.0000136029 -# File: 14 +# File: 14 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 8 0.0424264068711929 0.0424264068711929 0.0000000000000000 -0.0081073943 0.0000082430 -0.0000005855 @@ -935,7 +935,7 @@ -0.0000229669 -0.0000351804 -0.0000078297 0.0001090237 -0.0000503838 -0.0000143837 0.0004431136 0.0004107065 -0.0000363007 -# File: 15 +# File: 15 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 8 -0.0424264068711929 -0.0424264068711929 0.0000000000000000 -0.0081235237 -0.0000079849 0.0000000901 @@ -1002,7 +1002,7 @@ 0.0000491035 0.0000047786 -0.0000076635 0.0001491099 0.0000216513 -0.0000144582 -0.0004344622 -0.0004668271 -0.0000364501 -# File: 16 +# File: 16 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0079926295 0.0001157077 -0.0000672572 @@ -1069,7 +1069,7 @@ 0.0000025311 -0.0000285304 0.0000057476 0.0001001839 -0.0000362066 0.0000076516 0.0000014840 -0.0000272649 -0.0000065816 -# File: 17 +# File: 17 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 9 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0082331919 -0.0001113373 0.0000644818 @@ -1136,7 +1136,7 @@ 0.0000235604 -0.0000017313 -0.0000210008 0.0001576070 0.0000082395 -0.0000357998 -0.0000235465 0.0000016139 -0.0000210009 -# File: 18 +# File: 18 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0079983484 0.0001225587 -0.0000640899 @@ -1203,7 +1203,7 @@ -0.0000001684 -0.0000251860 -0.0000210638 0.0001061127 -0.0000430325 -0.0000356923 -0.0000247482 0.0001153606 -0.0000275915 -# File: 19 +# File: 19 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0082281257 -0.0001176045 0.0000610459 @@ -1270,7 +1270,7 @@ 0.0000265110 -0.0000049014 0.0000057291 0.0001511370 0.0000145536 0.0000078154 0.0000040805 -0.0001434787 0.0000011616 -# File: 20 +# File: 20 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0080519857 0.0000652294 -0.0002655082 @@ -1337,7 +1337,7 @@ 0.0000265434 -0.0000282755 -0.0000180404 0.0001513922 -0.0000367508 -0.0000210995 -0.0000035218 -0.0000273531 -0.0000014233 -# File: 21 +# File: 21 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0081803672 -0.0000666226 0.0002671262 @@ -1404,7 +1404,7 @@ -0.0000000924 -0.0000020099 0.0000024214 0.0001071720 0.0000076960 -0.0000080752 -0.0000180910 0.0000016803 -0.0000264486 -# File: 22 +# File: 22 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0079888106 -0.0001212716 -0.0000612530 @@ -1471,7 +1471,7 @@ 0.0001435279 -0.0000293841 0.0000068670 0.0001410366 -0.0000284074 -0.0000072341 -0.0000393363 -0.0000353577 0.0000085649 -# File: 23 +# File: 23 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 10 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0082475013 0.0001255594 0.0000642577 @@ -1538,7 +1538,7 @@ -0.0001162160 -0.0000010627 -0.0000219486 0.0001159267 0.0000006145 -0.0000220670 0.0000180976 0.0000093970 -0.0000348819 -# File: 24 +# File: 24 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0082394205 0.0001322460 0.0000676845 @@ -1605,7 +1605,7 @@ -0.0000019841 -0.0000020115 -0.0000154307 0.0001147517 0.0001146304 -0.0000286717 -0.0000331446 -0.0000419453 -0.0000348786 -# File: 25 +# File: 25 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0079957724 -0.0001270601 -0.0000647635 @@ -1672,7 +1672,7 @@ 0.0000271207 -0.0000268689 -0.0000007234 0.0001436553 -0.0001446812 0.0000003779 0.0000114067 0.0000153329 0.0000084775 -# File: 26 +# File: 26 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0080463564 -0.0000674887 -0.0002661160 @@ -1739,7 +1739,7 @@ 0.0000272384 -0.0000219751 0.0000041294 0.0001360055 -0.0000283715 -0.0000025210 0.0000118860 -0.0000357426 -0.0000203256 -# File: 27 +# File: 27 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0081827272 0.0000654244 0.0002651539 @@ -1806,7 +1806,7 @@ -0.0000020622 -0.0000072820 -0.0000207424 0.0001213306 0.0000007814 -0.0000272021 -0.0000323540 0.0000083922 -0.0000073915 -# File: 28 +# File: 28 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 13 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0080950184 -0.0000354096 -0.0000057782 @@ -1873,7 +1873,7 @@ 0.0000250748 -0.0000220081 0.0000062377 0.0021279081 -0.0014221560 0.0013935255 -0.0000173514 -0.0000357750 0.0000089639 -# File: 29 +# File: 29 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 13 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081361971 0.0000358184 0.0000058431 @@ -1940,7 +1940,7 @@ 0.0000003540 -0.0000071513 -0.0000227626 -0.0018134844 0.0012820986 -0.0013106835 -0.0000043903 0.0000083178 -0.0000351018 -# File: 30 +# File: 30 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 13 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0081514476 0.0000209930 -0.0000060035 @@ -2007,7 +2007,7 @@ 0.0000053852 -0.0000019295 -0.0000227595 -0.0011666893 0.0019278209 -0.0013101108 -0.0000319704 -0.0000419634 -0.0000361258 -# File: 31 +# File: 31 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 13 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0080793701 -0.0000209335 0.0000060027 @@ -2074,7 +2074,7 @@ 0.0000200834 -0.0000270220 0.0000062452 0.0015363808 -0.0020128086 0.0013931099 0.0000114112 0.0000154317 0.0000086192 -# File: 32 +# File: 32 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 13 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0081094796 0.0000061631 -0.0000034745 @@ -2141,7 +2141,7 @@ 0.0000276317 -0.0000295519 0.0001226692 0.0015367513 -0.0014223196 0.0019847105 0.0000114293 -0.0000353540 -0.0000422487 -# File: 33 +# File: 33 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 13 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0081214812 -0.0000060603 0.0000043024 @@ -2208,7 +2208,7 @@ -0.0000011587 -0.0000007602 -0.0001368210 -0.0011670382 0.0012820780 -0.0019568806 -0.0000319870 0.0000092691 0.0000151820 -# File: 34 +# File: 34 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 14 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0080947688 0.0000359010 -0.0000063001 @@ -2275,7 +2275,7 @@ -0.0000158420 -0.0000368307 0.0000142782 0.0001222330 -0.0000366943 0.0000081057 0.0019882305 -0.0014211366 0.0013945453 -# File: 35 +# File: 35 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 14 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081364719 -0.0000357253 0.0000062670 @@ -2342,7 +2342,7 @@ 0.0000417431 0.0000064079 -0.0000304363 0.0001351960 0.0000076101 -0.0000362326 -0.0019529162 0.0012826676 -0.0013096812 -# File: 36 +# File: 36 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 14 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0080803094 0.0000206442 0.0000060039 @@ -2409,7 +2409,7 @@ -0.0000088522 -0.0000210978 -0.0000296488 0.0001076139 -0.0000429647 -0.0000370958 -0.0013066656 0.0019291842 -0.0013095543 -# File: 37 +# File: 37 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 14 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081510610 -0.0000205770 -0.0000060831 @@ -2476,7 +2476,7 @@ 0.0000355336 -0.0000081771 0.0000146442 0.0001509502 0.0000146243 0.0000077847 0.0013972522 -0.0020124051 0.0013943838 -# File: 38 +# File: 38 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 14 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0081097566 -0.0000057683 -0.0000048026 @@ -2543,7 +2543,7 @@ 0.0000349719 -0.0000370152 -0.0000366018 0.0001510951 -0.0000360649 -0.0000431089 0.0013972806 -0.0014210458 0.0019857631 -# File: 39 +# File: 39 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 14 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0081214536 0.0000059445 0.0000038529 @@ -2610,7 +2610,7 @@ -0.0000096165 0.0000065055 0.0000209242 0.0001074725 0.0000082801 0.0000143303 -0.0013066879 0.0012826262 -0.0019559532 -# File: 40 +# File: 40 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 25 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0081783043 0.0001256756 0.0001221153 @@ -2677,7 +2677,7 @@ 0.0000206082 -0.0000019845 0.0000070346 0.0014247786 0.0019283779 0.0012807820 0.0000110061 -0.0000420888 0.0000092983 -# File: 41 +# File: 41 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 25 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0080552756 -0.0001202951 -0.0001177634 @@ -2744,7 +2744,7 @@ 0.0000062038 -0.0000268443 -0.0000217001 -0.0012783460 -0.0020134847 -0.0014210904 -0.0000324832 0.0000154238 -0.0000352703 -# File: 42 +# File: 42 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 25 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0083784891 0.0000651140 0.0000651140 @@ -2811,7 +2811,7 @@ 0.0000262364 -0.0000073786 0.0000072293 0.0020707024 0.0012820569 0.0012820570 -0.0000167153 0.0000084078 0.0000084078 -# File: 43 +# File: 43 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 25 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0078516934 -0.0000665942 -0.0000665942 @@ -2878,7 +2878,7 @@ 0.0000010438 -0.0000219580 -0.0000217048 -0.0018692189 -0.0014223580 -0.0014223578 -0.0000036104 -0.0000356757 -0.0000356757 -# File: 44 +# File: 44 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 26 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0081217735 0.0000210605 -0.0000355151 @@ -2945,7 +2945,7 @@ 0.0000349563 -0.0000210730 0.0000141900 0.0001504723 -0.0000428368 0.0000083545 0.0012858219 0.0019290397 0.0012828004 -# File: 45 +# File: 45 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 26 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081094935 -0.0000210934 0.0000359358 @@ -3012,7 +3012,7 @@ -0.0000093038 -0.0000079608 -0.0000302222 0.0001070584 0.0000144424 -0.0000361178 -0.0014184210 -0.0020125553 -0.0014211519 -# File: 46 +# File: 46 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 26 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081184675 0.0000062533 0.0000062532 @@ -3079,7 +3079,7 @@ -0.0000155052 0.0000064494 0.0000148579 0.0001229842 0.0000075277 0.0000075275 0.0019318851 0.0012828537 0.0012828535 -# File: 47 +# File: 47 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 26 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081119924 -0.0000061178 -0.0000061179 @@ -3146,7 +3146,7 @@ 0.0000419434 -0.0000369263 -0.0000296410 0.0001358427 -0.0000366203 -0.0000366204 -0.0020093253 -0.0014212747 -0.0014212747 -# File: 48 +# File: 48 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 27 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0081807182 0.0001241513 -0.0001146900 @@ -3213,7 +3213,7 @@ 0.0000344076 -0.0000431855 0.0000148406 0.0001510690 -0.0000205262 0.0000075544 -0.0000026512 -0.0000004145 0.0000018283 -# File: 49 +# File: 49 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 27 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0080470026 -0.0001292813 0.0001189777 @@ -3280,7 +3280,7 @@ -0.0000086974 0.0000135703 -0.0000296829 0.0001065045 -0.0000074967 -0.0000366751 -0.0000176811 -0.0000254920 -0.0000276098 -# File: 50 +# File: 50 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 27 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0083842934 0.0000679510 -0.0000679663 @@ -3347,7 +3347,7 @@ 0.0000071080 0.0000069994 0.0000141891 0.0001004875 0.0000070375 0.0000084876 0.0000024887 -0.0000057256 0.0000015601 -# File: 51 +# File: 51 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 27 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0078484023 -0.0000660228 0.0000660075 @@ -3414,7 +3414,7 @@ 0.0000198156 -0.0000375091 -0.0000301910 0.0001578966 -0.0000361129 -0.0000363834 -0.0000224461 -0.0000203687 -0.0000273457 -# File: 52 +# File: 52 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 28 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0081214510 0.0000204907 0.0000358291 @@ -3481,7 +3481,7 @@ 0.0013091965 0.0019274178 0.0012885474 0.0001367699 -0.0000012237 0.0000006429 0.0000113869 -0.0000195089 0.0000084575 -# File: 53 +# File: 53 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 28 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081097726 -0.0000206495 -0.0000356619 @@ -3548,7 +3548,7 @@ -0.0013948085 -0.0020140290 -0.0014158337 0.0001218868 -0.0000259496 -0.0000282885 -0.0000327412 -0.0000064800 -0.0000356110 -# File: 54 +# File: 54 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 28 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081208525 0.0000057900 -0.0000058053 @@ -3615,7 +3615,7 @@ 0.0019558562 0.0012814199 0.0012885783 0.0001421524 -0.0000065995 0.0000006060 -0.0000390906 0.0000080782 0.0000093119 -# File: 55 +# File: 55 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 28 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081111809 -0.0000059241 0.0000059086 @@ -3682,7 +3682,7 @@ -0.0019861052 -0.0014230655 -0.0014156997 0.0001170071 -0.0000212978 -0.0000282007 0.0000183282 -0.0000353364 -0.0000353891 -# File: 56 +# File: 56 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0068205738 0.0018878438 0.0012503888 @@ -3749,7 +3749,7 @@ 0.0000072069 0.0000058388 0.0000275257 0.0000665188 0.0001076990 0.0001027958 -0.0000166722 0.0000073935 -0.0000489858 -# File: 57 +# File: 57 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0093054450 -0.0018341164 -0.0011489248 @@ -3816,7 +3816,7 @@ 0.0000190828 -0.0000357902 -0.0000434295 0.0001945194 -0.0001414808 -0.0001356999 -0.0000043368 -0.0000342871 0.0000220283 -# File: 58 +# File: 58 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0061725893 0.0012942458 0.0012942459 @@ -3883,7 +3883,7 @@ 0.0000090740 -0.0000087365 -0.0000137627 -0.0001366568 0.0000526592 0.0000526591 -0.0000149655 -0.0000074775 -0.0000074775 -# File: 59 +# File: 59 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 33 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0099964380 -0.0011856534 -0.0011856533 @@ -3950,7 +3950,7 @@ 0.0000178313 -0.0000211175 -0.0000019083 0.0003932955 -0.0000794786 -0.0000794788 -0.0000069892 -0.0000195058 -0.0000195058 -# File: 60 +# File: 60 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0080941897 -0.0000290878 0.0000218677 @@ -4017,7 +4017,7 @@ -0.0000527668 0.0001123811 -0.0001283985 0.0001229750 0.0000064093 -0.0000501062 -0.0000736539 0.0001087878 0.0001029759 -# File: 61 +# File: 61 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081365907 0.0000287489 -0.0000226729 @@ -4084,7 +4084,7 @@ 0.0000759959 -0.0001372352 0.0001084516 0.0001350508 -0.0000350848 0.0000211892 0.0000554659 -0.0001408921 -0.0001340209 -# File: 62 +# File: 62 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081221075 0.0000224218 0.0000224219 @@ -4151,7 +4151,7 @@ -0.0002523522 0.0000505264 -0.0000732916 0.0001245756 -0.0000083353 -0.0000083354 -0.0002770105 0.0000537523 0.0000537524 -# File: 63 +# File: 63 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 34 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081098013 -0.0000219110 -0.0000219110 @@ -4218,7 +4218,7 @@ 0.0002798837 -0.0000822395 0.0000594862 0.0001326846 -0.0000203613 -0.0000203613 0.0002547725 -0.0000788296 -0.0000788298 -# File: 64 +# File: 64 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081438950 0.0000217007 0.0000207944 @@ -4285,7 +4285,7 @@ 0.0000086273 -0.0000090737 -0.0000018556 -0.0001363381 0.0000512051 -0.0000798194 -0.0000141746 -0.0000073099 -0.0000194843 -# File: 65 +# File: 65 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 35 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0080875990 -0.0000212465 -0.0000214503 @@ -4352,7 +4352,7 @@ 0.0000167539 -0.0000210897 -0.0000137854 0.0003956549 -0.0000815399 0.0000529565 -0.0000059962 -0.0000193543 -0.0000074377 -# File: 66 +# File: 66 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0080941750 -0.0000068794 0.0000226609 @@ -4419,7 +4419,7 @@ 0.0000071028 0.0000058895 -0.0000436731 0.0000630511 0.0001132211 -0.0001347006 -0.0000165096 0.0000075024 0.0000223155 -# File: 67 +# File: 67 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081363763 0.0000060353 -0.0000221757 @@ -4486,7 +4486,7 @@ 0.0000190871 -0.0000358676 0.0000277591 0.0001922068 -0.0001363742 0.0001019798 -0.0000044356 -0.0000341279 -0.0000492311 -# File: 68 +# File: 68 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0080926352 0.0000218339 -0.0000300400 @@ -4553,7 +4553,7 @@ 0.0000070271 -0.0000507072 0.0000129750 0.0001921061 -0.0001305045 0.0001078205 -0.0000044255 0.0000224652 0.0000073216 -# File: 69 +# File: 69 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0081392437 -0.0000214159 0.0000297757 @@ -4620,7 +4620,7 @@ 0.0000191015 0.0000203465 -0.0000285799 0.0000630983 0.0001062686 -0.0001417000 -0.0000165596 -0.0000489056 -0.0000342206 -# File: 70 +# File: 70 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081024465 0.0000079064 0.0000140966 @@ -4687,7 +4687,7 @@ -0.0002536211 0.0000520287 0.0000593870 0.0001253820 -0.0000082504 -0.0000203523 -0.0002758044 0.0000520911 -0.0000789086 -# File: 71 +# File: 71 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 36 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081296112 -0.0000085234 -0.0000151389 @@ -4754,7 +4754,7 @@ 0.0002785045 -0.0000803442 -0.0000731763 0.0001335315 -0.0000202148 -0.0000083952 0.0002560442 -0.0000805865 0.0000538103 -# File: 72 +# File: 72 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0081077973 0.0000129127 0.0000144050 @@ -4821,7 +4821,7 @@ -0.0000498261 0.0001072566 0.0001085360 0.0001230045 0.0000065453 0.0000212783 -0.0000766035 0.0001139240 -0.0001339845 -# File: 73 +# File: 73 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081240329 -0.0000138880 -0.0000154123 @@ -4888,7 +4888,7 @@ 0.0000788909 -0.0001425170 -0.0001284011 0.0001351297 -0.0000350654 -0.0000501792 0.0000526742 -0.0001354845 0.0001028177 -# File: 74 +# File: 74 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0081000805 0.0000146913 0.0001304092 @@ -4955,7 +4955,7 @@ -0.0000497312 0.0001014008 0.0001145095 0.0001349228 0.0000216070 0.0000065659 0.0000526649 -0.0001296341 0.0001088467 -# File: 75 +# File: 75 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0081306225 -0.0000143394 -0.0001290836 @@ -5022,7 +5022,7 @@ 0.0000788111 -0.0001357941 -0.0001352524 0.0001232105 -0.0000499592 -0.0000352730 -0.0000766113 0.0001072210 -0.0001408906 -# File: 76 +# File: 76 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0081017207 0.0000122615 0.0000072614 @@ -5089,7 +5089,7 @@ 0.0000190661 0.0000059786 0.0000282354 0.0001948360 0.0001131829 0.0001064497 -0.0000044980 0.0000074539 -0.0000490380 -# File: 77 +# File: 77 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081302181 -0.0000129264 -0.0000083077 @@ -5156,7 +5156,7 @@ 0.0000071121 -0.0000360449 -0.0000434614 0.0000659783 -0.0001362634 -0.0001310626 -0.0000166107 -0.0000341205 0.0000225853 -# File: 78 +# File: 78 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0079868546 0.0000146337 0.0000146336 @@ -5223,7 +5223,7 @@ 0.0000094289 -0.0000209135 -0.0000016347 -0.0001375690 -0.0000815270 -0.0000815272 -0.0000150200 -0.0000193391 -0.0000193393 -# File: 79 +# File: 79 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 39 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0082430697 -0.0000143540 -0.0000143539 @@ -5290,7 +5290,7 @@ 0.0000176231 -0.0000092563 -0.0000137174 0.0003943177 0.0000512302 0.0000512301 -0.0000067907 -0.0000073271 -0.0000073272 -# File: 80 +# File: 80 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0081021752 -0.0000105353 0.0000137921 @@ -5357,7 +5357,7 @@ 0.0000760764 0.0001072364 -0.0001239697 0.0001350480 0.0000064446 -0.0000498077 0.0000554206 0.0001139895 0.0001072089 -# File: 81 +# File: 81 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081287711 0.0000105765 -0.0000136389 @@ -5424,7 +5424,7 @@ -0.0000527952 -0.0001425127 0.0001128154 0.0001230090 -0.0000349755 0.0000214808 -0.0000735499 -0.0001355597 -0.0001296395 -# File: 82 +# File: 82 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081260729 0.0000134224 0.0000134223 @@ -5491,7 +5491,7 @@ -0.0002521993 -0.0000807082 0.0000579560 0.0001245491 -0.0000202899 -0.0000202899 -0.0002771911 -0.0000806706 -0.0000806706 -# File: 83 +# File: 83 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 40 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081049089 -0.0000132920 -0.0000132920 @@ -5558,7 +5558,7 @@ 0.0002796384 0.0000523914 -0.0000751638 0.0001327457 -0.0000081795 -0.0000081795 0.0002548715 0.0000521598 0.0000521598 -# File: 84 +# File: 84 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 41 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0067101803 0.0020574680 -0.0014541762 @@ -5625,7 +5625,7 @@ 0.0000794809 -0.0002801255 -0.0000737448 0.0001351273 -0.0000186059 -0.0000083598 -0.0000044424 -0.0000170515 -0.0000196199 -# File: 85 +# File: 85 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 41 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0096393878 -0.0021168997 0.0015766074 @@ -5692,7 +5692,7 @@ -0.0000550432 0.0002513892 0.0000599763 0.0001228247 -0.0000108729 -0.0000203960 -0.0000164469 -0.0000089674 -0.0000073146 -# File: 86 +# File: 86 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 41 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0061177212 0.0014099476 -0.0014099627 @@ -5759,7 +5759,7 @@ 0.0001397326 -0.0000806495 -0.0001287325 0.0001499067 -0.0000204104 -0.0000501780 0.0000104162 -0.0000194795 0.0000221996 -# File: 87 +# File: 87 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 41 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0101639388 -0.0015242652 0.0015242500 @@ -5826,7 +5826,7 @@ -0.0001082609 0.0000476910 0.0001088612 0.0001081172 -0.0000082509 0.0000213041 -0.0000313356 -0.0000072918 -0.0000493076 -# File: 88 +# File: 88 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 42 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0080938641 -0.0000284858 -0.0000228345 @@ -5893,7 +5893,7 @@ 0.0000802568 -0.0002817176 0.0000594730 0.0001351422 -0.0000178797 -0.0000204502 -0.0000045751 -0.0000177920 -0.0000073850 -# File: 89 +# File: 89 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 42 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081377671 0.0000286698 0.0000220590 @@ -5960,7 +5960,7 @@ -0.0000524226 0.0002504518 -0.0000733093 0.0001231352 -0.0000098890 -0.0000083402 -0.0000165796 -0.0000098329 -0.0000195347 -# File: 90 +# File: 90 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 42 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081220242 0.0000218067 -0.0000218219 @@ -6027,7 +6027,7 @@ 0.0001352191 -0.0000780165 0.0001085350 0.0001499316 -0.0000203145 0.0000212052 0.0000102430 -0.0000195004 -0.0000492279 -# File: 91 +# File: 91 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 42 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081085112 -0.0000222753 0.0000222601 @@ -6094,7 +6094,7 @@ -0.0001142766 0.0000509047 -0.0001283969 0.0001082381 -0.0000082523 -0.0000500991 -0.0000313486 -0.0000073366 0.0000221403 -# File: 92 +# File: 92 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 43 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081446245 0.0000216279 -0.0000238355 @@ -6161,7 +6161,7 @@ 0.0000339238 -0.0000209760 0.0000278529 0.0002512094 -0.0000770591 0.0001016341 0.0001169086 -0.0000793052 -0.0001339197 -# File: 93 +# File: 93 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 43 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0080862628 -0.0000222249 0.0000229846 @@ -6228,7 +6228,7 @@ -0.0000077439 -0.0000090461 -0.0000437913 0.0000014365 0.0000512382 -0.0001344279 -0.0001328958 0.0000495015 0.0001026070 -# File: 94 +# File: 94 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 43 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0080927872 -0.0000060334 -0.0000215475 @@ -6295,7 +6295,7 @@ 0.0000192217 -0.0000186788 -0.0000138697 0.0001962900 -0.0002807923 0.0000530301 0.0000549807 -0.0002788081 -0.0000789421 -# File: 95 +# File: 95 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 43 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081390438 0.0000068748 0.0000220895 @@ -6362,7 +6362,7 @@ 0.0000071414 -0.0000104870 -0.0000018129 0.0000635094 0.0002509614 -0.0000799430 -0.0000777059 0.0002533327 0.0000538400 -# File: 96 +# File: 96 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 43 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0081366335 -0.0000219259 -0.0000276836 @@ -6429,7 +6429,7 @@ 0.0000490190 -0.0000089101 0.0000129964 0.0002455635 -0.0000770070 0.0001079696 -0.0001268384 0.0000497185 0.0001087858 -# File: 97 +# File: 97 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 43 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0080939327 0.0000215150 0.0000274648 @@ -6496,7 +6496,7 @@ -0.0000225865 -0.0000210209 -0.0000286718 0.0000084536 0.0000511651 -0.0001420863 0.0001098969 -0.0000793003 -0.0001410828 -# File: 98 +# File: 98 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 44 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081036155 0.0000069172 -0.0000147630 @@ -6563,7 +6563,7 @@ 0.0000337956 -0.0000210693 -0.0000435829 0.0002565055 -0.0000804127 -0.0001350219 0.0001117176 -0.0000763369 0.0001028951 -# File: 99 +# File: 99 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 44 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081264361 -0.0000061198 0.0000137564 @@ -6630,7 +6630,7 @@ -0.0000076962 -0.0000089865 0.0000277906 0.0000068382 0.0000489063 0.0001020378 -0.0001379850 0.0000524360 -0.0001340390 -# File: 100 +# File: 100 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 44 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0081085727 0.0000122810 -0.0000145282 @@ -6697,7 +6697,7 @@ 0.0000190547 -0.0000194727 -0.0000018280 0.0001945969 -0.0002797711 -0.0000798508 0.0000567107 -0.0002800762 0.0000538115 -# File: 101 +# File: 101 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 44 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081218900 -0.0000111568 0.0000134991 @@ -6764,7 +6764,7 @@ 0.0000069591 -0.0000115311 -0.0000138501 0.0000617584 0.0002525012 0.0000529859 -0.0000760446 0.0002520531 -0.0000789192 -# File: 102 +# File: 102 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 44 0.0000000000000000 0.0000000000000000 0.0600000000000000 -0.0081290363 -0.0000142867 0.0001302213 @@ -6831,7 +6831,7 @@ -0.0000226974 -0.0000211747 0.0000129873 0.0000128890 0.0000488203 0.0001080333 0.0001057613 -0.0000762893 0.0001088393 -# File: 103 +# File: 103 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 44 0.0000000000000000 0.0000000000000000 -0.0600000000000000 -0.0081022002 0.0000140624 -0.0001288912 @@ -6898,7 +6898,7 @@ 0.0000485881 -0.0000088883 -0.0000285784 0.0002495883 -0.0000803321 -0.0001418864 -0.0001311698 0.0000523972 -0.0001408823 -# File: 104 +# File: 104 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 47 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0081002271 0.0000128777 -0.0000072762 @@ -6965,7 +6965,7 @@ 0.0000071205 -0.0000195273 -0.0000137034 0.0000636091 -0.0002796411 0.0000510025 -0.0000778141 -0.0002800266 -0.0000806016 -# File: 105 +# File: 105 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 47 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081296823 -0.0000118641 0.0000065369 @@ -7032,7 +7032,7 @@ 0.0000191984 -0.0000113252 -0.0000016557 0.0001961956 0.0002523815 -0.0000812819 0.0000550835 0.0002519749 0.0000521088 -# File: 106 +# File: 106 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 47 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0079853238 0.0000141560 -0.0000141711 @@ -7099,7 +7099,7 @@ 0.0000339894 -0.0000090370 -0.0000433699 0.0002512392 0.0000487961 -0.0001303492 0.0001168264 0.0000521674 0.0001071024 -# File: 107 +# File: 107 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 47 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0082472240 -0.0000144675 0.0000144526 @@ -7166,7 +7166,7 @@ -0.0000077192 -0.0000210215 0.0000281651 0.0000016274 -0.0000802971 0.0001061116 -0.0001325917 -0.0000761072 -0.0001295603 -# File: 108 +# File: 108 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 48 0.0000000000000000 0.0600000000000000 0.0000000000000000 -0.0081021485 -0.0000103551 -0.0000129714 @@ -7233,7 +7233,7 @@ 0.0000071157 -0.0000188461 -0.0000017929 0.0000615356 -0.0002810103 -0.0000817762 -0.0000760023 -0.0002788127 0.0000520561 -# File: 109 +# File: 109 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 48 0.0000000000000000 -0.0600000000000000 0.0000000000000000 -0.0081292533 0.0000103640 0.0000132240 @@ -7300,7 +7300,7 @@ 0.0000190207 -0.0000105364 -0.0000136681 0.0001948955 0.0002510884 0.0000514980 0.0000567152 0.0002532579 -0.0000805910 -# File: 110 +# File: 110 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 48 0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081259458 0.0000133926 -0.0000134078 @@ -7367,7 +7367,7 @@ 0.0000338315 -0.0000089409 0.0000280763 0.0002565534 0.0000515445 0.0001064355 0.0001116565 0.0000496164 -0.0001296366 -# File: 111 +# File: 111 # 1 0.0600000000000000 0.0000000000000000 0.0000000000000000 # 48 -0.0600000000000000 0.0000000000000000 0.0000000000000000 -0.0081052377 -0.0000136036 0.0000135884 diff --git a/example/Si-TURBOMOLE/README b/example/Si-TURBOMOLE/README index b4355a46..edd36927 100644 --- a/example/Si-TURBOMOLE/README +++ b/example/Si-TURBOMOLE/README @@ -6,7 +6,7 @@ so the -c control parameter is not needed 1) Create displaced supercells 2x2x2 conventional cell for 3rd order FC 3x3x3 conventional cell for 2nd order FC - + phono3py --turbomole --dim="2 2 2" --dim-fc2="3 3 3" -d Complete TURBOMOLE inputs can be prepared manually @@ -32,4 +32,3 @@ so the -c control parameter is not needed --br -> Relaxation time approximation With 20x20x20 mesh, the lattice thermal conductivity at 300 K is 142 W m^-1 K^-1. - diff --git a/example/Si-TURBOMOLE/control b/example/Si-TURBOMOLE/control index e8192d29..3ed7940e 100644 --- a/example/Si-TURBOMOLE/control +++ b/example/Si-TURBOMOLE/control @@ -1,9 +1,9 @@ $periodic 3 $lattice - 10.357962933 0.0000000000 0.0000000000 - 0.0000000000 10.357962933 0.0000000000 + 10.357962933 0.0000000000 0.0000000000 + 0.0000000000 10.357962933 0.0000000000 0.0000000000 0.0000000000 10.357962933 -$coord file=coord +$coord file=coord $kpoints nkpoints 6 6 6 $riper diff --git a/example/Si-TURBOMOLE/coord b/example/Si-TURBOMOLE/coord index e2cd6ffa..d9a3de23 100644 --- a/example/Si-TURBOMOLE/coord +++ b/example/Si-TURBOMOLE/coord @@ -8,4 +8,3 @@ $coord 5.17898184151 0.00000000000 5.17898184151 si 0.00000000000 5.17898184151 5.17898184151 si $end - diff --git a/example/zb-ZnTe-PBEsol/launch_phono3py_ZnTe_PBEsol_222.py b/example/zb-ZnTe-PBEsol/launch_phono3py_ZnTe_PBEsol_222.py index 9931c9f5..d15d2341 100644 --- a/example/zb-ZnTe-PBEsol/launch_phono3py_ZnTe_PBEsol_222.py +++ b/example/zb-ZnTe-PBEsol/launch_phono3py_ZnTe_PBEsol_222.py @@ -1,14 +1,14 @@ -import copy +"""Launch script of ZnTe AiiDA calculation using aiida-phononpy.""" from phonopy.interface.vasp import read_vasp_from_strings from aiida.manage.configuration import load_profile -from aiida.orm import Int, Float, Bool, Str, load_node, QueryBuilder +from aiida.orm import Float, Bool, Str from aiida.plugins import DataFactory, WorkflowFactory -from aiida.engine import run, submit +from aiida.engine import submit from aiida_phonopy.common.utils import phonopy_atoms_to_structure load_profile() -Dict = DataFactory('dict') +Dict = DataFactory("dict") def get_settings(cutoff_energy, is_nac=False): @@ -33,87 +33,100 @@ Direct structure = phonopy_atoms_to_structure(cell) base_incar_dict = { - 'PREC': 'Accurate', - 'IBRION': -1, - 'EDIFF': 1e-8, - 'NELMIN': 5, - 'NELM': 100, - 'ENCUT': cutoff_energy, - 'IALGO': 38, - 'ISMEAR': 0, - 'SIGMA': 0.01, - 'GGA' : 'PS', - 'LREAL': False, - 'lcharg': False, - 'lwave': False, + "PREC": "Accurate", + "IBRION": -1, + "EDIFF": 1e-8, + "NELMIN": 5, + "NELM": 100, + "ENCUT": cutoff_energy, + "IALGO": 38, + "ISMEAR": 0, + "SIGMA": 0.01, + "GGA": "PS", + "LREAL": False, + "lcharg": False, + "lwave": False, } - code_string = 'vasp544mpi@nancy' - resources = {'parallel_env': 'mpi*', 'tot_num_mpiprocs': 24} + code_string = "vasp544mpi@nancy" + resources = {"parallel_env": "mpi*", "tot_num_mpiprocs": 24} - base_config = {'code_string': code_string, - 'potential_family': 'PBE.54', - 'potential_mapping': {'Zn': 'Zn', 'Te': 'Te'}, - 'options': {'resources': resources, - 'max_wallclock_seconds': 3600 * 10}} - base_parser_settings = {'add_energies': True, - 'add_forces': True, - 'add_stress': True} + base_config = { + "code_string": code_string, + "potential_family": "PBE.54", + "potential_mapping": {"Zn": "Zn", "Te": "Te"}, + "options": {"resources": resources, "max_wallclock_seconds": 3600 * 10}, + } + base_parser_settings = { + "add_energies": True, + "add_forces": True, + "add_stress": True, + } forces_config = base_config.copy() kpoints_mesh = [2, 2, 2] - forces_config.update({'kpoints_mesh': kpoints_mesh, - 'kpoints_offset': [0.5, 0.5, 0.5], - 'parser_settings': base_parser_settings, - 'parameters': {'incar': base_incar_dict.copy()}}) - forces_config['parameters']['incar']['NPAR'] = 4 - nac_config = {'code_string': code_string, - 'potential_family': 'PBE.54', - 'potential_mapping': {'Zn': 'Zn', 'Te': 'Te'}, - 'options': {'resources': resources, - 'max_wallclock_seconds': 3600 * 10}} - nac_parser_settings = {'add_born_charges': True, - 'add_dielectrics': True} + forces_config.update( + { + "kpoints_mesh": kpoints_mesh, + "kpoints_offset": [0.5, 0.5, 0.5], + "parser_settings": base_parser_settings, + "parameters": {"incar": base_incar_dict.copy()}, + } + ) + forces_config["parameters"]["incar"]["NPAR"] = 4 + nac_config = { + "code_string": code_string, + "potential_family": "PBE.54", + "potential_mapping": {"Zn": "Zn", "Te": "Te"}, + "options": {"resources": resources, "max_wallclock_seconds": 3600 * 10}, + } + nac_parser_settings = {"add_born_charges": True, "add_dielectrics": True} nac_parser_settings.update(base_parser_settings) - nac_incar_dict = {'lepsilon': True} + nac_incar_dict = {"lepsilon": True} nac_incar_dict.update(base_incar_dict.copy()) - nac_config.update({'kpoints_mesh': [8, 8, 8], - 'kpoints_offset': [0.5, 0.5, 0.5], - 'parser_settings': nac_parser_settings, - 'parameters': {'incar': nac_incar_dict}}) - phonon_settings = {'supercell_matrix': [2, 2, 2], - 'distance': 0.03} + nac_config.update( + { + "kpoints_mesh": [8, 8, 8], + "kpoints_offset": [0.5, 0.5, 0.5], + "parser_settings": nac_parser_settings, + "parameters": {"incar": nac_incar_dict}, + } + ) + phonon_settings = {"supercell_matrix": [2, 2, 2], "distance": 0.03} if is_nac: - phonon_settings['is_nac'] = is_nac + phonon_settings["is_nac"] = is_nac return structure, forces_config, nac_config, phonon_settings def launch_phono3py(cutoff_energy=350, is_nac=False): structure, forces_config, nac_config, phonon_settings = get_settings( - cutoff_energy, is_nac) - Phono3pyWorkChain = WorkflowFactory('phonopy.phono3py') + cutoff_energy, is_nac + ) + Phono3pyWorkChain = WorkflowFactory("phonopy.phono3py") builder = Phono3pyWorkChain.get_builder() builder.structure = structure - builder.calculator_settings = Dict(dict={'forces': forces_config, - 'nac': nac_config}) + builder.calculator_settings = Dict( + dict={"forces": forces_config, "nac": nac_config} + ) builder.run_phono3py = Bool(False) builder.remote_phono3py = Bool(False) - builder.code_string = Str('phonopy@nancy') + builder.code_string = Str("phonopy@nancy") builder.phonon_settings = Dict(dict=phonon_settings) builder.symmetry_tolerance = Float(1e-5) - builder.options = Dict(dict=forces_config['options']) - dim = phonon_settings['supercell_matrix'] - kpoints_mesh = forces_config['kpoints_mesh'] - label = ("ZnTe phono3py %dx%dx%d kpt %dx%dx%d PBEsol %d eV" - % (tuple(dim) + tuple(kpoints_mesh) + (cutoff_energy, ))) + builder.options = Dict(dict=forces_config["options"]) + dim = phonon_settings["supercell_matrix"] + kpoints_mesh = forces_config["kpoints_mesh"] + label = "ZnTe phono3py %dx%dx%d kpt %dx%dx%d PBEsol %d eV" % ( + tuple(dim) + tuple(kpoints_mesh) + (cutoff_energy,) + ) builder.metadata.label = label builder.metadata.description = label future = submit(builder) print(label) print(future) - print('Running workchain with pk={}'.format(future.pk)) + print("Running workchain with pk={}".format(future.pk)) -if __name__ == '__main__': +if __name__ == "__main__": launch_phono3py(cutoff_energy=500, is_nac=True) diff --git a/phono3py/__init__.py b/phono3py/__init__.py index 7db4f39b..058516ff 100644 --- a/phono3py/__init__.py +++ b/phono3py/__init__.py @@ -1,3 +1,4 @@ +"""Shortcuts to important classes, methods, and variables.""" # Copyright (C) 2019 Atsushi Togo # All rights reserved. # @@ -32,8 +33,8 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -from phono3py.version import __version__ -from phono3py.api_phono3py import Phono3py -from phono3py.api_jointdos import Phono3pyJointDos -from phono3py.api_isotope import Phono3pyIsotope -from phono3py.cui.load import load +from phono3py.version import __version__ # noqa F401 +from phono3py.api_phono3py import Phono3py # noqa F401 +from phono3py.api_jointdos import Phono3pyJointDos # noqa F401 +from phono3py.api_isotope import Phono3pyIsotope # noqa F401 +from phono3py.cui.load import load # noqa F401 diff --git a/phono3py/api_isotope.py b/phono3py/api_isotope.py index 952d5d51..7741876b 100644 --- a/phono3py/api_isotope.py +++ b/phono3py/api_isotope.py @@ -38,31 +38,37 @@ from phono3py.other.isotope import Isotope class Phono3pyIsotope(object): - def __init__(self, - mesh, - primitive, - mass_variances=None, # length of list is num_atom. - band_indices=None, - sigmas=None, - frequency_factor_to_THz=VaspToTHz, - store_dense_gp_map=False, - symprec=1e-5, - cutoff_frequency=None, - lapack_zheev_uplo='L'): + def __init__( + self, + mesh, + primitive, + mass_variances=None, # length of list is num_atom. + band_indices=None, + sigmas=None, + frequency_factor_to_THz=VaspToTHz, + store_dense_gp_map=False, + symprec=1e-5, + cutoff_frequency=None, + lapack_zheev_uplo="L", + ): if sigmas is None: - self._sigmas = [None, ] + self._sigmas = [ + None, + ] else: self._sigmas = sigmas self._mesh_numbers = mesh - self._iso = Isotope(mesh, - primitive, - mass_variances=mass_variances, - band_indices=band_indices, - frequency_factor_to_THz=frequency_factor_to_THz, - store_dense_gp_map=store_dense_gp_map, - symprec=symprec, - cutoff_frequency=cutoff_frequency, - lapack_zheev_uplo=lapack_zheev_uplo) + self._iso = Isotope( + mesh, + primitive, + mass_variances=mass_variances, + band_indices=band_indices, + frequency_factor_to_THz=frequency_factor_to_THz, + store_dense_gp_map=store_dense_gp_map, + symprec=symprec, + cutoff_frequency=cutoff_frequency, + lapack_zheev_uplo=lapack_zheev_uplo, + ) @property def dynamical_matrix(self): @@ -75,7 +81,8 @@ class Phono3pyIsotope(object): def run(self, grid_points): gamma = np.zeros( (len(self._sigmas), len(grid_points), len(self._iso.band_indices)), - dtype='double') + dtype="double", + ) for j, gp in enumerate(grid_points): self._iso.set_grid_point(gp) @@ -83,7 +90,7 @@ class Phono3pyIsotope(object): print("--------------- Isotope scattering ---------------") print("Grid point: %d" % gp) adrs = self._iso.bz_grid.addresses[gp] - q = adrs.astype('double') / self._mesh_numbers + q = adrs.astype("double") / self._mesh_numbers print("q-point: %s" % q) if self._sigmas: @@ -96,7 +103,7 @@ class Phono3pyIsotope(object): self._iso.run() gamma[i, j] = self._iso.gamma frequencies = self._iso.get_phonons()[0] - print('') + print("") print("Phonon-isotope scattering rate in THz (1/4pi-tau)") print(" Frequency Rate") for g, f in zip(self._iso.gamma, frequencies[gp]): @@ -105,13 +112,15 @@ class Phono3pyIsotope(object): print("sigma or tetrahedron method has to be set.") self._gamma = gamma - def init_dynamical_matrix(self, - fc2, - supercell, - primitive, - nac_params=None, - frequency_scale_factor=None, - decimals=None): + def init_dynamical_matrix( + self, + fc2, + supercell, + primitive, + nac_params=None, + frequency_scale_factor=None, + decimals=None, + ): self._primitive = primitive self._iso.init_dynamical_matrix( fc2, @@ -119,7 +128,8 @@ class Phono3pyIsotope(object): primitive, nac_params=nac_params, frequency_scale_factor=frequency_scale_factor, - decimals=decimals) + decimals=decimals, + ) def set_sigma(self, sigma): self._iso.set_sigma(sigma) diff --git a/phono3py/api_jointdos.py b/phono3py/api_jointdos.py index 2cb22568..8564c1a1 100644 --- a/phono3py/api_jointdos.py +++ b/phono3py/api_jointdos.py @@ -42,25 +42,27 @@ from phono3py.file_IO import write_joint_dos class Phono3pyJointDos(object): - def __init__(self, - supercell, - primitive, - fc2, - mesh=None, - nac_params=None, - nac_q_direction=None, - sigmas=None, - cutoff_frequency=1e-4, - frequency_step=None, - num_frequency_points=None, - temperatures=None, - frequency_factor_to_THz=VaspToTHz, - frequency_scale_factor=None, - is_mesh_symmetry=True, - store_dense_gp_map=False, - symprec=1e-5, - output_filename=None, - log_level=0): + def __init__( + self, + supercell, + primitive, + fc2, + mesh=None, + nac_params=None, + nac_q_direction=None, + sigmas=None, + cutoff_frequency=1e-4, + frequency_step=None, + num_frequency_points=None, + temperatures=None, + frequency_factor_to_THz=VaspToTHz, + frequency_scale_factor=None, + is_mesh_symmetry=True, + store_dense_gp_map=False, + symprec=1e-5, + output_filename=None, + log_level=0, + ): if sigmas is None: self._sigmas = [None] else: @@ -71,10 +73,12 @@ class Phono3pyJointDos(object): self._log_level = log_level symmetry = Symmetry(primitive, symprec) - self._bz_grid = BZGrid(mesh, - lattice=primitive.cell, - symmetry_dataset=symmetry.dataset, - store_dense_gp_map=store_dense_gp_map) + self._bz_grid = BZGrid( + mesh, + lattice=primitive.cell, + symmetry_dataset=symmetry.dataset, + store_dense_gp_map=store_dense_gp_map, + ) self._jdos = JointDos( primitive, @@ -93,7 +97,8 @@ class Phono3pyJointDos(object): store_dense_gp_map=store_dense_gp_map, symprec=symprec, filename=output_filename, - log_level=self._log_level) + log_level=self._log_level, + ) self._joint_dos = None @@ -103,8 +108,10 @@ class Phono3pyJointDos(object): def run(self, grid_points, write_jdos=False): if self._log_level: - print("--------------------------------- Joint DOS " - "---------------------------------") + print( + "--------------------------------- Joint DOS " + "---------------------------------" + ) print("Sampling mesh: [ %d %d %d ]" % tuple(self._bz_grid.D_diag)) for i, gp in enumerate(grid_points): @@ -112,10 +119,11 @@ class Phono3pyJointDos(object): if self._log_level: weights = self._jdos.get_triplets_at_q()[1] - print("======================= " - "Grid point %d (%d/%d) " - "=======================" - % (gp, i + 1, len(grid_points))) + print( + "======================= " + "Grid point %d (%d/%d) " + "=======================" % (gp, i + 1, len(grid_points)) + ) adrs = self._jdos.bz_grid.addresses[gp] q = np.dot(adrs, self._bz_grid.QDinv.T) print("q-point: (%5.2f %5.2f %5.2f)" % tuple(q)) @@ -125,8 +133,7 @@ class Phono3pyJointDos(object): print("%8.3f" % f) if not self._sigmas: - raise RuntimeError( - "sigma or tetrahedron method has to be set.") + raise RuntimeError("sigma or tetrahedron method has to be set.") for sigma in self._sigmas: if self._log_level: @@ -140,7 +147,7 @@ class Phono3pyJointDos(object): if write_jdos: filename = self._write(gp, sigma=sigma) if self._log_level: - print("JDOS is written into \"%s\"." % filename) + print('JDOS is written into "%s".' % filename) @property def dynamical_matrix(self): @@ -155,11 +162,13 @@ class Phono3pyJointDos(object): return self._jdos.joint_dos def _write(self, gp, sigma=None): - return write_joint_dos(gp, - self._bz_grid.D_diag, - self._jdos.frequency_points, - self._jdos.joint_dos, - sigma=sigma, - temperatures=self._temperatures, - filename=self._filename, - is_mesh_symmetry=self._is_mesh_symmetry) + return write_joint_dos( + gp, + self._bz_grid.D_diag, + self._jdos.frequency_points, + self._jdos.joint_dos, + sigma=sigma, + temperatures=self._temperatures, + filename=self._filename, + is_mesh_symmetry=self._is_mesh_symmetry, + ) diff --git a/phono3py/api_phono3py.py b/phono3py/api_phono3py.py index ab82fa20..d942ebe6 100644 --- a/phono3py/api_phono3py.py +++ b/phono3py/api_phono3py.py @@ -2123,7 +2123,6 @@ class Phono3py(object): boundary_mfp=None, # in micrometre solve_collective_phonon=False, use_ave_pp=False, - gamma_unit_conversion=None, is_reducible_collision_matrix=False, is_kappa_star=True, gv_delta_q=None, # for group velocity @@ -2179,10 +2178,6 @@ class Phono3py(object): strength is used to calculate phonon lifetime. This does not reduce computational demand, but may be used to model thermal conductivity for analyze the calculation results. - gamma_unit_conversion : float, optional, default is None - RTA only (`is_LBTE=False`). Unit conversion factor when calculating - inversion phonon lifetime. This option should not be used - by users. is_reducible_collision_matrix : bool, optional, default is False Direct solution only (`is_LBTE=True`). This is an experimental option. With True, full collision matrix is created and solved. @@ -2330,7 +2325,6 @@ class Phono3py(object): grid_points=grid_points, boundary_mfp=boundary_mfp, use_ave_pp=use_ave_pp, - gamma_unit_conversion=gamma_unit_conversion, is_kappa_star=is_kappa_star, gv_delta_q=gv_delta_q, is_full_pp=is_full_pp, diff --git a/phono3py/cui/__init__.py b/phono3py/cui/__init__.py index e69de29b..ef701ecd 100644 --- a/phono3py/cui/__init__.py +++ b/phono3py/cui/__init__.py @@ -0,0 +1 @@ +"""Command user interface related routines.""" diff --git a/phono3py/cui/create_force_constants.py b/phono3py/cui/create_force_constants.py index b184984e..a54601c0 100644 --- a/phono3py/cui/create_force_constants.py +++ b/phono3py/cui/create_force_constants.py @@ -39,34 +39,44 @@ import numpy as np from phonopy.harmonic.force_constants import ( show_drift_force_constants, symmetrize_force_constants, - symmetrize_compact_force_constants) -from phonopy.file_IO import get_dataset_type2, parse_FORCE_SETS + symmetrize_compact_force_constants, +) +from phonopy.file_IO import get_dataset_type2 from phonopy.cui.phonopy_script import print_error, file_exists from phonopy.interface.calculator import get_default_physical_units from phono3py.phonon3.fc3 import show_drift_fc3 from phono3py.file_IO import ( - parse_disp_fc3_yaml, parse_disp_fc2_yaml, parse_FORCES_FC2, - parse_FORCES_FC3, read_fc3_from_hdf5, read_fc2_from_hdf5, - write_fc3_to_hdf5, write_fc2_to_hdf5, get_length_of_first_line) + parse_disp_fc3_yaml, + parse_disp_fc2_yaml, + parse_FORCES_FC2, + parse_FORCES_FC3, + read_fc3_from_hdf5, + read_fc2_from_hdf5, + write_fc3_to_hdf5, + write_fc2_to_hdf5, + get_length_of_first_line, +) from phono3py.cui.show_log import show_phono3py_force_constants_settings from phono3py.phonon3.fc3 import ( - set_permutation_symmetry_fc3, set_translational_invariance_fc3) + set_permutation_symmetry_fc3, + set_translational_invariance_fc3, +) from phono3py.interface.phono3py_yaml import Phono3pyYaml -def create_phono3py_force_constants(phono3py, - settings, - ph3py_yaml=None, - input_filename=None, - output_filename=None, - phono3py_yaml_filename=None, - log_level=1): +def create_phono3py_force_constants( + phono3py, + settings, + ph3py_yaml=None, + input_filename=None, + output_filename=None, + phono3py_yaml_filename=None, + log_level=1, +): """Read or calculate force constants.""" if settings.fc_calculator is None: - symmetrize_fc3r = (settings.is_symmetrize_fc3_r or - settings.fc_symmetry) - symmetrize_fc2 = (settings.is_symmetrize_fc2 or - settings.fc_symmetry) + symmetrize_fc3r = settings.is_symmetrize_fc3_r or settings.fc_symmetry + symmetrize_fc2 = settings.is_symmetrize_fc2 or settings.fc_symmetry else: # Rely on fc calculator the symmetrization of fc. symmetrize_fc2 = False symmetrize_fc3r = False @@ -77,46 +87,49 @@ def create_phono3py_force_constants(phono3py, ####### # fc3 # ####### - if (settings.is_joint_dos or - (settings.is_isotope and - not (settings.is_bterta or settings.is_lbte)) or - settings.read_gamma or - settings.read_pp or - (not settings.is_bterta and settings.write_phonon) or - settings.constant_averaged_pp_interaction is not None): # noqa E129 + if ( + settings.is_joint_dos + or (settings.is_isotope and not (settings.is_bterta or settings.is_lbte)) + or settings.read_gamma + or settings.read_pp + or (not settings.is_bterta and settings.write_phonon) + or settings.constant_averaged_pp_interaction is not None + ): # noqa E129 pass else: if settings.read_fc3: - _read_phono3py_fc3(phono3py, - symmetrize_fc3r, - input_filename, - log_level) + _read_phono3py_fc3(phono3py, symmetrize_fc3r, input_filename, log_level) else: # fc3 from FORCES_FC3 or ph3py_yaml - _create_phono3py_fc3(phono3py, - ph3py_yaml, - symmetrize_fc3r, - input_filename, - settings.is_compact_fc, - settings.cutoff_pair_distance, - settings.fc_calculator, - settings.fc_calculator_options, - log_level) + _create_phono3py_fc3( + phono3py, + ph3py_yaml, + symmetrize_fc3r, + input_filename, + settings.is_compact_fc, + settings.cutoff_pair_distance, + settings.fc_calculator, + settings.fc_calculator_options, + log_level, + ) if output_filename is None: - filename = 'fc3.hdf5' + filename = "fc3.hdf5" else: - filename = 'fc3.' + output_filename + '.hdf5' + filename = "fc3." + output_filename + ".hdf5" if log_level: - print("Writing fc3 to \"%s\"." % filename) - write_fc3_to_hdf5(phono3py.fc3, - filename=filename, - p2s_map=phono3py.primitive.p2s_map, - compression=settings.hdf5_compression) + print('Writing fc3 to "%s".' % filename) + write_fc3_to_hdf5( + phono3py.fc3, + filename=filename, + p2s_map=phono3py.primitive.p2s_map, + compression=settings.hdf5_compression, + ) cutoff_distance = settings.cutoff_fc3_distance if cutoff_distance is not None and cutoff_distance > 0: if log_level: - print("Cutting-off fc3 by zero (cut-off distance: %f)" % - cutoff_distance) + print( + "Cutting-off fc3 by zero (cut-off distance: %f)" % cutoff_distance + ) phono3py.cutoff_fc3_by_zero(cutoff_distance) if log_level: @@ -128,63 +141,65 @@ def create_phono3py_force_constants(phono3py, phonon_primitive = phono3py.phonon_primitive p2s_map = phonon_primitive.p2s_map if settings.read_fc2: - _read_phono3py_fc2(phono3py, - symmetrize_fc2, - input_filename, - log_level) + _read_phono3py_fc2(phono3py, symmetrize_fc2, input_filename, log_level) else: if phono3py.phonon_supercell_matrix is None: - if (settings.fc_calculator == 'alm' and phono3py.fc2 is not None): + if settings.fc_calculator == "alm" and phono3py.fc2 is not None: if log_level: - print("fc2 that was fit simultaneously with fc3 " - "by ALM is used.") + print("fc2 that was fit simultaneously with fc3 " "by ALM is used.") else: - _create_phono3py_fc2(phono3py, - ph3py_yaml, - symmetrize_fc2, - input_filename, - settings.is_compact_fc, - settings.fc_calculator, - settings.fc_calculator_options, - log_level) + _create_phono3py_fc2( + phono3py, + ph3py_yaml, + symmetrize_fc2, + input_filename, + settings.is_compact_fc, + settings.fc_calculator, + settings.fc_calculator_options, + log_level, + ) else: - _create_phono3py_phonon_fc2(phono3py, - ph3py_yaml, - symmetrize_fc2, - input_filename, - settings.is_compact_fc, - settings.fc_calculator, - settings.fc_calculator_options, - log_level) + _create_phono3py_phonon_fc2( + phono3py, + ph3py_yaml, + symmetrize_fc2, + input_filename, + settings.is_compact_fc, + settings.fc_calculator, + settings.fc_calculator_options, + log_level, + ) if output_filename is None: - filename = 'fc2.hdf5' + filename = "fc2.hdf5" else: - filename = 'fc2.' + output_filename + '.hdf5' + filename = "fc2." + output_filename + ".hdf5" if log_level: - print("Writing fc2 to \"%s\"." % filename) - write_fc2_to_hdf5(phono3py.fc2, - filename=filename, - p2s_map=p2s_map, - physical_unit='eV/angstrom^2', - compression=settings.hdf5_compression) + print('Writing fc2 to "%s".' % filename) + write_fc2_to_hdf5( + phono3py.fc2, + filename=filename, + p2s_map=p2s_map, + physical_unit="eV/angstrom^2", + compression=settings.hdf5_compression, + ) if log_level: - show_drift_force_constants(phono3py.fc2, - primitive=phonon_primitive, - name='fc2') + show_drift_force_constants(phono3py.fc2, primitive=phonon_primitive, name="fc2") -def parse_forces(phono3py, - ph3py_yaml=None, - cutoff_pair_distance=None, - force_filename="FORCES_FC3", - disp_filename=None, - fc_type=None, - log_level=0): +def parse_forces( + phono3py, + ph3py_yaml=None, + cutoff_pair_distance=None, + force_filename="FORCES_FC3", + disp_filename=None, + fc_type=None, + log_level=0, +): """Read displacements and forces.""" filename_read_from = None - if fc_type == 'phonon_fc2': + if fc_type == "phonon_fc2": natom = len(phono3py.phonon_supercell) else: natom = len(phono3py.supercell) @@ -197,12 +212,12 @@ def parse_forces(phono3py, # Try to read FORCES_FC* if type-2 and return dataset. # None is returned unless type-2. # can emit FileNotFoundError. - if (dataset is None or - dataset is not None and not forces_in_dataset(dataset)): # noqa E129 - _dataset = _get_type2_dataset(natom, - phono3py.calculator, - filename=force_filename, - log_level=log_level) + if ( + dataset is None or dataset is not None and not forces_in_dataset(dataset) + ): # noqa E129 + _dataset = _get_type2_dataset( + natom, phono3py.calculator, filename=force_filename, log_level=log_level + ) # Do not overwrite dataset when _dataset is None. if _dataset: filename_read_from = force_filename @@ -214,34 +229,38 @@ def parse_forces(phono3py, dataset = _read_disp_fc_yaml(disp_filename, fc_type) filename_read_from = disp_filename - if 'natom' in dataset and dataset['natom'] != natom: - msg = ("Number of atoms in supercell is not consistent with " - "\"%s\"." % filename_read_from) + if "natom" in dataset and dataset["natom"] != natom: + msg = ( + "Number of atoms in supercell is not consistent with " + '"%s".' % filename_read_from + ) raise RuntimeError(msg) if log_level and filename_read_from is not None: - print("Displacement dataset for %s was read from \"%s\"." - % (fc_type, filename_read_from)) + print( + 'Displacement dataset for %s was read from "%s".' + % (fc_type, filename_read_from) + ) if cutoff_pair_distance: - if ('cutoff_distance' not in dataset or - ('cutoff_distance' in dataset and - cutoff_pair_distance < dataset['cutoff_distance'])): - dataset['cutoff_distance'] = cutoff_pair_distance + if "cutoff_distance" not in dataset or ( + "cutoff_distance" in dataset + and cutoff_pair_distance < dataset["cutoff_distance"] + ): + dataset["cutoff_distance"] = cutoff_pair_distance if log_level: print("Cutoff-pair-distance: %f" % cutoff_pair_distance) # Type-1 FORCES_FC*. # dataset comes either from disp_fc*.yaml or phono3py*.yaml. if not forces_in_dataset(dataset): - if fc_type == 'phonon_fc2': + if fc_type == "phonon_fc2": parse_FORCES_FC2(dataset, filename=force_filename) else: parse_FORCES_FC3(dataset, filename=force_filename) if log_level: - print("Sets of supercell forces were read from \"%s\"." - % force_filename) + print('Sets of supercell forces were read from "%s".' % force_filename) sys.stdout.flush() _convert_unit_in_dataset(dataset, phono3py.calculator) @@ -251,13 +270,13 @@ def parse_forces(phono3py, def forces_in_dataset(dataset): """Return whether forces in dataset or not.""" - return ('forces' in dataset or - ('first_atoms' in dataset and - 'forces' in dataset['first_atoms'][0])) + return "forces" in dataset or ( + "first_atoms" in dataset and "forces" in dataset["first_atoms"][0] + ) def _read_disp_fc_yaml(disp_filename, fc_type): - if fc_type == 'phonon_fc2': + if fc_type == "phonon_fc2": dataset = parse_disp_fc2_yaml(filename=disp_filename) else: dataset = parse_disp_fc3_yaml(filename=disp_filename) @@ -265,23 +284,21 @@ def _read_disp_fc_yaml(disp_filename, fc_type): return dataset -def _read_phono3py_fc3(phono3py, - symmetrize_fc3r, - input_filename, - log_level): +def _read_phono3py_fc3(phono3py, symmetrize_fc3r, input_filename, log_level): if input_filename is None: - filename = 'fc3.hdf5' + filename = "fc3.hdf5" else: - filename = 'fc3.' + input_filename + '.hdf5' + filename = "fc3." + input_filename + ".hdf5" file_exists(filename, log_level) if log_level: - print("Reading fc3 from \"%s\"." % filename) + print('Reading fc3 from "%s".' % filename) p2s_map = phono3py.primitive.p2s_map try: fc3 = read_fc3_from_hdf5(filename=filename, p2s_map=p2s_map) except RuntimeError: import traceback + traceback.print_exc() if log_level: print_error() @@ -300,17 +317,14 @@ def _read_phono3py_fc3(phono3py, phono3py.fc3 = fc3 -def _read_phono3py_fc2(phono3py, - symmetrize_fc2, - input_filename, - log_level): +def _read_phono3py_fc2(phono3py, symmetrize_fc2, input_filename, log_level): if input_filename is None: - filename = 'fc2.hdf5' + filename = "fc2.hdf5" else: - filename = 'fc2.' + input_filename + '.hdf5' + filename = "fc2." + input_filename + ".hdf5" file_exists(filename, log_level) if log_level: - print("Reading fc2 from \"%s\"." % filename) + print('Reading fc2 from "%s".' % filename) num_atom = phono3py.phonon_supercell.get_number_of_atoms() p2s_map = phono3py.phonon_primitive.p2s_map @@ -318,6 +332,7 @@ def _read_phono3py_fc2(phono3py, phonon_fc2 = read_fc2_from_hdf5(filename=filename, p2s_map=p2s_map) except RuntimeError: import traceback + traceback.print_exc() if log_level: print_error() @@ -333,8 +348,7 @@ def _read_phono3py_fc2(phono3py, if phonon_fc2.shape[0] == phonon_fc2.shape[1]: symmetrize_force_constants(phonon_fc2) else: - symmetrize_compact_force_constants(phonon_fc2, - phono3py.phonon_primitive) + symmetrize_compact_force_constants(phonon_fc2, phono3py.phonon_primitive) phono3py.fc2 = phonon_fc2 @@ -343,27 +357,31 @@ def _get_type2_dataset(natom, calculator, filename="FORCES_FC3", log_level=0): if not os.path.isfile(filename): return None - with open(filename, 'r') as f: + with open(filename, "r") as f: len_first_line = get_length_of_first_line(f) if len_first_line == 6: dataset = get_dataset_type2(f, natom) if log_level: - print("%d snapshots were found in %s." - % (len(dataset['displacements']), "FORCES_FC3")) + print( + "%d snapshots were found in %s." + % (len(dataset["displacements"]), "FORCES_FC3") + ) else: dataset = None return dataset -def _create_phono3py_fc3(phono3py, - ph3py_yaml, - symmetrize_fc3r, - input_filename, - is_compact_fc, - cutoff_pair_distance, - fc_calculator, - fc_calculator_options, - log_level): +def _create_phono3py_fc3( + phono3py, + ph3py_yaml, + symmetrize_fc3r, + input_filename, + is_compact_fc, + cutoff_pair_distance, + fc_calculator, + fc_calculator_options, + log_level, +): """Read or calculate fc3. Note @@ -379,20 +397,22 @@ def _create_phono3py_fc3(phono3py, """ if input_filename is None: - disp_filename = 'disp_fc3.yaml' + disp_filename = "disp_fc3.yaml" else: - disp_filename = 'disp_fc3.' + input_filename + '.yaml' + disp_filename = "disp_fc3." + input_filename + ".yaml" _ph3py_yaml = _get_ph3py_yaml(disp_filename, ph3py_yaml) try: - dataset = parse_forces(phono3py, - ph3py_yaml=_ph3py_yaml, - cutoff_pair_distance=cutoff_pair_distance, - force_filename="FORCES_FC3", - disp_filename=disp_filename, - fc_type='fc3', - log_level=log_level) + dataset = parse_forces( + phono3py, + ph3py_yaml=_ph3py_yaml, + cutoff_pair_distance=cutoff_pair_distance, + force_filename="FORCES_FC3", + disp_filename=disp_filename, + fc_type="fc3", + log_level=log_level, + ) except RuntimeError as e: # from _parse_forces_type1 if log_level: @@ -404,34 +424,40 @@ def _create_phono3py_fc3(phono3py, file_exists(e.filename, log_level) phono3py.dataset = dataset - phono3py.produce_fc3(symmetrize_fc3r=symmetrize_fc3r, - is_compact_fc=is_compact_fc, - fc_calculator=fc_calculator, - fc_calculator_options=fc_calculator_options) + phono3py.produce_fc3( + symmetrize_fc3r=symmetrize_fc3r, + is_compact_fc=is_compact_fc, + fc_calculator=fc_calculator, + fc_calculator_options=fc_calculator_options, + ) -def _create_phono3py_fc2(phono3py, - ph3py_yaml, - symmetrize_fc2, - input_filename, - is_compact_fc, - fc_calculator, - fc_calculator_options, - log_level): +def _create_phono3py_fc2( + phono3py, + ph3py_yaml, + symmetrize_fc2, + input_filename, + is_compact_fc, + fc_calculator, + fc_calculator_options, + log_level, +): if input_filename is None: - disp_filename = 'disp_fc3.yaml' + disp_filename = "disp_fc3.yaml" else: - disp_filename = 'disp_fc3.' + input_filename + '.yaml' + disp_filename = "disp_fc3." + input_filename + ".yaml" _ph3py_yaml = _get_ph3py_yaml(disp_filename, ph3py_yaml) try: - dataset = parse_forces(phono3py, - ph3py_yaml=_ph3py_yaml, - force_filename="FORCES_FC3", - disp_filename=disp_filename, - fc_type='fc2', - log_level=log_level) + dataset = parse_forces( + phono3py, + ph3py_yaml=_ph3py_yaml, + force_filename="FORCES_FC3", + disp_filename=disp_filename, + fc_type="fc2", + log_level=log_level, + ) except RuntimeError as e: if log_level: print(str(e)) @@ -445,7 +471,8 @@ def _create_phono3py_fc2(phono3py, symmetrize_fc2=symmetrize_fc2, is_compact_fc=is_compact_fc, fc_calculator=fc_calculator, - fc_calculator_options=fc_calculator_options) + fc_calculator_options=fc_calculator_options, + ) def _get_ph3py_yaml(disp_filename, ph3py_yaml): @@ -453,34 +480,38 @@ def _get_ph3py_yaml(disp_filename, ph3py_yaml): # Try to use phono3py.phonon_dataset when the disp file not found if not os.path.isfile(disp_filename): disp_filename = None - if _ph3py_yaml is None and os.path.isfile('phono3py_disp.yaml'): + if _ph3py_yaml is None and os.path.isfile("phono3py_disp.yaml"): _ph3py_yaml = Phono3pyYaml() - _ph3py_yaml.read('phono3py_disp.yaml') + _ph3py_yaml.read("phono3py_disp.yaml") return _ph3py_yaml -def _create_phono3py_phonon_fc2(phono3py, - ph3py_yaml, - symmetrize_fc2, - input_filename, - is_compact_fc, - fc_calculator, - fc_calculator_options, - log_level): +def _create_phono3py_phonon_fc2( + phono3py, + ph3py_yaml, + symmetrize_fc2, + input_filename, + is_compact_fc, + fc_calculator, + fc_calculator_options, + log_level, +): if input_filename is None: - disp_filename = 'disp_fc2.yaml' + disp_filename = "disp_fc2.yaml" else: - disp_filename = 'disp_fc2.' + input_filename + '.yaml' + disp_filename = "disp_fc2." + input_filename + ".yaml" _ph3py_yaml = _get_ph3py_yaml(disp_filename, ph3py_yaml) try: - dataset = parse_forces(phono3py, - ph3py_yaml=_ph3py_yaml, - force_filename="FORCES_FC2", - disp_filename=disp_filename, - fc_type='phonon_fc2', - log_level=log_level) + dataset = parse_forces( + phono3py, + ph3py_yaml=_ph3py_yaml, + force_filename="FORCES_FC2", + disp_filename=disp_filename, + fc_type="phonon_fc2", + log_level=log_level, + ) except RuntimeError as e: if log_level: print(str(e)) @@ -494,49 +525,50 @@ def _create_phono3py_phonon_fc2(phono3py, symmetrize_fc2=symmetrize_fc2, is_compact_fc=is_compact_fc, fc_calculator=fc_calculator, - fc_calculator_options=fc_calculator_options) + fc_calculator_options=fc_calculator_options, + ) def _convert_unit_in_dataset(dataset, calculator): physical_units = get_default_physical_units(calculator) - force_to_eVperA = physical_units['force_to_eVperA'] - distance_to_A = physical_units['distance_to_A'] + force_to_eVperA = physical_units["force_to_eVperA"] + distance_to_A = physical_units["distance_to_A"] - if 'first_atoms' in dataset: - for d1 in dataset['first_atoms']: + if "first_atoms" in dataset: + for d1 in dataset["first_atoms"]: if distance_to_A is not None: - disp = _to_ndarray(d1['displacement']) - d1['displacement'] = disp * distance_to_A - if force_to_eVperA is not None and 'forces' in d1: - forces = _to_ndarray(d1['forces']) - d1['forces'] = forces * force_to_eVperA - if 'second_atoms' in d1: - for d2 in d1['second_atoms']: + disp = _to_ndarray(d1["displacement"]) + d1["displacement"] = disp * distance_to_A + if force_to_eVperA is not None and "forces" in d1: + forces = _to_ndarray(d1["forces"]) + d1["forces"] = forces * force_to_eVperA + if "second_atoms" in d1: + for d2 in d1["second_atoms"]: if distance_to_A is not None: - disp = _to_ndarray(d2['displacement']) - d2['displacement'] = disp * distance_to_A - if force_to_eVperA is not None and 'forces' in d2: - forces = _to_ndarray(d2['forces']) - d2['forces'] = forces * force_to_eVperA + disp = _to_ndarray(d2["displacement"]) + d2["displacement"] = disp * distance_to_A + if force_to_eVperA is not None and "forces" in d2: + forces = _to_ndarray(d2["forces"]) + d2["forces"] = forces * force_to_eVperA else: - if distance_to_A is not None and 'displacements' in dataset: - disp = _to_ndarray(dataset['displacements']) - dataset['displacements'] = disp * distance_to_A - if force_to_eVperA is not None and 'forces' in dataset: - forces = _to_ndarray(dataset['forces']) - dataset['forces'] = forces * force_to_eVperA + if distance_to_A is not None and "displacements" in dataset: + disp = _to_ndarray(dataset["displacements"]) + dataset["displacements"] = disp * distance_to_A + if force_to_eVperA is not None and "forces" in dataset: + forces = _to_ndarray(dataset["forces"]) + dataset["forces"] = forces * force_to_eVperA -def _to_ndarray(array, dtype='double'): +def _to_ndarray(array, dtype="double"): if type(array) is not np.ndarray: - return np.array(array, dtype=dtype, order='C') + return np.array(array, dtype=dtype, order="C") else: return array def _extract_datast_from_ph3py_yaml(ph3py_yaml, fc_type): dataset = None - if fc_type == 'phonon_fc2': + if fc_type == "phonon_fc2": if ph3py_yaml and ph3py_yaml.phonon_dataset is not None: # copy dataset # otherwise unit conversion can be applied multiple times. diff --git a/phono3py/cui/create_supercells.py b/phono3py/cui/create_supercells.py index d3bb42a4..f37c4bd2 100644 --- a/phono3py/cui/create_supercells.py +++ b/phono3py/cui/create_supercells.py @@ -1,3 +1,4 @@ +"""Utilities of main CUI script.""" # Copyright (C) 2015 Atsushi Togo # All rights reserved. # @@ -37,56 +38,59 @@ from phono3py.file_IO import write_disp_fc3_yaml, write_disp_fc2_yaml from phono3py.interface.calculator import ( get_additional_info_to_write_fc2_supercells, get_additional_info_to_write_supercells, - get_default_displacement_distance) + get_default_displacement_distance, +) from phonopy.interface.calculator import write_supercells_with_displacements -def create_phono3py_supercells(cell_info, - settings, - symprec, - output_filename=None, - interface_mode='vasp', - log_level=1): - """create displacements and supercells +def create_phono3py_supercells( + cell_info, + settings, + symprec, + output_filename=None, + interface_mode="vasp", + log_level=1, +): + """Create displacements and supercells. Distance unit used is that for the calculator interface. The default unit is Angstron. """ - - optional_structure_info = cell_info['optional_structure_info'] + optional_structure_info = cell_info["optional_structure_info"] if settings.displacement_distance is None: distance = get_default_displacement_distance(interface_mode) else: distance = settings.displacement_distance phono3py = Phono3py( - cell_info['unitcell'], - cell_info['supercell_matrix'], - primitive_matrix=cell_info['primitive_matrix'], - phonon_supercell_matrix=cell_info['phonon_supercell_matrix'], + cell_info["unitcell"], + cell_info["supercell_matrix"], + primitive_matrix=cell_info["primitive_matrix"], + phonon_supercell_matrix=cell_info["phonon_supercell_matrix"], is_symmetry=settings.is_symmetry, symprec=symprec, - calculator=interface_mode) + calculator=interface_mode, + ) phono3py.generate_displacements( distance=distance, cutoff_pair_distance=settings.cutoff_pair_distance, is_plusminus=settings.is_plusminus_displacement, - is_diagonal=settings.is_diagonal_displacement) + is_diagonal=settings.is_diagonal_displacement, + ) if log_level: - print('') - print("Unit cell was read from \"%s\"." % - optional_structure_info[0]) + print("") + print('Unit cell was read from "%s".' % optional_structure_info[0]) print("Displacement distance: %s" % distance) if output_filename is None: - filename = 'disp_fc3.yaml' + filename = "disp_fc3.yaml" else: - filename = 'disp_fc3.' + output_filename + '.yaml' - num_disps, num_disp_files = write_disp_fc3_yaml(phono3py.dataset, - phono3py.supercell, - filename=filename) + filename = "disp_fc3." + output_filename + ".yaml" + num_disps, num_disp_files = write_disp_fc3_yaml( + phono3py.dataset, phono3py.supercell, filename=filename + ) ids = [] disp_cells = [] for i, cell in enumerate(phono3py.supercells_with_displacements): @@ -95,41 +99,46 @@ def create_phono3py_supercells(cell_info, disp_cells.append(cell) additional_info = get_additional_info_to_write_supercells( - interface_mode, phono3py.supercell_matrix) - write_supercells_with_displacements(interface_mode, - phono3py.supercell, - disp_cells, - optional_structure_info, - displacement_ids=ids, - zfill_width=5, - additional_info=additional_info) + interface_mode, phono3py.supercell_matrix + ) + write_supercells_with_displacements( + interface_mode, + phono3py.supercell, + disp_cells, + optional_structure_info, + displacement_ids=ids, + zfill_width=5, + additional_info=additional_info, + ) if log_level: print("Number of displacements: %d" % num_disps) if settings.cutoff_pair_distance is not None: - print("Cutoff distance for displacements: %s" % - settings.cutoff_pair_distance) - print("Number of displacement supercell files created: %d" % - num_disp_files) + print( + "Cutoff distance for displacements: %s" % settings.cutoff_pair_distance + ) + print("Number of displacement supercell files created: %d" % num_disp_files) if phono3py.phonon_supercell_matrix is not None: if output_filename is None: - filename = 'disp_fc2.yaml' + filename = "disp_fc2.yaml" else: - filename = 'disp_fc2.' + output_filename + '.yaml' + filename = "disp_fc2." + output_filename + ".yaml" - num_disps = write_disp_fc2_yaml(phono3py.phonon_dataset, - phono3py.phonon_supercell, - filename=filename) + num_disps = write_disp_fc2_yaml( + phono3py.phonon_dataset, phono3py.phonon_supercell, filename=filename + ) additional_info = get_additional_info_to_write_fc2_supercells( - interface_mode, phono3py.phonon_supercell_matrix) + interface_mode, phono3py.phonon_supercell_matrix + ) write_supercells_with_displacements( interface_mode, phono3py.supercell, phono3py.phonon_supercells_with_displacements, optional_structure_info, zfill_width=5, - additional_info=additional_info) + additional_info=additional_info, + ) if log_level: print("Number of displacements for special fc2: %d" % num_disps) diff --git a/phono3py/cui/kaccum.py b/phono3py/cui/kaccum.py index fa8b239b..e830921d 100644 --- a/phono3py/cui/kaccum.py +++ b/phono3py/cui/kaccum.py @@ -8,8 +8,7 @@ from phonopy.structure.cells import get_primitive from phonopy.structure.symmetry import Symmetry from phonopy.interface.calculator import read_crystal_structure from phonopy.phonon.dos import NormalDistribution -from phonopy.structure.cells import ( - get_primitive_matrix, guess_primitive_matrix) +from phonopy.structure.cells import get_primitive_matrix, guess_primitive_matrix from phono3py.phonon.grid import BZGrid, get_ir_grid_points from phono3py.other.tetrahedron_method import get_integration_weights @@ -19,14 +18,16 @@ epsilon = 1.0e-8 class KappaDOS(object): """Class to calculate thermal conductivity spectram.""" - def __init__(self, - mode_kappa, - frequencies, - bz_grid, - ir_grid_points, - ir_grid_map=None, - frequency_points=None, - num_sampling_points=100): + def __init__( + self, + mode_kappa, + frequencies, + bz_grid, + ir_grid_points, + ir_grid_map=None, + frequency_points=None, + num_sampling_points=100, + ): """Init method. mode_kappa : ndarray @@ -53,29 +54,33 @@ class KappaDOS(object): max_freq = max(frequencies.ravel()) + epsilon if frequency_points is None: self._frequency_points = np.linspace( - min_freq, max_freq, num_sampling_points, dtype='double') + min_freq, max_freq, num_sampling_points, dtype="double" + ) else: - self._frequency_points = np.array( - frequency_points, dtype='double') + self._frequency_points = np.array(frequency_points, dtype="double") n_temp, _, _, n_elem = mode_kappa.shape self._kdos = np.zeros( - (n_temp, len(self._frequency_points), 2, n_elem), dtype='double') + (n_temp, len(self._frequency_points), 2, n_elem), dtype="double" + ) if ir_grid_map is None: bzgp2irgp_map = None else: bzgp2irgp_map = self._get_bzgp2irgp_map(bz_grid, ir_grid_map) - for j, function in enumerate(('J', 'I')): - iweights = get_integration_weights(self._frequency_points, - frequencies, - bz_grid, - grid_points=ir_grid_points, - bzgp2irgp_map=bzgp2irgp_map, - function=function) + for j, function in enumerate(("J", "I")): + iweights = get_integration_weights( + self._frequency_points, + frequencies, + bz_grid, + grid_points=ir_grid_points, + bzgp2irgp_map=bzgp2irgp_map, + function=function, + ) for i, iw in enumerate(iweights): self._kdos[:, :, j] += np.transpose( - np.dot(iw, mode_kappa[:, i]), axes=(1, 0, 2)) + np.dot(iw, mode_kappa[:, i]), axes=(1, 0, 2) + ) self._kdos /= np.prod(bz_grid.D_diag) def get_kdos(self): @@ -97,20 +102,17 @@ class KappaDOS(object): unique_gps = np.unique(ir_grid_map) gp_map = {j: i for i, j in enumerate(unique_gps)} bzgp2irgp_map = np.array( - [gp_map[ir_grid_map[grgp]] for grgp in bz_grid.bzg2grg], - dtype='int_') + [gp_map[ir_grid_map[grgp]] for grgp in bz_grid.bzg2grg], dtype="int_" + ) return bzgp2irgp_map class GammaDOSsmearing(object): """Class to calculate Gamma spectram by smearing method.""" - def __init__(self, - gamma, - frequencies, - ir_grid_weights, - sigma=None, - num_fpoints=200): + def __init__( + self, gamma, frequencies, ir_grid_weights, sigma=None, num_fpoints=200 + ): """Init method.""" self._gamma = gamma self._frequencies = frequencies @@ -118,10 +120,12 @@ class GammaDOSsmearing(object): self._num_fpoints = num_fpoints self._set_frequency_points() self._gdos = np.zeros( - (len(gamma), len(self._frequency_points), 2), dtype='double') + (len(gamma), len(self._frequency_points), 2), dtype="double" + ) if sigma is None: - self._sigma = (max(self._frequency_points) - - min(self._frequency_points)) / 100 + self._sigma = ( + max(self._frequency_points) - min(self._frequency_points) + ) / 100 else: self._sigma = 0.1 self._smearing_function = NormalDistribution(self._sigma) @@ -134,9 +138,7 @@ class GammaDOSsmearing(object): def _set_frequency_points(self): min_freq = np.min(self._frequencies) max_freq = np.max(self._frequencies) + epsilon - self._frequency_points = np.linspace(min_freq, - max_freq, - self._num_fpoints) + self._frequency_points = np.linspace(min_freq, max_freq, self._num_fpoints) def _run_smearing_method(self): self._dos = [] @@ -144,8 +146,9 @@ class GammaDOSsmearing(object): for i, f in enumerate(self._frequency_points): dos = self._smearing_function.calc(self._frequencies - f) for j, g_t in enumerate(self._gamma): - self._gdos[j, i, 1] = np.sum(np.dot(self._ir_grid_weights, - dos * g_t)) / num_gp + self._gdos[j, i, 1] = ( + np.sum(np.dot(self._ir_grid_weights, dos * g_t)) / num_gp + ) def _show_tensor(kdos, temperatures, sampling_points, args): @@ -156,15 +159,14 @@ def _show_tensor(kdos, temperatures, sampling_points, args): for f, k in zip(sampling_points[i], kdos_t): # show kappa_xx if args.average: - print(("%13.5f " * 3) % - (f, k[0][:3].sum() / 3, k[1][:3].sum() / 3)) + print(("%13.5f " * 3) % (f, k[0][:3].sum() / 3, k[1][:3].sum() / 3)) elif args.trace: print(("%13.5f " * 3) % (f, k[0][:3].sum(), k[1][:3].sum())) else: print(("%f " * 13) % ((f,) + tuple(k[0]) + tuple(k[1]))) - print('') - print('') + print("") + print("") def _show_scalar(gdos, temperatures, sampling_points, args): @@ -177,39 +179,35 @@ def _show_scalar(gdos, temperatures, sampling_points, args): print("# %d K" % temperatures[i]) for f, g in zip(sampling_points[i], gdos_t): print("%f %f %f" % (f, g[0], g[1])) - print('') - print('') + print("") + print("") -def _set_T_target(temperatures, - mode_prop, - T_target, - mean_freepath=None): +def _set_T_target(temperatures, mode_prop, T_target, mean_freepath=None): """Extract property at specified temperature.""" for i, t in enumerate(temperatures): if np.abs(t - T_target) < epsilon: - temperatures = temperatures[i:i+1] - mode_prop = mode_prop[i:i+1, :, :] + temperatures = temperatures[i : i + 1] + mode_prop = mode_prop[i : i + 1, :, :] if mean_freepath is not None: - mean_freepath = mean_freepath[i:i+1] + mean_freepath = mean_freepath[i : i + 1] return temperatures, mode_prop, mean_freepath else: return temperatures, mode_prop -def _run_prop_dos(frequencies, - mode_prop, - ir_grid_map, - ir_grid_points, - num_sampling_points, - bz_grid): +def _run_prop_dos( + frequencies, mode_prop, ir_grid_map, ir_grid_points, num_sampling_points, bz_grid +): """Run DOS-like calculation.""" - kappa_dos = KappaDOS(mode_prop, - frequencies, - bz_grid, - ir_grid_points, - ir_grid_map=ir_grid_map, - num_sampling_points=num_sampling_points) + kappa_dos = KappaDOS( + mode_prop, + frequencies, + bz_grid, + ir_grid_points, + ir_grid_map=ir_grid_map, + num_sampling_points=num_sampling_points, + ) freq_points, kdos = kappa_dos.get_kdos() sampling_points = np.tile(freq_points, (len(kdos), 1)) return kdos, sampling_points @@ -223,12 +221,9 @@ def _get_mfp(g, gv): return mean_freepath -def _run_mfp_dos(mean_freepath, - mode_prop, - ir_grid_map, - ir_grid_points, - num_sampling_points, - bz_grid): +def _run_mfp_dos( + mean_freepath, mode_prop, ir_grid_map, ir_grid_points, num_sampling_points, bz_grid +): """Run DOS-like calculation for mean free path. mean_freepath : shape=(temperatures, ir_grid_points, 6) @@ -238,12 +233,14 @@ def _run_mfp_dos(mean_freepath, kdos = [] sampling_points = [] for i, _ in enumerate(mean_freepath): - kappa_dos = KappaDOS(mode_prop[i:i+1, :, :], - mean_freepath[i], - bz_grid, - ir_grid_points, - ir_grid_map=ir_grid_map, - num_sampling_points=num_sampling_points) + kappa_dos = KappaDOS( + mode_prop[i : i + 1, :, :], + mean_freepath[i], + bz_grid, + ir_grid_points, + ir_grid_map=ir_grid_map, + num_sampling_points=num_sampling_points, + ) sampling_points_at_T, kdos_at_T = kappa_dos.get_kdos() kdos.append(kdos_at_T[0]) sampling_points.append(sampling_points_at_T) @@ -254,9 +251,7 @@ def _run_mfp_dos(mean_freepath, def _get_grid_symmetry(bz_grid, weights, qpoints): - (ir_grid_points, - weights_for_check, - ir_grid_map) = get_ir_grid_points(bz_grid) + (ir_grid_points, weights_for_check, ir_grid_map) = get_ir_grid_points(bz_grid) try: np.testing.assert_array_equal(weights, weights_for_check) @@ -267,7 +262,7 @@ def _get_grid_symmetry(bz_grid, weights, qpoints): raise addresses = bz_grid.addresses[ir_grid_points] - D_diag = bz_grid.D_diag.astype('double') + D_diag = bz_grid.D_diag.astype("double") qpoints_for_check = np.dot(addresses / D_diag, bz_grid.Q.T) diff_q = qpoints - qpoints_for_check np.testing.assert_almost_equal(diff_q, np.rint(diff_q)) @@ -279,13 +274,13 @@ def _get_calculator(args): """Return calculator name.""" interface_mode = None if args.qe_mode: - interface_mode = 'qe' + interface_mode = "qe" elif args.crystal_mode: - interface_mode = 'crystal' + interface_mode = "crystal" elif args.abinit_mode: - interface_mode = 'abinit' + interface_mode = "abinit" elif args.turbomole_mode: - interface_mode = 'turbomole' + interface_mode = "turbomole" return interface_mode @@ -293,13 +288,15 @@ def _read_files(args): """Read crystal structure and kappa.hdf5 files.""" interface_mode = _get_calculator(args) if len(args.filenames) > 1: - cell, _ = read_crystal_structure(args.filenames[0], - interface_mode=interface_mode) - f = h5py.File(args.filenames[1], 'r') + cell, _ = read_crystal_structure( + args.filenames[0], interface_mode=interface_mode + ) + f = h5py.File(args.filenames[1], "r") else: - cell, _ = read_crystal_structure(args.cell_filename, - interface_mode=interface_mode) - f = h5py.File(args.filenames[0], 'r') + cell, _ = read_crystal_structure( + args.cell_filename, interface_mode=interface_mode + ) + f = h5py.File(args.filenames[0], "r") return cell, f @@ -307,27 +304,25 @@ def _read_files(args): def _get_mode_property(args, f_kappa): """Read property data from hdf5 file object.""" if args.pqj: - mode_prop = f_kappa['ave_pp'][:].reshape( - (1,) + f_kappa['ave_pp'].shape) + mode_prop = f_kappa["ave_pp"][:].reshape((1,) + f_kappa["ave_pp"].shape) elif args.cv: - mode_prop = f_kappa['heat_capacity'][:] + mode_prop = f_kappa["heat_capacity"][:] elif args.tau: - g = f_kappa['gamma'][:] + g = f_kappa["gamma"][:] g = np.where(g > 0, g, -1) mode_prop = np.where(g > 0, 1.0 / (2 * 2 * np.pi * g), 0) elif args.gv_norm: - mode_prop = np.sqrt( - (f_kappa['group_velocity'][:, :, :] ** 2).sum(axis=2)) + mode_prop = np.sqrt((f_kappa["group_velocity"][:, :, :] ** 2).sum(axis=2)) mode_prop = mode_prop.reshape((1,) + mode_prop.shape) elif args.gamma: - mode_prop = f_kappa['gamma'][:] + mode_prop = f_kappa["gamma"][:] elif args.gruneisen: - mode_prop = f_kappa['gruneisen'][:].reshape( - (1,) + f_kappa['gruneisen'].shape) + mode_prop = f_kappa["gruneisen"][:].reshape((1,) + f_kappa["gruneisen"].shape) mode_prop **= 2 elif args.dos: - mode_prop = np.ones((1, ) + f_kappa['frequency'].shape, - dtype='double', order='C') + mode_prop = np.ones( + (1,) + f_kappa["frequency"].shape, dtype="double", order="C" + ) else: raise RuntimeError("No property target is specified.") return mode_prop @@ -337,74 +332,105 @@ def _get_parser(): """Return args of ArgumentParser.""" parser = argparse.ArgumentParser(description="Show unit cell volume") parser.add_argument( - "--pa", "--primitive-axis", "--primitive-axes", nargs='+', - dest="primitive_matrix", default=None, - help="Same as PRIMITIVE_AXES tags") + "--pa", + "--primitive-axis", + "--primitive-axes", + nargs="+", + dest="primitive_matrix", + default=None, + help="Same as PRIMITIVE_AXES tags", + ) parser.add_argument( - "-c", "--cell", dest="cell_filename", metavar="FILE", default=None, - help="Read unit cell") + "-c", + "--cell", + dest="cell_filename", + metavar="FILE", + default=None, + help="Read unit cell", + ) parser.add_argument( - '--gv', action='store_true', - help='Calculate for gv_x_gv (tensor)') + "--gv", action="store_true", help="Calculate for gv_x_gv (tensor)" + ) + parser.add_argument("--pqj", action="store_true", help="Calculate for Pqj (scalar)") + parser.add_argument("--cv", action="store_true", help="Calculate for Cv (scalar)") parser.add_argument( - '--pqj', action='store_true', - help='Calculate for Pqj (scalar)') + "--tau", action="store_true", help="Calculate for lifetimes (scalar)" + ) parser.add_argument( - '--cv', action='store_true', - help='Calculate for Cv (scalar)') + "--dos", action="store_true", help="Calculate for phonon DOS (scalar)" + ) parser.add_argument( - '--tau', action='store_true', - help='Calculate for lifetimes (scalar)') + "--gamma", action="store_true", help="Calculate for Gamma (scalar)" + ) parser.add_argument( - '--dos', action='store_true', - help='Calculate for phonon DOS (scalar)') + "--gruneisen", + action="store_true", + help="Calculate for mode-Gruneisen parameters squared (scalar)", + ) parser.add_argument( - '--gamma', action='store_true', - help='Calculate for Gamma (scalar)') + "--gv-norm", action="store_true", help="Calculate for |g_v| (scalar)" + ) parser.add_argument( - '--gruneisen', action='store_true', - help='Calculate for mode-Gruneisen parameters squared (scalar)') + "--mfp", action="store_true", help="Mean free path is used instead of frequency" + ) parser.add_argument( - '--gv-norm', action='store_true', - help='Calculate for |g_v| (scalar)') + "--temperature", + type=float, + dest="temperature", + help="Temperature to output data at", + ) parser.add_argument( - '--mfp', action='store_true', - help='Mean free path is used instead of frequency') - parser.add_argument( - '--temperature', type=float, dest='temperature', - help='Temperature to output data at') - parser.add_argument( - '--nsp', '--num-sampling-points', type=int, dest='num_sampling_points', + "--nsp", + "--num-sampling-points", + type=int, + dest="num_sampling_points", default=100, - help="Number of sampling points in frequency or MFP axis") + help="Number of sampling points in frequency or MFP axis", + ) parser.add_argument( - '--average', action='store_true', - help=("Output the traces of the tensors divided by 3 " - "rather than the unique elements")) + "--average", + action="store_true", + help=( + "Output the traces of the tensors divided by 3 " + "rather than the unique elements" + ), + ) parser.add_argument( - '--trace', action='store_true', - help=("Output the traces of the tensors " - "rather than the unique elements")) + "--trace", + action="store_true", + help=("Output the traces of the tensors " "rather than the unique elements"), + ) parser.add_argument( - '--smearing', action='store_true', - help='Use smearing method (only for scalar density)') + "--smearing", + action="store_true", + help="Use smearing method (only for scalar density)", + ) parser.add_argument( - '--qe', '--pwscf', dest="qe_mode", - action="store_true", help="Invoke Pwscf mode") + "--qe", "--pwscf", dest="qe_mode", action="store_true", help="Invoke Pwscf mode" + ) parser.add_argument( - '--crystal', dest="crystal_mode", - action="store_true", help="Invoke CRYSTAL mode") + "--crystal", + dest="crystal_mode", + action="store_true", + help="Invoke CRYSTAL mode", + ) parser.add_argument( - '--abinit', dest="abinit_mode", - action="store_true", help="Invoke Abinit mode") + "--abinit", dest="abinit_mode", action="store_true", help="Invoke Abinit mode" + ) parser.add_argument( - '--turbomole', dest="turbomole_mode", - action="store_true", help="Invoke TURBOMOLE mode") + "--turbomole", + dest="turbomole_mode", + action="store_true", + help="Invoke TURBOMOLE mode", + ) parser.add_argument( - "--noks", "--no-kappa-stars", - dest="no_kappa_stars", action="store_true", - help="Deactivate summation of partial kappa at q-stars") - parser.add_argument('filenames', nargs='*') + "--noks", + "--no-kappa-stars", + dest="no_kappa_stars", + action="store_true", + help="Deactivate summation of partial kappa at q-stars", + ) + parser.add_argument("filenames", nargs="*") args = parser.parse_args() return args @@ -417,22 +443,21 @@ def _analyze_primitive_matrix_option(args, unitcell=None): else: _primitive_matrix = args.primitive_matrix.strip() - if _primitive_matrix.lower() == 'auto': - primitive_matrix = 'auto' - elif _primitive_matrix.upper() in ('P', 'F', 'I', 'A', 'C', 'R'): + if _primitive_matrix.lower() == "auto": + primitive_matrix = "auto" + elif _primitive_matrix.upper() in ("P", "F", "I", "A", "C", "R"): primitive_matrix = _primitive_matrix.upper() elif len(_primitive_matrix.split()) != 9: - raise SyntaxError( - "Number of elements in --pa option argument has to be 9.") + raise SyntaxError("Number of elements in --pa option argument has to be 9.") else: primitive_matrix = np.reshape( - [fracval(x) for x in _primitive_matrix.split()], (3, 3)) + [fracval(x) for x in _primitive_matrix.split()], (3, 3) + ) if np.linalg.det(primitive_matrix) < 1e-8: - raise SyntaxError( - "Primitive matrix has to have positive determinant.") + raise SyntaxError("Primitive matrix has to have positive determinant.") pmat = get_primitive_matrix(primitive_matrix) - if unitcell is not None and isinstance(pmat, str) and pmat == 'auto': + if unitcell is not None and isinstance(pmat, str) and pmat == "auto": return guess_primitive_matrix(unitcell) else: return pmat @@ -442,100 +467,117 @@ def main(): """Calculate kappa spectrum.""" args = _get_parser() cell, f_kappa = _read_files(args) - mesh = np.array(f_kappa['mesh'][:], dtype='int_') - temperatures = f_kappa['temperature'][:] - ir_weights = f_kappa['weight'][:] + mesh = np.array(f_kappa["mesh"][:], dtype="int_") + temperatures = f_kappa["temperature"][:] + ir_weights = f_kappa["weight"][:] primitive_matrix = _analyze_primitive_matrix_option(args, unitcell=cell) primitive = get_primitive(cell, primitive_matrix) primitive_symmetry = Symmetry(primitive) - bz_grid = BZGrid(mesh, - lattice=primitive.cell, - symmetry_dataset=primitive_symmetry.dataset, - store_dense_gp_map=False) + bz_grid = BZGrid( + mesh, + lattice=primitive.cell, + symmetry_dataset=primitive_symmetry.dataset, + store_dense_gp_map=False, + ) if args.no_kappa_stars or (ir_weights == 1).all(): - ir_grid_points = np.arange(np.prod(mesh), dtype='int_') - ir_grid_map = np.arange(np.prod(mesh), dtype='int_') + ir_grid_points = np.arange(np.prod(mesh), dtype="int_") + ir_grid_map = np.arange(np.prod(mesh), dtype="int_") else: ir_grid_points, ir_grid_map = _get_grid_symmetry( - bz_grid, ir_weights, f_kappa['qpoint'][:]) - frequencies = f_kappa['frequency'][:] + bz_grid, ir_weights, f_kappa["qpoint"][:] + ) + frequencies = f_kappa["frequency"][:] conditions = frequencies > 0 if np.logical_not(conditions).sum() > 3: - sys.stderr.write("# Imaginary frequencies are found. " - "They are set to be zero.\n") + sys.stderr.write( + "# Imaginary frequencies are found. " "They are set to be zero.\n" + ) frequencies = np.where(conditions, frequencies, 0) # Run for scaler - if (args.gamma or args.gruneisen or args.pqj or - args.cv or args.tau or args.gv_norm or args.dos): # noqa E129 + if ( + args.gamma + or args.gruneisen + or args.pqj + or args.cv + or args.tau + or args.gv_norm + or args.dos + ): # noqa E129 mode_prop = _get_mode_property(args, f_kappa) - if (args.temperature is not None and - not (args.gv_norm or args.pqj or args.gruneisen or args.dos)): # noqa E129 - temperatures, mode_prop = _set_T_target(temperatures, - mode_prop, - args.temperature) + if args.temperature is not None and not ( + args.gv_norm or args.pqj or args.gruneisen or args.dos + ): # noqa E129 + temperatures, mode_prop = _set_T_target( + temperatures, mode_prop, args.temperature + ) if args.smearing: mode_prop_dos = GammaDOSsmearing( - mode_prop, - frequencies, - ir_weights, - num_fpoints=args.num_sampling_points) + mode_prop, frequencies, ir_weights, num_fpoints=args.num_sampling_points + ) sampling_points, gdos = mode_prop_dos.get_gdos() sampling_points = np.tile(sampling_points, (len(gdos), 1)) _show_scalar(gdos[:, :, :], temperatures, sampling_points, args) else: for i, w in enumerate(ir_weights): mode_prop[:, i, :] *= w - kdos, sampling_points = _run_prop_dos(frequencies, - mode_prop[:, :, :, None], - ir_grid_map, - ir_grid_points, - args.num_sampling_points, - bz_grid) + kdos, sampling_points = _run_prop_dos( + frequencies, + mode_prop[:, :, :, None], + ir_grid_map, + ir_grid_points, + args.num_sampling_points, + bz_grid, + ) _show_scalar(kdos[:, :, :, 0], temperatures, sampling_points, args) else: # Run for tensor if args.gv: - gv_sum2 = f_kappa['gv_by_gv'][:] + gv_sum2 = f_kappa["gv_by_gv"][:] # gv x gv is divied by primitive cell volume. unit_conversion = primitive.volume mode_prop = gv_sum2.reshape((1,) + gv_sum2.shape) / unit_conversion else: - mode_prop = f_kappa['mode_kappa'][:] + mode_prop = f_kappa["mode_kappa"][:] if args.mfp: - if 'mean_free_path' in f_kappa: - mfp = f_kappa['mean_free_path'][:] + if "mean_free_path" in f_kappa: + mfp = f_kappa["mean_free_path"][:] mean_freepath = np.sqrt((mfp ** 2).sum(axis=3)) else: - mean_freepath = _get_mfp(f_kappa['gamma'][:], - f_kappa['group_velocity'][:]) + mean_freepath = _get_mfp( + f_kappa["gamma"][:], f_kappa["group_velocity"][:] + ) if args.temperature is not None: - (temperatures, - mode_prop, - mean_freepath) = _set_T_target(temperatures, - mode_prop, - args.temperature, - mean_freepath=mean_freepath) + (temperatures, mode_prop, mean_freepath) = _set_T_target( + temperatures, + mode_prop, + args.temperature, + mean_freepath=mean_freepath, + ) - kdos, sampling_points = _run_mfp_dos(mean_freepath, - mode_prop, - ir_grid_map, - ir_grid_points, - args.num_sampling_points, - bz_grid) + kdos, sampling_points = _run_mfp_dos( + mean_freepath, + mode_prop, + ir_grid_map, + ir_grid_points, + args.num_sampling_points, + bz_grid, + ) _show_tensor(kdos, temperatures, sampling_points, args) else: if args.temperature is not None and not args.gv: - temperatures, mode_prop = _set_T_target(temperatures, - mode_prop, - args.temperature) - kdos, sampling_points = _run_prop_dos(frequencies, - mode_prop, - ir_grid_map, - ir_grid_points, - args.num_sampling_points, - bz_grid) + temperatures, mode_prop = _set_T_target( + temperatures, mode_prop, args.temperature + ) + kdos, sampling_points = _run_prop_dos( + frequencies, + mode_prop, + ir_grid_map, + ir_grid_points, + args.num_sampling_points, + bz_grid, + ) _show_tensor(kdos, temperatures, sampling_points, args) diff --git a/phono3py/cui/phono3py_argparse.py b/phono3py/cui/phono3py_argparse.py index c535b02b..4e177356 100644 --- a/phono3py/cui/phono3py_argparse.py +++ b/phono3py/cui/phono3py_argparse.py @@ -37,400 +37,757 @@ import sys from phonopy.cui.phonopy_argparse import fix_deprecated_option_names -def get_parser(fc_symmetry=False, - is_nac=False, - load_phono3py_yaml=False): +def get_parser(fc_symmetry=False, is_nac=False, load_phono3py_yaml=False): """Return ArgumentParser instance.""" deprecated = fix_deprecated_option_names(sys.argv) import argparse from phonopy.interface.calculator import add_arguments_of_calculators from phono3py.interface.calculator import calculator_info - parser = argparse.ArgumentParser( - description="Phono3py command-line-tool") + parser = argparse.ArgumentParser(description="Phono3py command-line-tool") add_arguments_of_calculators(parser, calculator_info) parser.add_argument( - "--alm", dest="use_alm", action="store_true", default=False, - help=("Use ALM for generating 2nd and 3rd force constants " - "in one fitting")) - parser.add_argument( - "--amplitude", dest="displacement_distance", type=float, default=None, - help="Distance of displacements") - parser.add_argument( - "--ave-pp", dest="use_ave_pp", action="store_true", default=False, - help="Use averaged ph-ph interaction") - parser.add_argument( - "--band", nargs='+', dest="band_paths", default=None, - help="Band structure paths calculated for Gruneisen parameter") - parser.add_argument( - "--band-points", dest="band_points", type=int, default=None, - help=("Number of points calculated on a band segment in the band " - "structure Gruneisen parameter calculation")) - parser.add_argument( - "--bi", "--band-indices", nargs='+', dest="band_indices", default=None, - help="Band indices where life time is calculated") - parser.add_argument( - "--boundary-mfp", "--bmfp", dest="boundary_mfp", type=float, - default=None, - help=("Boundary mean free path in micrometre for thermal conductivity " - "calculation")) - parser.add_argument( - "--br", "--bterta", dest="is_bterta", action="store_true", + "--alm", + dest="use_alm", + action="store_true", default=False, - help="Calculate thermal conductivity in BTE-RTA") + help=("Use ALM for generating 2nd and 3rd force constants " "in one fitting"), + ) + parser.add_argument( + "--amplitude", + dest="displacement_distance", + type=float, + default=None, + help="Distance of displacements", + ) + parser.add_argument( + "--ave-pp", + dest="use_ave_pp", + action="store_true", + default=False, + help="Use averaged ph-ph interaction", + ) + parser.add_argument( + "--band", + nargs="+", + dest="band_paths", + default=None, + help="Band structure paths calculated for Gruneisen parameter", + ) + parser.add_argument( + "--band-points", + dest="band_points", + type=int, + default=None, + help=( + "Number of points calculated on a band segment in the band " + "structure Gruneisen parameter calculation" + ), + ) + parser.add_argument( + "--bi", + "--band-indices", + nargs="+", + dest="band_indices", + default=None, + help="Band indices where life time is calculated", + ) + parser.add_argument( + "--boundary-mfp", + "--bmfp", + dest="boundary_mfp", + type=float, + default=None, + help=( + "Boundary mean free path in micrometre for thermal conductivity " + "calculation" + ), + ) + parser.add_argument( + "--br", + "--bterta", + dest="is_bterta", + action="store_true", + default=False, + help="Calculate thermal conductivity in BTE-RTA", + ) if not load_phono3py_yaml: parser.add_argument( - "-c", "--cell", dest="cell_filename", metavar="FILE", default=None, - help="Read unit cell") + "-c", + "--cell", + dest="cell_filename", + metavar="FILE", + default=None, + help="Read unit cell", + ) parser.add_argument( - "--cf2", "--create-f2", dest="create_forces_fc2", nargs='+', - default=None, help="Create FORCES_FC2") - parser.add_argument( - "--cf3", "--create-f3", dest="create_forces_fc3", nargs='+', - default=None, help="Create FORCES_FC3") - parser.add_argument( - "--cf3-file", "--create-f3-from-file", - metavar="FILE", dest="create_forces_fc3_file", default=None, - help="Create FORCES_FC3 from file name list") - parser.add_argument( - "--cfz", "--subtract-forces", - metavar="FILE", dest="subtract_forces", default=None, - help="Subtract recidual forces from supercell forces") - parser.add_argument( - "--cfc", "--compact-fc", dest="is_compact_fc", action="store_true", - default=False, - help="Use compact force cosntants") - parser.add_argument( - "--cfs", "--create-force-sets", dest="force_sets_mode", - action="store_true", default=False, - help="Create phonopy FORCE_SETS from FORCES_FC2") - parser.add_argument( - "--cph", "--collective-phonon", dest="solve_collective_phonon", - action="store_true", default=False, - help="Solve collective phonons") - parser.add_argument( - "--const-ave-pp", dest="const_ave_pp", type=float, default=None, - help="Set constant averaged ph-ph interaction (Pqj)") - parser.add_argument( - "--cutoff-fc3", "--cutoff-fc3-distance", dest="cutoff_fc3_distance", - type=float, default=None, - help=("Cutoff distance of third-order force constants. Elements where " - "any pair of atoms has larger distance than cut-off distance " - "are set zero.")) - parser.add_argument( - "--cutoff-freq", "--cutoff-frequency", dest="cutoff_frequency", - type=float, default=None, - help="Phonon modes below this frequency are ignored.") - parser.add_argument( - "--cutoff-pair", "--cutoff-pair-distance", dest="cutoff_pair_distance", - type=float, default=None, - help=("Cutoff distance between pairs of displaced atoms used for " - "supercell creation with displacements and making third-order " - "force constants")) - parser.add_argument( - "-d", "--disp", dest="is_displacement", action="store_true", - default=False, - help="As first stage, get least displacements") - parser.add_argument( - "--dim", nargs='+', dest="supercell_dimension", default=None, - help="Supercell dimension") - parser.add_argument( - "--dim-fc2", nargs='+', dest="phonon_supercell_dimension", + "--cf2", + "--create-f2", + dest="create_forces_fc2", + nargs="+", default=None, - help="Supercell dimension for extra fc2") + help="Create FORCES_FC2", + ) parser.add_argument( - "--emulate-v1", dest="emulate_v1", action="store_true", - default=False, - help="Emulate v1.x grid system and shortest vectors.") - parser.add_argument( - "--factor", dest="frequency_conversion_factor", type=float, + "--cf3", + "--create-f3", + dest="create_forces_fc3", + nargs="+", default=None, - help="Frequency unit conversion factor") + help="Create FORCES_FC3", + ) + parser.add_argument( + "--cf3-file", + "--create-f3-from-file", + metavar="FILE", + dest="create_forces_fc3_file", + default=None, + help="Create FORCES_FC3 from file name list", + ) + parser.add_argument( + "--cfz", + "--subtract-forces", + metavar="FILE", + dest="subtract_forces", + default=None, + help="Subtract recidual forces from supercell forces", + ) + parser.add_argument( + "--cfc", + "--compact-fc", + dest="is_compact_fc", + action="store_true", + default=False, + help="Use compact force cosntants", + ) + parser.add_argument( + "--cfs", + "--create-force-sets", + dest="force_sets_mode", + action="store_true", + default=False, + help="Create phonopy FORCE_SETS from FORCES_FC2", + ) + parser.add_argument( + "--cph", + "--collective-phonon", + dest="solve_collective_phonon", + action="store_true", + default=False, + help="Solve collective phonons", + ) + parser.add_argument( + "--const-ave-pp", + dest="const_ave_pp", + type=float, + default=None, + help="Set constant averaged ph-ph interaction (Pqj)", + ) + parser.add_argument( + "--cutoff-fc3", + "--cutoff-fc3-distance", + dest="cutoff_fc3_distance", + type=float, + default=None, + help=( + "Cutoff distance of third-order force constants. Elements where " + "any pair of atoms has larger distance than cut-off distance " + "are set zero." + ), + ) + parser.add_argument( + "--cutoff-freq", + "--cutoff-frequency", + dest="cutoff_frequency", + type=float, + default=None, + help="Phonon modes below this frequency are ignored.", + ) + parser.add_argument( + "--cutoff-pair", + "--cutoff-pair-distance", + dest="cutoff_pair_distance", + type=float, + default=None, + help=( + "Cutoff distance between pairs of displaced atoms used for " + "supercell creation with displacements and making third-order " + "force constants" + ), + ) + parser.add_argument( + "-d", + "--disp", + dest="is_displacement", + action="store_true", + default=False, + help="As first stage, get least displacements", + ) + parser.add_argument( + "--dim", + nargs="+", + dest="supercell_dimension", + default=None, + help="Supercell dimension", + ) + parser.add_argument( + "--dim-fc2", + nargs="+", + dest="phonon_supercell_dimension", + default=None, + help="Supercell dimension for extra fc2", + ) + parser.add_argument( + "--emulate-v1", + dest="emulate_v1", + action="store_true", + default=False, + help="Emulate v1.x grid system and shortest vectors.", + ) + parser.add_argument( + "--factor", + dest="frequency_conversion_factor", + type=float, + default=None, + help="Frequency unit conversion factor", + ) if not load_phono3py_yaml: parser.add_argument( - "--fc2", dest="read_fc2", action="store_true", default=False, - help="Read second order force constants") + "--fc2", + dest="read_fc2", + action="store_true", + default=False, + help="Read second order force constants", + ) parser.add_argument( - "--fc3", dest="read_fc3", action="store_true", default=False, - help="Read third order force constants") + "--fc3", + dest="read_fc3", + action="store_true", + default=False, + help="Read third order force constants", + ) parser.add_argument( - "--fc-calc-opt", "--fc-calculator-options", - dest="fc_calculator_options", default=None, - help=("Options for force constants calculator as comma separated " - "string with the style of key = values")) + "--fc-calc-opt", + "--fc-calculator-options", + dest="fc_calculator_options", + default=None, + help=( + "Options for force constants calculator as comma separated " + "string with the style of key = values" + ), + ) if not fc_symmetry: parser.add_argument( - "--fc-symmetry", "--sym-fc", dest="fc_symmetry", - action="store_true", default=False, - help="Symmetrize force constants") + "--fc-symmetry", + "--sym-fc", + dest="fc_symmetry", + action="store_true", + default=False, + help="Symmetrize force constants", + ) parser.add_argument( - "--freq-scale", dest="frequency_scale_factor", type=float, + "--freq-scale", + dest="frequency_scale_factor", + type=float, default=None, - help=("Factor multiplied as fc2 * factor^2 and fc3 * factor^2. " - "Phonon frequency is changed but the contribution from NAC is " - "not changed.")) + help=( + "Factor multiplied as fc2 * factor^2 and fc3 * factor^2. " + "Phonon frequency is changed but the contribution from NAC is " + "not changed." + ), + ) parser.add_argument( - "--freq-pitch", dest="fpitch", type=float, default=None, - help="Pitch in frequency for spectrum") - parser.add_argument( - "--fs2f2", "--force-sets-to-forces-fc2", - dest="force_sets_to_forces_fc2_mode", default=False, - action="store_true", help="Create FORCES_FC2 from FORCE_SETS") - parser.add_argument( - "--full-pp", dest="is_full_pp", action="store_true", default=False, - help=("Calculate full ph-ph interaction for RTA conductivity." - "This may be activated when full elements of ph-ph interaction " - "strength are needed, i.e., to calculate average ph-ph " - "interaction strength.")) - parser.add_argument( - "--ga", "--grid-addresses", nargs='+', dest="grid_addresses", + "--freq-pitch", + dest="fpitch", + type=float, default=None, - help="Fixed grid addresses where anharmonic properties are calculated") + help="Pitch in frequency for spectrum", + ) parser.add_argument( - "--gamma-unit-conversion", dest="gamma_unit_conversion", type=float, + "--fs2f2", + "--force-sets-to-forces-fc2", + dest="force_sets_to_forces_fc2_mode", + default=False, + action="store_true", + help="Create FORCES_FC2 from FORCE_SETS", + ) + parser.add_argument( + "--full-pp", + dest="is_full_pp", + action="store_true", + default=False, + help=( + "Calculate full ph-ph interaction for RTA conductivity." + "This may be activated when full elements of ph-ph interaction " + "strength are needed, i.e., to calculate average ph-ph " + "interaction strength." + ), + ) + parser.add_argument( + "--ga", + "--grid-addresses", + nargs="+", + dest="grid_addresses", default=None, - help="Conversion factor for gamma") + help="Fixed grid addresses where anharmonic properties are calculated", + ) parser.add_argument( - "--gp", "--grid-points", nargs='+', dest="grid_points", default=None, - help="Fixed grid points where anharmonic properties are calculated") + "--gp", + "--grid-points", + nargs="+", + dest="grid_points", + default=None, + help="Fixed grid points where anharmonic properties are calculated", + ) parser.add_argument( - "--grg", "--generalized-regular-grid", dest="use_grg", - action="store_true", default=False, - help="Use generalized regular grid.") + "--grg", + "--generalized-regular-grid", + dest="use_grg", + action="store_true", + default=False, + help="Use generalized regular grid.", + ) parser.add_argument( - "--gruneisen", dest="is_gruneisen", action="store_true", default=False, - help="Calculate phonon Gruneisen parameter") + "--gruneisen", + dest="is_gruneisen", + action="store_true", + default=False, + help="Calculate phonon Gruneisen parameter", + ) parser.add_argument( - "--gv-delta-q", dest="gv_delta_q", type=float, default=None, - help="Delta-q distance used for group velocity calculation") + "--gv-delta-q", + dest="gv_delta_q", + type=float, + default=None, + help="Delta-q distance used for group velocity calculation", + ) parser.add_argument( - "--hdf5-compression", dest="hdf5_compression", default=None, - help="hdf5 compression filter (default: gzip)") + "--hdf5-compression", + dest="hdf5_compression", + default=None, + help="hdf5 compression filter (default: gzip)", + ) if not load_phono3py_yaml: parser.add_argument( - "-i", dest="input_filename", default=None, - help="Input filename extension") + "-i", dest="input_filename", default=None, help="Input filename extension" + ) parser.add_argument( - "--io", dest="input_output_filename", default=None, - help="Input and output filename extension") + "--io", + dest="input_output_filename", + default=None, + help="Input and output filename extension", + ) parser.add_argument( - "--ion-clamped", dest="ion_clamped", action="store_true", + "--ion-clamped", + dest="ion_clamped", + action="store_true", default=False, - help=("Atoms are clamped under applied strain in Gruneisen parameter " - "calculation")) + help=( + "Atoms are clamped under applied strain in Gruneisen parameter " + "calculation" + ), + ) parser.add_argument( - "--ise", dest="is_imag_self_energy", action="store_true", + "--ise", + dest="is_imag_self_energy", + action="store_true", default=False, - help="Calculate imaginary part of self energy") + help="Calculate imaginary part of self energy", + ) parser.add_argument( - "--isotope", dest="is_isotope", action="store_true", default=False, - help="Isotope scattering lifetime") + "--isotope", + dest="is_isotope", + action="store_true", + default=False, + help="Isotope scattering lifetime", + ) parser.add_argument( - "--jdos", dest="is_joint_dos", action="store_true", default=False, - help="Calculate joint density of states") + "--jdos", + dest="is_joint_dos", + action="store_true", + default=False, + help="Calculate joint density of states", + ) parser.add_argument( - "--lbte", dest="is_lbte", action="store_true", default=False, - help="Calculate thermal conductivity LBTE with Chaput's method") + "--lbte", + dest="is_lbte", + action="store_true", + default=False, + help="Calculate thermal conductivity LBTE with Chaput's method", + ) parser.add_argument( - "--loglevel", dest="log_level", type=int, default=None, - help="Log level") + "--loglevel", dest="log_level", type=int, default=None, help="Log level" + ) parser.add_argument( - "--mass", nargs='+', dest="masses", default=None, - help="Same as MASS tag") + "--mass", nargs="+", dest="masses", default=None, help="Same as MASS tag" + ) parser.add_argument( - "--mesh", nargs='+', dest="mesh_numbers", default=None, - help="Mesh numbers") + "--mesh", nargs="+", dest="mesh_numbers", default=None, help="Mesh numbers" + ) parser.add_argument( - "--mv", "--mass-variances", nargs='+', dest="mass_variances", + "--mv", + "--mass-variances", + nargs="+", + dest="mass_variances", default=None, - help="Mass variance parameters for isotope scattering") + help="Mass variance parameters for isotope scattering", + ) if not is_nac: parser.add_argument( - "--nac", dest="is_nac", action="store_true", default=False, - help="Non-analytical term correction") + "--nac", + dest="is_nac", + action="store_true", + default=False, + help="Non-analytical term correction", + ) parser.add_argument( - "--nac-method", dest="nac_method", default=None, - help="Non-analytical term correction method: Wang (default) or Gonze") + "--nac-method", + dest="nac_method", + default=None, + help="Non-analytical term correction method: Wang (default) or Gonze", + ) if fc_symmetry: parser.add_argument( - "--no-fc-symmetry", "--no-sym-fc", - dest="fc_symmetry", action="store_false", - default=True, help="Do not symmetrize force constants") + "--no-fc-symmetry", + "--no-sym-fc", + dest="fc_symmetry", + action="store_false", + default=True, + help="Do not symmetrize force constants", + ) parser.add_argument( - "--nodiag", dest="is_nodiag", action="store_true", default=False, - help="Set displacements parallel to axes") + "--nodiag", + dest="is_nodiag", + action="store_true", + default=False, + help="Set displacements parallel to axes", + ) parser.add_argument( - "--noks", "--no-kappa-stars", dest="no_kappa_stars", - action="store_true", default=False, - help="Deactivate summation of partial kappa at q-stars"), + "--noks", + "--no-kappa-stars", + dest="no_kappa_stars", + action="store_true", + default=False, + help="Deactivate summation of partial kappa at q-stars", + ), parser.add_argument( - "--nomeshsym", dest="is_nomeshsym", action="store_true", default=False, - help="No symmetrization of triplets is made.") + "--nomeshsym", + dest="is_nomeshsym", + action="store_true", + default=False, + help="No symmetrization of triplets is made.", + ) if is_nac: parser.add_argument( - "--nonac", dest="is_nac", action="store_false", default=True, - help="Non-analytical term correction") + "--nonac", + dest="is_nac", + action="store_false", + default=True, + help="Non-analytical term correction", + ) parser.add_argument( - "--nosym", dest="is_nosym", action="store_true", default=False, - help="Symmetry is not imposed.") + "--nosym", + dest="is_nosym", + action="store_true", + default=False, + help="Symmetry is not imposed.", + ) parser.add_argument( - "--nu", dest="is_N_U", action="store_true", default=False, - help="Split Gamma into Normal and Umklapp processes") + "--nu", + dest="is_N_U", + action="store_true", + default=False, + help="Split Gamma into Normal and Umklapp processes", + ) parser.add_argument( - "--num-freq-points", dest="num_frequency_points", type=int, + "--num-freq-points", + dest="num_frequency_points", + type=int, default=None, - help="Number of sampling points for spectrum") + help="Number of sampling points for spectrum", + ) parser.add_argument( - "--num-points-in-batch", dest="num_points_in_batch", type=int, + "--num-points-in-batch", + dest="num_points_in_batch", + type=int, default=None, - help=("Number of frequency points in a batch for the frequency " - "sampling modes of imag-self-energy calculation")) + help=( + "Number of frequency points in a batch for the frequency " + "sampling modes of imag-self-energy calculation" + ), + ) if not load_phono3py_yaml: parser.add_argument( - "-o", dest="output_filename", default=None, - help="Output filename extension") + "-o", dest="output_filename", default=None, help="Output filename extension" + ) parser.add_argument( - "--pa", "--primitive-axis", "--primitive-axes", nargs='+', - dest="primitive_axes", default=None, - help="Same as PRIMITIVE_AXES tags") - parser.add_argument( - "--pinv-cutoff", dest="pinv_cutoff", type=float, default=None, - help="Cutoff frequency (THz) for pseudo inversion of collision matrix") - parser.add_argument( - "--pinv-solver", dest="pinv_solver", type=int, default=None, - help="Switch of LBTE pinv solver") - parser.add_argument( - "--pm", dest="is_plusminus_displacements", action="store_true", - default=False, - help="Set plus minus displacements") - parser.add_argument( - "--pp-unit-conversion", dest="pp_unit_conversion", type=float, + "--pa", + "--primitive-axis", + "--primitive-axes", + nargs="+", + dest="primitive_axes", default=None, - help="Conversion factor for ph-ph interaction") + help="Same as PRIMITIVE_AXES tags", + ) parser.add_argument( - "--qpoints", nargs='+', dest="qpoints", default=None, - help="Calculate at specified q-points") - parser.add_argument( - "--q-direction", nargs='+', dest="nac_q_direction", default=None, - help="q-vector direction at q->0 for non-analytical term correction") - parser.add_argument( - "-q", "--quiet", dest="quiet", action="store_true", default=False, - help="Print out smallest information") - parser.add_argument( - "--read-collision", dest="read_collision", default=None, - help="Read collision matrix and Gammas from files") - parser.add_argument( - "--read-gamma", dest="read_gamma", action="store_true", default=False, - help="Read Gammas from files") - parser.add_argument( - "--read-phonon", dest="read_phonon", action="store_true", - default=False, - help="Read phonons from files") - parser.add_argument( - "--read-pp", dest="read_pp", action="store_true", default=False, - help="Read phonon-phonon interaction strength") - parser.add_argument( - "--reducible-colmat", dest="is_reducible_collision_matrix", - action="store_true", default=False, - help="Solve reducible collision matrix") - parser.add_argument( - "--rse", dest="is_real_self_energy", action="store_true", - default=False, - help="Calculate real part of self energy") - parser.add_argument( - "--scattering-event-class", dest="scattering_event_class", type=int, + "--pinv-cutoff", + dest="pinv_cutoff", + type=float, default=None, - help=("Scattering event class 1 or 2 to draw imaginary part of self " - "energy")) + help="Cutoff frequency (THz) for pseudo inversion of collision matrix", + ) parser.add_argument( - "--sigma", nargs='+', dest="sigma", default=None, - help=("A sigma value or multiple sigma values (separated by space) " - "for smearing function")) + "--pinv-solver", + dest="pinv_solver", + type=int, + default=None, + help="Switch of LBTE pinv solver", + ) parser.add_argument( - "--sigma-cutoff", dest="sigma_cutoff_width", type=float, default=None, - help="Cutoff width of smearing function (ratio to sigma value)") - parser.add_argument( - "--spf", dest="is_spectral_function", action="store_true", + "--pm", + dest="is_plusminus_displacements", + action="store_true", default=False, - help="Calculate spectral function") + help="Set plus minus displacements", + ) parser.add_argument( - "--stp", "--show-num-triplets", dest="show_num_triplets", - action="store_true", default=False, - help=("Show reduced number of triplets to be calculated at " - "specified grid points")) + "--pp-unit-conversion", + dest="pp_unit_conversion", + type=float, + default=None, + help="Conversion factor for ph-ph interaction", + ) + parser.add_argument( + "--qpoints", + nargs="+", + dest="qpoints", + default=None, + help="Calculate at specified q-points", + ) + parser.add_argument( + "--q-direction", + nargs="+", + dest="nac_q_direction", + default=None, + help="q-vector direction at q->0 for non-analytical term correction", + ) + parser.add_argument( + "-q", + "--quiet", + dest="quiet", + action="store_true", + default=False, + help="Print out smallest information", + ) + parser.add_argument( + "--read-collision", + dest="read_collision", + default=None, + help="Read collision matrix and Gammas from files", + ) + parser.add_argument( + "--read-gamma", + dest="read_gamma", + action="store_true", + default=False, + help="Read Gammas from files", + ) + parser.add_argument( + "--read-phonon", + dest="read_phonon", + action="store_true", + default=False, + help="Read phonons from files", + ) + parser.add_argument( + "--read-pp", + dest="read_pp", + action="store_true", + default=False, + help="Read phonon-phonon interaction strength", + ) + parser.add_argument( + "--reducible-colmat", + dest="is_reducible_collision_matrix", + action="store_true", + default=False, + help="Solve reducible collision matrix", + ) + parser.add_argument( + "--rse", + dest="is_real_self_energy", + action="store_true", + default=False, + help="Calculate real part of self energy", + ) + parser.add_argument( + "--scattering-event-class", + dest="scattering_event_class", + type=int, + default=None, + help=("Scattering event class 1 or 2 to draw imaginary part of self " "energy"), + ) + parser.add_argument( + "--sigma", + nargs="+", + dest="sigma", + default=None, + help=( + "A sigma value or multiple sigma values (separated by space) " + "for smearing function" + ), + ) + parser.add_argument( + "--sigma-cutoff", + dest="sigma_cutoff_width", + type=float, + default=None, + help="Cutoff width of smearing function (ratio to sigma value)", + ) + parser.add_argument( + "--spf", + dest="is_spectral_function", + action="store_true", + default=False, + help="Calculate spectral function", + ) + parser.add_argument( + "--stp", + "--show-num-triplets", + dest="show_num_triplets", + action="store_true", + default=False, + help=( + "Show reduced number of triplets to be calculated at " + "specified grid points" + ), + ) if not load_phono3py_yaml: parser.add_argument( - "--sym-fc2", dest="is_symmetrize_fc2", action="store_true", + "--sym-fc2", + dest="is_symmetrize_fc2", + action="store_true", default=False, - help="Symmetrize fc2 by index exchange") + help="Symmetrize fc2 by index exchange", + ) parser.add_argument( - "--sym-fc3r", dest="is_symmetrize_fc3_r", action="store_true", + "--sym-fc3r", + dest="is_symmetrize_fc3_r", + action="store_true", default=False, - help="Symmetrize fc3 in real space by index exchange") + help="Symmetrize fc3 in real space by index exchange", + ) parser.add_argument( - "--sym-fc3q", dest="is_symmetrize_fc3_q", action="store_true", + "--sym-fc3q", + dest="is_symmetrize_fc3_q", + action="store_true", default=False, - help="Symmetrize fc3 in reciprocal space by index exchange") + help="Symmetrize fc3 in reciprocal space by index exchange", + ) parser.add_argument( - "--thm", "--tetrahedron-method", dest="is_tetrahedron_method", - action="store_true", default=False, - help="Use tetrahedron method.") - parser.add_argument( - "--tmax", dest="tmax", default=None, - help="Maximum calculated temperature") - parser.add_argument( - "--tmin", dest="tmin", default=None, - help="Minimum calculated temperature") - parser.add_argument( - "--ts", nargs='+', dest="temperatures", default=None, - help="Temperatures for damping functions") - parser.add_argument( - "--tstep", dest="tstep", default=None, - help="Calculated temperature step") - parser.add_argument( - "--tolerance", dest="symmetry_tolerance", type=float, default=None, - help="Symmetry tolerance to search") - parser.add_argument( - "--uplo", dest="lapack_zheev_uplo", default=None, - help="Lapack zheev UPLO for phonon solver (default: L)") - parser.add_argument( - "-v", "--verbose", dest="verbose", action="store_true", default=False, - help="Detailed run-time information is displayed") - parser.add_argument( - "--wgp", "--write-grid-points", dest="write_grid_points", - action="store_true", default=False, - help=("Write grid address of irreducible grid points for specified " - "mesh numbers to ir_grid_address.yaml")) - parser.add_argument( - "--write-collision", dest="write_collision", action="store_true", + "--thm", + "--tetrahedron-method", + dest="is_tetrahedron_method", + action="store_true", default=False, - help="Write collision matrix and Gammas to files") + help="Use tetrahedron method.", + ) parser.add_argument( - "--write-gamma", dest="write_gamma", action="store_true", + "--tmax", dest="tmax", default=None, help="Maximum calculated temperature" + ) + parser.add_argument( + "--tmin", dest="tmin", default=None, help="Minimum calculated temperature" + ) + parser.add_argument( + "--ts", + nargs="+", + dest="temperatures", + default=None, + help="Temperatures for damping functions", + ) + parser.add_argument( + "--tstep", dest="tstep", default=None, help="Calculated temperature step" + ) + parser.add_argument( + "--tolerance", + dest="symmetry_tolerance", + type=float, + default=None, + help="Symmetry tolerance to search", + ) + parser.add_argument( + "--uplo", + dest="lapack_zheev_uplo", + default=None, + help="Lapack zheev UPLO for phonon solver (default: L)", + ) + parser.add_argument( + "-v", + "--verbose", + dest="verbose", + action="store_true", default=False, - help="Write imag-part of self energy to files") + help="Detailed run-time information is displayed", + ) parser.add_argument( - "--write-gamma-detail", "--write_detailed_gamma", - dest="write_gamma_detail", action="store_true", default=False, - help="Write out detailed imag-part of self energy") - parser.add_argument( - "--write-phonon", dest="write_phonon", action="store_true", + "--wgp", + "--write-grid-points", + dest="write_grid_points", + action="store_true", default=False, - help="Write all phonons on grid points to files") + help=( + "Write grid address of irreducible grid points for specified " + "mesh numbers to ir_grid_address.yaml" + ), + ) parser.add_argument( - "--write-pp", dest="write_pp", action="store_true", default=False, - help="Write phonon-phonon interaction strength") + "--write-collision", + dest="write_collision", + action="store_true", + default=False, + help="Write collision matrix and Gammas to files", + ) parser.add_argument( - "--write-lbte-solution", dest="write_LBTE_solution", - action="store_true", default=False, - help="Write direct solution of LBTE to hdf5 files") + "--write-gamma", + dest="write_gamma", + action="store_true", + default=False, + help="Write imag-part of self energy to files", + ) + parser.add_argument( + "--write-gamma-detail", + "--write_detailed_gamma", + dest="write_gamma_detail", + action="store_true", + default=False, + help="Write out detailed imag-part of self energy", + ) + parser.add_argument( + "--write-phonon", + dest="write_phonon", + action="store_true", + default=False, + help="Write all phonons on grid points to files", + ) + parser.add_argument( + "--write-pp", + dest="write_pp", + action="store_true", + default=False, + help="Write phonon-phonon interaction strength", + ) + parser.add_argument( + "--write-lbte-solution", + dest="write_LBTE_solution", + action="store_true", + default=False, + help="Write direct solution of LBTE to hdf5 files", + ) if load_phono3py_yaml: - parser.add_argument( - "filename", nargs='*', help="phono3py.yaml like file") + parser.add_argument("filename", nargs="*", help="phono3py.yaml like file") else: - parser.add_argument( - "filename", nargs='*', help="Phono3py configure file") + parser.add_argument("filename", nargs="*", help="Phono3py configure file") return parser, deprecated diff --git a/phono3py/cui/phono3py_script.py b/phono3py/cui/phono3py_script.py index 6bc28517..0b3d2ba0 100644 --- a/phono3py/cui/phono3py_script.py +++ b/phono3py/cui/phono3py_script.py @@ -35,25 +35,41 @@ import sys import numpy as np -from phonopy.file_IO import ( - write_FORCE_SETS, parse_FORCE_SETS, is_file_phonopy_yaml) +from phonopy.file_IO import write_FORCE_SETS, parse_FORCE_SETS, is_file_phonopy_yaml from phonopy.units import VaspToTHz, Bohr, Hartree from phonopy.cui.collect_cell_info import collect_cell_info from phonopy.cui.create_force_sets import check_number_of_force_files from phonopy.interface.calculator import ( - get_force_sets, get_default_physical_units, get_interface_mode) + get_force_sets, + get_default_physical_units, + get_interface_mode, +) from phonopy.cui.phonopy_argparse import show_deprecated_option_warnings from phonopy.phonon.band_structure import get_band_qpoints from phonopy.cui.phonopy_script import ( - store_nac_params, print_end, print_error, print_error_message, - print_version, file_exists, files_exist, get_fc_calculator_params) + store_nac_params, + print_end, + print_error, + print_error_message, + print_version, + file_exists, + files_exist, + get_fc_calculator_params, +) from phonopy.structure.cells import isclose as cells_isclose from phono3py.version import __version__ from phono3py.file_IO import ( - parse_disp_fc2_yaml, parse_disp_fc3_yaml, - write_disp_fc2_yaml, read_phonon_from_hdf5, write_phonon_to_hdf5, - parse_FORCES_FC2, write_FORCES_FC2, write_FORCES_FC3, - get_length_of_first_line, write_fc3_to_hdf5, write_fc2_to_hdf5) + parse_disp_fc2_yaml, + parse_disp_fc3_yaml, + read_phonon_from_hdf5, + write_phonon_to_hdf5, + parse_FORCES_FC2, + write_FORCES_FC2, + write_FORCES_FC3, + get_length_of_first_line, + write_fc3_to_hdf5, + write_fc2_to_hdf5, +) from phono3py.cui.settings import Phono3pyConfParser from phono3py.cui.load import set_dataset_and_force_constants from phono3py import Phono3py, Phono3pyJointDos, Phono3pyIsotope @@ -61,12 +77,17 @@ from phono3py.phonon3.gruneisen import run_gruneisen_parameters from phono3py.phonon.grid import get_grid_point_from_address from phono3py.cui.phono3py_argparse import get_parser from phono3py.cui.show_log import ( - show_general_settings, show_phono3py_settings, show_phono3py_cells) + show_general_settings, + show_phono3py_settings, + show_phono3py_cells, +) from phono3py.cui.triplets_info import write_grid_points, show_num_triplets from phono3py.cui.create_supercells import create_phono3py_supercells from phono3py.cui.create_force_constants import create_phono3py_force_constants from phono3py.interface.phono3py_yaml import ( - Phono3pyYaml, displacements_yaml_lines_type1) + Phono3pyYaml, + displacements_yaml_lines_type1, +) # import logging @@ -77,19 +98,19 @@ from phono3py.interface.phono3py_yaml import ( # AA is created at http://www.network-science.de/ascii/. def print_phono3py(): """Show phono3py logo.""" - print(r""" _ _____ + print( + r""" _ _____ _ __ | |__ ___ _ __ ___|___ / _ __ _ _ | '_ \| '_ \ / _ \| '_ \ / _ \ |_ \| '_ \| | | | | |_) | | | | (_) | | | | (_) |__) | |_) | |_| | | .__/|_| |_|\___/|_| |_|\___/____/| .__/ \__, | - |_| |_| |___/ """) + |_| |_| |___/ """ + ) -def finalize_phono3py(phono3py, - confs, - log_level, - displacements_mode=False, - filename="phono3py.yaml"): +def finalize_phono3py( + phono3py, confs, log_level, displacements_mode=False, filename="phono3py.yaml" +): """Write phono3py.yaml and then exit. Parameters @@ -114,25 +135,22 @@ def finalize_phono3py(phono3py, _calculator = None _physical_units = get_default_physical_units(_calculator) - yaml_settings = { - 'force_sets': False, - 'displacements': displacements_mode - } + yaml_settings = {"force_sets": False, "displacements": displacements_mode} - ph3py_yaml = Phono3pyYaml(configuration=confs, - physical_units=_physical_units, - settings=yaml_settings) + ph3py_yaml = Phono3pyYaml( + configuration=confs, physical_units=_physical_units, settings=yaml_settings + ) ph3py_yaml.set_phonon_info(phono3py) ph3py_yaml.calculator = _calculator - with open(filename, 'w') as w: + with open(filename, "w") as w: w.write(str(ph3py_yaml)) if log_level > 0: print("") if displacements_mode: - print("Displacement dataset was written in \"%s\"." % filename) + print('Displacement dataset was written in "%s".' % filename) else: - print("Summary of calculation was written in \"%s\"." % filename) + print('Summary of calculation was written in "%s".' % filename) print_end() sys.exit(0) @@ -181,10 +199,11 @@ def start_phono3py(**argparse_control): if log_level: print_phono3py() print_version(__version__) - if argparse_control.get('load_phono3py_yaml', False): + if argparse_control.get("load_phono3py_yaml", False): print("Running in phono3py.load mode.") print("Python version %d.%d.%d" % sys.version_info[:3]) import spglib + print("Spglib version %d.%d.%d" % spglib.get_version()) if deprecated: @@ -202,21 +221,23 @@ def read_phono3py_settings(args, argparse_control, log_level): * Command line options """ - load_phono3py_yaml = argparse_control.get('load_phono3py_yaml', False) + load_phono3py_yaml = argparse_control.get("load_phono3py_yaml", False) if len(args.filename) > 0: file_exists(args.filename[0], log_level) if load_phono3py_yaml: phono3py_conf_parser = Phono3pyConfParser( - args=args, default_settings=argparse_control) + args=args, default_settings=argparse_control + ) cell_filename = args.filename[0] else: - if is_file_phonopy_yaml(args.filename[0], keyword='phono3py'): + if is_file_phonopy_yaml(args.filename[0], keyword="phono3py"): phono3py_conf_parser = Phono3pyConfParser(args=args) cell_filename = args.filename[0] else: phono3py_conf_parser = Phono3pyConfParser( - filename=args.filename[0], args=args) + filename=args.filename[0], args=args + ) cell_filename = phono3py_conf_parser.settings.cell_filename else: phono3py_conf_parser = Phono3pyConfParser(args=args) @@ -230,7 +251,7 @@ def read_phono3py_settings(args, argparse_control, log_level): def create_FORCES_FC2_from_FORCE_SETS_then_exit(log_level): """Convert FORCE_SETS to FORCES_FC2.""" - filename = 'FORCE_SETS' + filename = "FORCE_SETS" file_exists(filename, log_level) disp_dataset = parse_FORCE_SETS(filename=filename) write_FORCES_FC2(disp_dataset) @@ -249,24 +270,22 @@ def create_FORCES_FC2_from_FORCE_SETS_then_exit(log_level): sys.exit(0) -def create_FORCE_SETS_from_FORCES_FCx_then_exit(phonon_smat, - input_filename, - log_level): +def create_FORCE_SETS_from_FORCES_FCx_then_exit(phonon_smat, input_filename, log_level): """Convert FORCES_FC3 or FORCES_FC2 to FORCE_SETS.""" if phonon_smat is not None: if input_filename is None: - disp_filename = 'disp_fc2.yaml' + disp_filename = "disp_fc2.yaml" else: - disp_filename = 'disp_fc2.' + input_filename + '.yaml' + disp_filename = "disp_fc2." + input_filename + ".yaml" forces_filename = "FORCES_FC2" else: if input_filename is None: - disp_filename = 'disp_fc3.yaml' + disp_filename = "disp_fc3.yaml" else: - disp_filename = 'disp_fc3.' + input_filename + '.yaml' + disp_filename = "disp_fc3." + input_filename + ".yaml" forces_filename = "FORCES_FC3" - with open(forces_filename, 'r') as f: + with open(forces_filename, "r") as f: len_first_line = get_length_of_first_line(f) if len_first_line == 3: @@ -275,8 +294,7 @@ def create_FORCE_SETS_from_FORCES_FCx_then_exit(phonon_smat, file_exists(forces_filename, log_level) parse_FORCES_FC2(disp_dataset, filename=forces_filename) if log_level: - print("Displacement dataset was read from \"%s\"." - % disp_filename) + print('Displacement dataset was read from "%s".' % disp_filename) write_FORCE_SETS(disp_dataset) if log_level: @@ -284,16 +302,17 @@ def create_FORCE_SETS_from_FORCES_FCx_then_exit(phonon_smat, print_end() else: if log_level: - print("The file format of %s is already readable by phonopy." - % forces_filename) + print( + "The file format of %s is already readable by phonopy." + % forces_filename + ) print_end() sys.exit(0) -def create_FORCES_FC3_and_FORCES_FC2_then_exit(settings, - input_filename, - output_filename, - log_level): +def create_FORCES_FC3_and_FORCES_FC2_then_exit( + settings, input_filename, output_filename, log_level +): """Create FORCES_FC3 and FORCES_FC2 from files.""" interface_mode = settings.calculator @@ -302,25 +321,26 @@ def create_FORCES_FC3_and_FORCES_FC2_then_exit(settings, ##################### if settings.create_forces_fc3 or settings.create_forces_fc3_file: if input_filename is None: - disp_fc3_filename = 'disp_fc3.yaml' + disp_fc3_filename = "disp_fc3.yaml" else: - disp_fc3_filename = 'disp_fc3.' + input_filename + '.yaml' + disp_fc3_filename = "disp_fc3." + input_filename + ".yaml" ph3py_yaml = None disp_filenames = files_exist( - ['phono3py_disp.yaml', disp_fc3_filename], log_level, is_any=True) + ["phono3py_disp.yaml", disp_fc3_filename], log_level, is_any=True + ) - if disp_filenames[0] == 'phono3py_disp.yaml': + if disp_filenames[0] == "phono3py_disp.yaml": try: ph3py_yaml = Phono3pyYaml() - ph3py_yaml.read('phono3py_disp.yaml') + ph3py_yaml.read("phono3py_disp.yaml") if ph3py_yaml.calculator is not None: interface_mode = ph3py_yaml.calculator # overwrite - disp_filename = 'phono3py_disp.yaml' + disp_filename = "phono3py_disp.yaml" except KeyError: - file_exists('disp_fc3.yaml', log_level) + file_exists("disp_fc3.yaml", log_level) if log_level > 0: - print("\"phono3py_disp.yaml\" was found but wasn't used.") + print('"phono3py_disp.yaml" was found but wasn\'t used.') disp_filename = disp_fc3_filename else: disp_filename = disp_filenames[0] @@ -332,20 +352,19 @@ def create_FORCES_FC3_and_FORCES_FC2_then_exit(settings, disp_dataset = ph3py_yaml.dataset if log_level: - print('') - print("Displacement dataset was read from \"%s\"." % disp_filename) + print("") + print('Displacement dataset was read from "%s".' % disp_filename) - num_atoms = disp_dataset['natom'] - num_disps = len(disp_dataset['first_atoms']) - for d1 in disp_dataset['first_atoms']: - for d2 in d1['second_atoms']: - if 'included' not in d2 or d2['included']: + num_atoms = disp_dataset["natom"] + num_disps = len(disp_dataset["first_atoms"]) + for d1 in disp_dataset["first_atoms"]: + for d2 in d1["second_atoms"]: + if "included" not in d2 or d2["included"]: num_disps += 1 if settings.create_forces_fc3_file: file_exists(settings.create_forces_fc3_file, log_level) - force_filenames = [ - x.strip() for x in open(settings.create_forces_fc3_file)] + force_filenames = [x.strip() for x in open(settings.create_forces_fc3_file)] else: force_filenames = settings.create_forces_fc3 @@ -356,37 +375,41 @@ def create_FORCES_FC3_and_FORCES_FC2_then_exit(settings, print("Number of displacements: %d" % num_disps) print("Number of supercell files: %d" % len(force_filenames)) - if not check_number_of_force_files(num_disps, - force_filenames, - disp_filename): + if not check_number_of_force_files(num_disps, force_filenames, disp_filename): force_sets = [] else: - force_sets = get_force_sets(interface_mode, - num_atoms, - num_disps, - force_filenames, - disp_filename=disp_filename, - verbose=(log_level > 0)) + force_sets = get_force_sets( + interface_mode, + num_atoms, + num_disps, + force_filenames, + disp_filename=disp_filename, + verbose=(log_level > 0), + ) if settings.subtract_forces: force_filename = settings.subtract_forces file_exists(force_filename, log_level) - force_set_zero = get_force_sets(interface_mode, - num_atoms, - 1, - [force_filename, ], - verbose=(log_level > 0))[0] + force_set_zero = get_force_sets( + interface_mode, + num_atoms, + 1, + [ + force_filename, + ], + verbose=(log_level > 0), + )[0] for fs in force_sets: fs -= force_set_zero if log_level > 0: - print("Forces in \'%s\' were subtracted from supercell forces." - % force_filename) + print( + "Forces in '%s' were subtracted from supercell forces." + % force_filename + ) if force_sets: - write_FORCES_FC3(disp_dataset, - forces_fc3=force_sets, - filename="FORCES_FC3") + write_FORCES_FC3(disp_dataset, forces_fc3=force_sets, filename="FORCES_FC3") if log_level: print("") print("%s has been created." % "FORCES_FC3") @@ -404,15 +427,15 @@ def create_FORCES_FC3_and_FORCES_FC2_then_exit(settings, ##################### if settings.create_forces_fc2: if input_filename is None: - disp_filename = 'disp_fc2.yaml' + disp_filename = "disp_fc2.yaml" else: - disp_filename = 'disp_fc2.' + input_filename + '.yaml' + disp_filename = "disp_fc2." + input_filename + ".yaml" file_exists(disp_filename, log_level) disp_dataset = parse_disp_fc2_yaml(filename=disp_filename) if log_level: - print("Displacement dataset was read from \"%s\"." % disp_filename) - num_atoms = disp_dataset['natom'] - num_disps = len(disp_dataset['first_atoms']) + print('Displacement dataset was read from "%s".' % disp_filename) + num_atoms = disp_dataset["natom"] + num_disps = len(disp_dataset["first_atoms"]) force_filenames = settings.create_forces_fc2 for filename in force_filenames: file_exists(filename, log_level) @@ -420,32 +443,38 @@ def create_FORCES_FC3_and_FORCES_FC2_then_exit(settings, if log_level > 0: print("Number of displacements: %d" % num_disps) print("Number of supercell files: %d" % len(force_filenames)) - force_sets = get_force_sets(interface_mode, - num_atoms, - num_disps, - force_filenames, - disp_filename, - verbose=(log_level > 0)) + force_sets = get_force_sets( + interface_mode, + num_atoms, + num_disps, + force_filenames, + disp_filename, + verbose=(log_level > 0), + ) if settings.subtract_forces: force_filename = settings.subtract_forces file_exists(force_filename, log_level) - force_set_zero = get_force_sets(interface_mode, - num_atoms, - 1, - [force_filename, ], - verbose=(log_level > 0))[0] + force_set_zero = get_force_sets( + interface_mode, + num_atoms, + 1, + [ + force_filename, + ], + verbose=(log_level > 0), + )[0] for fs in force_sets: fs -= force_set_zero if log_level > 0: - print("Forces in \'%s\' were subtracted from supercell forces." - % force_filename) + print( + "Forces in '%s' were subtracted from supercell forces." + % force_filename + ) if force_sets: - write_FORCES_FC2(disp_dataset, - forces_fc2=force_sets, - filename="FORCES_FC2") + write_FORCES_FC2(disp_dataset, forces_fc2=force_sets, filename="FORCES_FC2") if log_level: print("") print("%s has been created." % "FORCES_FC2") @@ -479,7 +508,8 @@ def get_cell_info(settings, cell_filename, symprec, log_level): chemical_symbols=settings.chemical_symbols, phonopy_yaml_cls=Phono3pyYaml, symprec=symprec, - return_dict=True) + return_dict=True, + ) if type(cell_info) is str: print_error_message(cell_info) if log_level > 0: @@ -490,11 +520,11 @@ def get_cell_info(settings, cell_filename, symprec, log_level): # ('unitcell', 'supercell_matrix', 'primitive_matrix', # 'optional_structure_info', 'interface_mode', 'phonopy_yaml') - cell_info['phonon_supercell_matrix'] = settings.phonon_supercell_matrix - ph3py_yaml = cell_info['phonopy_yaml'] - if cell_info['phonon_supercell_matrix'] is None and ph3py_yaml: + cell_info["phonon_supercell_matrix"] = settings.phonon_supercell_matrix + ph3py_yaml = cell_info["phonopy_yaml"] + if cell_info["phonon_supercell_matrix"] is None and ph3py_yaml: ph_smat = ph3py_yaml.phonon_supercell_matrix - cell_info['phonon_supercell_matrix'] = ph_smat + cell_info["phonon_supercell_matrix"] = ph_smat return cell_info @@ -560,61 +590,63 @@ def get_default_values(settings): cutoff_frequency = settings.cutoff_frequency params = {} - params['sigmas'] = sigmas - params['temperature_points'] = temperature_points - params['temperatures'] = temperatures - params['frequency_factor_to_THz'] = frequency_factor_to_THz - params['num_frequency_points'] = num_frequency_points - params['num_points_in_batch'] = num_points_in_batch - params['frequency_step'] = frequency_step - params['frequency_scale_factor'] = frequency_scale_factor - params['cutoff_frequency'] = cutoff_frequency + params["sigmas"] = sigmas + params["temperature_points"] = temperature_points + params["temperatures"] = temperatures + params["frequency_factor_to_THz"] = frequency_factor_to_THz + params["num_frequency_points"] = num_frequency_points + params["num_points_in_batch"] = num_points_in_batch + params["frequency_step"] = frequency_step + params["frequency_scale_factor"] = frequency_scale_factor + params["cutoff_frequency"] = cutoff_frequency return params def check_supercell_in_yaml(cell_info, ph3, distance_to_A, log_level): """Check consistency between generated cells and cells in yaml.""" - if cell_info['phonopy_yaml'] is not None: + if cell_info["phonopy_yaml"] is not None: if distance_to_A is None: d2A = 1.0 else: d2A = distance_to_A - if (cell_info['phonopy_yaml'].supercell is not None and - ph3.supercell is not None): # noqa E129 - yaml_cell = cell_info['phonopy_yaml'].supercell.copy() + if ( + cell_info["phonopy_yaml"].supercell is not None + and ph3.supercell is not None + ): # noqa E129 + yaml_cell = cell_info["phonopy_yaml"].supercell.copy() yaml_cell.cell = yaml_cell.cell * d2A if not cells_isclose(yaml_cell, ph3.supercell): if log_level: - print("Generated supercell is inconsistent with " - "that in \"%s\"." % - cell_info['optional_structure_info'][0]) + print( + "Generated supercell is inconsistent with " + 'that in "%s".' % cell_info["optional_structure_info"][0] + ) print_error() sys.exit(1) - if (cell_info['phonopy_yaml'].phonon_supercell is not None and - ph3.phonon_supercell is not None): # noqa E129 - yaml_cell = cell_info['phonopy_yaml'].phonon_supercell.copy() + if ( + cell_info["phonopy_yaml"].phonon_supercell is not None + and ph3.phonon_supercell is not None + ): # noqa E129 + yaml_cell = cell_info["phonopy_yaml"].phonon_supercell.copy() yaml_cell.cell = yaml_cell.cell * d2A if not cells_isclose(yaml_cell, ph3.phonon_supercell): if log_level: - print("Generated phonon supercell is inconsistent with " - "that in \"%s\"." % - cell_info['optional_structure_info'][0]) + print( + "Generated phonon supercell is inconsistent with " + 'that in "%s".' % cell_info["optional_structure_info"][0] + ) print_error() sys.exit(1) -def init_phono3py(settings, - cell_info, - interface_mode, - symprec, - log_level): +def init_phono3py(settings, cell_info, interface_mode, symprec, log_level): """Initialize phono3py and update settings by default values.""" physical_units = get_default_physical_units(interface_mode) - distance_to_A = physical_units['distance_to_A'] + distance_to_A = physical_units["distance_to_A"] # Change unit of lattice parameters to angstrom - unitcell = cell_info['unitcell'].copy() + unitcell = cell_info["unitcell"].copy() if distance_to_A is not None: lattice = unitcell.cell lattice *= distance_to_A @@ -629,11 +661,11 @@ def init_phono3py(settings, phono3py = Phono3py( unitcell, - cell_info['supercell_matrix'], - primitive_matrix=cell_info['primitive_matrix'], - phonon_supercell_matrix=cell_info['phonon_supercell_matrix'], - cutoff_frequency=updated_settings['cutoff_frequency'], - frequency_factor_to_THz=updated_settings['frequency_factor_to_THz'], + cell_info["supercell_matrix"], + primitive_matrix=cell_info["primitive_matrix"], + phonon_supercell_matrix=cell_info["phonon_supercell_matrix"], + cutoff_frequency=updated_settings["cutoff_frequency"], + frequency_factor_to_THz=updated_settings["frequency_factor_to_THz"], is_symmetry=settings.is_symmetry, is_mesh_symmetry=settings.is_mesh_symmetry, use_grg=settings.use_grg, @@ -641,10 +673,11 @@ def init_phono3py(settings, store_dense_svecs=(not settings.emulate_v1), symprec=symprec, calculator=interface_mode, - log_level=log_level) + log_level=log_level, + ) phono3py.masses = settings.masses phono3py.band_indices = settings.band_indices - phono3py.sigmas = updated_settings['sigmas'] + phono3py.sigmas = updated_settings["sigmas"] phono3py.sigma_cutoff = settings.sigma_cutoff_width check_supercell_in_yaml(cell_info, phono3py, distance_to_A, log_level) @@ -655,8 +688,7 @@ def init_phono3py(settings, def settings_to_grid_points(settings, bz_grid): """Read or set grid point indices.""" if settings.grid_addresses is not None: - grid_points = grid_addresses_to_grid_points( - settings.grid_addresses, bz_grid) + grid_points = grid_addresses_to_grid_points(settings.grid_addresses, bz_grid) elif settings.grid_points is not None: grid_points = settings.grid_points else: @@ -666,26 +698,28 @@ def settings_to_grid_points(settings, bz_grid): def grid_addresses_to_grid_points(grid_addresses, bz_grid): """Return grid point indices from grid addresses.""" - grid_points = [get_grid_point_from_address(ga, bz_grid.D_diag) - for ga in grid_addresses] + grid_points = [ + get_grid_point_from_address(ga, bz_grid.D_diag) for ga in grid_addresses + ] return bz_grid.grg2bzg[grid_points] -def store_force_constants(phono3py, - settings, - ph3py_yaml, - physical_units, - input_filename, - output_filename, - load_phono3py_yaml, - log_level): +def store_force_constants( + phono3py, + settings, + ph3py_yaml, + physical_units, + input_filename, + output_filename, + load_phono3py_yaml, + log_level, +): """Calculate, read, and write force constants.""" if load_phono3py_yaml: if log_level: print("-" * 29 + " Force constants " + "-" * 30) - (fc_calculator, - fc_calculator_options) = get_fc_calculator_params(settings) + (fc_calculator, fc_calculator_options) = get_fc_calculator_params(settings) read_fc = set_dataset_and_force_constants( phono3py, @@ -694,7 +728,8 @@ def store_force_constants(phono3py, fc_calculator_options=fc_calculator_options, symmetrize_fc=settings.fc_symmetry, is_compact_fc=settings.is_compact_fc, - log_level=log_level) + log_level=log_level, + ) if log_level: if phono3py.fc3 is None: @@ -705,19 +740,23 @@ def store_force_constants(phono3py, print_error() sys.exit(1) - if not read_fc['fc3']: - write_fc3_to_hdf5(phono3py.fc3, - p2s_map=phono3py.primitive.p2s_map, - compression=settings.hdf5_compression) + if not read_fc["fc3"]: + write_fc3_to_hdf5( + phono3py.fc3, + p2s_map=phono3py.primitive.p2s_map, + compression=settings.hdf5_compression, + ) if log_level: - print("fc3 was written into \"fc3.hdf5\".") - if not read_fc['fc2']: - write_fc2_to_hdf5(phono3py.fc2, - p2s_map=phono3py.primitive.p2s_map, - physical_unit='eV/angstrom^2', - compression=settings.hdf5_compression) + print('fc3 was written into "fc3.hdf5".') + if not read_fc["fc2"]: + write_fc2_to_hdf5( + phono3py.fc2, + p2s_map=phono3py.primitive.p2s_map, + physical_unit="eV/angstrom^2", + compression=settings.hdf5_compression, + ) if log_level: - print("fc2 was written into \"fc2.hdf5\".") + print('fc2 was written into "fc2.hdf5".') else: create_phono3py_force_constants( phono3py, @@ -725,14 +764,17 @@ def store_force_constants(phono3py, ph3py_yaml=ph3py_yaml, input_filename=input_filename, output_filename=output_filename, - log_level=log_level) + log_level=log_level, + ) def run_gruneisen_then_exit(phono3py, settings, output_filename, log_level): """Run mode Grueneisen parameter calculation from fc3.""" - if (settings.mesh_numbers is None and - settings.band_paths is None and - settings.qpoints is None): # noqa E129 + if ( + settings.mesh_numbers is None + and settings.band_paths is None + and settings.qpoints is None + ): # noqa E129 print("An option of --mesh, --band, or --qpoints has to be specified.") if log_level: print_error() @@ -770,18 +812,17 @@ def run_gruneisen_then_exit(phono3py, settings, output_filename, log_level): factor=VaspToTHz, symprec=phono3py.symmetry.tolerance, output_filename=output_filename, - log_level=log_level) + log_level=log_level, + ) if log_level: print_end() sys.exit(0) -def run_jdos_then_exit(phono3py, - settings, - updated_settings, - output_filename, - log_level): +def run_jdos_then_exit( + phono3py, settings, updated_settings, output_filename, log_level +): """Run joint-DOS calculation.""" joint_dos = Phono3pyJointDos( phono3py.phonon_supercell, @@ -790,22 +831,23 @@ def run_jdos_then_exit(phono3py, mesh=settings.mesh_numbers, nac_params=phono3py.nac_params, nac_q_direction=settings.nac_q_direction, - sigmas=updated_settings['sigmas'], - cutoff_frequency=updated_settings['cutoff_frequency'], - frequency_step=updated_settings['frequency_step'], - num_frequency_points=updated_settings['num_frequency_points'], - temperatures=updated_settings['temperature_points'], - frequency_factor_to_THz=updated_settings['frequency_factor_to_THz'], - frequency_scale_factor=updated_settings['frequency_scale_factor'], + sigmas=updated_settings["sigmas"], + cutoff_frequency=updated_settings["cutoff_frequency"], + frequency_step=updated_settings["frequency_step"], + num_frequency_points=updated_settings["num_frequency_points"], + temperatures=updated_settings["temperature_points"], + frequency_factor_to_THz=updated_settings["frequency_factor_to_THz"], + frequency_scale_factor=updated_settings["frequency_scale_factor"], is_mesh_symmetry=settings.is_mesh_symmetry, store_dense_gp_map=settings.store_dense_gp_map, symprec=phono3py.symmetry.tolerance, output_filename=output_filename, - log_level=log_level) + log_level=log_level, + ) if log_level > 0: dm = joint_dos.dynamical_matrix - if (dm.is_nac() and dm.nac_method == 'gonze'): + if dm.is_nac() and dm.nac_method == "gonze": dm.show_Gonze_nac_message() grid_points = settings_to_grid_points(settings, joint_dos.grid) @@ -820,7 +862,7 @@ def run_isotope_then_exit(phono3py, settings, updated_settings, log_level): """Run isotope scattering calculation.""" mass_variances = settings.mass_variances if settings.band_indices is not None: - band_indices = np.hstack(settings.band_indices).astype('intc') + band_indices = np.hstack(settings.band_indices).astype("intc") else: band_indices = None iso = Phono3pyIsotope( @@ -828,21 +870,23 @@ def run_isotope_then_exit(phono3py, settings, updated_settings, log_level): phono3py.phonon_primitive, mass_variances=mass_variances, band_indices=band_indices, - sigmas=updated_settings['sigmas'], - frequency_factor_to_THz=updated_settings['frequency_factor_to_THz'], + sigmas=updated_settings["sigmas"], + frequency_factor_to_THz=updated_settings["frequency_factor_to_THz"], store_dense_gp_map=settings.store_dense_gp_map, symprec=phono3py.symmetry.tolerance, cutoff_frequency=settings.cutoff_frequency, - lapack_zheev_uplo=settings.lapack_zheev_uplo) + lapack_zheev_uplo=settings.lapack_zheev_uplo, + ) iso.init_dynamical_matrix( phono3py.fc2, phono3py.phonon_supercell, phono3py.phonon_primitive, nac_params=phono3py.nac_params, - frequency_scale_factor=updated_settings['frequency_scale_factor']) + frequency_scale_factor=updated_settings["frequency_scale_factor"], + ) if log_level > 0: dm = iso.dynamical_matrix - if (dm.is_nac() and dm.nac_method == 'gonze'): + if dm.is_nac() and dm.nac_method == "gonze": dm.show_Gonze_nac_message() grid_points = settings_to_grid_points(settings, iso.grid) @@ -853,28 +897,23 @@ def run_isotope_then_exit(phono3py, settings, updated_settings, log_level): sys.exit(0) -def init_phph_interaction(phono3py, - settings, - updated_settings, - input_filename, - output_filename, - log_level): +def init_phph_interaction( + phono3py, settings, updated_settings, input_filename, output_filename, log_level +): """Initialize ph-ph interaction and phonons on grid.""" if log_level: sys.stdout.write("Generating grid system ... ") sys.stdout.flush() phono3py.mesh_numbers = settings.mesh_numbers bz_grid = phono3py.grid - identity = np.eye(3, dtype='int_') - not_grg = ((bz_grid.P == identity).all() and - (bz_grid.Q == identity).all()) + identity = np.eye(3, dtype="int_") + not_grg = (bz_grid.P == identity).all() and (bz_grid.Q == identity).all() if log_level: if not_grg: print("[ %d %d %d ]" % tuple(phono3py.mesh_numbers)) else: print("") - print("Generalized regular grid: [ %d %d %d ]" - % tuple(bz_grid.D_diag)) + print("Generalized regular grid: [ %d %d %d ]" % tuple(bz_grid.D_diag)) print("Grid generation matrix:") print(" [ %d %d %d ]" % tuple(bz_grid.grid_matrix[0])) print(" [ %d %d %d ]" % tuple(bz_grid.grid_matrix[1])) @@ -884,15 +923,16 @@ def init_phph_interaction(phono3py, phono3py.init_phph_interaction( nac_q_direction=settings.nac_q_direction, constant_averaged_interaction=ave_pp, - frequency_scale_factor=updated_settings['frequency_scale_factor'], + frequency_scale_factor=updated_settings["frequency_scale_factor"], symmetrize_fc3q=settings.is_symmetrize_fc3_q, - lapack_zheev_uplo=settings.lapack_zheev_uplo) + lapack_zheev_uplo=settings.lapack_zheev_uplo, + ) if not settings.read_phonon: if log_level: print("-" * 27 + " Phonon calculations " + "-" * 28) dm = phono3py.dynamical_matrix - if (dm.is_nac() and dm.nac_method == 'gonze'): + if dm.is_nac() and dm.nac_method == "gonze": dm.show_nac_message() print("Running harmonic phonon calculations...") sys.stdout.flush() @@ -906,10 +946,11 @@ def init_phph_interaction(phono3py, grid_address, phono3py.mesh_numbers, compression=settings.hdf5_compression, - filename=output_filename) + filename=output_filename, + ) if filename: if log_level: - print("Phonons are written into \"%s\"." % filename) + print('Phonons are written into "%s".' % filename) else: print("Writing phonons failed.") if log_level: @@ -917,9 +958,9 @@ def init_phph_interaction(phono3py, sys.exit(1) if settings.read_phonon: - phonons = read_phonon_from_hdf5(phono3py.mesh_numbers, - filename=input_filename, - verbose=(log_level > 0)) + phonons = read_phonon_from_hdf5( + phono3py.mesh_numbers, filename=input_filename, verbose=(log_level > 0) + ) if phonons is None: print("Reading phonons failed.") if log_level: @@ -936,9 +977,9 @@ def init_phph_interaction(phono3py, def main(**argparse_control): """Phono3py main part of command line interface.""" - import warnings + # import warnings # warnings.simplefilter('error') - load_phono3py_yaml = argparse_control.get('load_phono3py_yaml', False) + load_phono3py_yaml = argparse_control.get("load_phono3py_yaml", False) args, log_level = start_phono3py(**argparse_control) physical_units = get_default_physical_units(get_interface_mode(vars(args))) @@ -947,17 +988,18 @@ def main(**argparse_control): input_filename = None output_filename = None else: - (input_filename, - output_filename) = get_input_output_filenames_from_args(args) + (input_filename, output_filename) = get_input_output_filenames_from_args(args) settings, confs, cell_filename = read_phono3py_settings( - args, argparse_control, log_level) + args, argparse_control, log_level + ) if args.force_sets_to_forces_fc2_mode: create_FORCES_FC2_from_FORCE_SETS_then_exit(log_level) if args.force_sets_mode: create_FORCE_SETS_from_FORCES_FCx_then_exit( - settings.phonon_supercell_matrix, input_filename, log_level) + settings.phonon_supercell_matrix, input_filename, log_level + ) if args.write_grid_points: run_mode = "write_grid_info" elif args.show_num_triplets: @@ -973,7 +1015,8 @@ def main(**argparse_control): # Create FORCES_FC3 and FORCES_FC2 # #################################### create_FORCES_FC3_and_FORCES_FC2_then_exit( - settings, input_filename, output_filename, log_level) + settings, input_filename, output_filename, log_level + ) ########################################################### # Symmetry tolerance. Distance unit depends on interface. # @@ -984,8 +1027,8 @@ def main(**argparse_control): symprec = settings.symmetry_tolerance cell_info = get_cell_info(settings, cell_filename, symprec, log_level) - unitcell_filename = cell_info['optional_structure_info'][0] - interface_mode = cell_info['interface_mode'] + unitcell_filename = cell_info["optional_structure_info"][0] + interface_mode = cell_info["interface_mode"] # ph3py_yaml = cell_info['phonopy_yaml'] if run_mode is None: @@ -1001,13 +1044,16 @@ def main(**argparse_control): symprec, output_filename=output_filename, interface_mode=interface_mode, - log_level=log_level) + log_level=log_level, + ) - finalize_phono3py(phono3py, - confs, - log_level, - displacements_mode=True, - filename="phono3py_disp.yaml") + finalize_phono3py( + phono3py, + confs, + log_level, + displacements_mode=True, + filename="phono3py_disp.yaml", + ) ####################### # Initialize phono3py # @@ -1017,40 +1063,46 @@ def main(**argparse_control): # 'frequency_factor_to_THz', 'num_frequency_points', # 'frequency_step', 'frequency_scale_factor', # 'cutoff_frequency') - phono3py, updated_settings = init_phono3py(settings, - cell_info, - interface_mode, - symprec, - log_level) + phono3py, updated_settings = init_phono3py( + settings, cell_info, interface_mode, symprec, log_level + ) ################################################# # Show phono3py settings and crystal structures # ################################################# if log_level: - show_general_settings(settings, - run_mode, - phono3py, - unitcell_filename, - input_filename, - output_filename) + show_general_settings( + settings, + run_mode, + phono3py, + unitcell_filename, + input_filename, + output_filename, + ) if log_level > 1: show_phono3py_cells(phono3py, settings) else: - print("Spacegroup: %s" % - phono3py.symmetry.get_international_table()) - print("Use -v option to watch primitive cell, unit cell, " - "and supercell structures.") + print("Spacegroup: %s" % phono3py.symmetry.get_international_table()) + print( + "Use -v option to watch primitive cell, unit cell, " + "and supercell structures." + ) ################## # Check settings # ################## - run_modes_with_mesh = ("conductivity-RTA", "conductivity-LBTE", - "imag_self_energy", "real_self_energy", - "jdos", "isotope", - "write_grid_info", "show_triplets_info") - run_modes_with_gp = ("imag_self_energy", "real_self_energy", - "jdos", "isotope") + run_modes_with_mesh = ( + "conductivity-RTA", + "conductivity-LBTE", + "imag_self_energy", + "real_self_energy", + "jdos", + "isotope", + "write_grid_info", + "show_triplets_info", + ) + run_modes_with_gp = ("imag_self_energy", "real_self_energy", "jdos", "isotope") if settings.mesh_numbers is None and run_mode in run_modes_with_mesh: print("") print("Mesh numbers have to be specified.") @@ -1059,9 +1111,11 @@ def main(**argparse_control): print_error() sys.exit(1) - if (run_mode in run_modes_with_gp and - settings.grid_points is None and - settings.grid_addresses is None): # noqa E129 + if ( + run_mode in run_modes_with_gp + and settings.grid_points is None + and settings.grid_addresses is None + ): # noqa E129 print("") print("Grid point(s) has to be specified.") print("") @@ -1074,15 +1128,16 @@ def main(**argparse_control): ######################################################### if run_mode == "write_grid_info": phono3py.mesh_numbers = settings.mesh_numbers - write_grid_points(phono3py.primitive, - phono3py.grid, - band_indices=settings.band_indices, - sigmas=updated_settings['sigmas'], - temperatures=updated_settings['temperatures'], - is_kappa_star=settings.is_kappa_star, - is_lbte=(settings.write_collision or - settings.is_lbte), - compression=settings.hdf5_compression) + write_grid_points( + phono3py.primitive, + phono3py.grid, + band_indices=settings.band_indices, + sigmas=updated_settings["sigmas"], + temperatures=updated_settings["temperatures"], + is_kappa_star=settings.is_kappa_star, + is_lbte=(settings.write_collision or settings.is_lbte), + compression=settings.hdf5_compression, + ) if log_level: print_end() @@ -1094,11 +1149,13 @@ def main(**argparse_control): if run_mode == "show_triplets_info": phono3py.mesh_numbers = settings.mesh_numbers grid_points = settings_to_grid_points(settings, phono3py.grid) - show_num_triplets(phono3py.primitive, - phono3py.grid, - band_indices=settings.band_indices, - grid_points=grid_points, - is_kappa_star=settings.is_kappa_star) + show_num_triplets( + phono3py.primitive, + phono3py.grid, + band_indices=settings.band_indices, + grid_points=grid_points, + is_kappa_star=settings.is_kappa_star, + ) if log_level: print_end() @@ -1107,25 +1164,29 @@ def main(**argparse_control): ################################## # Non-analytical term correction # ################################## - store_nac_params(phono3py, - settings, - cell_info['phonopy_yaml'], - unitcell_filename, - log_level, - nac_factor=Hartree * Bohr, - load_phonopy_yaml=load_phono3py_yaml) + store_nac_params( + phono3py, + settings, + cell_info["phonopy_yaml"], + unitcell_filename, + log_level, + nac_factor=Hartree * Bohr, + load_phonopy_yaml=load_phono3py_yaml, + ) ################### # Force constants # ################### - store_force_constants(phono3py, - settings, - cell_info['phonopy_yaml'], - physical_units, - input_filename, - output_filename, - load_phono3py_yaml, - log_level) + store_force_constants( + phono3py, + settings, + cell_info["phonopy_yaml"], + physical_units, + input_filename, + output_filename, + load_phono3py_yaml, + log_level, + ) ############################################ # Phonon Gruneisen parameter and then exit # @@ -1143,17 +1204,16 @@ def main(**argparse_control): # Joint DOS and then exit # ########################### if run_mode == "jdos": - run_jdos_then_exit(phono3py, - settings, - updated_settings, - output_filename, - log_level) + run_jdos_then_exit( + phono3py, settings, updated_settings, output_filename, log_level + ) ################################################ # Mass variances for phonon-isotope scattering # ################################################ if settings.is_isotope and settings.mass_variances is None: from phonopy.structure.atoms import isotope_data + symbols = phono3py.phonon_primitive.symbols in_database = True for s in set(symbols): @@ -1177,12 +1237,14 @@ def main(**argparse_control): # Initialize phonon-phonon interaction # ######################################## if run_mode is not None: - init_phph_interaction(phono3py, - settings, - updated_settings, - input_filename, - output_filename, - log_level) + init_phph_interaction( + phono3py, + settings, + updated_settings, + input_filename, + output_filename, + log_level, + ) ####################################################### # Run imaginary part of self energy of bubble diagram # @@ -1190,13 +1252,14 @@ def main(**argparse_control): if run_mode == "imag_self_energy": phono3py.run_imag_self_energy( settings_to_grid_points(settings, phono3py.grid), - updated_settings['temperature_points'], - frequency_step=updated_settings['frequency_step'], - num_frequency_points=updated_settings['num_frequency_points'], + updated_settings["temperature_points"], + frequency_step=updated_settings["frequency_step"], + num_frequency_points=updated_settings["num_frequency_points"], scattering_event_class=settings.scattering_event_class, write_txt=True, write_gamma_detail=settings.write_gamma_detail, - output_filename=output_filename) + output_filename=output_filename, + ) ##################################################### # Run frequency shift calculation of bubble diagram # @@ -1204,12 +1267,13 @@ def main(**argparse_control): elif run_mode == "real_self_energy": phono3py.run_real_self_energy( settings_to_grid_points(settings, phono3py.grid), - updated_settings['temperature_points'], - frequency_step=updated_settings['frequency_step'], - num_frequency_points=updated_settings['num_frequency_points'], + updated_settings["temperature_points"], + frequency_step=updated_settings["frequency_step"], + num_frequency_points=updated_settings["num_frequency_points"], write_txt=True, write_hdf5=True, - output_filename=output_filename) + output_filename=output_filename, + ) ####################################################### # Run spectral function calculation of bubble diagram # @@ -1217,13 +1281,14 @@ def main(**argparse_control): elif run_mode == "spectral_function": phono3py.run_spectral_function( settings_to_grid_points(settings, phono3py.grid), - updated_settings['temperature_points'], - frequency_step=updated_settings['frequency_step'], - num_frequency_points=updated_settings['num_frequency_points'], - num_points_in_batch=updated_settings['num_points_in_batch'], + updated_settings["temperature_points"], + frequency_step=updated_settings["frequency_step"], + num_frequency_points=updated_settings["num_frequency_points"], + num_points_in_batch=updated_settings["num_points_in_batch"], write_txt=True, write_hdf5=True, - output_filename=output_filename) + output_filename=output_filename, + ) #################################### # Run lattice thermal conductivity # @@ -1232,14 +1297,13 @@ def main(**argparse_control): grid_points = settings_to_grid_points(settings, phono3py.grid) phono3py.run_thermal_conductivity( is_LBTE=settings.is_lbte, - temperatures=updated_settings['temperatures'], + temperatures=updated_settings["temperatures"], is_isotope=settings.is_isotope, mass_variances=settings.mass_variances, grid_points=grid_points, boundary_mfp=settings.boundary_mfp, solve_collective_phonon=settings.solve_collective_phonon, use_ave_pp=settings.use_ave_pp, - gamma_unit_conversion=settings.gamma_conversion_factor, is_reducible_collision_matrix=settings.is_reducible_collision_matrix, # noqa E501 is_kappa_star=settings.is_kappa_star, gv_delta_q=settings.group_velocity_delta_q, @@ -1258,11 +1322,14 @@ def main(**argparse_control): write_LBTE_solution=settings.write_LBTE_solution, compression=settings.hdf5_compression, input_filename=input_filename, - output_filename=output_filename) + output_filename=output_filename, + ) else: if log_level: - print("-" * 11 + - " None of ph-ph interaction calculation was performed. " + - "-" * 11) + print( + "-" * 11 + + " None of ph-ph interaction calculation was performed. " + + "-" * 11 + ) finalize_phono3py(phono3py, confs, log_level) diff --git a/phono3py/cui/settings.py b/phono3py/cui/settings.py index c502e73a..3bd1af75 100644 --- a/phono3py/cui/settings.py +++ b/phono3py/cui/settings.py @@ -42,61 +42,60 @@ class Phono3pySettings(Settings): _default = { # In micrometre. The default value is just set to avoid divergence. - 'boundary_mfp': 1.0e6, - 'constant_averaged_pp_interaction': None, - 'create_forces_fc2': None, - 'create_forces_fc3': None, - 'create_forces_fc3_file': None, - 'cutoff_fc3_distance': None, - 'cutoff_pair_distance': None, - 'gamma_conversion_factor': None, - 'grid_addresses': None, - 'grid_points': None, - 'ion_clamped': False, - 'is_bterta': False, - 'is_compact_fc': False, - 'is_full_pp': False, - 'is_gruneisen': False, - 'is_imag_self_energy': False, - 'is_isotope': False, - 'is_joint_dos': False, - 'is_kappa_star': True, - 'is_lbte': False, - 'is_N_U': False, - 'is_real_self_energy': False, - 'is_reducible_collision_matrix': False, - 'is_spectral_function': False, - 'is_symmetrize_fc2': False, - 'is_symmetrize_fc3_q': False, - 'is_symmetrize_fc3_r': False, - 'is_tetrahedron_method': False, - 'lapack_zheev_uplo': 'L', - 'mass_variances': None, - 'max_freepath': None, - 'num_points_in_batch': None, - 'read_collision': None, - 'read_fc2': False, - 'read_fc3': False, - 'read_gamma': False, - 'read_phonon': False, - 'read_pp': False, - 'phonon_supercell_matrix': None, - 'pinv_cutoff': 1.0e-8, - 'pinv_solver': 0, - 'pp_conversion_factor': None, - 'scattering_event_class': None, # scattering event class 1 or 2 - 'sigma_cutoff_width': None, - 'solve_collective_phonon': False, - 'emulate_v1': False, - 'subtract_forces': None, - 'use_ave_pp': False, - 'use_grg': False, - 'write_collision': False, - 'write_gamma_detail': False, - 'write_gamma': False, - 'write_phonon': False, - 'write_pp': False, - 'write_LBTE_solution': False + "boundary_mfp": 1.0e6, + "constant_averaged_pp_interaction": None, + "create_forces_fc2": None, + "create_forces_fc3": None, + "create_forces_fc3_file": None, + "cutoff_fc3_distance": None, + "cutoff_pair_distance": None, + "grid_addresses": None, + "grid_points": None, + "ion_clamped": False, + "is_bterta": False, + "is_compact_fc": False, + "is_full_pp": False, + "is_gruneisen": False, + "is_imag_self_energy": False, + "is_isotope": False, + "is_joint_dos": False, + "is_kappa_star": True, + "is_lbte": False, + "is_N_U": False, + "is_real_self_energy": False, + "is_reducible_collision_matrix": False, + "is_spectral_function": False, + "is_symmetrize_fc2": False, + "is_symmetrize_fc3_q": False, + "is_symmetrize_fc3_r": False, + "is_tetrahedron_method": False, + "lapack_zheev_uplo": "L", + "mass_variances": None, + "max_freepath": None, + "num_points_in_batch": None, + "read_collision": None, + "read_fc2": False, + "read_fc3": False, + "read_gamma": False, + "read_phonon": False, + "read_pp": False, + "phonon_supercell_matrix": None, + "pinv_cutoff": 1.0e-8, + "pinv_solver": 0, + "pp_conversion_factor": None, + "scattering_event_class": None, # scattering event class 1 or 2 + "sigma_cutoff_width": None, + "solve_collective_phonon": False, + "emulate_v1": False, + "subtract_forces": None, + "use_ave_pp": False, + "use_grg": False, + "write_collision": False, + "write_gamma_detail": False, + "write_gamma": False, + "write_phonon": False, + "write_pp": False, + "write_LBTE_solution": False, } def __init__(self, default=None): @@ -112,219 +111,215 @@ class Phono3pySettings(Settings): def set_boundary_mfp(self, val): """Set boundary_mfp.""" - self._v['boundary_mfp'] = val + self._v["boundary_mfp"] = val def set_constant_averaged_pp_interaction(self, val): """Set constant_averaged_pp_interaction.""" - self._v['constant_averaged_pp_interaction'] = val + self._v["constant_averaged_pp_interaction"] = val def set_create_forces_fc2(self, val): """Set create_forces_fc2.""" - self._v['create_forces_fc2'] = val + self._v["create_forces_fc2"] = val def set_create_forces_fc3(self, val): """Set create_forces_fc3.""" - self._v['create_forces_fc3'] = val + self._v["create_forces_fc3"] = val def set_create_forces_fc3_file(self, val): """Set create_forces_fc3_file.""" - self._v['create_forces_fc3_file'] = val + self._v["create_forces_fc3_file"] = val def set_cutoff_fc3_distance(self, val): """Set cutoff_fc3_distance.""" - self._v['cutoff_fc3_distance'] = val + self._v["cutoff_fc3_distance"] = val def set_cutoff_pair_distance(self, val): """Set cutoff_pair_distance.""" - self._v['cutoff_pair_distance'] = val + self._v["cutoff_pair_distance"] = val def set_emulate_v1(self, val): """Set emulate_v1.""" - self._v['emulate_v1'] = val - - def set_gamma_conversion_factor(self, val): - """Set gamma_conversion_factor.""" - self._v['gamma_conversion_factor'] = val + self._v["emulate_v1"] = val def set_grid_addresses(self, val): """Set grid_addresses.""" - self._v['grid_addresses'] = val + self._v["grid_addresses"] = val def set_grid_points(self, val): """Set grid_points.""" - self._v['grid_points'] = val + self._v["grid_points"] = val def set_ion_clamped(self, val): """Set ion_clamped.""" - self._v['ion_clamped'] = val + self._v["ion_clamped"] = val def set_is_bterta(self, val): """Set is_bterta.""" - self._v['is_bterta'] = val + self._v["is_bterta"] = val def set_is_compact_fc(self, val): """Set is_compact_fc.""" - self._v['is_compact_fc'] = val + self._v["is_compact_fc"] = val def set_is_full_pp(self, val): """Set is_full_pp.""" - self._v['is_full_pp'] = val + self._v["is_full_pp"] = val def set_is_gruneisen(self, val): """Set is_gruneisen.""" - self._v['is_gruneisen'] = val + self._v["is_gruneisen"] = val def set_is_imag_self_energy(self, val): """Set is_imag_self_energy.""" - self._v['is_imag_self_energy'] = val + self._v["is_imag_self_energy"] = val def set_is_isotope(self, val): """Set is_isotope.""" - self._v['is_isotope'] = val + self._v["is_isotope"] = val def set_is_joint_dos(self, val): """Set is_joint_dos.""" - self._v['is_joint_dos'] = val + self._v["is_joint_dos"] = val def set_is_kappa_star(self, val): """Set is_kappa_star.""" - self._v['is_kappa_star'] = val + self._v["is_kappa_star"] = val def set_is_lbte(self, val): """Set is_lbte.""" - self._v['is_lbte'] = val + self._v["is_lbte"] = val def set_is_N_U(self, val): """Set is_N_U.""" - self._v['is_N_U'] = val + self._v["is_N_U"] = val def set_is_real_self_energy(self, val): """Set is_real_self_energy.""" - self._v['is_real_self_energy'] = val + self._v["is_real_self_energy"] = val def set_is_reducible_collision_matrix(self, val): """Set is_reducible_collision_matrix.""" - self._v['is_reducible_collision_matrix'] = val + self._v["is_reducible_collision_matrix"] = val def set_is_spectral_function(self, val): """Set is_spectral_function.""" - self._v['is_spectral_function'] = val + self._v["is_spectral_function"] = val def set_is_symmetrize_fc2(self, val): """Set is_symmetrize_fc2.""" - self._v['is_symmetrize_fc2'] = val + self._v["is_symmetrize_fc2"] = val def set_is_symmetrize_fc3_q(self, val): """Set is_symmetrize_fc3_q.""" - self._v['is_symmetrize_fc3_q'] = val + self._v["is_symmetrize_fc3_q"] = val def set_is_symmetrize_fc3_r(self, val): """Set is_symmetrize_fc3_r.""" - self._v['is_symmetrize_fc3_r'] = val + self._v["is_symmetrize_fc3_r"] = val def set_lapack_zheev_uplo(self, val): """Set lapack_zheev_uplo.""" - self._v['lapack_zheev_uplo'] = val + self._v["lapack_zheev_uplo"] = val def set_mass_variances(self, val): """Set mass_variances.""" - self._v['mass_variances'] = val + self._v["mass_variances"] = val def set_max_freepath(self, val): """Set max_freepath.""" - self._v['max_freepath'] = val + self._v["max_freepath"] = val def set_num_points_in_batch(self, val): """Set num_points_in_batch.""" - self._v['num_points_in_batch'] = val + self._v["num_points_in_batch"] = val def set_phonon_supercell_matrix(self, val): """Set phonon_supercell_matrix.""" - self._v['phonon_supercell_matrix'] = val + self._v["phonon_supercell_matrix"] = val def set_pinv_cutoff(self, val): """Set pinv_cutoff.""" - self._v['pinv_cutoff'] = val + self._v["pinv_cutoff"] = val def set_pinv_solver(self, val): """Set pinv_solver.""" - self._v['pinv_solver'] = val + self._v["pinv_solver"] = val def set_pp_conversion_factor(self, val): """Set pp_conversion_factor.""" - self._v['pp_conversion_factor'] = val + self._v["pp_conversion_factor"] = val def set_read_collision(self, val): """Set read_collision.""" - self._v['read_collision'] = val + self._v["read_collision"] = val def set_read_fc2(self, val): """Set read_fc2.""" - self._v['read_fc2'] = val + self._v["read_fc2"] = val def set_read_fc3(self, val): """Set read_fc3.""" - self._v['read_fc3'] = val + self._v["read_fc3"] = val def set_read_gamma(self, val): """Set read_gamma.""" - self._v['read_gamma'] = val + self._v["read_gamma"] = val def set_read_phonon(self, val): """Set read_phonon.""" - self._v['read_phonon'] = val + self._v["read_phonon"] = val def set_read_pp(self, val): """Set read_pp.""" - self._v['read_pp'] = val + self._v["read_pp"] = val def set_scattering_event_class(self, val): """Set scattering_event_class.""" - self._v['scattering_event_class'] = val + self._v["scattering_event_class"] = val def set_sigma_cutoff_width(self, val): """Set sigma_cutoff_width.""" - self._v['sigma_cutoff_width'] = val + self._v["sigma_cutoff_width"] = val def set_solve_collective_phonon(self, val): """Set solve_collective_phonon.""" - self._v['solve_collective_phonon'] = val + self._v["solve_collective_phonon"] = val def set_subtract_forces(self, val): """Set subtract_forces.""" - self._v['subtract_forces'] = val + self._v["subtract_forces"] = val def set_use_ave_pp(self, val): """Set use_ave_pp.""" - self._v['use_ave_pp'] = val + self._v["use_ave_pp"] = val def set_use_grg(self, val): """Set use_grg.""" - self._v['use_grg'] = val + self._v["use_grg"] = val def set_write_collision(self, val): """Set write_collision.""" - self._v['write_collision'] = val + self._v["write_collision"] = val def set_write_gamma_detail(self, val): """Set write_gamma_detail.""" - self._v['write_gamma_detail'] = val + self._v["write_gamma_detail"] = val def set_write_gamma(self, val): """Set write_gamma.""" - self._v['write_gamma'] = val + self._v["write_gamma"] = val def set_write_phonon(self, val): """Set write_phonon.""" - self._v['write_phonon'] = val + self._v["write_phonon"] = val def set_write_pp(self, val): """Set write_pp.""" - self._v['write_pp'] = val + self._v["write_pp"] = val def set_write_LBTE_solution(self, val): """Set write_LBTE_solution.""" - self._v['write_LBTE_solution'] = val + self._v["write_LBTE_solution"] = val class Phono3pyConfParser(ConfParser): @@ -350,237 +345,232 @@ class Phono3pyConfParser(ConfParser): def _read_options(self): ConfParser.read_options(self) # store data in self._confs - if 'phonon_supercell_dimension' in self._args: + if "phonon_supercell_dimension" in self._args: dim_fc2 = self._args.phonon_supercell_dimension if dim_fc2 is not None: - self._confs['dim_fc2'] = " ".join(dim_fc2) + self._confs["dim_fc2"] = " ".join(dim_fc2) - if 'boundary_mfp' in self._args: + if "boundary_mfp" in self._args: if self._args.boundary_mfp is not None: - self._confs['boundary_mfp'] = self._args.boundary_mfp + self._confs["boundary_mfp"] = self._args.boundary_mfp - if 'const_ave_pp' in self._args: + if "const_ave_pp" in self._args: const_ave_pp = self._args.const_ave_pp if const_ave_pp is not None: - self._confs['const_ave_pp'] = const_ave_pp + self._confs["const_ave_pp"] = const_ave_pp - if 'create_forces_fc2' in self._args: + if "create_forces_fc2" in self._args: if self._args.create_forces_fc2: - self._confs['create_forces_fc2'] = self._args.create_forces_fc2 + self._confs["create_forces_fc2"] = self._args.create_forces_fc2 - if 'create_forces_fc3' in self._args: + if "create_forces_fc3" in self._args: if self._args.create_forces_fc3: - self._confs['create_forces_fc3'] = self._args.create_forces_fc3 + self._confs["create_forces_fc3"] = self._args.create_forces_fc3 - if 'create_forces_fc3_file' in self._args: + if "create_forces_fc3_file" in self._args: if self._args.create_forces_fc3_file: cfc3_file = self._args.create_forces_fc3_file - self._confs['create_forces_fc3_file'] = cfc3_file + self._confs["create_forces_fc3_file"] = cfc3_file - if 'cutoff_fc3_distance' in self._args: + if "cutoff_fc3_distance" in self._args: cutoff_fc3 = self._args.cutoff_fc3_distance if cutoff_fc3 is not None: - self._confs['cutoff_fc3_distance'] = cutoff_fc3 + self._confs["cutoff_fc3_distance"] = cutoff_fc3 - if 'cutoff_pair_distance' in self._args: + if "cutoff_pair_distance" in self._args: cutoff_pair = self._args.cutoff_pair_distance if cutoff_pair is not None: - self._confs['cutoff_pair_distance'] = cutoff_pair + self._confs["cutoff_pair_distance"] = cutoff_pair - if 'gamma_conversion_factor' in self._args: - g_conv_factor = self._args.gamma_conversion_factor - if g_conv_factor is not None: - self._confs['gamma_conversion_factor'] = g_conv_factor - - if 'grid_addresses' in self._args: + if "grid_addresses" in self._args: grid_adrs = self._args.grid_addresses if grid_adrs is not None: - self._confs['grid_addresses'] = " ".join(grid_adrs) + self._confs["grid_addresses"] = " ".join(grid_adrs) - if 'grid_points' in self._args: + if "grid_points" in self._args: if self._args.grid_points is not None: - self._confs['grid_points'] = " ".join(self._args.grid_points) + self._confs["grid_points"] = " ".join(self._args.grid_points) - if 'ion_clamped' in self._args: + if "ion_clamped" in self._args: if self._args.ion_clamped: - self._confs['ion_clamped'] = '.true.' + self._confs["ion_clamped"] = ".true." - if 'is_bterta' in self._args: + if "is_bterta" in self._args: if self._args.is_bterta: - self._confs['bterta'] = '.true.' + self._confs["bterta"] = ".true." - if 'is_compact_fc' in self._args: + if "is_compact_fc" in self._args: if self._args.is_compact_fc: - self._confs['compact_fc'] = '.true.' + self._confs["compact_fc"] = ".true." - if 'emulate_v1' in self._args: + if "emulate_v1" in self._args: if self._args.emulate_v1: - self._confs['emulate_v1'] = '.true.' + self._confs["emulate_v1"] = ".true." - if 'is_gruneisen' in self._args: + if "is_gruneisen" in self._args: if self._args.is_gruneisen: - self._confs['gruneisen'] = '.true.' + self._confs["gruneisen"] = ".true." - if 'is_full_pp' in self._args: + if "is_full_pp" in self._args: if self._args.is_full_pp: - self._confs['full_pp'] = '.true.' + self._confs["full_pp"] = ".true." - if 'is_imag_self_energy' in self._args: + if "is_imag_self_energy" in self._args: if self._args.is_imag_self_energy: - self._confs['imag_self_energy'] = '.true.' + self._confs["imag_self_energy"] = ".true." - if 'is_isotope' in self._args: + if "is_isotope" in self._args: if self._args.is_isotope: - self._confs['isotope'] = '.true.' + self._confs["isotope"] = ".true." - if 'is_joint_dos' in self._args: + if "is_joint_dos" in self._args: if self._args.is_joint_dos: - self._confs['joint_dos'] = '.true.' + self._confs["joint_dos"] = ".true." - if 'no_kappa_stars' in self._args: + if "no_kappa_stars" in self._args: if self._args.no_kappa_stars: - self._confs['kappa_star'] = '.false.' + self._confs["kappa_star"] = ".false." - if 'is_lbte' in self._args: + if "is_lbte" in self._args: if self._args.is_lbte: - self._confs['lbte'] = '.true.' + self._confs["lbte"] = ".true." - if 'is_N_U' in self._args: + if "is_N_U" in self._args: if self._args.is_N_U: - self._confs['N_U'] = '.true.' + self._confs["N_U"] = ".true." - if 'is_real_self_energy' in self._args: + if "is_real_self_energy" in self._args: if self._args.is_real_self_energy: - self._confs['real_self_energy'] = '.true.' + self._confs["real_self_energy"] = ".true." - if 'is_reducible_collision_matrix' in self._args: + if "is_reducible_collision_matrix" in self._args: if self._args.is_reducible_collision_matrix: - self._confs['reducible_collision_matrix'] = '.true.' + self._confs["reducible_collision_matrix"] = ".true." - if 'is_spectral_function' in self._args: + if "is_spectral_function" in self._args: if self._args.is_spectral_function: - self._confs['spectral_function'] = '.true.' + self._confs["spectral_function"] = ".true." - if 'is_symmetrize_fc2' in self._args: + if "is_symmetrize_fc2" in self._args: if self._args.is_symmetrize_fc2: - self._confs['symmetrize_fc2'] = '.true.' + self._confs["symmetrize_fc2"] = ".true." - if 'is_symmetrize_fc3_q' in self._args: + if "is_symmetrize_fc3_q" in self._args: if self._args.is_symmetrize_fc3_q: - self._confs['symmetrize_fc3_q'] = '.true.' + self._confs["symmetrize_fc3_q"] = ".true." - if 'is_symmetrize_fc3_r' in self._args: + if "is_symmetrize_fc3_r" in self._args: if self._args.is_symmetrize_fc3_r: - self._confs['symmetrize_fc3_r'] = '.true.' + self._confs["symmetrize_fc3_r"] = ".true." - if 'is_tetrahedron_method' in self._args: + if "is_tetrahedron_method" in self._args: if self._args.is_tetrahedron_method: - self._confs['tetrahedron'] = '.true.' + self._confs["tetrahedron"] = ".true." - if 'lapack_zheev_uplo' in self._args: + if "lapack_zheev_uplo" in self._args: if self._args.lapack_zheev_uplo is not None: - self._confs['lapack_zheev_uplo'] = self._args.lapack_zheev_uplo + self._confs["lapack_zheev_uplo"] = self._args.lapack_zheev_uplo - if 'mass_variances' in self._args: + if "mass_variances" in self._args: mass_variances = self._args.mass_variances if mass_variances is not None: - self._confs['mass_variances'] = " ".join(mass_variances) + self._confs["mass_variances"] = " ".join(mass_variances) - if 'max_freepath' in self._args: + if "max_freepath" in self._args: if self._args.max_freepath is not None: - self._confs['max_freepath'] = self._args.max_freepath + self._confs["max_freepath"] = self._args.max_freepath - if 'num_points_in_batch' in self._args: + if "num_points_in_batch" in self._args: num_points_in_batch = self._args.num_points_in_batch if num_points_in_batch is not None: - self._confs['num_points_in_batch'] = num_points_in_batch + self._confs["num_points_in_batch"] = num_points_in_batch - if 'pinv_cutoff' in self._args: + if "pinv_cutoff" in self._args: if self._args.pinv_cutoff is not None: - self._confs['pinv_cutoff'] = self._args.pinv_cutoff + self._confs["pinv_cutoff"] = self._args.pinv_cutoff - if 'pinv_solver' in self._args: + if "pinv_solver" in self._args: if self._args.pinv_solver is not None: - self._confs['pinv_solver'] = self._args.pinv_solver + self._confs["pinv_solver"] = self._args.pinv_solver - if 'pp_conversion_factor' in self._args: + if "pp_conversion_factor" in self._args: pp_conv_factor = self._args.pp_conversion_factor if pp_conv_factor is not None: - self._confs['pp_conversion_factor'] = pp_conv_factor + self._confs["pp_conversion_factor"] = pp_conv_factor - if 'read_fc2' in self._args: + if "read_fc2" in self._args: if self._args.read_fc2: - self._confs['read_fc2'] = '.true.' + self._confs["read_fc2"] = ".true." - if 'read_fc3' in self._args: + if "read_fc3" in self._args: if self._args.read_fc3: - self._confs['read_fc3'] = '.true.' + self._confs["read_fc3"] = ".true." - if 'read_gamma' in self._args: + if "read_gamma" in self._args: if self._args.read_gamma: - self._confs['read_gamma'] = '.true.' + self._confs["read_gamma"] = ".true." - if 'read_phonon' in self._args: + if "read_phonon" in self._args: if self._args.read_phonon: - self._confs['read_phonon'] = '.true.' + self._confs["read_phonon"] = ".true." - if 'read_pp' in self._args: + if "read_pp" in self._args: if self._args.read_pp: - self._confs['read_pp'] = '.true.' + self._confs["read_pp"] = ".true." - if 'read_collision' in self._args: + if "read_collision" in self._args: if self._args.read_collision is not None: - self._confs['read_collision'] = self._args.read_collision + self._confs["read_collision"] = self._args.read_collision - if 'scattering_event_class' in self._args: + if "scattering_event_class" in self._args: scatt_class = self._args.scattering_event_class if scatt_class is not None: - self._confs['scattering_event_class'] = scatt_class + self._confs["scattering_event_class"] = scatt_class - if 'sigma_cutoff_width' in self._args: + if "sigma_cutoff_width" in self._args: sigma_cutoff = self._args.sigma_cutoff_width if sigma_cutoff is not None: - self._confs['sigma_cutoff_width'] = sigma_cutoff + self._confs["sigma_cutoff_width"] = sigma_cutoff - if 'solve_collective_phonon' in self._args: + if "solve_collective_phonon" in self._args: if self._args.solve_collective_phonon: - self._confs['collective_phonon'] = '.true.' + self._confs["collective_phonon"] = ".true." - if 'subtract_forces' in self._args: + if "subtract_forces" in self._args: if self._args.subtract_forces: - self._confs['subtract_forces'] = self._args.subtract_forces + self._confs["subtract_forces"] = self._args.subtract_forces - if 'use_ave_pp' in self._args: + if "use_ave_pp" in self._args: if self._args.use_ave_pp: - self._confs['use_ave_pp'] = '.true.' + self._confs["use_ave_pp"] = ".true." - if 'use_grg' in self._args: + if "use_grg" in self._args: if self._args.use_grg: - self._confs['use_grg'] = '.true.' + self._confs["use_grg"] = ".true." - if 'write_gamma_detail' in self._args: + if "write_gamma_detail" in self._args: if self._args.write_gamma_detail: - self._confs['write_gamma_detail'] = '.true.' + self._confs["write_gamma_detail"] = ".true." - if 'write_gamma' in self._args: + if "write_gamma" in self._args: if self._args.write_gamma: - self._confs['write_gamma'] = '.true.' + self._confs["write_gamma"] = ".true." - if 'write_collision' in self._args: + if "write_collision" in self._args: if self._args.write_collision: - self._confs['write_collision'] = '.true.' + self._confs["write_collision"] = ".true." - if 'write_phonon' in self._args: + if "write_phonon" in self._args: if self._args.write_phonon: - self._confs['write_phonon'] = '.true.' + self._confs["write_phonon"] = ".true." - if 'write_pp' in self._args: + if "write_pp" in self._args: if self._args.write_pp: - self._confs['write_pp'] = '.true.' + self._confs["write_pp"] = ".true." - if 'write_LBTE_solution' in self._args: + if "write_LBTE_solution" in self._args: if self._args.write_LBTE_solution: - self._confs['write_LBTE_solution'] = '.true.' + self._confs["write_LBTE_solution"] = ".true." def _parse_conf(self): ConfParser.parse_conf(self) @@ -589,338 +579,348 @@ class Phono3pyConfParser(ConfParser): for conf_key in confs.keys(): # Boolean if conf_key in ( - 'read_fc2', 'read_fc3', 'read_gamma', 'read_phonon', - 'read_pp', 'use_ave_pp', 'use_grg', 'collective_phonon', - 'write_gamma_detail', 'write_gamma', - 'write_collision', 'write_phonon', 'write_pp', - 'write_LBTE_solution', 'full_pp', 'ion_clamped', - 'bterta', 'compact_fc', 'emulate_v1', 'real_self_energy', - 'gruneisen', 'imag_self_energy', 'isotope', - 'joint_dos', 'lbte', 'N_U', 'spectral_function', - 'reducible_collision_matrix', 'symmetrize_fc2', - 'symmetrize_fc3_q', 'symmetrize_fc3_r', 'kappa_star'): - if confs[conf_key].lower() == '.true.': + "read_fc2", + "read_fc3", + "read_gamma", + "read_phonon", + "read_pp", + "use_ave_pp", + "use_grg", + "collective_phonon", + "write_gamma_detail", + "write_gamma", + "write_collision", + "write_phonon", + "write_pp", + "write_LBTE_solution", + "full_pp", + "ion_clamped", + "bterta", + "compact_fc", + "emulate_v1", + "real_self_energy", + "gruneisen", + "imag_self_energy", + "isotope", + "joint_dos", + "lbte", + "N_U", + "spectral_function", + "reducible_collision_matrix", + "symmetrize_fc2", + "symmetrize_fc3_q", + "symmetrize_fc3_r", + "kappa_star", + ): + if confs[conf_key].lower() == ".true.": self.set_parameter(conf_key, True) - elif confs[conf_key].lower() == '.false.': + elif confs[conf_key].lower() == ".false.": self.set_parameter(conf_key, False) # float if conf_key in ( - 'boundary_mfp', 'cutoff_fc3_distance', - 'cutoff_pair_distance', 'gamma_conversion_factor', - 'max_freepath', 'pinv_cutoff', 'pp_conversion_factor', - 'sigma_cutoff_width'): + "boundary_mfp", + "cutoff_fc3_distance", + "cutoff_pair_distance", + "max_freepath", + "pinv_cutoff", + "pp_conversion_factor", + "sigma_cutoff_width", + ): self.set_parameter(conf_key, float(confs[conf_key])) # int - if conf_key in ('pinv_solver', 'num_points_in_batch'): + if conf_key in ("pinv_solver", "num_points_in_batch"): self.set_parameter(conf_key, int(confs[conf_key])) # specials - if conf_key in ('create_forces_fc2', 'create_forces_fc3'): + if conf_key in ("create_forces_fc2", "create_forces_fc3"): if type(confs[conf_key]) is str: fnames = confs[conf_key].split() else: fnames = confs[conf_key] self.set_parameter(conf_key, fnames) - if conf_key == 'create_forces_fc3_file': + if conf_key == "create_forces_fc3_file": self.set_parameter( - 'create_forces_fc3_file', confs['create_forces_fc3_file']) + "create_forces_fc3_file", confs["create_forces_fc3_file"] + ) - if conf_key == 'dim_fc2': - matrix = [int(x) for x in confs['dim_fc2'].split()] + if conf_key == "dim_fc2": + matrix = [int(x) for x in confs["dim_fc2"].split()] if len(matrix) == 9: matrix = np.array(matrix).reshape(3, 3) elif len(matrix) == 3: matrix = np.diag(matrix) else: - self.setting_error( - "Number of elements of dim2 has to be 3 or 9.") + self.setting_error("Number of elements of dim2 has to be 3 or 9.") if matrix.shape == (3, 3): if np.linalg.det(matrix) < 1: self.setting_error( - "Determinant of supercell matrix has " + - "to be positive.") + "Determinant of supercell matrix has " + "to be positive." + ) else: - self.set_parameter('dim_fc2', matrix) + self.set_parameter("dim_fc2", matrix) - if conf_key in ('constant_averaged_pp_interaction' - 'const_ave_pp'): - self.set_parameter('const_ave_pp', - float(confs['const_ave_pp'])) + if conf_key in ("constant_averaged_pp_interaction" "const_ave_pp"): + self.set_parameter("const_ave_pp", float(confs["const_ave_pp"])) - if conf_key == 'grid_addresses': - vals = [int(x) for x in - confs['grid_addresses'].replace(',', ' ').split()] + if conf_key == "grid_addresses": + vals = [ + int(x) for x in confs["grid_addresses"].replace(",", " ").split() + ] if len(vals) % 3 == 0 and len(vals) > 0: - self.set_parameter('grid_addresses', - np.reshape(vals, (-1, 3))) + self.set_parameter("grid_addresses", np.reshape(vals, (-1, 3))) else: self.setting_error("Grid addresses are incorrectly set.") - if conf_key == 'grid_points': - vals = [int(x) for x in - confs['grid_points'].replace(',', ' ').split()] - self.set_parameter('grid_points', vals) + if conf_key == "grid_points": + vals = [int(x) for x in confs["grid_points"].replace(",", " ").split()] + self.set_parameter("grid_points", vals) - if conf_key == 'lapack_zheev_uplo': - self.set_parameter('lapack_zheev_uplo', - confs['lapack_zheev_uplo'].upper()) + if conf_key == "lapack_zheev_uplo": + self.set_parameter( + "lapack_zheev_uplo", confs["lapack_zheev_uplo"].upper() + ) - if conf_key == 'mass_variances': - vals = [fracval(x) for x in confs['mass_variances'].split()] + if conf_key == "mass_variances": + vals = [fracval(x) for x in confs["mass_variances"].split()] if len(vals) < 1: - self.setting_error( - "Mass variance parameters are incorrectly set.") + self.setting_error("Mass variance parameters are incorrectly set.") else: - self.set_parameter('mass_variances', vals) + self.set_parameter("mass_variances", vals) - if conf_key == 'read_collision': - if confs['read_collision'] == 'all': - self.set_parameter('read_collision', 'all') + if conf_key == "read_collision": + if confs["read_collision"] == "all": + self.set_parameter("read_collision", "all") else: - vals = [int(x) for x in confs['read_collision'].split()] - self.set_parameter('read_collision', vals) + vals = [int(x) for x in confs["read_collision"].split()] + self.set_parameter("read_collision", vals) - if conf_key == 'scattering_event_class': - self.set_parameter('scattering_event_class', - int(confs['scattering_event_class'])) + if conf_key == "scattering_event_class": + self.set_parameter( + "scattering_event_class", int(confs["scattering_event_class"]) + ) def _set_settings(self): self.set_settings() params = self._parameters # Supercell dimension for fc2 - if 'dim_fc2' in params: - self._settings.set_phonon_supercell_matrix(params['dim_fc2']) + if "dim_fc2" in params: + self._settings.set_phonon_supercell_matrix(params["dim_fc2"]) # Boundary mean free path for thermal conductivity calculation - if 'boundary_mfp' in params: - self._settings.set_boundary_mfp(params['boundary_mfp']) + if "boundary_mfp" in params: + self._settings.set_boundary_mfp(params["boundary_mfp"]) # Calculate thermal conductivity in BTE-RTA - if 'bterta' in params: - self._settings.set_is_bterta(params['bterta']) + if "bterta" in params: + self._settings.set_is_bterta(params["bterta"]) # Solve collective phonons - if 'collective_phonon' in params: - self._settings.set_solve_collective_phonon( - params['collective_phonon']) + if "collective_phonon" in params: + self._settings.set_solve_collective_phonon(params["collective_phonon"]) # Compact force constants or full force constants - if 'compact_fc' in params: - self._settings.set_is_compact_fc(params['compact_fc']) + if "compact_fc" in params: + self._settings.set_is_compact_fc(params["compact_fc"]) # Peierls type approximation for squared ph-ph interaction strength - if 'const_ave_pp' in params: - self._settings.set_constant_averaged_pp_interaction( - params['const_ave_pp']) + if "const_ave_pp" in params: + self._settings.set_constant_averaged_pp_interaction(params["const_ave_pp"]) # Trigger to create FORCES_FC2 and FORCES_FC3 - if 'create_forces_fc2' in params: - self._settings.set_create_forces_fc2(params['create_forces_fc2']) + if "create_forces_fc2" in params: + self._settings.set_create_forces_fc2(params["create_forces_fc2"]) - if 'create_forces_fc3' in params: - self._settings.set_create_forces_fc3(params['create_forces_fc3']) + if "create_forces_fc3" in params: + self._settings.set_create_forces_fc3(params["create_forces_fc3"]) - if 'create_forces_fc3_file' in params: - self._settings.set_create_forces_fc3_file( - params['create_forces_fc3_file']) + if "create_forces_fc3_file" in params: + self._settings.set_create_forces_fc3_file(params["create_forces_fc3_file"]) # Cutoff distance of third-order force constants. Elements where any # pair of atoms has larger distance than cut-off distance are set zero. - if 'cutoff_fc3_distance' in params: - self._settings.set_cutoff_fc3_distance( - params['cutoff_fc3_distance']) + if "cutoff_fc3_distance" in params: + self._settings.set_cutoff_fc3_distance(params["cutoff_fc3_distance"]) # Cutoff distance between pairs of displaced atoms used for supercell # creation with displacements and making third-order force constants - if 'cutoff_pair_distance' in params: - self._settings.set_cutoff_pair_distance( - params['cutoff_pair_distance']) + if "cutoff_pair_distance" in params: + self._settings.set_cutoff_pair_distance(params["cutoff_pair_distance"]) # Emulate v1.x grid system and shortest vectors. - if 'emulate_v1' in params: - self._settings.set_emulate_v1(params['emulate_v1']) - - # Gamma unit conversion factor - if 'gamma_conversion_factor' in params: - self._settings.set_gamma_conversion_factor( - params['gamma_conversion_factor']) + if "emulate_v1" in params: + self._settings.set_emulate_v1(params["emulate_v1"]) # Grid addresses (sets of three integer values) - if 'grid_addresses' in params: - self._settings.set_grid_addresses(params['grid_addresses']) + if "grid_addresses" in params: + self._settings.set_grid_addresses(params["grid_addresses"]) # Grid points - if 'grid_points' in params: - self._settings.set_grid_points(params['grid_points']) + if "grid_points" in params: + self._settings.set_grid_points(params["grid_points"]) # Atoms are clamped under applied strain in Gruneisen parameter # calculation. - if 'ion_clamped' in params: - self._settings.set_ion_clamped(params['ion_clamped']) + if "ion_clamped" in params: + self._settings.set_ion_clamped(params["ion_clamped"]) # Calculate full ph-ph interaction strength for RTA conductivity - if 'full_pp' in params: - self._settings.set_is_full_pp(params['full_pp']) + if "full_pp" in params: + self._settings.set_is_full_pp(params["full_pp"]) # Calculate phonon-Gruneisen parameters - if 'gruneisen' in params: - self._settings.set_is_gruneisen(params['gruneisen']) + if "gruneisen" in params: + self._settings.set_is_gruneisen(params["gruneisen"]) # Calculate imaginary part of self energy - if 'imag_self_energy' in params: - self._settings.set_is_imag_self_energy(params['imag_self_energy']) + if "imag_self_energy" in params: + self._settings.set_is_imag_self_energy(params["imag_self_energy"]) # Calculate lifetime due to isotope scattering - if 'isotope' in params: - self._settings.set_is_isotope(params['isotope']) + if "isotope" in params: + self._settings.set_is_isotope(params["isotope"]) # Calculate joint-DOS - if 'joint_dos' in params: - self._settings.set_is_joint_dos(params['joint_dos']) + if "joint_dos" in params: + self._settings.set_is_joint_dos(params["joint_dos"]) # Sum partial kappa at q-stars - if 'kappa_star' in params: - self._settings.set_is_kappa_star(params['kappa_star']) + if "kappa_star" in params: + self._settings.set_is_kappa_star(params["kappa_star"]) - if 'lapack_zheev_uplo' in params: - self._settings.set_lapack_zheev_uplo(params['lapack_zheev_uplo']) + if "lapack_zheev_uplo" in params: + self._settings.set_lapack_zheev_uplo(params["lapack_zheev_uplo"]) # Calculate thermal conductivity in LBTE with Chaput's method - if 'lbte' in params: - self._settings.set_is_lbte(params['lbte']) + if "lbte" in params: + self._settings.set_is_lbte(params["lbte"]) # Number of frequency points in a batch. - if 'num_points_in_batch' in params: - self._settings.set_num_points_in_batch( - params['num_points_in_batch']) + if "num_points_in_batch" in params: + self._settings.set_num_points_in_batch(params["num_points_in_batch"]) # Calculate Normal and Umklapp processes - if 'N_U' in params: - self._settings.set_is_N_U(params['N_U']) + if "N_U" in params: + self._settings.set_is_N_U(params["N_U"]) # Solve reducible collision matrix but not reduced matrix - if 'reducible_collision_matrix' in params: + if "reducible_collision_matrix" in params: self._settings.set_is_reducible_collision_matrix( - params['reducible_collision_matrix']) + params["reducible_collision_matrix"] + ) # Symmetrize fc2 by index exchange - if 'symmetrize_fc2' in params: - self._settings.set_is_symmetrize_fc2(params['symmetrize_fc2']) + if "symmetrize_fc2" in params: + self._settings.set_is_symmetrize_fc2(params["symmetrize_fc2"]) # Symmetrize phonon fc3 by index exchange - if 'symmetrize_fc3_q' in params: - self._settings.set_is_symmetrize_fc3_q(params['symmetrize_fc3_q']) + if "symmetrize_fc3_q" in params: + self._settings.set_is_symmetrize_fc3_q(params["symmetrize_fc3_q"]) # Symmetrize fc3 by index exchange - if 'symmetrize_fc3_r' in params: - self._settings.set_is_symmetrize_fc3_r(params['symmetrize_fc3_r']) + if "symmetrize_fc3_r" in params: + self._settings.set_is_symmetrize_fc3_r(params["symmetrize_fc3_r"]) # Mass variance parameters - if 'mass_variances' in params: - self._settings.set_mass_variances(params['mass_variances']) + if "mass_variances" in params: + self._settings.set_mass_variances(params["mass_variances"]) # Maximum mean free path - if 'max_freepath' in params: - self._settings.set_max_freepath(params['max_freepath']) + if "max_freepath" in params: + self._settings.set_max_freepath(params["max_freepath"]) # Cutoff frequency for pseudo inversion of collision matrix - if 'pinv_cutoff' in params: - self._settings.set_pinv_cutoff(params['pinv_cutoff']) + if "pinv_cutoff" in params: + self._settings.set_pinv_cutoff(params["pinv_cutoff"]) # Switch for pseudo-inverse solver - if 'pinv_solver' in params: - self._settings.set_pinv_solver(params['pinv_solver']) + if "pinv_solver" in params: + self._settings.set_pinv_solver(params["pinv_solver"]) # Ph-ph interaction unit conversion factor - if 'pp_conversion_factor' in params: - self._settings.set_pp_conversion_factor( - params['pp_conversion_factor']) + if "pp_conversion_factor" in params: + self._settings.set_pp_conversion_factor(params["pp_conversion_factor"]) # Calculate real_self_energys - if 'real_self_energy' in params: - self._settings.set_is_real_self_energy(params['real_self_energy']) + if "real_self_energy" in params: + self._settings.set_is_real_self_energy(params["real_self_energy"]) # Read phonon-phonon interaction amplitudes from hdf5 - if 'read_amplitude' in params: - self._settings.set_read_amplitude(params['read_amplitude']) + if "read_amplitude" in params: + self._settings.set_read_amplitude(params["read_amplitude"]) # Read collision matrix and gammas from hdf5 - if 'read_collision' in params: - self._settings.set_read_collision(params['read_collision']) + if "read_collision" in params: + self._settings.set_read_collision(params["read_collision"]) # Read fc2 from hdf5 - if 'read_fc2' in params: - self._settings.set_read_fc2(params['read_fc2']) + if "read_fc2" in params: + self._settings.set_read_fc2(params["read_fc2"]) # Read fc3 from hdf5 - if 'read_fc3' in params: - self._settings.set_read_fc3(params['read_fc3']) + if "read_fc3" in params: + self._settings.set_read_fc3(params["read_fc3"]) # Read gammas from hdf5 - if 'read_gamma' in params: - self._settings.set_read_gamma(params['read_gamma']) + if "read_gamma" in params: + self._settings.set_read_gamma(params["read_gamma"]) # Read phonons from hdf5 - if 'read_phonon' in params: - self._settings.set_read_phonon(params['read_phonon']) + if "read_phonon" in params: + self._settings.set_read_phonon(params["read_phonon"]) # Read ph-ph interaction strength from hdf5 - if 'read_pp' in params: - self._settings.set_read_pp(params['read_pp']) + if "read_pp" in params: + self._settings.set_read_pp(params["read_pp"]) # Scattering event class 1 or 2 - if 'scattering_event_class' in params: - self._settings.set_scattering_event_class( - params['scattering_event_class']) + if "scattering_event_class" in params: + self._settings.set_scattering_event_class(params["scattering_event_class"]) # Cutoff width of smearing function (ratio to sigma value) - if 'sigma_cutoff_width' in params: - self._settings.set_sigma_cutoff_width(params['sigma_cutoff_width']) + if "sigma_cutoff_width" in params: + self._settings.set_sigma_cutoff_width(params["sigma_cutoff_width"]) # Calculate spectral_functions - if 'spectral_function' in params: - self._settings.set_is_spectral_function( - params['spectral_function']) + if "spectral_function" in params: + self._settings.set_is_spectral_function(params["spectral_function"]) # Subtract residual forces to create FORCES_FC2 and FORCES_FC3 - if 'subtract_forces' in params: - self._settings.set_subtract_forces(params['subtract_forces']) + if "subtract_forces" in params: + self._settings.set_subtract_forces(params["subtract_forces"]) # Use averaged ph-ph interaction - if 'use_ave_pp' in params: - self._settings.set_use_ave_pp(params['use_ave_pp']) + if "use_ave_pp" in params: + self._settings.set_use_ave_pp(params["use_ave_pp"]) # Use generalized regular grid - if 'use_grg' in params: - self._settings.set_use_grg(params['use_grg']) + if "use_grg" in params: + self._settings.set_use_grg(params["use_grg"]) # Write detailed imag-part of self energy to hdf5 - if 'write_gamma_detail' in params: - self._settings.set_write_gamma_detail( - params['write_gamma_detail']) + if "write_gamma_detail" in params: + self._settings.set_write_gamma_detail(params["write_gamma_detail"]) # Write imag-part of self energy to hdf5 - if 'write_gamma' in params: - self._settings.set_write_gamma(params['write_gamma']) + if "write_gamma" in params: + self._settings.set_write_gamma(params["write_gamma"]) # Write collision matrix and gammas to hdf5 - if 'write_collision' in params: - self._settings.set_write_collision(params['write_collision']) + if "write_collision" in params: + self._settings.set_write_collision(params["write_collision"]) # Write all phonons on grid points to hdf5 - if 'write_phonon' in params: - self._settings.set_write_phonon(params['write_phonon']) + if "write_phonon" in params: + self._settings.set_write_phonon(params["write_phonon"]) # Write phonon-phonon interaction amplitudes to hdf5 - if 'write_pp' in params: - self._settings.set_write_pp(params['write_pp']) + if "write_pp" in params: + self._settings.set_write_pp(params["write_pp"]) # Write direct solution of LBTE to hdf5 files - if 'write_LBTE_solution' in params: - self._settings.set_write_LBTE_solution( - params['write_LBTE_solution']) + if "write_LBTE_solution" in params: + self._settings.set_write_LBTE_solution(params["write_LBTE_solution"]) diff --git a/phono3py/cui/show_log.py b/phono3py/cui/show_log.py index 914e2c90..50fc8432 100644 --- a/phono3py/cui/show_log.py +++ b/phono3py/cui/show_log.py @@ -37,14 +37,12 @@ import numpy as np from phonopy.structure.cells import print_cell -def show_general_settings(settings, - run_mode, - phono3py, - cell_filename, - input_filename, - output_filename): - is_primitive_axes_auto = (type(phono3py.primitive_matrix) is str and - phono3py.primitive_matrix == 'auto') +def show_general_settings( + settings, run_mode, phono3py, cell_filename, input_filename, output_filename +): + is_primitive_axes_auto = ( + type(phono3py.primitive_matrix) is str and phono3py.primitive_matrix == "auto" + ) primitive_matrix = phono3py.primitive_matrix supercell_matrix = phono3py.supercell_matrix phonon_supercell_matrix = phono3py.phonon_supercell_matrix @@ -60,7 +58,7 @@ def show_general_settings(settings, if phono3py.calculator: print("Calculator interface: %s" % phono3py.calculator) - print("Crystal structure was read from \"%s\"." % cell_filename) + print('Crystal structure was read from "%s".' % cell_filename) if (np.diag(np.diag(supercell_matrix)) - supercell_matrix).any(): print("Supercell matrix (dim):") @@ -69,14 +67,12 @@ def show_general_settings(settings, else: print("Supercell (dim): %s" % np.diag(supercell_matrix)) if phonon_supercell_matrix is not None: - if (np.diag(np.diag(phonon_supercell_matrix)) - - phonon_supercell_matrix).any(): + if (np.diag(np.diag(phonon_supercell_matrix)) - phonon_supercell_matrix).any(): print("Phonon supercell matrix (dim-fc2):") for v in phonon_supercell_matrix: print(" %s" % v) else: - print("Phonon supercell (dim-fc2): %s" - % np.diag(phonon_supercell_matrix)) + print("Phonon supercell (dim-fc2): %s" % np.diag(phonon_supercell_matrix)) if is_primitive_axes_auto: print("Primitive matrix (Auto):") for v in primitive_matrix: @@ -110,54 +106,59 @@ def show_phono3py_cells(phono3py, settings): def show_phono3py_force_constants_settings(settings): read_fc3 = settings.read_fc3 read_fc2 = settings.read_fc2 - symmetrize_fc3r = (settings.is_symmetrize_fc3_r or - settings.fc_symmetry) + symmetrize_fc3r = settings.is_symmetrize_fc3_r or settings.fc_symmetry symmetrize_fc3q = settings.is_symmetrize_fc3_q - symmetrize_fc2 = (settings.is_symmetrize_fc2 or - settings.fc_symmetry) + symmetrize_fc2 = settings.is_symmetrize_fc2 or settings.fc_symmetry print("-" * 29 + " Force constants " + "-" * 30) - if settings.fc_calculator == 'alm' and not read_fc2: + if settings.fc_calculator == "alm" and not read_fc2: print("Use ALM for getting fc2 (simultaneous fit to fc2 and fc3)") else: - print("Imposing translational and index exchange symmetry to fc2: %s" % - symmetrize_fc2) + print( + "Imposing translational and index exchange symmetry to fc2: %s" + % symmetrize_fc2 + ) if settings.is_isotope or settings.is_joint_dos: pass - elif settings.fc_calculator == 'alm' and not read_fc3: + elif settings.fc_calculator == "alm" and not read_fc3: print("Use ALM for getting fc3") else: - print("Imposing translational and index exchange symmetry to fc3: " - "%s" % symmetrize_fc3r) - print(("Imposing symmetry of index exchange to fc3 in reciprocal " - "space: %s") % symmetrize_fc3q) + print( + "Imposing translational and index exchange symmetry to fc3: " + "%s" % symmetrize_fc3r + ) + print( + ("Imposing symmetry of index exchange to fc3 in reciprocal " "space: %s") + % symmetrize_fc3q + ) if settings.cutoff_fc3_distance is not None: print("FC3 cutoff distance: %s" % settings.cutoff_fc3_distance) def show_phono3py_settings(phono3py, settings, updated_settings, log_level): - sigmas = updated_settings['sigmas'] - temperatures = updated_settings['temperatures'] - temperature_points = updated_settings['temperature_points'] - cutoff_frequency = updated_settings['cutoff_frequency'] - frequency_factor_to_THz = updated_settings['frequency_factor_to_THz'] - frequency_scale_factor = updated_settings['frequency_scale_factor'] - frequency_step = updated_settings['frequency_step'] - num_frequency_points = updated_settings['num_frequency_points'] + sigmas = updated_settings["sigmas"] + temperatures = updated_settings["temperatures"] + temperature_points = updated_settings["temperature_points"] + cutoff_frequency = updated_settings["cutoff_frequency"] + frequency_factor_to_THz = updated_settings["frequency_factor_to_THz"] + frequency_scale_factor = updated_settings["frequency_scale_factor"] + frequency_step = updated_settings["frequency_step"] + num_frequency_points = updated_settings["num_frequency_points"] print("-" * 27 + " Calculation settings " + "-" * 27) if settings.is_nac: print("Non-analytical term correction (NAC): %s" % settings.is_nac) if phono3py.nac_params: - print("NAC unit conversion factor: %9.5f" - % phono3py.nac_params['factor']) + print("NAC unit conversion factor: %9.5f" % phono3py.nac_params["factor"]) if settings.nac_q_direction is not None: print("NAC q-direction: %s" % settings.nac_q_direction) if settings.band_indices is not None and not settings.is_bterta: - print(("Band indices: [" + " %s" * len(settings.band_indices) + " ]") % - tuple([np.array(bi) + 1 for bi in settings.band_indices])) + print( + ("Band indices: [" + " %s" * len(settings.band_indices) + " ]") + % tuple([np.array(bi) + 1 for bi in settings.band_indices]) + ) if sigmas: text = "BZ integration: " for i, sigma in enumerate(sigmas): @@ -183,47 +184,44 @@ def show_phono3py_settings(phono3py, settings, updated_settings, log_level): text = (" %.1f " * len(temperatures)) % tuple(temperatures) print("Temperature: " + text) elif temperature_points is not None: - print(("Temperatures:" + " %.1f " * len(temperature_points)) - % tuple(temperature_points)) + print( + ("Temperatures:" + " %.1f " * len(temperature_points)) + % tuple(temperature_points) + ) if settings.scattering_event_class is not None: - print("Scattering event class: %s" - % settings.scattering_event_class) + print("Scattering event class: %s" % settings.scattering_event_class) if cutoff_frequency: print("Cutoff frequency: %s" % cutoff_frequency) - if (settings.use_ave_pp and - (settings.is_bterta or settings.is_lbte)): + if settings.use_ave_pp and (settings.is_bterta or settings.is_lbte): print("Use averaged ph-ph interaction") const_ave_pp = settings.constant_averaged_pp_interaction - if (const_ave_pp is not None and - (settings.is_bterta or settings.is_lbte)): + if const_ave_pp is not None and (settings.is_bterta or settings.is_lbte): print("Constant ph-ph interaction: %6.3e" % const_ave_pp) - print("Frequency conversion factor to THz: %9.5f" % - frequency_factor_to_THz) + print("Frequency conversion factor to THz: %9.5f" % frequency_factor_to_THz) if frequency_scale_factor is not None: print("Frequency scale factor: %8.5f" % frequency_scale_factor) - if (settings.is_joint_dos or - settings.is_imag_self_energy or - settings.is_real_self_energy or - settings.is_spectral_function): + if ( + settings.is_joint_dos + or settings.is_imag_self_energy + or settings.is_real_self_energy + or settings.is_spectral_function + ): if frequency_step is not None: print("Frequency step for spectrum: %s" % frequency_step) if num_frequency_points is not None: - print("Number of frequency sampling points: %d" % - num_frequency_points) + print("Number of frequency sampling points: %d" % num_frequency_points) if settings.mesh_numbers is not None: try: if len(settings.mesh_numbers) == 3: - print("Mesh sampling: [ %d %d %d ]" % - tuple(settings.mesh_numbers)) + print("Mesh sampling: [ %d %d %d ]" % tuple(settings.mesh_numbers)) except TypeError: - print("Length for sampling mesh generation: %.2f" % - settings.mesh_numbers) + print("Length for sampling mesh generation: %.2f" % settings.mesh_numbers) sys.stdout.flush() diff --git a/phono3py/cui/triplets_info.py b/phono3py/cui/triplets_info.py index 08be3f99..d18c0394 100644 --- a/phono3py/cui/triplets_info.py +++ b/phono3py/cui/triplets_info.py @@ -38,30 +38,33 @@ from phono3py.phonon3.triplets import get_triplets_at_q from phono3py.phonon.grid import get_ir_grid_points -def write_grid_points(primitive, - bz_grid, - band_indices=None, - sigmas=None, - temperatures=None, - is_kappa_star=True, - is_lbte=False, - compression="gzip", - filename=None): +def write_grid_points( + primitive, + bz_grid, + band_indices=None, + sigmas=None, + temperatures=None, + is_kappa_star=True, + is_lbte=False, + compression="gzip", + filename=None, +): ir_grid_points, ir_grid_weights = _get_ir_grid_points( - bz_grid, - is_kappa_star=is_kappa_star) - write_ir_grid_points(bz_grid, - ir_grid_points, - ir_grid_weights, - np.linalg.inv(primitive.cell)) - gadrs_hdf5_fname = write_grid_address_to_hdf5(bz_grid.addresses, - bz_grid.D_diag, - bz_grid.gp_map, - compression=compression, - filename=filename) + bz_grid, is_kappa_star=is_kappa_star + ) + write_ir_grid_points( + bz_grid, ir_grid_points, ir_grid_weights, np.linalg.inv(primitive.cell) + ) + gadrs_hdf5_fname = write_grid_address_to_hdf5( + bz_grid.addresses, + bz_grid.D_diag, + bz_grid.gp_map, + compression=compression, + filename=filename, + ) - print("Ir-grid points are written into \"ir_grid_points.yaml\".") - print("Grid addresses are written into \"%s\"." % gadrs_hdf5_fname) + print('Ir-grid points are written into "ir_grid_points.yaml".') + print('Grid addresses are written into "%s".' % gadrs_hdf5_fname) if is_lbte and temperatures is not None: num_temp = len(temperatures) @@ -75,26 +78,29 @@ def write_grid_points(primitive, num_band0 = len(band_indices) print("Memory requirements:") size = (num_band0 * 3 * num_ir_gp * num_band * 3) * 8 / 1.0e9 - print("- Piece of collision matrix at each grid point, temp and " - "sigma: %.2f Gb" % size) + print( + "- Piece of collision matrix at each grid point, temp and " + "sigma: %.2f Gb" % size + ) size = (num_ir_gp * num_band * 3) ** 2 * 8 / 1.0e9 - print("- Full collision matrix at each temp and sigma: %.2f Gb" - % size) + print("- Full collision matrix at each temp and sigma: %.2f Gb" % size) size = num_gp * (num_band ** 2 * 16 + num_band * 8 + 1) / 1.0e9 print("- Phonons: %.2f Gb" % size) size = num_gp * 5 * 4 / 1.0e9 print("- Grid point information: %.2f Gb" % size) - size = (num_ir_gp * num_band0 * - (3 + 6 + num_temp * 2 + num_sigma * num_temp * 15 + 2) * - 8 / 1.0e9) + size = ( + num_ir_gp + * num_band0 + * (3 + 6 + num_temp * 2 + num_sigma * num_temp * 15 + 2) + * 8 + / 1.0e9 + ) print("- Phonon properties: %.2f Gb" % size) -def show_num_triplets(primitive, - bz_grid, - band_indices=None, - grid_points=None, - is_kappa_star=True): +def show_num_triplets( + primitive, bz_grid, band_indices=None, grid_points=None, is_kappa_star=True +): tp_nums = _TripletsNumbers(bz_grid, is_kappa_star=is_kappa_star) num_band = len(primitive) * 3 if band_indices is None: @@ -113,40 +119,38 @@ def show_num_triplets(primitive, num_triplets = tp_nums.get_number_of_triplets(gp) q = np.dot(bz_grid.addresses[gp], bz_grid.QDinv.T) size = num_triplets * num_band0 * num_band ** 2 * 8 / 1e6 - print(" %5d (%5.2f %5.2f %5.2f) %8d %d Mb" % - (gp, q[0], q[1], q[2], num_triplets, size)) + print( + " %5d (%5.2f %5.2f %5.2f) %8d %d Mb" + % (gp, q[0], q[1], q[2], num_triplets, size) + ) class _TripletsNumbers(object): def __init__(self, bz_grid, is_kappa_star=True): self._bz_grid = bz_grid - self.ir_grid_points, _, = _get_ir_grid_points( - self._bz_grid, - is_kappa_star=is_kappa_star) + ( + self.ir_grid_points, + _, + ) = _get_ir_grid_points(self._bz_grid, is_kappa_star=is_kappa_star) def get_number_of_triplets(self, gp): - num_triplets = _get_number_of_triplets( - self._bz_grid, gp, swappable=True) + num_triplets = _get_number_of_triplets(self._bz_grid, gp, swappable=True) return num_triplets def _get_ir_grid_points(bz_grid, is_kappa_star=True): if is_kappa_star: ir_grid_points, ir_grid_weights, _ = get_ir_grid_points(bz_grid) - ir_grid_points = np.array(bz_grid.grg2bzg[ir_grid_points], dtype='int_') + ir_grid_points = np.array(bz_grid.grg2bzg[ir_grid_points], dtype="int_") else: ir_grid_points = np.array( - bz_grid.grg2bzg[:np.prod(bz_grid.D_diag)], - dtype='int_', order='C') - ir_grid_weights = np.ones(len(ir_grid_points), dtype='int_') + bz_grid.grg2bzg[: np.prod(bz_grid.D_diag)], dtype="int_", order="C" + ) + ir_grid_weights = np.ones(len(ir_grid_points), dtype="int_") return ir_grid_points, ir_grid_weights -def _get_number_of_triplets(bz_grid, - grid_point, - swappable=True): - triplets_at_q = get_triplets_at_q(grid_point, - bz_grid, - swappable=swappable)[0] +def _get_number_of_triplets(bz_grid, grid_point, swappable=True): + triplets_at_q = get_triplets_at_q(grid_point, bz_grid, swappable=swappable)[0] return len(triplets_at_q) diff --git a/phono3py/file_IO.py b/phono3py/file_IO.py index c37d8afb..92244351 100644 --- a/phono3py/file_IO.py +++ b/phono3py/file_IO.py @@ -40,8 +40,7 @@ import h5py # This import is deactivated for a while. # from phonopy.file_IO import write_force_constants_to_hdf5 -from phonopy.file_IO import (check_force_constants_indices, - get_cell_from_disp_yaml) +from phonopy.file_IO import check_force_constants_indices, get_cell_from_disp_yaml from phonopy.cui.load_helper import read_force_constants_from_hdf5 from phono3py.version import __version__ @@ -53,8 +52,7 @@ def write_cell_yaml(w, supercell): These methods are also deprecated. """ - warnings.warn("write_cell_yaml() is deprecated.", - DeprecationWarning) + warnings.warn("write_cell_yaml() is deprecated.", DeprecationWarning) w.write("lattice:\n") for axis in supercell.get_cell(): @@ -63,31 +61,30 @@ def write_cell_yaml(w, supercell): positions = supercell.get_scaled_positions() w.write("atoms:\n") for i, (s, v) in enumerate(zip(symbols, positions)): - w.write("- symbol: %-2s # %d\n" % (s, i+1)) + w.write("- symbol: %-2s # %d\n" % (s, i + 1)) w.write(" position: [ %18.14f,%18.14f,%18.14f ]\n" % tuple(v)) -def write_disp_fc3_yaml(dataset, supercell, filename='disp_fc3.yaml'): +def write_disp_fc3_yaml(dataset, supercell, filename="disp_fc3.yaml"): """Write disp_fc3.yaml.""" - warnings.warn("write_disp_fc3_yaml() is deprecated.", - DeprecationWarning) + warnings.warn("write_disp_fc3_yaml() is deprecated.", DeprecationWarning) - w = open(filename, 'w') - w.write("natom: %d\n" % dataset['natom']) + w = open(filename, "w") + w.write("natom: %d\n" % dataset["natom"]) - num_first = len(dataset['first_atoms']) + num_first = len(dataset["first_atoms"]) w.write("num_first_displacements: %d\n" % num_first) - if 'cutoff_distance' in dataset: - w.write("cutoff_distance: %f\n" % dataset['cutoff_distance']) + if "cutoff_distance" in dataset: + w.write("cutoff_distance: %f\n" % dataset["cutoff_distance"]) num_second = 0 num_disp_files = 0 - for d1 in dataset['first_atoms']: + for d1 in dataset["first_atoms"]: num_disp_files += 1 - num_second += len(d1['second_atoms']) - for d2 in d1['second_atoms']: - if 'included' in d2: - if d2['included']: + num_second += len(d1["second_atoms"]) + for d2 in d1["second_atoms"]: + if "included" in d2: + if d2["included"]: num_disp_files += 1 else: num_disp_files += 1 @@ -95,39 +92,42 @@ def write_disp_fc3_yaml(dataset, supercell, filename='disp_fc3.yaml'): w.write("num_second_displacements: %d\n" % num_second) w.write("num_displacements_created: %d\n" % num_disp_files) - if 'duplicates' in dataset: + if "duplicates" in dataset: w.write("duplicates:\n") - for (i, j) in dataset['duplicates']: + for (i, j) in dataset["duplicates"]: w.write("- [ %d, %d ]\n" % (i, j)) w.write("first_atoms:\n") count1 = 0 - count2 = len(dataset['first_atoms']) - for disp1 in dataset['first_atoms']: + count2 = len(dataset["first_atoms"]) + for disp1 in dataset["first_atoms"]: count1 += 1 - disp_cart1 = disp1['displacement'] - w.write("- number: %5d\n" % (disp1['number'] + 1)) + disp_cart1 = disp1["displacement"] + w.write("- number: %5d\n" % (disp1["number"] + 1)) w.write(" displacement:\n") - w.write(" [%20.16f,%20.16f,%20.16f ] # %05d\n" % - (disp_cart1[0], disp_cart1[1], disp_cart1[2], count1)) + w.write( + " [%20.16f,%20.16f,%20.16f ] # %05d\n" + % (disp_cart1[0], disp_cart1[1], disp_cart1[2], count1) + ) w.write(" displacement_id: %d\n" % count1) w.write(" second_atoms:\n") included = None - atom2_list = np.array([disp2['number'] - for disp2 in disp1['second_atoms']], dtype=int) + atom2_list = np.array( + [disp2["number"] for disp2 in disp1["second_atoms"]], dtype=int + ) _, indices = np.unique(atom2_list, return_index=True) for atom2 in atom2_list[indices]: disp2_list = [] - for disp2 in disp1['second_atoms']: - if disp2['number'] == atom2: + for disp2 in disp1["second_atoms"]: + if disp2["number"] == atom2: disp2_list.append(disp2) disp2 = disp2_list[0] - atom2 = disp2['number'] - if 'included' in disp2: - included = disp2['included'] - pair_distance = disp2['pair_distance'] + atom2 = disp2["number"] + if "included" in disp2: + included = disp2["included"] + pair_distance = disp2["pair_distance"] w.write(" - number: %5d\n" % (atom2 + 1)) w.write(" distance: %f\n" % pair_distance) if included is not None: @@ -141,15 +141,16 @@ def write_disp_fc3_yaml(dataset, supercell, filename='disp_fc3.yaml'): count2 += 1 # Assert all disp2s belonging to same atom2 appear straight. - assert disp2['id'] == count2 + assert disp2["id"] == count2 - disp_cart2 = disp2['displacement'] - w.write(" - [%20.16f,%20.16f,%20.16f ] # %05d\n" % - (disp_cart2[0], disp_cart2[1], disp_cart2[2], - count2)) + disp_cart2 = disp2["displacement"] + w.write( + " - [%20.16f,%20.16f,%20.16f ] # %05d\n" + % (disp_cart2[0], disp_cart2[1], disp_cart2[2], count2) + ) - ids = ["%d" % disp2['id'] for disp2 in disp2_list] - w.write(" displacement_ids: [ %s ]\n" % ', '.join(ids)) + ids = ["%d" % disp2["id"] for disp2 in disp2_list] + w.write(" displacement_ids: [ %s ]\n" % ", ".join(ids)) write_cell_yaml(w, supercell) @@ -158,23 +159,24 @@ def write_disp_fc3_yaml(dataset, supercell, filename='disp_fc3.yaml'): return num_first + num_second, num_disp_files -def write_disp_fc2_yaml(dataset, supercell, filename='disp_fc2.yaml'): +def write_disp_fc2_yaml(dataset, supercell, filename="disp_fc2.yaml"): """Write disp_fc2.yaml.""" - warnings.warn("write_disp_fc2_yaml() is deprecated.", - DeprecationWarning) + warnings.warn("write_disp_fc2_yaml() is deprecated.", DeprecationWarning) - w = open(filename, 'w') - w.write("natom: %d\n" % dataset['natom']) + w = open(filename, "w") + w.write("natom: %d\n" % dataset["natom"]) - num_first = len(dataset['first_atoms']) + num_first = len(dataset["first_atoms"]) w.write("num_first_displacements: %d\n" % num_first) w.write("first_atoms:\n") - for i, disp1 in enumerate(dataset['first_atoms']): - disp_cart1 = disp1['displacement'] - w.write("- number: %5d\n" % (disp1['number'] + 1)) + for i, disp1 in enumerate(dataset["first_atoms"]): + disp_cart1 = disp1["displacement"] + w.write("- number: %5d\n" % (disp1["number"] + 1)) w.write(" displacement:\n") - w.write(" [%20.16f,%20.16f,%20.16f ] # %05d\n" % - (disp_cart1[0], disp_cart1[1], disp_cart1[2], i + 1)) + w.write( + " [%20.16f,%20.16f,%20.16f ] # %05d\n" + % (disp_cart1[0], disp_cart1[1], disp_cart1[2], i + 1) + ) if supercell is not None: write_cell_yaml(w, supercell) @@ -184,10 +186,7 @@ def write_disp_fc2_yaml(dataset, supercell, filename='disp_fc2.yaml'): return num_first -def write_FORCES_FC2(disp_dataset, - forces_fc2=None, - fp=None, - filename="FORCES_FC2"): +def write_FORCES_FC2(disp_dataset, forces_fc2=None, fp=None, filename="FORCES_FC2"): """Write FORCES_FC2. fp : IO object, optional, default=None @@ -195,26 +194,23 @@ def write_FORCES_FC2(disp_dataset, """ if fp is None: - w = open(filename, 'w') + w = open(filename, "w") else: w = fp - for i, disp1 in enumerate(disp_dataset['first_atoms']): + for i, disp1 in enumerate(disp_dataset["first_atoms"]): w.write("# File: %-5d\n" % (i + 1)) - w.write("# %-5d " % (disp1['number'] + 1)) - w.write("%20.16f %20.16f %20.16f\n" % tuple(disp1['displacement'])) - if 'forces' in disp1 and forces_fc2 is None: - force_set = disp1['forces'] + w.write("# %-5d " % (disp1["number"] + 1)) + w.write("%20.16f %20.16f %20.16f\n" % tuple(disp1["displacement"])) + if "forces" in disp1 and forces_fc2 is None: + force_set = disp1["forces"] else: force_set = forces_fc2[i] for forces in force_set: w.write("%15.10f %15.10f %15.10f\n" % tuple(forces)) -def write_FORCES_FC3(disp_dataset, - forces_fc3=None, - fp=None, - filename="FORCES_FC3"): +def write_FORCES_FC3(disp_dataset, forces_fc3=None, fp=None, filename="FORCES_FC3"): """Write FORCES_FC3. fp : IO object, optional, default=None @@ -222,34 +218,34 @@ def write_FORCES_FC3(disp_dataset, """ if fp is None: - w = open(filename, 'w') + w = open(filename, "w") else: w = fp - natom = disp_dataset['natom'] - num_disp1 = len(disp_dataset['first_atoms']) + natom = disp_dataset["natom"] + num_disp1 = len(disp_dataset["first_atoms"]) count = num_disp1 file_count = num_disp1 write_FORCES_FC2(disp_dataset, forces_fc2=forces_fc3, fp=w) - for i, disp1 in enumerate(disp_dataset['first_atoms']): - atom1 = disp1['number'] - for disp2 in disp1['second_atoms']: - atom2 = disp2['number'] + for i, disp1 in enumerate(disp_dataset["first_atoms"]): + atom1 = disp1["number"] + for disp2 in disp1["second_atoms"]: + atom2 = disp2["number"] w.write("# File: %-5d\n" % (count + 1)) w.write("# %-5d " % (atom1 + 1)) - w.write("%20.16f %20.16f %20.16f\n" % tuple(disp1['displacement'])) + w.write("%20.16f %20.16f %20.16f\n" % tuple(disp1["displacement"])) w.write("# %-5d " % (atom2 + 1)) - w.write("%20.16f %20.16f %20.16f\n" % tuple(disp2['displacement'])) + w.write("%20.16f %20.16f %20.16f\n" % tuple(disp2["displacement"])) # For supercell calculation reduction included = True - if 'included' in disp2: - included = disp2['included'] + if "included" in disp2: + included = disp2["included"] if included: - if 'forces' in disp2 and forces_fc3 is None: - force_set = disp2['forces'] + if "forces" in disp2 and forces_fc3 is None: + force_set = disp2["forces"] else: force_set = forces_fc3[file_count] for force in force_set: @@ -263,28 +259,26 @@ def write_FORCES_FC3(disp_dataset, count += 1 -def write_fc3_dat(force_constants_third, filename='fc3.dat'): +def write_fc3_dat(force_constants_third, filename="fc3.dat"): """Write fc3.dat.""" - warnings.warn("write_fc3_dat() is deprecated.", - DeprecationWarning) + warnings.warn("write_fc3_dat() is deprecated.", DeprecationWarning) - w = open(filename, 'w') + w = open(filename, "w") for i in range(force_constants_third.shape[0]): for j in range(force_constants_third.shape[1]): for k in range(force_constants_third.shape[2]): tensor3 = force_constants_third[i, j, k] - w.write(" %d - %d - %d (%f)\n" % (i + 1, j + 1, k + 1, - np.abs(tensor3).sum())) + w.write( + " %d - %d - %d (%f)\n" + % (i + 1, j + 1, k + 1, np.abs(tensor3).sum()) + ) for tensor2 in tensor3: for vec in tensor2: w.write("%20.14f %20.14f %20.14f\n" % tuple(vec)) w.write("\n") -def write_fc3_to_hdf5(fc3, - filename='fc3.hdf5', - p2s_map=None, - compression="gzip"): +def write_fc3_to_hdf5(fc3, filename="fc3.hdf5", p2s_map=None, compression="gzip"): """Write fc3 in fc3.hdf5. Parameters @@ -304,14 +298,14 @@ def write_fc3_to_hdf5(fc3, h5py.Group.create_dataset. Default is "gzip". """ - with h5py.File(filename, 'w') as w: - w.create_dataset('version', data=np.string_(__version__)) - w.create_dataset('fc3', data=fc3, compression=compression) + with h5py.File(filename, "w") as w: + w.create_dataset("version", data=np.string_(__version__)) + w.create_dataset("fc3", data=fc3, compression=compression) if p2s_map is not None: - w.create_dataset('p2s_map', data=p2s_map) + w.create_dataset("p2s_map", data=p2s_map) -def read_fc3_from_hdf5(filename='fc3.hdf5', p2s_map=None): +def read_fc3_from_hdf5(filename="fc3.hdf5", p2s_map=None): """Read fc3 from fc3.hdf5. fc3 can be in full or compact format. They are distinguished by @@ -322,92 +316,97 @@ def read_fc3_from_hdf5(filename='fc3.hdf5', p2s_map=None): respective indices. """ - with h5py.File(filename, 'r') as f: - fc3 = f['fc3'][:] - if 'p2s_map' in f: - p2s_map_in_file = f['p2s_map'][:] - check_force_constants_indices(fc3.shape[:2], - p2s_map_in_file, - p2s_map, - filename) + with h5py.File(filename, "r") as f: + fc3 = f["fc3"][:] + if "p2s_map" in f: + p2s_map_in_file = f["p2s_map"][:] + check_force_constants_indices( + fc3.shape[:2], p2s_map_in_file, p2s_map, filename + ) if fc3.dtype == np.double and fc3.flags.c_contiguous: return fc3 else: - msg = ("%s has to be read by h5py as numpy ndarray of " - "dtype='double' and c_contiguous." % filename) + msg = ( + "%s has to be read by h5py as numpy ndarray of " + "dtype='double' and c_contiguous." % filename + ) raise TypeError(msg) return None -def write_fc2_to_hdf5(force_constants, - filename='fc2.hdf5', - p2s_map=None, - physical_unit=None, - compression="gzip"): +def write_fc2_to_hdf5( + force_constants, + filename="fc2.hdf5", + p2s_map=None, + physical_unit=None, + compression="gzip", +): """Write fc2 in fc2.hdf5. write_force_constants_to_hdf5 was copied from phonopy because it in phonopy doesn't support 'version' dataset. """ - def write_force_constants_to_hdf5(force_constants, - filename='force_constants.hdf5', - p2s_map=None, - physical_unit=None, - compression=None, - version=None): + + def write_force_constants_to_hdf5( + force_constants, + filename="force_constants.hdf5", + p2s_map=None, + physical_unit=None, + compression=None, + version=None, + ): try: import h5py except ImportError: raise ModuleNotFoundError("You need to install python-h5py.") - with h5py.File(filename, 'w') as w: - w.create_dataset('force_constants', data=force_constants, - compression=compression) + with h5py.File(filename, "w") as w: + w.create_dataset( + "force_constants", data=force_constants, compression=compression + ) if p2s_map is not None: - w.create_dataset('p2s_map', data=p2s_map) + w.create_dataset("p2s_map", data=p2s_map) if physical_unit is not None: - dset = w.create_dataset('physical_unit', (1,), - dtype='S%d' % len(physical_unit)) + dset = w.create_dataset( + "physical_unit", (1,), dtype="S%d" % len(physical_unit) + ) dset[0] = np.string_(physical_unit) if version is not None: - w.create_dataset('version', data=np.string_(version)) + w.create_dataset("version", data=np.string_(version)) - write_force_constants_to_hdf5(force_constants, - filename=filename, - p2s_map=p2s_map, - physical_unit=physical_unit, - compression=compression, - version=__version__) + write_force_constants_to_hdf5( + force_constants, + filename=filename, + p2s_map=p2s_map, + physical_unit=physical_unit, + compression=compression, + version=__version__, + ) -def read_fc2_from_hdf5(filename='fc2.hdf5', - p2s_map=None): +def read_fc2_from_hdf5(filename="fc2.hdf5", p2s_map=None): """Read fc2 from fc2.hdf5.""" - return read_force_constants_from_hdf5(filename=filename, - p2s_map=p2s_map, - calculator='vasp') + return read_force_constants_from_hdf5( + filename=filename, p2s_map=p2s_map, calculator="vasp" + ) -def write_triplets(triplets, - weights, - mesh, - grid_address, - grid_point=None, - filename=None): +def write_triplets( + triplets, weights, mesh, grid_address, grid_point=None, filename=None +): """Write triplets in triplets.dat.""" - warnings.warn("write_triplets() is deprecated.", - DeprecationWarning) + warnings.warn("write_triplets() is deprecated.", DeprecationWarning) triplets_filename = "triplets" suffix = "-m%d%d%d" % tuple(mesh) if grid_point is not None: - suffix += ("-g%d" % grid_point) + suffix += "-g%d" % grid_point if filename is not None: suffix += "." + filename suffix += ".dat" triplets_filename += suffix - w = open(triplets_filename, 'w') + w = open(triplets_filename, "w") for weight, g3 in zip(weights, triplets): w.write("%4d " % weight) for q3 in grid_address[g3]: @@ -418,8 +417,7 @@ def write_triplets(triplets, def write_grid_address(grid_address, mesh, filename=None): """Write grid addresses in grid_address.dat.""" - warnings.warn("write_grid_address() is deprecated.", - DeprecationWarning) + warnings.warn("write_grid_address() is deprecated.", DeprecationWarning) grid_address_filename = "grid_address" suffix = "-m%d%d%d" % tuple(mesh) @@ -428,11 +426,20 @@ def write_grid_address(grid_address, mesh, filename=None): suffix += ".dat" grid_address_filename += suffix - w = open(grid_address_filename, 'w') + w = open(grid_address_filename, "w") w.write("# Grid addresses for %dx%dx%d mesh\n" % tuple(mesh)) - w.write("#%9s %8s %8s %8s %8s %8s %8s\n" % - ("index", "a", "b", "c", - ("a%%%d" % mesh[0]), ("b%%%d" % mesh[1]), ("c%%%d" % mesh[2]))) + w.write( + "#%9s %8s %8s %8s %8s %8s %8s\n" + % ( + "index", + "a", + "b", + "c", + ("a%%%d" % mesh[0]), + ("b%%%d" % mesh[1]), + ("c%%%d" % mesh[2]), + ) + ) for i, bz_q in enumerate(grid_address): if i == np.prod(mesh): w.write("#" + "-" * 78 + "\n") @@ -443,35 +450,35 @@ def write_grid_address(grid_address, mesh, filename=None): return grid_address_filename -def write_grid_address_to_hdf5(grid_address, - mesh, - grid_mapping_table, - compression="gzip", - filename=None): +def write_grid_address_to_hdf5( + grid_address, mesh, grid_mapping_table, compression="gzip", filename=None +): """Write grid addresses to grid_address.hdf5.""" suffix = _get_filename_suffix(mesh, filename=filename) full_filename = "grid_address" + suffix + ".hdf5" - with h5py.File(full_filename, 'w') as w: - w.create_dataset('version', data=np.string_(__version__)) - w.create_dataset('mesh', data=mesh) - w.create_dataset('grid_address', data=grid_address, - compression=compression) - w.create_dataset('grid_mapping_table', data=grid_mapping_table, - compression=compression) + with h5py.File(full_filename, "w") as w: + w.create_dataset("version", data=np.string_(__version__)) + w.create_dataset("mesh", data=mesh) + w.create_dataset("grid_address", data=grid_address, compression=compression) + w.create_dataset( + "grid_mapping_table", data=grid_mapping_table, compression=compression + ) return full_filename return None -def write_imag_self_energy_at_grid_point(gp, - band_indices, - mesh, - frequencies, - gammas, - sigma=None, - temperature=None, - scattering_event_class=None, - filename=None, - is_mesh_symmetry=True): +def write_imag_self_energy_at_grid_point( + gp, + band_indices, + mesh, + frequencies, + gammas, + sigma=None, + temperature=None, + scattering_event_class=None, + filename=None, + is_mesh_symmetry=True, +): """Write imaginary part of self-energy spectrum in gamma-*.dat.""" gammas_filename = "gammas" gammas_filename += "-m%d%d%d-g%d-" % (mesh[0], mesh[1], mesh[2], gp) @@ -493,7 +500,7 @@ def write_imag_self_energy_at_grid_point(gp, gammas_filename += ".nosym" gammas_filename += ".dat" - w = open(gammas_filename, 'w') + w = open(gammas_filename, "w") for freq, g in zip(frequencies, gammas): w.write("%15.7f %20.15e\n" % (freq, g)) w.close() @@ -501,48 +508,55 @@ def write_imag_self_energy_at_grid_point(gp, return gammas_filename -def write_joint_dos(gp, - mesh, - frequencies, - jdos, - sigma=None, - temperatures=None, - filename=None, - is_mesh_symmetry=True): +def write_joint_dos( + gp, + mesh, + frequencies, + jdos, + sigma=None, + temperatures=None, + filename=None, + is_mesh_symmetry=True, +): """Write joint-DOS spectrum in jdos-*.dat.""" if temperatures is None: - return _write_joint_dos_at_t(gp, - mesh, - frequencies, - jdos, - sigma=sigma, - temperature=None, - filename=filename, - is_mesh_symmetry=is_mesh_symmetry) + return _write_joint_dos_at_t( + gp, + mesh, + frequencies, + jdos, + sigma=sigma, + temperature=None, + filename=filename, + is_mesh_symmetry=is_mesh_symmetry, + ) else: for jdos_at_t, t in zip(jdos, temperatures): - return _write_joint_dos_at_t(gp, - mesh, - frequencies, - jdos_at_t, - sigma=sigma, - temperature=t, - filename=filename, - is_mesh_symmetry=is_mesh_symmetry) + return _write_joint_dos_at_t( + gp, + mesh, + frequencies, + jdos_at_t, + sigma=sigma, + temperature=t, + filename=filename, + is_mesh_symmetry=is_mesh_symmetry, + ) -def _write_joint_dos_at_t(grid_point, - mesh, - frequencies, - jdos, - sigma=None, - temperature=None, - filename=None, - is_mesh_symmetry=True): - suffix = _get_filename_suffix(mesh, - grid_point=grid_point, - sigma=sigma, - filename=filename) +def _write_joint_dos_at_t( + grid_point, + mesh, + frequencies, + jdos, + sigma=None, + temperature=None, + filename=None, + is_mesh_symmetry=True, +): + suffix = _get_filename_suffix( + mesh, grid_point=grid_point, sigma=sigma, filename=filename + ) jdos_filename = "jdos%s" % suffix if temperature is not None: jdos_filename += "-t" + _del_zeros(temperature) @@ -552,7 +566,7 @@ def _write_joint_dos_at_t(grid_point, jdos_filename += ".%s" % filename jdos_filename += ".dat" - with open(jdos_filename, 'w') as w: + with open(jdos_filename, "w") as w: for omega, vals in zip(frequencies, jdos): w.write("%15.7f" % omega) w.write((" %20.15e" * len(vals)) % tuple(vals)) @@ -560,15 +574,17 @@ def _write_joint_dos_at_t(grid_point, return jdos_filename -def write_real_self_energy_at_grid_point(gp, - band_indices, - frequency_points, - deltas, - mesh, - epsilon, - temperature, - filename=None, - is_mesh_symmetry=True): +def write_real_self_energy_at_grid_point( + gp, + band_indices, + frequency_points, + deltas, + mesh, + epsilon, + temperature, + filename=None, + is_mesh_symmetry=True, +): """Write real part of self-energy spectrum in deltas-*.dat.""" deltas_filename = "deltas" deltas_filename += _get_filename_suffix(mesh, grid_point=gp) @@ -586,22 +602,24 @@ def write_real_self_energy_at_grid_point(gp, deltas_filename += ".nosym" deltas_filename += ".dat" - with open(deltas_filename, 'w') as w: + with open(deltas_filename, "w") as w: for freq, v in zip(frequency_points, deltas): w.write("%15.7f %20.15e\n" % (freq, v)) return deltas_filename -def write_real_self_energy_to_hdf5(grid_point, - band_indices, - temperatures, - deltas, - mesh, - epsilon, - frequency_points=None, - frequencies=None, - filename=None): +def write_real_self_energy_to_hdf5( + grid_point, + band_indices, + temperatures, + deltas, + mesh, + epsilon, + frequency_points=None, + frequencies=None, + filename=None, +): """Wirte real part of self energy (currently only bubble) in hdf5. deltas : ndarray @@ -616,7 +634,7 @@ def write_real_self_energy_to_hdf5(grid_point, """ full_filename = "deltas" suffix = _get_filename_suffix(mesh, grid_point=grid_point) - _band_indices = np.array(band_indices, dtype='intc') + _band_indices = np.array(band_indices, dtype="intc") full_filename += suffix if epsilon > 1e-5: @@ -625,31 +643,33 @@ def write_real_self_energy_to_hdf5(grid_point, full_filename += "-e%.3e" % epsilon full_filename += ".hdf5" - with h5py.File(full_filename, 'w') as w: - w.create_dataset('version', data=np.string_(__version__)) - w.create_dataset('grid_point', data=grid_point) - w.create_dataset('mesh', data=mesh) - w.create_dataset('band_index', data=_band_indices) - w.create_dataset('delta', data=deltas) - w.create_dataset('temperature', data=temperatures) - w.create_dataset('epsilon', data=epsilon) + with h5py.File(full_filename, "w") as w: + w.create_dataset("version", data=np.string_(__version__)) + w.create_dataset("grid_point", data=grid_point) + w.create_dataset("mesh", data=mesh) + w.create_dataset("band_index", data=_band_indices) + w.create_dataset("delta", data=deltas) + w.create_dataset("temperature", data=temperatures) + w.create_dataset("epsilon", data=epsilon) if frequency_points is not None: - w.create_dataset('frequency_points', data=frequency_points) + w.create_dataset("frequency_points", data=frequency_points) if frequencies is not None: - w.create_dataset('frequency', data=frequencies) + w.create_dataset("frequency", data=frequencies) return full_filename -def write_spectral_function_at_grid_point(gp, - band_indices, - frequency_points, - spectral_functions, - mesh, - temperature, - sigma=None, - filename=None, - is_mesh_symmetry=True): +def write_spectral_function_at_grid_point( + gp, + band_indices, + frequency_points, + spectral_functions, + mesh, + temperature, + sigma=None, + filename=None, + is_mesh_symmetry=True, +): """Write spectral function spectrum in spectral-*.dat.""" spectral_filename = "spectral" spectral_filename += _get_filename_suffix(mesh, grid_point=gp, sigma=sigma) @@ -663,24 +683,26 @@ def write_spectral_function_at_grid_point(gp, spectral_filename += ".nosym" spectral_filename += ".dat" - with open(spectral_filename, 'w') as w: + with open(spectral_filename, "w") as w: for freq, v in zip(frequency_points, spectral_functions): w.write("%15.7f %20.15e\n" % (freq, v)) return spectral_filename -def write_spectral_function_to_hdf5(grid_point, - band_indices, - temperatures, - spectral_functions, - shifts, - half_linewidths, - mesh, - sigma=None, - frequency_points=None, - frequencies=None, - filename=None): +def write_spectral_function_to_hdf5( + grid_point, + band_indices, + temperatures, + spectral_functions, + shifts, + half_linewidths, + mesh, + sigma=None, + frequency_points=None, + frequencies=None, + filename=None, +): """Wirte spectral functions (currently only bubble) in hdf5. spectral_functions : ndarray @@ -691,67 +713,71 @@ def write_spectral_function_to_hdf5(grid_point, """ full_filename = "spectral" suffix = _get_filename_suffix(mesh, grid_point=grid_point, sigma=sigma) - _band_indices = np.array(band_indices, dtype='intc') + _band_indices = np.array(band_indices, dtype="intc") full_filename += suffix full_filename += ".hdf5" - with h5py.File(full_filename, 'w') as w: - w.create_dataset('version', data=np.string_(__version__)) - w.create_dataset('grid_point', data=grid_point) - w.create_dataset('mesh', data=mesh) - w.create_dataset('band_index', data=_band_indices) - w.create_dataset('spectral_function', data=spectral_functions) - w.create_dataset('shift', data=shifts) - w.create_dataset('half_linewidth', data=half_linewidths) - w.create_dataset('temperature', data=temperatures) + with h5py.File(full_filename, "w") as w: + w.create_dataset("version", data=np.string_(__version__)) + w.create_dataset("grid_point", data=grid_point) + w.create_dataset("mesh", data=mesh) + w.create_dataset("band_index", data=_band_indices) + w.create_dataset("spectral_function", data=spectral_functions) + w.create_dataset("shift", data=shifts) + w.create_dataset("half_linewidth", data=half_linewidths) + w.create_dataset("temperature", data=temperatures) if frequency_points is not None: - w.create_dataset('frequency_point', data=frequency_points) + w.create_dataset("frequency_point", data=frequency_points) if frequencies is not None: - w.create_dataset('frequency', data=frequencies) + w.create_dataset("frequency", data=frequencies) return full_filename -def write_collision_to_hdf5(temperature, - mesh, - gamma=None, - gamma_isotope=None, - collision_matrix=None, - grid_point=None, - band_index=None, - sigma=None, - sigma_cutoff=None, - filename=None): +def write_collision_to_hdf5( + temperature, + mesh, + gamma=None, + gamma_isotope=None, + collision_matrix=None, + grid_point=None, + band_index=None, + sigma=None, + sigma_cutoff=None, + filename=None, +): """Write collision matrix to collision-*.hdf5.""" if band_index is None: band_indices = None else: band_indices = [band_index] - suffix = _get_filename_suffix(mesh, - grid_point=grid_point, - band_indices=band_indices, - sigma=sigma, - sigma_cutoff=sigma_cutoff, - filename=filename) + suffix = _get_filename_suffix( + mesh, + grid_point=grid_point, + band_indices=band_indices, + sigma=sigma, + sigma_cutoff=sigma_cutoff, + filename=filename, + ) full_filename = "collision" + suffix + ".hdf5" - with h5py.File(full_filename, 'w') as w: - w.create_dataset('version', data=np.string_(__version__)) - w.create_dataset('temperature', data=temperature) + with h5py.File(full_filename, "w") as w: + w.create_dataset("version", data=np.string_(__version__)) + w.create_dataset("temperature", data=temperature) if gamma is not None: - w.create_dataset('gamma', data=gamma) + w.create_dataset("gamma", data=gamma) if gamma_isotope is not None: - w.create_dataset('gamma_isotope', data=gamma_isotope) + w.create_dataset("gamma_isotope", data=gamma_isotope) if collision_matrix is not None: - w.create_dataset('collision_matrix', data=collision_matrix) + w.create_dataset("collision_matrix", data=collision_matrix) if grid_point is not None: - w.create_dataset('grid_point', data=grid_point) + w.create_dataset("grid_point", data=grid_point) if band_index is not None: - w.create_dataset('band_index', data=(band_index + 1)) + w.create_dataset("band_index", data=(band_index + 1)) if sigma is not None: - w.create_dataset('sigma', data=sigma) + w.create_dataset("sigma", data=sigma) if sigma_cutoff is not None: - w.create_dataset('sigma_cutoff_width', data=sigma_cutoff) + w.create_dataset("sigma_cutoff_width", data=sigma_cutoff) text = "Collisions " if grid_point is not None: @@ -765,45 +791,46 @@ def write_collision_to_hdf5(temperature, text += "were written into " if sigma is not None: text += "\n" - text += "\"%s\"." % ("collision" + suffix + ".hdf5") + text += '"%s".' % ("collision" + suffix + ".hdf5") print(text) return full_filename -def write_full_collision_matrix(collision_matrix, filename='fcm.hdf5'): +def write_full_collision_matrix(collision_matrix, filename="fcm.hdf5"): """Write full (non-symmetrized) collision matrix to collision-*.hdf5.""" - with h5py.File(filename, 'w') as w: - w.create_dataset('version', data=np.string_(__version__)) - w.create_dataset('collision_matrix', data=collision_matrix) + with h5py.File(filename, "w") as w: + w.create_dataset("version", data=np.string_(__version__)) + w.create_dataset("collision_matrix", data=collision_matrix) -def write_unitary_matrix_to_hdf5(temperature, - mesh, - unitary_matrix=None, - sigma=None, - sigma_cutoff=None, - solver=None, - filename=None, - verbose=False): +def write_unitary_matrix_to_hdf5( + temperature, + mesh, + unitary_matrix=None, + sigma=None, + sigma_cutoff=None, + solver=None, + filename=None, + verbose=False, +): """Write eigenvectors of collision matrices at temperatures. Depending on the choice of the solver, eigenvectors are sotred in either column-wise or row-wise. """ - suffix = _get_filename_suffix(mesh, - sigma=sigma, - sigma_cutoff=sigma_cutoff, - filename=filename) + suffix = _get_filename_suffix( + mesh, sigma=sigma, sigma_cutoff=sigma_cutoff, filename=filename + ) hdf5_filename = "unitary" + suffix + ".hdf5" - with h5py.File(hdf5_filename, 'w') as w: - w.create_dataset('version', data=np.string_(__version__)) - w.create_dataset('temperature', data=temperature) + with h5py.File(hdf5_filename, "w") as w: + w.create_dataset("version", data=np.string_(__version__)) + w.create_dataset("temperature", data=temperature) if unitary_matrix is not None: - w.create_dataset('unitary_matrix', data=unitary_matrix) + w.create_dataset("unitary_matrix", data=unitary_matrix) if solver is not None: - w.create_dataset('solver', data=solver) + w.create_dataset("solver", data=solver) if verbose: if len(temperature) > 1: @@ -820,26 +847,27 @@ def write_unitary_matrix_to_hdf5(temperature, text += "was written into " if sigma is not None: text += "\n" - text += "\"%s\"." % hdf5_filename + text += '"%s".' % hdf5_filename print(text) -def write_collision_eigenvalues_to_hdf5(temperatures, - mesh, - collision_eigenvalues, - sigma=None, - sigma_cutoff=None, - filename=None, - verbose=True): +def write_collision_eigenvalues_to_hdf5( + temperatures, + mesh, + collision_eigenvalues, + sigma=None, + sigma_cutoff=None, + filename=None, + verbose=True, +): """Write eigenvalues of collision matrix to coleigs-*.hdf5.""" - suffix = _get_filename_suffix(mesh, - sigma=sigma, - sigma_cutoff=sigma_cutoff, - filename=filename) - with h5py.File("coleigs" + suffix + ".hdf5", 'w') as w: - w.create_dataset('version', data=np.string_(__version__)) - w.create_dataset('temperature', data=temperatures) - w.create_dataset('collision_eigenvalues', data=collision_eigenvalues) + suffix = _get_filename_suffix( + mesh, sigma=sigma, sigma_cutoff=sigma_cutoff, filename=filename + ) + with h5py.File("coleigs" + suffix + ".hdf5", "w") as w: + w.create_dataset("version", data=np.string_(__version__)) + w.create_dataset("temperature", data=temperatures) + w.create_dataset("collision_eigenvalues", data=collision_eigenvalues) w.close() if verbose: @@ -847,116 +875,116 @@ def write_collision_eigenvalues_to_hdf5(temperatures, if sigma is not None: text += "with sigma %s\n" % sigma text += "were written into " - text += "\"%s\"" % ("coleigs" + suffix + ".hdf5") + text += '"%s"' % ("coleigs" + suffix + ".hdf5") print(text) -def write_kappa_to_hdf5(temperature, - mesh, - frequency=None, - group_velocity=None, - gv_by_gv=None, - mean_free_path=None, - heat_capacity=None, - kappa=None, - mode_kappa=None, - kappa_RTA=None, # RTA calculated in LBTE - mode_kappa_RTA=None, # RTA calculated in LBTE - f_vector=None, - gamma=None, - gamma_isotope=None, - gamma_N=None, - gamma_U=None, - averaged_pp_interaction=None, - qpoint=None, - weight=None, - grid_point=None, - band_index=None, - sigma=None, - sigma_cutoff=None, - kappa_unit_conversion=None, - compression="gzip", - filename=None, - verbose=True): +def write_kappa_to_hdf5( + temperature, + mesh, + frequency=None, + group_velocity=None, + gv_by_gv=None, + mean_free_path=None, + heat_capacity=None, + kappa=None, + mode_kappa=None, + kappa_RTA=None, # RTA calculated in LBTE + mode_kappa_RTA=None, # RTA calculated in LBTE + f_vector=None, + gamma=None, + gamma_isotope=None, + gamma_N=None, + gamma_U=None, + averaged_pp_interaction=None, + qpoint=None, + weight=None, + grid_point=None, + band_index=None, + sigma=None, + sigma_cutoff=None, + kappa_unit_conversion=None, + compression="gzip", + filename=None, + verbose=True, +): """Write thermal conductivity related properties in kappa-*.hdf5.""" if band_index is None: band_indices = None else: band_indices = [band_index] - suffix = _get_filename_suffix(mesh, - grid_point=grid_point, - band_indices=band_indices, - sigma=sigma, - sigma_cutoff=sigma_cutoff, - filename=filename) + suffix = _get_filename_suffix( + mesh, + grid_point=grid_point, + band_indices=band_indices, + sigma=sigma, + sigma_cutoff=sigma_cutoff, + filename=filename, + ) full_filename = "kappa" + suffix + ".hdf5" - with h5py.File(full_filename, 'w') as w: - w.create_dataset('version', data=np.string_(__version__)) - w.create_dataset('temperature', data=temperature) - w.create_dataset('mesh', data=mesh) + with h5py.File(full_filename, "w") as w: + w.create_dataset("version", data=np.string_(__version__)) + w.create_dataset("temperature", data=temperature) + w.create_dataset("mesh", data=mesh) if frequency is not None: if isinstance(frequency, np.floating): - w.create_dataset('frequency', data=frequency) + w.create_dataset("frequency", data=frequency) else: - w.create_dataset('frequency', data=frequency, - compression=compression) + w.create_dataset("frequency", data=frequency, compression=compression) if group_velocity is not None: - w.create_dataset('group_velocity', data=group_velocity, - compression=compression) + w.create_dataset( + "group_velocity", data=group_velocity, compression=compression + ) if gv_by_gv is not None: - w.create_dataset('gv_by_gv', data=gv_by_gv) + w.create_dataset("gv_by_gv", data=gv_by_gv) # if mean_free_path is not None: # w.create_dataset('mean_free_path', data=mean_free_path, # compression=compression) if heat_capacity is not None: - w.create_dataset('heat_capacity', data=heat_capacity, - compression=compression) + w.create_dataset( + "heat_capacity", data=heat_capacity, compression=compression + ) if kappa is not None: - w.create_dataset('kappa', data=kappa) + w.create_dataset("kappa", data=kappa) if mode_kappa is not None: - w.create_dataset('mode_kappa', data=mode_kappa, - compression=compression) + w.create_dataset("mode_kappa", data=mode_kappa, compression=compression) if kappa_RTA is not None: - w.create_dataset('kappa_RTA', data=kappa_RTA) + w.create_dataset("kappa_RTA", data=kappa_RTA) if mode_kappa_RTA is not None: - w.create_dataset('mode_kappa_RTA', data=mode_kappa_RTA, - compression=compression) + w.create_dataset( + "mode_kappa_RTA", data=mode_kappa_RTA, compression=compression + ) if f_vector is not None: - w.create_dataset('f_vector', data=f_vector, - compression=compression) + w.create_dataset("f_vector", data=f_vector, compression=compression) if gamma is not None: - w.create_dataset('gamma', data=gamma, - compression=compression) + w.create_dataset("gamma", data=gamma, compression=compression) if gamma_isotope is not None: - w.create_dataset('gamma_isotope', data=gamma_isotope, - compression=compression) + w.create_dataset( + "gamma_isotope", data=gamma_isotope, compression=compression + ) if gamma_N is not None: - w.create_dataset('gamma_N', data=gamma_N, - compression=compression) + w.create_dataset("gamma_N", data=gamma_N, compression=compression) if gamma_U is not None: - w.create_dataset('gamma_U', data=gamma_U, - compression=compression) + w.create_dataset("gamma_U", data=gamma_U, compression=compression) if averaged_pp_interaction is not None: - w.create_dataset('ave_pp', data=averaged_pp_interaction, - compression=compression) + w.create_dataset( + "ave_pp", data=averaged_pp_interaction, compression=compression + ) if qpoint is not None: - w.create_dataset('qpoint', data=qpoint, - compression=compression) + w.create_dataset("qpoint", data=qpoint, compression=compression) if weight is not None: - w.create_dataset('weight', data=weight, - compression=compression) + w.create_dataset("weight", data=weight, compression=compression) if grid_point is not None: - w.create_dataset('grid_point', data=grid_point) + w.create_dataset("grid_point", data=grid_point) if band_index is not None: - w.create_dataset('band_index', data=(band_index + 1)) + w.create_dataset("band_index", data=(band_index + 1)) if sigma is not None: - w.create_dataset('sigma', data=sigma) + w.create_dataset("sigma", data=sigma) if sigma_cutoff is not None: - w.create_dataset('sigma_cutoff_width', data=sigma_cutoff) + w.create_dataset("sigma_cutoff_width", data=sigma_cutoff) if kappa_unit_conversion is not None: - w.create_dataset('kappa_unit_conversion', - data=kappa_unit_conversion) + w.create_dataset("kappa_unit_conversion", data=kappa_unit_conversion) if verbose: text = "" @@ -983,30 +1011,34 @@ def write_kappa_to_hdf5(temperature, text += "were written into " if band_index is None: text += "\n" - text += "\"%s\"." % full_filename + text += '"%s".' % full_filename print(text) return full_filename -def read_gamma_from_hdf5(mesh, - grid_point=None, - band_index=None, - sigma=None, - sigma_cutoff=None, - filename=None, - verbose=True): +def read_gamma_from_hdf5( + mesh, + grid_point=None, + band_index=None, + sigma=None, + sigma_cutoff=None, + filename=None, + verbose=True, +): """Read gamma from kappa-*.hdf5 file.""" if band_index is None: band_indices = None else: band_indices = [band_index] - suffix = _get_filename_suffix(mesh, - grid_point=grid_point, - band_indices=band_indices, - sigma=sigma, - sigma_cutoff=sigma_cutoff, - filename=filename) + suffix = _get_filename_suffix( + mesh, + grid_point=grid_point, + band_indices=band_indices, + sigma=sigma, + sigma_cutoff=sigma_cutoff, + filename=filename, + ) full_filename = "kappa" + suffix + ".hdf5" if not os.path.exists(full_filename): if verbose: @@ -1015,12 +1047,9 @@ def read_gamma_from_hdf5(mesh, read_data = {} - with h5py.File(full_filename, 'r') as f: - read_data['gamma'] = f['gamma'][:] - for key in ('gamma_isotope', - 'ave_pp', - 'gamma_N', - 'gamma_U'): + with h5py.File(full_filename, "r") as f: + read_data["gamma"] = f["gamma"][:] + for key in ("gamma_isotope", "ave_pp", "gamma_N", "gamma_U"): if key in f.keys(): if len(f[key].shape) > 0: read_data[key] = f[key][:] @@ -1032,45 +1061,48 @@ def read_gamma_from_hdf5(mesh, return read_data -def read_collision_from_hdf5(mesh, - indices=None, - grid_point=None, - band_index=None, - sigma=None, - sigma_cutoff=None, - filename=None, - verbose=True): +def read_collision_from_hdf5( + mesh, + indices=None, + grid_point=None, + band_index=None, + sigma=None, + sigma_cutoff=None, + filename=None, + verbose=True, +): """Read colliction matrix.""" if band_index is None: band_indices = None else: band_indices = [band_index] - suffix = _get_filename_suffix(mesh, - grid_point=grid_point, - band_indices=band_indices, - sigma=sigma, - sigma_cutoff=sigma_cutoff, - filename=filename) + suffix = _get_filename_suffix( + mesh, + grid_point=grid_point, + band_indices=band_indices, + sigma=sigma, + sigma_cutoff=sigma_cutoff, + filename=filename, + ) full_filename = "collision" + suffix + ".hdf5" if not os.path.exists(full_filename): if verbose: print("%s not found." % full_filename) return None - with h5py.File(full_filename, 'r') as f: - if indices == 'all': - colmat_shape = (1,) + f['collision_matrix'].shape - collision_matrix = np.zeros(colmat_shape, - dtype='double', order='C') - gamma = np.array(f['gamma'][:], dtype='double', order='C') - collision_matrix[0] = f['collision_matrix'][:] - temperatures = np.array(f['temperature'][:], dtype='double') + with h5py.File(full_filename, "r") as f: + if indices == "all": + colmat_shape = (1,) + f["collision_matrix"].shape + collision_matrix = np.zeros(colmat_shape, dtype="double", order="C") + gamma = np.array(f["gamma"][:], dtype="double", order="C") + collision_matrix[0] = f["collision_matrix"][:] + temperatures = np.array(f["temperature"][:], dtype="double") else: - colmat_shape = (1, len(indices)) + f['collision_matrix'].shape[1:] - collision_matrix = np.zeros(colmat_shape, dtype='double') - gamma = np.array(f['gamma'][indices], dtype='double', order='C') - collision_matrix[0] = f['collision_matrix'][indices] - temperatures = np.array(f['temperature'][indices], dtype='double') + colmat_shape = (1, len(indices)) + f["collision_matrix"].shape[1:] + collision_matrix = np.zeros(colmat_shape, dtype="double") + gamma = np.array(f["gamma"][indices], dtype="double", order="C") + collision_matrix[0] = f["collision_matrix"][indices] + temperatures = np.array(f["temperature"][indices], dtype="double") if verbose: text = "Collisions " @@ -1079,8 +1111,10 @@ def read_collision_from_hdf5(mesh, text += "at grid point %d " % grid_point else: if grid_point is not None: - text += ("at (grid point %d, band index %d) " % - (grid_point, band_index)) + text += "at (grid point %d, band index %d) " % ( + grid_point, + band_index, + ) if sigma is not None: if grid_point is not None: text += "and " @@ -1095,7 +1129,7 @@ def read_collision_from_hdf5(mesh, else: text += "\n" text += "were read from " - text += "\"%s\"." % full_filename + text += '"%s".' % full_filename print(text) return collision_matrix, gamma, temperatures @@ -1103,72 +1137,70 @@ def read_collision_from_hdf5(mesh, return None -def write_pp_to_hdf5(mesh, - pp=None, - g_zero=None, - grid_point=None, - triplet=None, - weight=None, - triplet_map=None, - triplet_all=None, - sigma=None, - sigma_cutoff=None, - filename=None, - verbose=True, - check_consistency=False, - compression="gzip"): +def write_pp_to_hdf5( + mesh, + pp=None, + g_zero=None, + grid_point=None, + triplet=None, + weight=None, + triplet_map=None, + triplet_all=None, + sigma=None, + sigma_cutoff=None, + filename=None, + verbose=True, + check_consistency=False, + compression="gzip", +): """Write ph-ph interaction strength in its hdf5 file.""" - suffix = _get_filename_suffix(mesh, - grid_point=grid_point, - sigma=sigma, - sigma_cutoff=sigma_cutoff, - filename=filename) + suffix = _get_filename_suffix( + mesh, + grid_point=grid_point, + sigma=sigma, + sigma_cutoff=sigma_cutoff, + filename=filename, + ) full_filename = "pp" + suffix + ".hdf5" - with h5py.File(full_filename, 'w') as w: - w.create_dataset('version', data=np.string_(__version__)) + with h5py.File(full_filename, "w") as w: + w.create_dataset("version", data=np.string_(__version__)) if pp is not None: if g_zero is None: - w.create_dataset('pp', data=pp, - compression=compression) + w.create_dataset("pp", data=pp, compression=compression) if triplet is not None: - w.create_dataset('triplet', data=triplet, - compression=compression) + w.create_dataset("triplet", data=triplet, compression=compression) if weight is not None: - w.create_dataset('weight', data=weight, - compression=compression) + w.create_dataset("weight", data=weight, compression=compression) if triplet_map is not None: - w.create_dataset('triplet_map', data=triplet_map, - compression=compression) + w.create_dataset( + "triplet_map", data=triplet_map, compression=compression + ) if triplet_all is not None: - w.create_dataset('triplet_all', data=triplet_all, - compression=compression) + w.create_dataset( + "triplet_all", data=triplet_all, compression=compression + ) else: x = g_zero.ravel() - nonzero_pp = np.array(pp.ravel()[x == 0], dtype='double') + nonzero_pp = np.array(pp.ravel()[x == 0], dtype="double") bytelen = len(x) // 8 remlen = len(x) % 8 - y = x[:bytelen * 8].reshape(-1, 8) + y = x[: bytelen * 8].reshape(-1, 8) z = np.packbits(y) if remlen != 0: - z_rem = np.packbits(x[bytelen * 8:]) + z_rem = np.packbits(x[bytelen * 8 :]) # No compression for pp because already almost random. - w.create_dataset('nonzero_pp', data=nonzero_pp, - compression=None) - w.create_dataset('pp_shape', data=pp.shape, - compression=compression) - w.create_dataset('g_zero_bits', data=z, - compression=compression) + w.create_dataset("nonzero_pp", data=nonzero_pp, compression=None) + w.create_dataset("pp_shape", data=pp.shape, compression=compression) + w.create_dataset("g_zero_bits", data=z, compression=compression) if remlen != 0: - w.create_dataset('g_zero_bits_reminder', data=z_rem) + w.create_dataset("g_zero_bits_reminder", data=z_rem) # This is only for the test and coupled with read_pp_from_hdf5. if check_consistency: - w.create_dataset('pp', data=pp, - compression=compression) - w.create_dataset('g_zero', data=g_zero, - compression=compression) + w.create_dataset("pp", data=pp, compression=compression) + w.create_dataset("g_zero", data=g_zero, compression=compression) if verbose: text = "" @@ -1189,134 +1221,135 @@ def write_pp_to_hdf5(mesh, else: text += "were written into " text += "\n" - text += "\"%s\"." % full_filename + text += '"%s".' % full_filename print(text) return full_filename -def read_pp_from_hdf5(mesh, - grid_point=None, - sigma=None, - sigma_cutoff=None, - filename=None, - verbose=True, - check_consistency=False): +def read_pp_from_hdf5( + mesh, + grid_point=None, + sigma=None, + sigma_cutoff=None, + filename=None, + verbose=True, + check_consistency=False, +): """Read ph-ph interaction strength from its hdf5 file.""" - suffix = _get_filename_suffix(mesh, - grid_point=grid_point, - sigma=sigma, - sigma_cutoff=sigma_cutoff, - filename=filename) + suffix = _get_filename_suffix( + mesh, + grid_point=grid_point, + sigma=sigma, + sigma_cutoff=sigma_cutoff, + filename=filename, + ) full_filename = "pp" + suffix + ".hdf5" if not os.path.exists(full_filename): if verbose: print("%s not found." % full_filename) return None - with h5py.File(full_filename, 'r') as f: - if 'nonzero_pp' in f: - nonzero_pp = f['nonzero_pp'][:] - pp_shape = f['pp_shape'][:] - z = f['g_zero_bits'][:] + with h5py.File(full_filename, "r") as f: + if "nonzero_pp" in f: + nonzero_pp = f["nonzero_pp"][:] + pp_shape = f["pp_shape"][:] + z = f["g_zero_bits"][:] bytelen = np.prod(pp_shape) // 8 remlen = 0 - if 'g_zero_bits_reminder' in f: - z_rem = f['g_zero_bits_reminder'][:] + if "g_zero_bits_reminder" in f: + z_rem = f["g_zero_bits_reminder"][:] remlen = np.prod(pp_shape) - bytelen * 8 bits = np.unpackbits(z) - if not bits.flags['C_CONTIGUOUS']: - bits = np.array(bits, dtype='uint8') + if not bits.flags["C_CONTIGUOUS"]: + bits = np.array(bits, dtype="uint8") - g_zero = np.zeros(pp_shape, dtype='byte', order='C') + g_zero = np.zeros(pp_shape, dtype="byte", order="C") b = g_zero.ravel() - b[:(bytelen * 8)] = bits + b[: (bytelen * 8)] = bits if remlen != 0: b[-remlen:] = np.unpackbits(z_rem)[:remlen] - pp = np.zeros(pp_shape, dtype='double', order='C') + pp = np.zeros(pp_shape, dtype="double", order="C") pp_ravel = pp.ravel() pp_ravel[g_zero.ravel() == 0] = nonzero_pp # check_consistency==True in write_pp_to_hdf5 required. if check_consistency and g_zero is not None: if verbose: - print("Checking consistency of ph-ph interanction " - "strength.") - assert (g_zero == f['g_zero'][:]).all() - assert np.allclose(pp, f['pp'][:]) + print("Checking consistency of ph-ph interanction " "strength.") + assert (g_zero == f["g_zero"][:]).all() + assert np.allclose(pp, f["pp"][:]) else: - pp = np.zeros(f['pp'].shape, dtype='double', order='C') - pp[:] = f['pp'][:] + pp = np.zeros(f["pp"].shape, dtype="double", order="C") + pp[:] = f["pp"][:] g_zero = None if verbose: - print("Ph-ph interaction strength was read from \"%s\"." % - full_filename) + print('Ph-ph interaction strength was read from "%s".' % full_filename) return pp, g_zero return None -def write_gamma_detail_to_hdf5(temperature, - mesh, - gamma_detail=None, - grid_point=None, - triplet=None, - weight=None, - triplet_map=None, - triplet_all=None, - frequency_points=None, - band_index=None, - sigma=None, - sigma_cutoff=None, - compression="gzip", - filename=None, - verbose=True): +def write_gamma_detail_to_hdf5( + temperature, + mesh, + gamma_detail=None, + grid_point=None, + triplet=None, + weight=None, + triplet_map=None, + triplet_all=None, + frequency_points=None, + band_index=None, + sigma=None, + sigma_cutoff=None, + compression="gzip", + filename=None, + verbose=True, +): """Write detailed gamma in its hdf5 file.""" if band_index is None: band_indices = None else: band_indices = [band_index] - suffix = _get_filename_suffix(mesh, - grid_point=grid_point, - band_indices=band_indices, - sigma=sigma, - sigma_cutoff=sigma_cutoff, - filename=filename) + suffix = _get_filename_suffix( + mesh, + grid_point=grid_point, + band_indices=band_indices, + sigma=sigma, + sigma_cutoff=sigma_cutoff, + filename=filename, + ) full_filename = "gamma_detail" + suffix + ".hdf5" - with h5py.File(full_filename, 'w') as w: - w.create_dataset('version', data=np.string_(__version__)) - w.create_dataset('temperature', data=temperature) - w.create_dataset('mesh', data=mesh) + with h5py.File(full_filename, "w") as w: + w.create_dataset("version", data=np.string_(__version__)) + w.create_dataset("temperature", data=temperature) + w.create_dataset("mesh", data=mesh) if gamma_detail is not None: - w.create_dataset('gamma_detail', data=gamma_detail, - compression=compression) + w.create_dataset("gamma_detail", data=gamma_detail, compression=compression) if triplet is not None: - w.create_dataset('triplet', data=triplet, - compression=compression) + w.create_dataset("triplet", data=triplet, compression=compression) if weight is not None: - w.create_dataset('weight', data=weight, - compression=compression) + w.create_dataset("weight", data=weight, compression=compression) if triplet_map is not None: - w.create_dataset('triplet_map', data=triplet_map, - compression=compression) + w.create_dataset("triplet_map", data=triplet_map, compression=compression) if triplet_all is not None: - w.create_dataset('triplet_all', data=triplet_all, - compression=compression) + w.create_dataset("triplet_all", data=triplet_all, compression=compression) if grid_point is not None: - w.create_dataset('grid_point', data=grid_point) + w.create_dataset("grid_point", data=grid_point) if band_index is not None: - w.create_dataset('band_index', data=(band_index + 1)) + w.create_dataset("band_index", data=(band_index + 1)) if sigma is not None: - w.create_dataset('sigma', data=sigma) + w.create_dataset("sigma", data=sigma) if sigma_cutoff is not None: - w.create_dataset('sigma_cutoff_width', data=sigma_cutoff) + w.create_dataset("sigma_cutoff_width", data=sigma_cutoff) if frequency_points is not None: - w.create_dataset('frequency_point', data=frequency_points) + w.create_dataset("frequency_point", data=frequency_points) if verbose: text = "" @@ -1340,7 +1373,7 @@ def write_gamma_detail_to_hdf5(temperature, text += "were written into " if band_index is None: text += "\n" - text += "\"%s\"." % full_filename + text += '"%s".' % full_filename print(text) return full_filename @@ -1348,33 +1381,25 @@ def write_gamma_detail_to_hdf5(temperature, return None -def write_phonon_to_hdf5(frequency, - eigenvector, - grid_address, - mesh, - compression="gzip", - filename=None): +def write_phonon_to_hdf5( + frequency, eigenvector, grid_address, mesh, compression="gzip", filename=None +): """Write phonon on grid in its hdf5 file.""" suffix = _get_filename_suffix(mesh, filename=filename) full_filename = "phonon" + suffix + ".hdf5" - with h5py.File(full_filename, 'w') as w: - w.create_dataset('version', data=np.string_(__version__)) - w.create_dataset('mesh', data=mesh) - w.create_dataset('grid_address', data=grid_address, - compression=compression) - w.create_dataset('frequency', data=frequency, - compression=compression) - w.create_dataset('eigenvector', data=eigenvector, - compression=compression) + with h5py.File(full_filename, "w") as w: + w.create_dataset("version", data=np.string_(__version__)) + w.create_dataset("mesh", data=mesh) + w.create_dataset("grid_address", data=grid_address, compression=compression) + w.create_dataset("frequency", data=frequency, compression=compression) + w.create_dataset("eigenvector", data=eigenvector, compression=compression) return full_filename return None -def read_phonon_from_hdf5(mesh, - filename=None, - verbose=True): +def read_phonon_from_hdf5(mesh, filename=None, verbose=True): """Read phonon from its hdf5 file.""" suffix = _get_filename_suffix(mesh, filename=filename) full_filename = "phonon" + suffix + ".hdf5" @@ -1383,52 +1408,49 @@ def read_phonon_from_hdf5(mesh, print("%s not found." % full_filename) return None - with h5py.File(full_filename, 'r') as f: - frequencies = np.array(f['frequency'][:], dtype='double', order='C') + with h5py.File(full_filename, "r") as f: + frequencies = np.array(f["frequency"][:], dtype="double", order="C") itemsize = frequencies.itemsize - eigenvectors = np.array(f['eigenvector'][:], - dtype=("c%d" % (itemsize * 2)), order='C') - mesh_in_file = np.array(f['mesh'][:], dtype='intc') - grid_address = np.array(f['grid_address'][:], dtype='intc', order='C') + eigenvectors = np.array( + f["eigenvector"][:], dtype=("c%d" % (itemsize * 2)), order="C" + ) + mesh_in_file = np.array(f["mesh"][:], dtype="intc") + grid_address = np.array(f["grid_address"][:], dtype="intc", order="C") assert (mesh_in_file == mesh).all(), "Mesh numbers are inconsistent." if verbose: - print("Phonons are read from \"%s\"." % full_filename) + print('Phonons are read from "%s".' % full_filename) return frequencies, eigenvectors, grid_address return None -def write_ir_grid_points(bz_grid, - grid_points, - grid_weights, - primitive_lattice): +def write_ir_grid_points(bz_grid, grid_points, grid_weights, primitive_lattice): """Write ir-grid-points in yaml.""" lines = [] lines.append("mesh: [ %d, %d, %d ]" % tuple(bz_grid.D_diag)) lines.append("reciprocal_lattice:") - for vec, axis in zip(primitive_lattice.T, ('a*', 'b*', 'c*')): - lines.append("- [ %12.8f, %12.8f, %12.8f ] # %2s" - % (tuple(vec) + (axis,))) + for vec, axis in zip(primitive_lattice.T, ("a*", "b*", "c*")): + lines.append("- [ %12.8f, %12.8f, %12.8f ] # %2s" % (tuple(vec) + (axis,))) lines.append("microzone_lattice:") - for vec, axis in zip(bz_grid.microzone_lattice.T, ('a*', 'b*', 'c*')): - lines.append("- [ %12.8f, %12.8f, %12.8f ] # %2s" - % (tuple(vec) + (axis,))) + for vec, axis in zip(bz_grid.microzone_lattice.T, ("a*", "b*", "c*")): + lines.append("- [ %12.8f, %12.8f, %12.8f ] # %2s" % (tuple(vec) + (axis,))) lines.append("num_reduced_ir_grid_points: %d" % len(grid_points)) lines.append("ir_grid_points: # [address, weight]") for g, weight in zip(grid_points, grid_weights): lines.append("- grid_point: %d" % g) lines.append(" weight: %d" % weight) - lines.append(" grid_address: [ %12d, %12d, %12d ]" % - tuple(bz_grid.addresses[g])) + lines.append( + " grid_address: [ %12d, %12d, %12d ]" % tuple(bz_grid.addresses[g]) + ) q = np.dot(bz_grid.addresses[g], bz_grid.QDinv.T) lines.append(" q-point: [ %12.7f, %12.7f, %12.7f ]" % tuple(q)) lines.append("") - with open("ir_grid_points.yaml", 'w') as w: + with open("ir_grid_points.yaml", "w") as w: w.write("\n".join(lines)) @@ -1438,20 +1460,19 @@ def parse_disp_fc2_yaml(filename="disp_fc2.yaml", return_cell=False): This is obsolete at v2 and later versions. """ - warnings.warn("parse_disp_fc2_yaml() is deprecated.", - DeprecationWarning) + warnings.warn("parse_disp_fc2_yaml() is deprecated.", DeprecationWarning) dataset = _parse_yaml(filename) - natom = dataset['natom'] + natom = dataset["natom"] new_dataset = {} - new_dataset['natom'] = natom + new_dataset["natom"] = natom new_first_atoms = [] - for first_atoms in dataset['first_atoms']: - first_atoms['number'] -= 1 - atom1 = first_atoms['number'] - disp1 = first_atoms['displacement'] - new_first_atoms.append({'number': atom1, 'displacement': disp1}) - new_dataset['first_atoms'] = new_first_atoms + for first_atoms in dataset["first_atoms"]: + first_atoms["number"] -= 1 + atom1 = first_atoms["number"] + disp1 = first_atoms["displacement"] + new_first_atoms.append({"number": atom1, "displacement": disp1}) + new_dataset["first_atoms"] = new_first_atoms if return_cell: cell = get_cell_from_disp_yaml(dataset) @@ -1466,34 +1487,32 @@ def parse_disp_fc3_yaml(filename="disp_fc3.yaml", return_cell=False): This is obsolete at v2 and later versions. """ - warnings.warn("parse_disp_fc3_yaml() is deprecated.", - DeprecationWarning) + warnings.warn("parse_disp_fc3_yaml() is deprecated.", DeprecationWarning) dataset = _parse_yaml(filename) - natom = dataset['natom'] + natom = dataset["natom"] new_dataset = {} - new_dataset['natom'] = natom - if 'cutoff_distance' in dataset: - new_dataset['cutoff_distance'] = dataset['cutoff_distance'] + new_dataset["natom"] = natom + if "cutoff_distance" in dataset: + new_dataset["cutoff_distance"] = dataset["cutoff_distance"] new_first_atoms = [] - for first_atoms in dataset['first_atoms']: - atom1 = first_atoms['number'] - 1 - disp1 = first_atoms['displacement'] + for first_atoms in dataset["first_atoms"]: + atom1 = first_atoms["number"] - 1 + disp1 = first_atoms["displacement"] new_second_atoms = [] - for second_atom in first_atoms['second_atoms']: - disp2_dataset = {'number': second_atom['number'] - 1} - if 'included' in second_atom: - disp2_dataset.update({'included': second_atom['included']}) - if 'distance' in second_atom: - disp2_dataset.update( - {'pair_distance': second_atom['distance']}) - for disp2 in second_atom['displacements']: - disp2_dataset.update({'displacement': disp2}) + for second_atom in first_atoms["second_atoms"]: + disp2_dataset = {"number": second_atom["number"] - 1} + if "included" in second_atom: + disp2_dataset.update({"included": second_atom["included"]}) + if "distance" in second_atom: + disp2_dataset.update({"pair_distance": second_atom["distance"]}) + for disp2 in second_atom["displacements"]: + disp2_dataset.update({"displacement": disp2}) new_second_atoms.append(disp2_dataset.copy()) - new_first_atoms.append({'number': atom1, - 'displacement': disp1, - 'second_atoms': new_second_atoms}) - new_dataset['first_atoms'] = new_first_atoms + new_first_atoms.append( + {"number": atom1, "displacement": disp1, "second_atoms": new_second_atoms} + ) + new_dataset["first_atoms"] = new_first_atoms if return_cell: cell = get_cell_from_disp_yaml(dataset) @@ -1502,14 +1521,12 @@ def parse_disp_fc3_yaml(filename="disp_fc3.yaml", return_cell=False): return new_dataset -def parse_FORCES_FC2(disp_dataset, - filename="FORCES_FC2", - unit_conversion_factor=None): +def parse_FORCES_FC2(disp_dataset, filename="FORCES_FC2", unit_conversion_factor=None): """Parse type1 FORCES_FC2 file and store forces in disp_dataset.""" - num_atom = disp_dataset['natom'] - num_disp = len(disp_dataset['first_atoms']) + num_atom = disp_dataset["natom"] + num_disp = len(disp_dataset["first_atoms"]) forces_fc2 = [] - with open(filename, 'r') as f2: + with open(filename, "r") as f2: for i in range(num_disp): forces = _parse_force_lines(f2, num_atom) if forces is None: @@ -1517,29 +1534,27 @@ def parse_FORCES_FC2(disp_dataset, else: forces_fc2.append(forces) - for i, disp1 in enumerate(disp_dataset['first_atoms']): + for i, disp1 in enumerate(disp_dataset["first_atoms"]): if unit_conversion_factor is not None: - disp1['forces'] = forces_fc2[i] * unit_conversion_factor + disp1["forces"] = forces_fc2[i] * unit_conversion_factor else: - disp1['forces'] = forces_fc2[i] + disp1["forces"] = forces_fc2[i] -def parse_FORCES_FC3(disp_dataset, - filename="FORCES_FC3", - use_loadtxt=False, - unit_conversion_factor=None): +def parse_FORCES_FC3( + disp_dataset, filename="FORCES_FC3", use_loadtxt=False, unit_conversion_factor=None +): """Parse type1 FORCES_FC3 and store forces in disp_dataset.""" - num_atom = disp_dataset['natom'] - num_disp = len(disp_dataset['first_atoms']) - for disp1 in disp_dataset['first_atoms']: - num_disp += len(disp1['second_atoms']) + num_atom = disp_dataset["natom"] + num_disp = len(disp_dataset["first_atoms"]) + for disp1 in disp_dataset["first_atoms"]: + num_disp += len(disp1["second_atoms"]) if use_loadtxt: forces_fc3 = np.loadtxt(filename).reshape((num_disp, -1, 3)) else: - forces_fc3 = np.zeros((num_disp, num_atom, 3), - dtype='double', order='C') - with open(filename, 'r') as f3: + forces_fc3 = np.zeros((num_disp, num_atom, 3), dtype="double", order="C") + with open(filename, "r") as f3: for i in range(num_disp): forces = _parse_force_lines(f3, num_atom) if forces is None: @@ -1551,31 +1566,35 @@ def parse_FORCES_FC3(disp_dataset, forces_fc3 *= unit_conversion_factor i = 0 - for disp1 in disp_dataset['first_atoms']: - disp1['forces'] = forces_fc3[i] + for disp1 in disp_dataset["first_atoms"]: + disp1["forces"] = forces_fc3[i] i += 1 - for disp1 in disp_dataset['first_atoms']: - for disp2 in disp1['second_atoms']: - disp2['forces'] = forces_fc3[i] + for disp1 in disp_dataset["first_atoms"]: + for disp2 in disp1["second_atoms"]: + disp2["forces"] = forces_fc3[i] i += 1 -def get_filename_suffix(mesh, - grid_point=None, - band_indices=None, - sigma=None, - sigma_cutoff=None, - temperature=None, - filename=None): +def get_filename_suffix( + mesh, + grid_point=None, + band_indices=None, + sigma=None, + sigma_cutoff=None, + temperature=None, + filename=None, +): """Return filename suffix corresponding to parameters.""" - return _get_filename_suffix(mesh, - grid_point=grid_point, - band_indices=band_indices, - sigma=sigma, - sigma_cutoff=sigma_cutoff, - temperature=temperature, - filename=filename) + return _get_filename_suffix( + mesh, + grid_point=grid_point, + band_indices=band_indices, + sigma=sigma, + sigma_cutoff=sigma_cutoff, + temperature=temperature, + filename=filename, + ) def get_length_of_first_line(f): @@ -1586,9 +1605,9 @@ def get_length_of_first_line(f): """ for line in f: - if line.strip() == '': + if line.strip() == "": continue - elif line.strip()[0] == '#': + elif line.strip()[0] == "#": continue else: f.seek(0) @@ -1597,17 +1616,19 @@ def get_length_of_first_line(f): raise RuntimeError("File doesn't contain relevant infomration.") -def _get_filename_suffix(mesh, - grid_point=None, - band_indices=None, - sigma=None, - sigma_cutoff=None, - temperature=None, - filename=None): +def _get_filename_suffix( + mesh, + grid_point=None, + band_indices=None, + sigma=None, + sigma_cutoff=None, + temperature=None, + filename=None, +): """Return filename suffix corresponding to parameters.""" suffix = "-m%d%d%d" % tuple(mesh) if grid_point is not None: - suffix += ("-g%d" % grid_point) + suffix += "-g%d" % grid_point if band_indices is not None: suffix += "-" for bi in band_indices: @@ -1627,7 +1648,7 @@ def _get_filename_suffix(mesh, def _del_zeros(val): """Remove trailing zeros after decimal point.""" - return ("%f" % val).rstrip('0').rstrip(r'\.') + return ("%f" % val).rstrip("0").rstrip(r"\.") def _parse_yaml(file_yaml): @@ -1637,15 +1658,14 @@ def _parse_yaml(file_yaml): So this is obsolete at v2 and later versions. """ - warnings.warn("_parse_yaml() is deprecated.", - DeprecationWarning) + warnings.warn("_parse_yaml() is deprecated.", DeprecationWarning) import yaml + try: from yaml import CLoader as Loader - from yaml import CDumper as Dumper except ImportError: - from yaml import Loader, Dumper + from yaml import Loader with open(file_yaml) as f: string = f.read() @@ -1656,9 +1676,9 @@ def _parse_yaml(file_yaml): def _parse_force_lines(forcefile, num_atom): forces = [] for line in forcefile: - if line.strip() == '': + if line.strip() == "": continue - if line.strip()[0] == '#': + if line.strip()[0] == "#": continue forces.append([float(x) for x in line.strip().split()]) if len(forces) == num_atom: diff --git a/phono3py/interface/__init__.py b/phono3py/interface/__init__.py index e69de29b..857b8148 100644 --- a/phono3py/interface/__init__.py +++ b/phono3py/interface/__init__.py @@ -0,0 +1 @@ +"""Interfaces to routines and data structures.""" diff --git a/phono3py/interface/alm.py b/phono3py/interface/alm.py index 26c8a408..804b8702 100644 --- a/phono3py/interface/alm.py +++ b/phono3py/interface/alm.py @@ -1,3 +1,4 @@ +"""ALM interface for force constants calculation.""" # Copyright (C) 2016 Atsushi Togo # All rights reserved. # @@ -32,50 +33,26 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -import numpy as np from phonopy.interface.alm import run_alm -def get_fc3(supercell, - primitive, - displacements, - forces, - options=None, - is_compact_fc=False, - log_level=0): - return run_alm(supercell, - primitive, - displacements, - forces, - 2, - is_compact_fc=is_compact_fc, - options=options, - log_level=log_level) - - -def _extract_fc3_from_alm(alm, - natom, - is_compact_fc, - p2s_map=None, - p2p_map=None): - p2s_map_alm = alm.getmap_primitive_to_supercell()[0] - if (p2s_map is not None and - len(p2s_map_alm) == len(p2s_map) and - (p2s_map_alm == p2s_map).all()): - fc3 = np.zeros((len(p2s_map), natom, natom, 3, 3, 3), - dtype='double', order='C') - for (fc, indices) in zip(*alm.get_fc(2, mode='origin')): - v1, v2, v3 = indices // 3 - c1, c2, c3 = indices % 3 - fc3[p2p_map[v1], v2, v3, c1, c2, c3] = fc - fc3[p2p_map[v1], v3, v2, c1, c3, c2] = fc - else: - fc3 = np.zeros((natom, natom, natom, 3, 3, 3), - dtype='double', order='C') - for (fc, indices) in zip(*alm.get_fc(2, mode='all')): - v1, v2, v3 = indices // 3 - c1, c2, c3 = indices % 3 - fc3[v1, v2, v3, c1, c2, c3] = fc - fc3[v1, v3, v2, c1, c3, c2] = fc - - return fc3 +def get_fc3( + supercell, + primitive, + displacements, + forces, + options=None, + is_compact_fc=False, + log_level=0, +): + """Calculate fc3 using ALM.""" + return run_alm( + supercell, + primitive, + displacements, + forces, + 2, + is_compact_fc=is_compact_fc, + options=options, + log_level=log_level, + ) diff --git a/phono3py/interface/calculator.py b/phono3py/interface/calculator.py index 4bdffc64..a62da670 100644 --- a/phono3py/interface/calculator.py +++ b/phono3py/interface/calculator.py @@ -34,35 +34,30 @@ calculator_info = { - 'abinit': {'option': {'name': "--abinit", - 'help': "Invoke Abinit mode"}}, + "abinit": {"option": {"name": "--abinit", "help": "Invoke Abinit mode"}}, # 'aims': {'option': {'name': "--aims", # 'help': "Invoke FHI-aims mode"}}, # 'cp2k': {'option': {'name': "--cp2k", # 'help': "Invoke CP2K mode"}}, - 'crystal': {'option': {'name': "--crystal", - 'help': "Invoke CRYSTAL mode"}}, + "crystal": {"option": {"name": "--crystal", "help": "Invoke CRYSTAL mode"}}, # 'dftbp': {'option': {'name': "--dftb+", # 'help': "Invoke dftb+ mode"}}, # 'elk': {'option': {'name': "--elk", # 'help': "Invoke elk mode"}}, - 'qe': {'option': {'name': "--qe", - 'help': "Invoke Quantum espresso (QE) mode"}}, + "qe": {"option": {"name": "--qe", "help": "Invoke Quantum espresso (QE) mode"}}, # 'siesta': {'option': {'name': "--siesta", # 'help': "Invoke Siesta mode"}}, - 'turbomole': {'option': {'name': "--turbomole", - 'help': "Invoke TURBOMOLE mode"}}, - 'vasp': {'option': {'name': "--vasp", - 'help': "Invoke Vasp mode"}}, + "turbomole": {"option": {"name": "--turbomole", "help": "Invoke TURBOMOLE mode"}}, + "vasp": {"option": {"name": "--vasp", "help": "Invoke Vasp mode"}}, # 'wien2k': {'option': {'name': "--wien2k", # 'help': "Invoke Wien2k mode"}}, } def get_default_displacement_distance(interface_mode): - if interface_mode in ('qe', 'abinit', 'turbomole'): + if interface_mode in ("qe", "abinit", "turbomole"): displacement_distance = 0.06 - elif interface_mode == 'crystal': + elif interface_mode == "crystal": displacement_distance = 0.03 else: displacement_distance = 0.03 @@ -71,25 +66,26 @@ def get_default_displacement_distance(interface_mode): def get_additional_info_to_write_supercells(interface_mode, supercell_matrix): additional_info = {} - if interface_mode == 'crystal': - additional_info['template_file'] = "TEMPLATE3" - additional_info['supercell_matrix'] = supercell_matrix + if interface_mode == "crystal": + additional_info["template_file"] = "TEMPLATE3" + additional_info["supercell_matrix"] = supercell_matrix return additional_info -def get_additional_info_to_write_fc2_supercells(interface_mode, - phonon_supercell_matrix): +def get_additional_info_to_write_fc2_supercells( + interface_mode, phonon_supercell_matrix +): additional_info = {} - if interface_mode == 'qe': - additional_info['pre_filename'] = "supercell_fc2" - elif interface_mode == 'crystal': - additional_info['template_file'] = "TEMPLATE" - additional_info['pre_filename'] = "supercell_fc2" - additional_info['supercell_matrix'] = phonon_supercell_matrix - elif interface_mode == 'abinit': - additional_info['pre_filename'] = "supercell_fc2" - elif interface_mode == 'turbomole': - additional_info['pre_filename'] = "supercell_fc2" + if interface_mode == "qe": + additional_info["pre_filename"] = "supercell_fc2" + elif interface_mode == "crystal": + additional_info["template_file"] = "TEMPLATE" + additional_info["pre_filename"] = "supercell_fc2" + additional_info["supercell_matrix"] = phonon_supercell_matrix + elif interface_mode == "abinit": + additional_info["pre_filename"] = "supercell_fc2" + elif interface_mode == "turbomole": + additional_info["pre_filename"] = "supercell_fc2" else: - additional_info['pre_filename'] = "POSCAR_FC2" + additional_info["pre_filename"] = "POSCAR_FC2" return additional_info diff --git a/phono3py/interface/fc_calculator.py b/phono3py/interface/fc_calculator.py index cbc68f5d..8bfeff7f 100644 --- a/phono3py/interface/fc_calculator.py +++ b/phono3py/interface/fc_calculator.py @@ -33,14 +33,16 @@ # POSSIBILITY OF SUCH DAMAGE. -def get_fc3(supercell, - primitive, - displacements, - forces, - fc_calculator=None, - fc_calculator_options=None, - is_compact_fc=False, - log_level=0): +def get_fc3( + supercell, + primitive, + displacements, + forces, + fc_calculator=None, + fc_calculator_options=None, + is_compact_fc=False, + log_level=0, +): """Supercell 2nd order force constants (fc2) are calculated. The expected shape of supercell fc3 to be returned is @@ -82,16 +84,18 @@ def get_fc3(supercell, """ - if fc_calculator == 'alm': + if fc_calculator == "alm": from phono3py.interface.alm import get_fc3 - return get_fc3(supercell, - primitive, - displacements, - forces, - options=fc_calculator_options, - is_compact_fc=is_compact_fc, - log_level=log_level) + + return get_fc3( + supercell, + primitive, + displacements, + forces, + options=fc_calculator_options, + is_compact_fc=is_compact_fc, + log_level=log_level, + ) else: - msg = ("Force constants calculator of %s was not found ." - % fc_calculator) + msg = "Force constants calculator of %s was not found ." % fc_calculator raise RuntimeError(msg) diff --git a/phono3py/interface/phono3py_yaml.py b/phono3py/interface/phono3py_yaml.py index 1d9b5f9d..5592a3f6 100644 --- a/phono3py/interface/phono3py_yaml.py +++ b/phono3py/interface/phono3py_yaml.py @@ -1,4 +1,3 @@ - """phono3py_yaml reader and writer.""" # Copyright (C) 2016 Atsushi Togo # All rights reserved. @@ -62,17 +61,17 @@ class Phono3pyYaml(PhonopyYaml): command_name = "phono3py" default_filenames = ("phono3py_disp.yaml", "phono3py.yaml") - default_settings = {'force_sets': False, - 'displacements': True, - 'force_constants': False, - 'born_effective_charge': True, - 'dielectric_constant': True} + default_settings = { + "force_sets": False, + "displacements": True, + "force_constants": False, + "born_effective_charge": True, + "dielectric_constant": True, + } - def __init__(self, - configuration=None, - calculator=None, - physical_units=None, - settings=None): + def __init__( + self, configuration=None, calculator=None, physical_units=None, settings=None + ): """Init method.""" self.configuration = None self.calculator = None @@ -109,7 +108,8 @@ class Phono3pyYaml(PhonopyYaml): configuration=configuration, calculator=calculator, physical_units=physical_units, - settings=settings) + settings=settings, + ) def set_phonon_info(self, phono3py): """Store data in phono3py instance in this instance.""" @@ -131,15 +131,16 @@ class Phono3pyYaml(PhonopyYaml): """ super(Phono3pyYaml, self)._parse_all_cells() - if 'phonon_primitive_cell' in self._yaml: + if "phonon_primitive_cell" in self._yaml: self.phonon_primitive = self._parse_cell( - self._yaml['phonon_primitive_cell']) - if 'phonon_supercell' in self._yaml: - self.phonon_supercell = self._parse_cell( - self._yaml['phonon_supercell']) - if 'phonon_supercell_matrix' in self._yaml: + self._yaml["phonon_primitive_cell"] + ) + if "phonon_supercell" in self._yaml: + self.phonon_supercell = self._parse_cell(self._yaml["phonon_supercell"]) + if "phonon_supercell_matrix" in self._yaml: self.phonon_supercell_matrix = np.array( - self._yaml['phonon_supercell_matrix'], dtype='intc', order='C') + self._yaml["phonon_supercell_matrix"], dtype="intc", order="C" + ) def _parse_dataset(self): """Parse phonon_dataset. @@ -158,61 +159,67 @@ class Phono3pyYaml(PhonopyYaml): """ dataset = None - if 'displacement_pairs' in self._yaml: - disp = self._yaml['displacement_pairs'][0] + if "displacement_pairs" in self._yaml: + disp = self._yaml["displacement_pairs"][0] if type(disp) is dict: # type1 dataset = self._parse_forces_fc3_type1(len(self.supercell)) elif type(disp) is list: # type2 - if 'displacement' in disp[0]: + if "displacement" in disp[0]: dataset = self._parse_force_sets_type2() - if 'displacement_pair_info' in self._yaml: - info_yaml = self._yaml['displacement_pair_info'] - if 'cutoff_pair_distance' in info_yaml: - dataset['cutoff_distance'] = info_yaml['cutoff_pair_distance'] - if 'duplicated_supercell_ids' in info_yaml: - dataset['duplicates'] = info_yaml['duplicated_supercell_ids'] + if "displacement_pair_info" in self._yaml: + info_yaml = self._yaml["displacement_pair_info"] + if "cutoff_pair_distance" in info_yaml: + dataset["cutoff_distance"] = info_yaml["cutoff_pair_distance"] + if "duplicated_supercell_ids" in info_yaml: + dataset["duplicates"] = info_yaml["duplicated_supercell_ids"] self.dataset = dataset def _parse_forces_fc3_type1(self, natom): - dataset = {'natom': natom, 'first_atoms': []} - for d1 in self._yaml['displacement_pairs']: + dataset = {"natom": natom, "first_atoms": []} + for d1 in self._yaml["displacement_pairs"]: data1 = { - 'number': d1['atom'] - 1, - 'displacement': np.array(d1['displacement'], dtype='double'), - 'id': d1['displacement_id'], - 'second_atoms': []} - if 'forces' in d1: - data1['forces'] = np.array(d1['forces'], - dtype='double', order='C') - d2_list = d1.get('paired_with') + "number": d1["atom"] - 1, + "displacement": np.array(d1["displacement"], dtype="double"), + "id": d1["displacement_id"], + "second_atoms": [], + } + if "forces" in d1: + data1["forces"] = np.array(d1["forces"], dtype="double", order="C") + d2_list = d1.get("paired_with") if d2_list is None: # backward compatibility - d2_list = d1.get('second_atoms') + d2_list = d1.get("second_atoms") for d2 in d2_list: - if 'forces' in d2: - data1['second_atoms'].append( - {'number': d2['atom'] - 1, - 'displacement': np.array(d2['displacement'], - dtype='double'), - 'forces': np.array(d2['forces'], - dtype='double', order='C'), - 'id': d2['displacement_id'], - 'pair_distance': d2['pair_distance']}) + if "forces" in d2: + data1["second_atoms"].append( + { + "number": d2["atom"] - 1, + "displacement": np.array( + d2["displacement"], dtype="double" + ), + "forces": np.array(d2["forces"], dtype="double", order="C"), + "id": d2["displacement_id"], + "pair_distance": d2["pair_distance"], + } + ) else: - disps = [{'number': d2['atom'] - 1, - 'displacement': np.array(disp, dtype='double')} - for disp in d2['displacements']] - if 'pair_distance' in d2: + disps = [ + { + "number": d2["atom"] - 1, + "displacement": np.array(disp, dtype="double"), + } + for disp in d2["displacements"] + ] + if "pair_distance" in d2: for d2_dict in disps: - d2_dict['pair_distance'] = d2['pair_distance'] - if 'included' in d2: + d2_dict["pair_distance"] = d2["pair_distance"] + if "included" in d2: for d2_dict in disps: - d2_dict['included'] = d2['included'] - if 'displacement_ids' in d2: - for disp_id, d2_dict in zip( - d2['displacement_ids'], disps): - d2_dict['id'] = disp_id - data1['second_atoms'] += disps - dataset['first_atoms'].append(data1) + d2_dict["included"] = d2["included"] + if "displacement_ids" in d2: + for disp_id, d2_dict in zip(d2["displacement_ids"], disps): + d2_dict["id"] = disp_id + data1["second_atoms"] += disps + dataset["first_atoms"].append(data1) return dataset def _cell_info_yaml_lines(self): @@ -223,9 +230,11 @@ class Phono3pyYaml(PhonopyYaml): """ lines = super(Phono3pyYaml, self)._cell_info_yaml_lines() lines += self._supercell_matrix_yaml_lines( - self.phonon_supercell_matrix, "phonon_supercell_matrix") - lines += self._primitive_yaml_lines(self.phonon_primitive, - "phonon_primitive_cell") + self.phonon_supercell_matrix, "phonon_supercell_matrix" + ) + lines += self._primitive_yaml_lines( + self.phonon_primitive, "phonon_primitive_cell" + ) lines += self._phonon_supercell_yaml_lines() return lines @@ -241,9 +250,10 @@ class Phono3pyYaml(PhonopyYaml): def _phonon_supercell_yaml_lines(self): lines = [] if self.phonon_supercell is not None: - s2p_map = getattr(self.phonon_primitive, 's2p_map', None) + s2p_map = getattr(self.phonon_primitive, "s2p_map", None) lines += self._cell_yaml_lines( - self.phonon_supercell, "phonon_supercell", s2p_map) + self.phonon_supercell, "phonon_supercell", s2p_map + ) lines.append("") return lines @@ -254,11 +264,9 @@ class Phono3pyYaml(PhonopyYaml): """ if self.phonon_primitive is not None: - return self._nac_yaml_lines_given_symbols( - self.phonon_primitive.symbols) + return self._nac_yaml_lines_given_symbols(self.phonon_primitive.symbols) else: - return self._nac_yaml_lines_given_symbols( - self.primitive.symbols) + return self._nac_yaml_lines_given_symbols(self.primitive.symbols) def _displacements_yaml_lines(self, with_forces=False): """Get YAML lines for phonon_dataset and dataset. @@ -271,9 +279,11 @@ class Phono3pyYaml(PhonopyYaml): lines = [] if self.phonon_supercell_matrix is not None: lines += self._displacements_yaml_lines_2types( - self.phonon_dataset, with_forces=with_forces) + self.phonon_dataset, with_forces=with_forces + ) lines += self._displacements_yaml_lines_2types( - self.dataset, with_forces=with_forces) + self.dataset, with_forces=with_forces + ) return lines def _displacements_yaml_lines_type1(self, dataset, with_forces=False): @@ -289,120 +299,116 @@ class Phono3pyYaml(PhonopyYaml): def displacements_yaml_lines_type1(dataset, with_forces=False): """Get YAML lines for type1 phonon_dataset and dataset.""" - id_offset = len(dataset['first_atoms']) + id_offset = len(dataset["first_atoms"]) - if 'second_atoms' in dataset['first_atoms'][0]: + if "second_atoms" in dataset["first_atoms"][0]: lines = ["displacement_pairs:"] else: lines = ["displacements:"] - for i, d in enumerate(dataset['first_atoms']): - lines.append("- atom: %4d" % (d['number'] + 1)) + for i, d in enumerate(dataset["first_atoms"]): + lines.append("- atom: %4d" % (d["number"] + 1)) lines.append(" displacement:") - lines.append(" [ %19.16f, %19.16f, %19.16f ]" - % tuple(d['displacement'])) + lines.append(" [ %19.16f, %19.16f, %19.16f ]" % tuple(d["displacement"])) id_num = i + 1 - if 'id' in d: - assert id_num == d['id'] + if "id" in d: + assert id_num == d["id"] lines.append(" displacement_id: %d" % id_num) - if with_forces and 'forces' in d: + if with_forces and "forces" in d: lines.append(" forces:") - for v in d['forces']: - lines.append( - " - [ %19.16f, %19.16f, %19.16f ]" % tuple(v)) - if 'second_atoms' in d: + for v in d["forces"]: + lines.append(" - [ %19.16f, %19.16f, %19.16f ]" % tuple(v)) + if "second_atoms" in d: ret_lines, id_offset = _second_displacements_yaml_lines( - d['second_atoms'], id_offset, with_forces=with_forces) + d["second_atoms"], id_offset, with_forces=with_forces + ) lines += ret_lines lines.append("") - if 'second_atoms' in dataset['first_atoms'][0]: - n_single = len(dataset['first_atoms']) + if "second_atoms" in dataset["first_atoms"][0]: + n_single = len(dataset["first_atoms"]) n_pair = 0 n_included = 0 - for d1 in dataset['first_atoms']: - n_d2 = len(d1['second_atoms']) + for d1 in dataset["first_atoms"]: + n_d2 = len(d1["second_atoms"]) n_pair += n_d2 - for d2 in d1['second_atoms']: - if 'included' not in d2: + for d2 in d1["second_atoms"]: + if "included" not in d2: n_included += 1 - elif d2['included']: + elif d2["included"]: n_included += 1 lines.append("displacement_pair_info:") - if 'cutoff_distance' in dataset: - lines.append(" cutoff_pair_distance: %11.8f" - % dataset['cutoff_distance']) + if "cutoff_distance" in dataset: + lines.append(" cutoff_pair_distance: %11.8f" % dataset["cutoff_distance"]) lines.append(" number_of_singles: %d" % n_single) lines.append(" number_of_pairs: %d" % n_pair) - if 'cutoff_distance' in dataset: - lines.append(" number_of_pairs_in_cutoff: %d" - % n_included) + if "cutoff_distance" in dataset: + lines.append(" number_of_pairs_in_cutoff: %d" % n_included) # 'duplicates' is dict, but written as a list of list in yaml. # See the docstring of _parse_fc3_dataset for the reason. - if 'duplicates' in dataset and dataset['duplicates']: - lines.append(" duplicated_supercell_ids: " - "# 0 means perfect supercell") + if "duplicates" in dataset and dataset["duplicates"]: + lines.append(" duplicated_supercell_ids: " "# 0 means perfect supercell") # Backward compatibility for dict type - if type(dataset['duplicates']) is dict: - for i, j in dataset['duplicates'].items(): + if type(dataset["duplicates"]) is dict: + for i, j in dataset["duplicates"].items(): lines.append(" - [ %d, %d ]" % (int(i), j)) else: - for (i, j) in dataset['duplicates']: + for (i, j) in dataset["duplicates"]: lines.append(" - [ %d, %d ]" % (i, j)) lines.append("") return lines -def _second_displacements_yaml_lines(dataset2, - id_offset, - with_forces=False): +def _second_displacements_yaml_lines(dataset2, id_offset, with_forces=False): lines = [] id_num = id_offset # lines.append(" second_atoms:") lines.append(" paired_with:") - numbers = np.array([d['number'] for d in dataset2]) + numbers = np.array([d["number"] for d in dataset2]) unique_numbers = np.unique(numbers) for i in unique_numbers: indices_eq_i = np.sort(np.where(numbers == i)[0]) - if with_forces and 'forces' in dataset2[indices_eq_i[0]]: + if with_forces and "forces" in dataset2[indices_eq_i[0]]: for j in indices_eq_i: id_num += 1 lines.append(" - atom: %4d" % (i + 1)) - lines.append(" pair_distance: %.8f" - % dataset2[j]['pair_distance']) + lines.append(" pair_distance: %.8f" % dataset2[j]["pair_distance"]) lines.append(" displacement:") - lines.append(" [ %19.16f, %19.16f, %19.16f ]" - % tuple(dataset2[j]['displacement'])) + lines.append( + " [ %19.16f, %19.16f, %19.16f ]" + % tuple(dataset2[j]["displacement"]) + ) - if 'id' in dataset2[j]: - assert dataset2[j]['id'] == id_num + if "id" in dataset2[j]: + assert dataset2[j]["id"] == id_num lines.append(" displacement_id: %d" % id_num) lines.append(" forces:") - for v in dataset2[j]['forces']: - lines.append( - " - [ %19.16f, %19.16f, %19.16f ]" % tuple(v)) + for v in dataset2[j]["forces"]: + lines.append(" - [ %19.16f, %19.16f, %19.16f ]" % tuple(v)) else: lines.append(" - atom: %4d" % (i + 1)) - lines.append(" pair_distance: %.8f" - % dataset2[indices_eq_i[0]]['pair_distance']) - if 'included' in dataset2[indices_eq_i[0]]: - included = dataset2[indices_eq_i[0]]['included'] - lines.append(" included: %s" - % ("true" if included else "false")) + lines.append( + " pair_distance: %.8f" % dataset2[indices_eq_i[0]]["pair_distance"] + ) + if "included" in dataset2[indices_eq_i[0]]: + included = dataset2[indices_eq_i[0]]["included"] + lines.append(" included: %s" % ("true" if included else "false")) disp_ids = [] lines.append(" displacements:") for j in indices_eq_i: id_num += 1 - d = tuple(dataset2[j]['displacement']) + d = tuple(dataset2[j]["displacement"]) lines.append(" - [ %19.16f, %19.16f, %19.16f ]" % d) - if 'id' in dataset2[j]: - assert dataset2[j]['id'] == id_num - disp_ids.append(dataset2[j]['id']) + if "id" in dataset2[j]: + assert dataset2[j]["id"] == id_num + disp_ids.append(dataset2[j]["id"]) if disp_ids: - lines.append(" displacement_ids: [ %s ]" - % ', '.join(["%d" % j for j in disp_ids])) + lines.append( + " displacement_ids: [ %s ]" + % ", ".join(["%d" % j for j in disp_ids]) + ) return lines, id_num diff --git a/phono3py/other/isotope.py b/phono3py/other/isotope.py index e0a4f847..1d99b7b7 100644 --- a/phono3py/other/isotope.py +++ b/phono3py/other/isotope.py @@ -42,7 +42,9 @@ from phonopy.phonon.tetrahedron_mesh import get_tetrahedra_frequencies from phonopy.units import VaspToTHz from phonopy.structure.atoms import isotope_data from phono3py.other.tetrahedron_method import ( - get_integration_weights, get_unique_grid_points) + get_integration_weights, + get_unique_grid_points, +) from phono3py.phonon.solver import run_phonon_solver_c, run_phonon_solver_py from phono3py.phonon.grid import BZGrid from phono3py.phonon.func import gaussian @@ -59,31 +61,33 @@ def get_mass_variances(primitive): g = np.dot(fractions, (1 - masses / m_ave) ** 2) mass_variances.append(g) - return np.array(mass_variances, dtype='double') + return np.array(mass_variances, dtype="double") class Isotope(object): """Isotope scattering calculation class.""" - def __init__(self, - mesh, - primitive, - mass_variances=None, # length of list is num_atom. - band_indices=None, - sigma=None, - bz_grid=None, - frequency_factor_to_THz=VaspToTHz, - store_dense_gp_map=False, - symprec=1e-5, - cutoff_frequency=None, - lapack_zheev_uplo='L'): + def __init__( + self, + mesh, + primitive, + mass_variances=None, # length of list is num_atom. + band_indices=None, + sigma=None, + bz_grid=None, + frequency_factor_to_THz=VaspToTHz, + store_dense_gp_map=False, + symprec=1e-5, + cutoff_frequency=None, + lapack_zheev_uplo="L", + ): """Init method.""" - self._mesh = np.array(mesh, dtype='int_') + self._mesh = np.array(mesh, dtype="int_") if mass_variances is None: self._mass_variances = get_mass_variances(primitive) else: - self._mass_variances = np.array(mass_variances, dtype='double') + self._mass_variances = np.array(mass_variances, dtype="double") self._primitive = primitive self._sigma = sigma self._bz_grid = bz_grid @@ -106,22 +110,23 @@ class Isotope(object): num_band = len(self._primitive) * 3 if band_indices is None: - self._band_indices = np.arange(num_band, dtype='int_') + self._band_indices = np.arange(num_band, dtype="int_") else: - self._band_indices = np.array(band_indices, dtype='int_') + self._band_indices = np.array(band_indices, dtype="int_") if self._bz_grid is None: primitive_symmetry = Symmetry(self._primitive, self._symprec) - self._bz_grid = BZGrid(self._mesh, - lattice=self._primitive.cell, - symmetry_dataset=primitive_symmetry.dataset, - store_dense_gp_map=store_dense_gp_map) + self._bz_grid = BZGrid( + self._mesh, + lattice=self._primitive.cell, + symmetry_dataset=primitive_symmetry.dataset, + store_dense_gp_map=store_dense_gp_map, + ) def set_grid_point(self, grid_point): """Initialize grid points.""" self._grid_point = grid_point - self._grid_points = np.arange( - len(self._bz_grid.addresses), dtype='int_') + self._grid_points = np.arange(len(self._bz_grid.addresses), dtype="int_") if self._phonon_done is None: self._allocate_phonon() @@ -144,9 +149,10 @@ class Isotope(object): def set_sigma(self, sigma): """Set smearing width.""" - warnings.warn("Isotope.set_sigma() is deprecated." - "Use Isotope.sigma attribute.", - DeprecationWarning) + warnings.warn( + "Isotope.set_sigma() is deprecated." "Use Isotope.sigma attribute.", + DeprecationWarning, + ) self.sigma = sigma @property @@ -166,9 +172,10 @@ class Isotope(object): def get_gamma(self): """Return scattering strength.""" - warnings.warn("Isotope.get_gamma() is deprecated." - "Use Isotope.gamma attribute.", - DeprecationWarning) + warnings.warn( + "Isotope.get_gamma() is deprecated." "Use Isotope.gamma attribute.", + DeprecationWarning, + ) return self.gamma @property @@ -183,20 +190,18 @@ class Isotope(object): def get_mass_variances(self): """Return mass variances.""" - warnings.warn("Isotope.get_mass_variances() is deprecated." - "Use Isotope.mass_variances attribute.", - DeprecationWarning) + warnings.warn( + "Isotope.get_mass_variances() is deprecated." + "Use Isotope.mass_variances attribute.", + DeprecationWarning, + ) return self.mass_variances def get_phonons(self): """Return phonons on grid.""" return self._frequencies, self._eigenvectors, self._phonon_done - def set_phonons(self, - frequencies, - eigenvectors, - phonon_done, - dm=None): + def set_phonons(self, frequencies, eigenvectors, phonon_done, dm=None): """Set phonons on grid.""" self._frequencies = frequencies self._eigenvectors = eigenvectors @@ -204,13 +209,15 @@ class Isotope(object): if dm is not None: self._dm = dm - def init_dynamical_matrix(self, - fc2, - supercell, - primitive, - nac_params=None, - frequency_scale_factor=None, - decimals=None): + def init_dynamical_matrix( + self, + fc2, + supercell, + primitive, + nac_params=None, + frequency_scale_factor=None, + decimals=None, + ): """Initialize dynamical matrix.""" self._primitive = primitive self._dm = get_dynamical_matrix( @@ -220,40 +227,46 @@ class Isotope(object): nac_params=nac_params, frequency_scale_factor=frequency_scale_factor, decimals=decimals, - symprec=self._symprec) + symprec=self._symprec, + ) def set_nac_q_direction(self, nac_q_direction=None): """Set q-direction at q->0 used for NAC.""" if nac_q_direction is not None: - self._nac_q_direction = np.array(nac_q_direction, dtype='double') + self._nac_q_direction = np.array(nac_q_direction, dtype="double") def _run_c(self): self._run_phonon_solver_c(self._grid_points) import phono3py._phono3py as phono3c - gamma = np.zeros(len(self._band_indices), dtype='double') + + gamma = np.zeros(len(self._band_indices), dtype="double") if self._sigma is None: self._set_integration_weights() - weights = np.ones(len(self._grid_points), dtype='int_') - phono3c.thm_isotope_strength(gamma, - self._grid_point, - self._grid_points, - weights, - self._mass_variances, - self._frequencies, - self._eigenvectors, - self._band_indices, - self._integration_weights, - self._cutoff_frequency) + weights = np.ones(len(self._grid_points), dtype="int_") + phono3c.thm_isotope_strength( + gamma, + self._grid_point, + self._grid_points, + weights, + self._mass_variances, + self._frequencies, + self._eigenvectors, + self._band_indices, + self._integration_weights, + self._cutoff_frequency, + ) else: - phono3c.isotope_strength(gamma, - self._grid_point, - self._mass_variances, - self._frequencies, - self._eigenvectors, - self._band_indices, - np.prod(self._bz_grid.D_diag), - self._sigma, - self._cutoff_frequency) + phono3c.isotope_strength( + gamma, + self._grid_point, + self._mass_variances, + self._frequencies, + self._eigenvectors, + self._band_indices, + np.prod(self._bz_grid.D_diag), + self._sigma, + self._cutoff_frequency, + ) self._gamma = gamma / np.prod(self._bz_grid.D_diag) @@ -261,42 +274,47 @@ class Isotope(object): self._set_integration_weights_c() def _set_integration_weights_c(self): - unique_grid_points = get_unique_grid_points(self._grid_points, - self._bz_grid) + unique_grid_points = get_unique_grid_points(self._grid_points, self._bz_grid) self._run_phonon_solver_c(unique_grid_points) freq_points = np.array( self._frequencies[self._grid_point, self._band_indices], - dtype='double', order='C') + dtype="double", + order="C", + ) self._integration_weights = get_integration_weights( - freq_points, - self._frequencies, - self._bz_grid, - grid_points=self._grid_points) + freq_points, self._frequencies, self._bz_grid, grid_points=self._grid_points + ) def _set_integration_weights_py(self): thm = TetrahedronMethod(self._bz_grid.microzone_lattice) num_grid_points = len(self._grid_points) num_band = len(self._primitive) * 3 self._integration_weights = np.zeros( - (num_grid_points, len(self._band_indices), num_band), - dtype='double') + (num_grid_points, len(self._band_indices), num_band), dtype="double" + ) for i, gp in enumerate(self._grid_points): tfreqs = get_tetrahedra_frequencies( gp, self._bz_grid.D_diag, self._bz_grid.addresses, - np.array(np.dot(thm.get_tetrahedra(), self._bz_grid.P.T), - dtype='int_', order='C'), + np.array( + np.dot(thm.get_tetrahedra(), self._bz_grid.P.T), + dtype="int_", + order="C", + ), self._grid_points, self._frequencies, - grid_order=[1, self._bz_grid.D_diag[0], - self._bz_grid.D_diag[0] * self._bz_grid.D_diag[1]], - lang='Py') + grid_order=[ + 1, + self._bz_grid.D_diag[0], + self._bz_grid.D_diag[0] * self._bz_grid.D_diag[1], + ], + lang="Py", + ) for bi, frequencies in enumerate(tfreqs): thm.set_tetrahedra_omegas(frequencies) - thm.run(self._frequencies[self._grid_point, - self._band_indices]) + thm.run(self._frequencies[self._grid_point, self._band_indices]) iw = thm.get_integration_weight() self._integration_weights[i, :, bi] = iw @@ -314,50 +332,55 @@ class Isotope(object): ti_sum = 0.0 for i, gp in enumerate(self._grid_points): for j, (f, vec) in enumerate( - zip(self._frequencies[i], self._eigenvectors[i].T)): + zip(self._frequencies[i], self._eigenvectors[i].T) + ): if f < self._cutoff_frequency: continue ti_sum_band = np.sum( np.abs((vec * vec0).reshape(-1, 3).sum(axis=1)) ** 2 - * self._mass_variances) + * self._mass_variances + ) if self._sigma is None: - ti_sum += ti_sum_band * self._integration_weights[ - i, bi, j] + ti_sum += ti_sum_band * self._integration_weights[i, bi, j] else: ti_sum += ti_sum_band * gaussian(f0 - f, self._sigma) - t_inv.append(np.pi / 2 - / np.prod(self._bz_grid.D_diag) * f0 ** 2 * ti_sum) + t_inv.append(np.pi / 2 / np.prod(self._bz_grid.D_diag) * f0 ** 2 * ti_sum) - self._gamma = np.array(t_inv, dtype='double') / 2 + self._gamma = np.array(t_inv, dtype="double") / 2 def _run_phonon_solver_c(self, grid_points): - run_phonon_solver_c(self._dm, - self._frequencies, - self._eigenvectors, - self._phonon_done, - grid_points, - self._bz_grid.addresses, - self._bz_grid.QDinv, - self._frequency_factor_to_THz, - self._nac_q_direction, - self._lapack_zheev_uplo) + run_phonon_solver_c( + self._dm, + self._frequencies, + self._eigenvectors, + self._phonon_done, + grid_points, + self._bz_grid.addresses, + self._bz_grid.QDinv, + self._frequency_factor_to_THz, + self._nac_q_direction, + self._lapack_zheev_uplo, + ) def _run_phonon_solver_py(self, grid_point): - run_phonon_solver_py(grid_point, - self._phonon_done, - self._frequencies, - self._eigenvectors, - self._bz_grid.addresses, - self._bz_grid.QDinv, - self._dm, - self._frequency_factor_to_THz, - self._lapack_zheev_uplo) + run_phonon_solver_py( + grid_point, + self._phonon_done, + self._frequencies, + self._eigenvectors, + self._bz_grid.addresses, + self._bz_grid.QDinv, + self._dm, + self._frequency_factor_to_THz, + self._lapack_zheev_uplo, + ) def _allocate_phonon(self): num_band = len(self._primitive) * 3 num_grid = len(self._bz_grid.addresses) - self._phonon_done = np.zeros(num_grid, dtype='byte') - self._frequencies = np.zeros((num_grid, num_band), dtype='double') + self._phonon_done = np.zeros(num_grid, dtype="byte") + self._frequencies = np.zeros((num_grid, num_band), dtype="double") itemsize = self._frequencies.itemsize - self._eigenvectors = np.zeros((num_grid, num_band, num_band), - dtype=("c%d" % (itemsize * 2))) + self._eigenvectors = np.zeros( + (num_grid, num_band, num_band), dtype=("c%d" % (itemsize * 2)) + ) diff --git a/phono3py/other/tetrahedron_method.py b/phono3py/other/tetrahedron_method.py index 088c83c9..1bc6532d 100644 --- a/phono3py/other/tetrahedron_method.py +++ b/phono3py/other/tetrahedron_method.py @@ -58,16 +58,20 @@ def get_unique_grid_points(grid_points, bz_grid): """ import phono3py._phono3py as phono3c - if _check_ndarray_state(grid_points, 'int_'): + + if _check_ndarray_state(grid_points, "int_"): _grid_points = grid_points else: - _grid_points = np.array(grid_points, dtype='int_') + _grid_points = np.array(grid_points, dtype="int_") thm = TetrahedronMethod(bz_grid.microzone_lattice) unique_vertices = np.array( np.dot(thm.get_unique_tetrahedra_vertices(), bz_grid.P.T), - dtype='int_', order='C') + dtype="int_", + order="C", + ) neighboring_grid_points = np.zeros( - len(unique_vertices) * len(_grid_points), dtype='int_') + len(unique_vertices) * len(_grid_points), dtype="int_" + ) phono3c.neighboring_grid_points( neighboring_grid_points, _grid_points, @@ -75,18 +79,20 @@ def get_unique_grid_points(grid_points, bz_grid): bz_grid.D_diag, bz_grid.addresses, bz_grid.gp_map, - bz_grid.store_dense_gp_map * 1 + 1) - unique_grid_points = np.array(np.unique(neighboring_grid_points), - dtype='int_') + bz_grid.store_dense_gp_map * 1 + 1, + ) + unique_grid_points = np.array(np.unique(neighboring_grid_points), dtype="int_") return unique_grid_points -def get_integration_weights(sampling_points, - grid_values, - bz_grid, - grid_points=None, - bzgp2irgp_map=None, - function='I'): +def get_integration_weights( + sampling_points, + grid_values, + bz_grid, + grid_points=None, + bzgp2irgp_map=None, + function="I", +): """Return tetrahedron method integration weights. Parameters @@ -118,39 +124,39 @@ def get_integration_weights(sampling_points, """ import phono3py._phono3py as phono3c + thm = TetrahedronMethod(bz_grid.microzone_lattice) if grid_points is None: _grid_points = bz_grid.grg2bzg - elif _check_ndarray_state(grid_points, 'int_'): + elif _check_ndarray_state(grid_points, "int_"): _grid_points = grid_points else: - _grid_points = np.array(grid_points, dtype='int_') - if _check_ndarray_state(grid_values, 'double'): + _grid_points = np.array(grid_points, dtype="int_") + if _check_ndarray_state(grid_values, "double"): _grid_values = grid_values else: - _grid_values = np.array(grid_values, dtype='double', order='C') - if _check_ndarray_state(sampling_points, 'double'): + _grid_values = np.array(grid_values, dtype="double", order="C") + if _check_ndarray_state(sampling_points, "double"): _sampling_points = sampling_points else: - _sampling_points = np.array(sampling_points, dtype='double') + _sampling_points = np.array(sampling_points, dtype="double") if bzgp2irgp_map is None: - _bzgp2irgp_map = np.arange(len(grid_values), dtype='int_') - elif _check_ndarray_state(bzgp2irgp_map, 'int_'): + _bzgp2irgp_map = np.arange(len(grid_values), dtype="int_") + elif _check_ndarray_state(bzgp2irgp_map, "int_"): _bzgp2irgp_map = bzgp2irgp_map else: - _bzgp2irgp_map = np.array(bzgp2irgp_map, dtype='int_') + _bzgp2irgp_map = np.array(bzgp2irgp_map, dtype="int_") num_grid_points = len(_grid_points) num_band = _grid_values.shape[1] integration_weights = np.zeros( - (num_grid_points, len(_sampling_points), num_band), - dtype='double', order='C') + (num_grid_points, len(_sampling_points), num_band), dtype="double", order="C" + ) phono3c.integration_weights_at_grid_points( integration_weights, _sampling_points, - np.array(np.dot(thm.get_tetrahedra(), bz_grid.P.T), - dtype='int_', order='C'), + np.array(np.dot(thm.get_tetrahedra(), bz_grid.P.T), dtype="int_", order="C"), bz_grid.D_diag, _grid_points, _grid_values, @@ -158,11 +164,11 @@ def get_integration_weights(sampling_points, bz_grid.gp_map, _bzgp2irgp_map, bz_grid.store_dense_gp_map * 1 + 1, - function) + function, + ) return integration_weights def _check_ndarray_state(array, dtype): """Check contiguousness and dtype.""" - return (array.dtype == dtype and - array.flags.c_contiguous) + return array.dtype == dtype and array.flags.c_contiguous diff --git a/phono3py/phonon/func.py b/phono3py/phonon/func.py index b8eda680..066d111c 100644 --- a/phono3py/phonon/func.py +++ b/phono3py/phonon/func.py @@ -1,3 +1,4 @@ +"""Mathematical functions.""" # Copyright (C) 2020 Atsushi Togo # All rights reserved. # @@ -37,11 +38,12 @@ from phonopy.units import THzToEv, Kb, Hbar, EV, Angstrom, THz, AMU def gaussian(x, sigma): - return 1.0 / np.sqrt(2 * np.pi) / sigma * np.exp(-x**2 / 2 / sigma**2) + """Return normal distribution.""" + return 1.0 / np.sqrt(2 * np.pi) / sigma * np.exp(-(x ** 2) / 2 / sigma ** 2) def bose_einstein(x, T): - """Returns Bose-Einstein distribution + """Return Bose-Einstein distribution. Note ---- @@ -63,7 +65,7 @@ def bose_einstein(x, T): def mode_length(x, T): - """Returns mode length + """Return mode length. sqrt((0.5 + n) hbar / omega) @@ -87,9 +89,8 @@ def mode_length(x, T): Values in [sqrt(AMU) * Angstrom] """ - ##################################### - old_settings = np.seterr(all='raise') + old_settings = np.seterr(all="raise") ##################################### n = bose_einstein(x, T) diff --git a/phono3py/phonon3/collision_matrix.py b/phono3py/phonon3/collision_matrix.py index f145df22..7da6a0fc 100644 --- a/phono3py/phonon3/collision_matrix.py +++ b/phono3py/phonon3/collision_matrix.py @@ -52,8 +52,6 @@ class CollisionMatrix(ImagSelfEnergy): rotations_cartesian=None, num_ir_grid_points=None, rot_grid_points=None, - temperature=None, - sigma=None, is_reducible_collision_matrix=False, log_level=0, lang="C", @@ -80,9 +78,7 @@ class CollisionMatrix(ImagSelfEnergy): self._unit_conversion = None self._log_level = log_level - ImagSelfEnergy.__init__( - self, interaction, temperature=temperature, sigma=sigma, lang=lang - ) + ImagSelfEnergy.__init__(self, interaction, lang=lang) self._is_reducible_collision_matrix = is_reducible_collision_matrix self._is_collision_matrix = True diff --git a/phono3py/phonon3/conductivity_RTA.py b/phono3py/phonon3/conductivity_RTA.py index a5d62e5e..89046975 100644 --- a/phono3py/phonon3/conductivity_RTA.py +++ b/phono3py/phonon3/conductivity_RTA.py @@ -59,7 +59,6 @@ def get_thermal_conductivity_RTA( is_isotope=False, boundary_mfp=None, # in micrometre use_ave_pp=False, - gamma_unit_conversion=None, is_kappa_star=True, gv_delta_q=None, is_full_pp=False, @@ -96,7 +95,6 @@ def get_thermal_conductivity_RTA( mass_variances=mass_variances, boundary_mfp=boundary_mfp, use_ave_pp=use_ave_pp, - gamma_unit_conversion=gamma_unit_conversion, is_kappa_star=is_kappa_star, gv_delta_q=gv_delta_q, is_full_pp=is_full_pp, @@ -508,7 +506,6 @@ class Conductivity_RTA(Conductivity): mass_variances=None, boundary_mfp=None, # in micrometre use_ave_pp=False, - gamma_unit_conversion=None, is_kappa_star=True, gv_delta_q=None, is_full_pp=False, @@ -552,7 +549,6 @@ class Conductivity_RTA(Conductivity): self._gamma_N = None self._gamma_U = None self._gamma_detail_at_q = None - self._gamma_unit_conversion = gamma_unit_conversion self._use_ave_pp = use_ave_pp self._use_const_ave_pp = None self._averaged_pp_interaction = None @@ -733,9 +729,7 @@ class Conductivity_RTA(Conductivity): (len(self._sigmas), num_temp), order="C", dtype="intc" ) self._collision = ImagSelfEnergy( - self._pp, - with_detail=(self._is_gamma_detail or self._is_N_U), - unit_conversion=self._gamma_unit_conversion, + self._pp, with_detail=(self._is_gamma_detail or self._is_N_U) ) def _set_gamma_at_sigmas(self, i): diff --git a/phono3py/phonon3/dataset.py b/phono3py/phonon3/dataset.py index 0139ddc3..93ce3a92 100644 --- a/phono3py/phonon3/dataset.py +++ b/phono3py/phonon3/dataset.py @@ -60,35 +60,37 @@ def get_displacements_and_forces_fc3(disp_dataset): """ - if 'first_atoms' in disp_dataset: - natom = disp_dataset['natom'] - ndisp = len(disp_dataset['first_atoms']) - for disp1 in disp_dataset['first_atoms']: - ndisp += len(disp1['second_atoms']) - displacements = np.zeros((ndisp, natom, 3), dtype='double', order='C') + if "first_atoms" in disp_dataset: + natom = disp_dataset["natom"] + ndisp = len(disp_dataset["first_atoms"]) + for disp1 in disp_dataset["first_atoms"]: + ndisp += len(disp1["second_atoms"]) + displacements = np.zeros((ndisp, natom, 3), dtype="double", order="C") forces = np.zeros_like(displacements) indices = [] count = 0 - for disp1 in disp_dataset['first_atoms']: + for disp1 in disp_dataset["first_atoms"]: indices.append(count) - displacements[count, disp1['number']] = disp1['displacement'] - forces[count] = disp1['forces'] + displacements[count, disp1["number"]] = disp1["displacement"] + forces[count] = disp1["forces"] count += 1 - for disp1 in disp_dataset['first_atoms']: - for disp2 in disp1['second_atoms']: - if 'included' in disp2: - if disp2['included']: + for disp1 in disp_dataset["first_atoms"]: + for disp2 in disp1["second_atoms"]: + if "included" in disp2: + if disp2["included"]: indices.append(count) else: indices.append(count) - displacements[count, disp1['number']] = disp1['displacement'] - displacements[count, disp2['number']] = disp2['displacement'] - forces[count] = disp2['forces'] + displacements[count, disp1["number"]] = disp1["displacement"] + displacements[count, disp2["number"]] = disp2["displacement"] + forces[count] = disp2["forces"] count += 1 - return (np.array(displacements[indices], dtype='double', order='C'), - np.array(forces[indices], dtype='double', order='C')) - elif 'forces' in disp_dataset and 'displacements' in disp_dataset: - return disp_dataset['displacements'], disp_dataset['forces'] + return ( + np.array(displacements[indices], dtype="double", order="C"), + np.array(forces[indices], dtype="double", order="C"), + ) + elif "forces" in disp_dataset and "displacements" in disp_dataset: + return disp_dataset["displacements"], disp_dataset["forces"] else: raise RuntimeError("disp_dataset doesn't contain correct information.") diff --git a/phono3py/phonon3/displacement_fc3.py b/phono3py/phonon3/displacement_fc3.py index 4ea99f80..c48ba4d8 100644 --- a/phono3py/phonon3/displacement_fc3.py +++ b/phono3py/phonon3/displacement_fc3.py @@ -34,16 +34,18 @@ # POSSIBILITY OF SUCH DAMAGE. import numpy as np -from phonopy.harmonic.displacement import (get_least_displacements, - directions_axis, get_displacement, - is_minus_displacement) +from phonopy.harmonic.displacement import ( + get_least_displacements, + directions_axis, + get_displacement, + is_minus_displacement, +) from phonopy.structure.cells import get_smallest_vectors -def direction_to_displacement(direction_dataset, - displacement_distance, - supercell, - cutoff_distance=None): +def direction_to_displacement( + direction_dataset, displacement_distance, supercell, cutoff_distance=None +): """Convert displacement directions to those in Cartesian coordinates. Parameters @@ -75,52 +77,56 @@ def direction_to_displacement(direction_dataset, lattice = supercell.cell.T new_dataset = {} - new_dataset['natom'] = len(supercell) + new_dataset["natom"] = len(supercell) if duplicates: - new_dataset['duplicates'] = duplicates + new_dataset["duplicates"] = duplicates if cutoff_distance is not None: - new_dataset['cutoff_distance'] = cutoff_distance + new_dataset["cutoff_distance"] = cutoff_distance new_first_atoms = [] for i, first_atoms in enumerate(direction_dataset): - atom1 = first_atoms['number'] - direction1 = first_atoms['direction'] + atom1 = first_atoms["number"] + direction1 = first_atoms["direction"] disp_cart1 = np.dot(direction1, lattice.T) disp_cart1 *= displacement_distance / np.linalg.norm(disp_cart1) new_second_atoms = [] - for second_atom in first_atoms['second_atoms']: - atom2 = second_atom['number'] - pair_distance = second_atom['distance'] - included = (cutoff_distance is None or - pair_distance < cutoff_distance) - for direction2 in second_atom['directions']: + for second_atom in first_atoms["second_atoms"]: + atom2 = second_atom["number"] + pair_distance = second_atom["distance"] + included = cutoff_distance is None or pair_distance < cutoff_distance + for direction2 in second_atom["directions"]: disp_cart2 = np.dot(direction2, lattice.T) norm = np.linalg.norm(disp_cart2) disp_cart2 *= displacement_distance / norm - disp2_dict = {'id': d3_count, - 'number': atom2, - 'direction': direction2, - 'displacement': disp_cart2, - 'pair_distance': pair_distance} + disp2_dict = { + "id": d3_count, + "number": atom2, + "direction": direction2, + "displacement": disp_cart2, + "pair_distance": pair_distance, + } if cutoff_distance is not None: - disp2_dict['included'] = included + disp2_dict["included"] = included new_second_atoms.append(disp2_dict) d3_count += 1 - new_first_atoms.append({'number': atom1, - 'direction': direction1, - 'displacement': disp_cart1, - 'id': (i + 1), - 'second_atoms': new_second_atoms}) - new_dataset['first_atoms'] = new_first_atoms + new_first_atoms.append( + { + "number": atom1, + "direction": direction1, + "displacement": disp_cart1, + "id": (i + 1), + "second_atoms": new_second_atoms, + } + ) + new_dataset["first_atoms"] = new_first_atoms return new_dataset -def get_third_order_displacements(cell, - symmetry, - is_plusminus='auto', - is_diagonal=False): +def get_third_order_displacements( + cell, symmetry, is_plusminus="auto", is_diagonal=False +): """Create dispalcement dataset. Note @@ -163,9 +169,9 @@ def get_third_order_displacements(cell, # using respective site symmetries of the original crystal. # 'is_diagonal=False' below is made intentionally to expect # better accuracy. - disps_first = get_least_displacements(symmetry, - is_plusminus=is_plusminus, - is_diagonal=False) + disps_first = get_least_displacements( + symmetry, is_plusminus=is_plusminus, is_diagonal=False + ) symprec = symmetry.tolerance @@ -175,57 +181,37 @@ def get_third_order_displacements(cell, disp1 = disp[1:4] site_sym = symmetry.get_site_symmetry(atom1) - dds_atom1 = {'number': atom1, - 'direction': disp1, - 'second_atoms': []} + dds_atom1 = {"number": atom1, "direction": disp1, "second_atoms": []} # Reduced site symmetry at the first atom with respect to # the displacement of the first atoms. reduced_site_sym = get_reduced_site_symmetry(site_sym, disp1, symprec) # Searching orbits (second atoms) with respect to # the first atom and its reduced site symmetry. - second_atoms = get_least_orbits(atom1, - cell, - reduced_site_sym, - symprec) + second_atoms = get_least_orbits(atom1, cell, reduced_site_sym, symprec) for atom2 in second_atoms: - dds_atom2 = _get_next_displacements(atom1, - atom2, - reduced_site_sym, - lattice, - positions, - symprec, - is_diagonal) + dds_atom2 = _get_next_displacements( + atom1, atom2, reduced_site_sym, lattice, positions, symprec, is_diagonal + ) - min_vec = get_smallest_vector_of_atom_pair(atom1, - atom2, - cell, - symprec) + min_vec = get_smallest_vector_of_atom_pair(atom1, atom2, cell, symprec) min_distance = np.linalg.norm(np.dot(lattice, min_vec)) - dds_atom2['distance'] = min_distance - dds_atom1['second_atoms'].append(dds_atom2) + dds_atom2["distance"] = min_distance + dds_atom1["second_atoms"].append(dds_atom2) dds.append(dds_atom1) return dds -def _get_next_displacements(atom1, - atom2, - reduced_site_sym, - lattice, - positions, - symprec, - is_diagonal): +def _get_next_displacements( + atom1, atom2, reduced_site_sym, lattice, positions, symprec, is_diagonal +): """Find displacements of second atom.""" # Bond symmetry between first and second atoms. reduced_bond_sym = get_bond_symmetry( - reduced_site_sym, - lattice, - positions, - atom1, - atom2, - symprec) + reduced_site_sym, lattice, positions, atom1, atom2, symprec + ) # Since displacement of first atom breaks translation # symmetry, the crystal symmetry is reduced to point @@ -237,11 +223,11 @@ def _get_next_displacements(atom1, disps_second = get_displacement(reduced_bond_sym) else: disps_second = get_displacement(reduced_bond_sym, directions_axis) - dds_atom2 = {'number': atom2, 'directions': []} + dds_atom2 = {"number": atom2, "directions": []} for disp2 in disps_second: - dds_atom2['directions'].append(list(disp2)) + dds_atom2["directions"].append(list(disp2)) if is_minus_displacement(disp2, reduced_bond_sym): - dds_atom2['directions'].append(list(-disp2)) + dds_atom2["directions"].append(list(-disp2)) return dds_atom2 @@ -252,15 +238,12 @@ def get_reduced_site_symmetry(site_sym, direction, symprec=1e-5): for rot in site_sym: if (abs(direction - np.dot(direction, rot.T)) < symprec).all(): reduced_site_sym.append(rot) - return np.array(reduced_site_sym, dtype='intc') + return np.array(reduced_site_sym, dtype="intc") -def get_bond_symmetry(site_symmetry, - lattice, - positions, - atom_center, - atom_disp, - symprec=1e-5): +def get_bond_symmetry( + site_symmetry, lattice, positions, atom_center, atom_disp, symprec=1e-5 +): """Return bond symmetry. Bond symmetry is the symmetry operations that keep the symmetry @@ -270,8 +253,7 @@ def get_bond_symmetry(site_symmetry, bond_sym = [] pos = positions for rot in site_symmetry: - rot_pos = (np.dot(pos[atom_disp] - pos[atom_center], rot.T) + - pos[atom_center]) + rot_pos = np.dot(pos[atom_disp] - pos[atom_center], rot.T) + pos[atom_center] diff = pos[atom_disp] - rot_pos diff -= np.rint(diff) dist = np.linalg.norm(np.dot(lattice, diff)) @@ -294,17 +276,18 @@ def get_least_orbits(atom_index, cell, site_symmetry, symprec=1e-5): return np.unique(mapping) -def get_smallest_vector_of_atom_pair(atom_number_supercell, - atom_number_primitive, - supercell, - symprec): +def get_smallest_vector_of_atom_pair( + atom_number_supercell, atom_number_primitive, supercell, symprec +): """Return smallest vectors of an atom pair in supercell.""" s_pos = supercell.scaled_positions - svecs, multi = get_smallest_vectors(supercell.cell, - [s_pos[atom_number_supercell]], - [s_pos[atom_number_primitive]], - store_dense_svecs=True, - symprec=symprec) + svecs, multi = get_smallest_vectors( + supercell.cell, + [s_pos[atom_number_supercell]], + [s_pos[atom_number_primitive]], + store_dense_svecs=True, + symprec=symprec, + ) return svecs[0] @@ -347,43 +330,47 @@ def _find_duplicates(direction_dataset): # This id is stamped in direction_to_displacement by the sequence of # the loops. Therefore the same system of the loops should be used here. for direction1 in direction_dataset: - n1 = direction1['number'] - d1 = direction1['direction'] - for directions2 in direction1['second_atoms']: - n2 = directions2['number'] + n1 = direction1["number"] + d1 = direction1["direction"] + for directions2 in direction1["second_atoms"]: + n2 = directions2["number"] if (n1, n2) not in direction_sets: direction_sets[(n1, n2)] = [] pair_idx[(n1, n2)] = [] - for i, d2 in enumerate(directions2['directions']): + for i, d2 in enumerate(directions2["directions"]): direction_sets[(n1, n2)].append(d1 + d2) pair_idx[(n1, n2)].append(idx + i) - idx += len(directions2['directions']) + idx += len(directions2["directions"]) duplucates = [] done = [] for i, direction1 in enumerate(direction_dataset): - n1 = direction1['number'] - for directions2 in direction1['second_atoms']: - n2 = directions2['number'] - if (n2 > n1 and (n2, n1) not in done and - (n2, n1) in direction_sets): # noqa E129 + n1 = direction1["number"] + for directions2 in direction1["second_atoms"]: + n2 = directions2["number"] + if ( + n2 > n1 and (n2, n1) not in done and (n2, n1) in direction_sets + ): # noqa E129 done.append((n2, n1)) duplucates += _compare( - n1, n2, - direction_sets[(n1, n2)], direction_sets[(n2, n1)], - pair_idx[(n1, n2)], pair_idx[(n2, n1)]) + n1, + n2, + direction_sets[(n1, n2)], + direction_sets[(n2, n1)], + pair_idx[(n1, n2)], + pair_idx[(n2, n1)], + ) done = [] for i, direction1 in enumerate(direction_dataset): - n1 = direction1['number'] - for directions2 in direction1['second_atoms']: - n2 = directions2['number'] + n1 = direction1["number"] + for directions2 in direction1["second_atoms"]: + n2 = directions2["number"] if n1 == n2 and n1 not in done: done.append(n1) duplucates += _compare_opposite( - n1, - direction_sets[(n1, n1)], - pair_idx[(n1, n1)]) + n1, direction_sets[(n1, n1)], pair_idx[(n1, n1)] + ) return duplucates diff --git a/phono3py/phonon3/fc3.py b/phono3py/phonon3/fc3.py index e17ee857..f91c717f 100644 --- a/phono3py/phonon3/fc3.py +++ b/phono3py/phonon3/fc3.py @@ -43,39 +43,39 @@ from phonopy.harmonic.force_constants import ( solve_force_constants, get_rotated_displacement, get_positions_sent_by_rot_inv, - get_nsym_list_and_s2pp) + get_nsym_list_and_s2pp, +) from phono3py.phonon3.displacement_fc3 import ( get_reduced_site_symmetry, get_bond_symmetry, - get_smallest_vector_of_atom_pair) + get_smallest_vector_of_atom_pair, +) from phonopy.structure.cells import compute_all_sg_permutations logger = logging.getLogger(__name__) -def get_fc3(supercell, - primitive, - disp_dataset, - symmetry, - is_compact_fc=False, - verbose=False): +def get_fc3( + supercell, primitive, disp_dataset, symmetry, is_compact_fc=False, verbose=False +): """Calculate fc3.""" # fc2 has to be full matrix to compute delta-fc2 # p2s_map elements are extracted if is_compact_fc=True at the last part. fc2 = get_fc2(supercell, symmetry, disp_dataset) - fc3 = _get_fc3_least_atoms(supercell, - primitive, - disp_dataset, - fc2, - symmetry, - is_compact_fc=is_compact_fc, - verbose=verbose) + fc3 = _get_fc3_least_atoms( + supercell, + primitive, + disp_dataset, + fc2, + symmetry, + is_compact_fc=is_compact_fc, + verbose=verbose, + ) if verbose: print("Expanding fc3.") - first_disp_atoms = np.unique( - [x['number'] for x in disp_dataset['first_atoms']]) - rotations = symmetry.get_symmetry_operations()['rotations'] + first_disp_atoms = np.unique([x["number"] for x in disp_dataset["first_atoms"]]) + rotations = symmetry.get_symmetry_operations()["rotations"] lattice = supercell.cell.T permutations = symmetry.atomic_permutations @@ -83,51 +83,53 @@ def get_fc3(supercell, s2p_map = primitive.s2p_map p2s_map = primitive.p2s_map p2p_map = primitive.p2p_map - s2compact = np.array([p2p_map[i] for i in s2p_map], dtype='int_') + s2compact = np.array([p2p_map[i] for i in s2p_map], dtype="int_") for i in first_disp_atoms: assert i in p2s_map target_atoms = [i for i in p2s_map if i not in first_disp_atoms] else: - s2compact = np.arange(len(supercell), dtype='int_') + s2compact = np.arange(len(supercell), dtype="int_") target_atoms = [i for i in s2compact if i not in first_disp_atoms] - distribute_fc3(fc3, - first_disp_atoms, - target_atoms, - lattice, - rotations, - permutations, - s2compact, - verbose=verbose) + distribute_fc3( + fc3, + first_disp_atoms, + target_atoms, + lattice, + rotations, + permutations, + s2compact, + verbose=verbose, + ) - if 'cutoff_distance' in disp_dataset: + if "cutoff_distance" in disp_dataset: if verbose: - print("Cutting-off fc3 (cut-off distance: %f)" % - disp_dataset['cutoff_distance']) + print( + "Cutting-off fc3 (cut-off distance: %f)" + % disp_dataset["cutoff_distance"] + ) if is_compact_fc: print("cutoff_fc3 doesn't support compact-fc3 yet.") raise ValueError - _cutoff_fc3(fc3, - supercell, - disp_dataset, - symmetry, - verbose=verbose) + _cutoff_fc3(fc3, supercell, disp_dataset, symmetry, verbose=verbose) if is_compact_fc: p2s_map = primitive.p2s_map - fc2 = np.array(fc2[p2s_map], dtype='double', order='C') + fc2 = np.array(fc2[p2s_map], dtype="double", order="C") return fc2, fc3 -def distribute_fc3(fc3, - first_disp_atoms, - target_atoms, - lattice, - rotations, - permutations, - s2compact, - verbose=False): +def distribute_fc3( + fc3, + first_disp_atoms, + target_atoms, + lattice, + rotations, + permutations, + s2compact, + verbose=False, +): """Distribute fc3. fc3[i, :, :, 0:3, 0:3, 0:3] where i=indices done are distributed to @@ -155,12 +157,11 @@ def distribute_fc3(fc3, for i_done in first_disp_atoms: rot_indices = np.where(permutations[:, i_target] == i_done)[0] if len(rot_indices) > 0: - atom_mapping = np.array(permutations[rot_indices[0]], - dtype='int_') + atom_mapping = np.array(permutations[rot_indices[0]], dtype="int_") rot = rotations[rot_indices[0]] rot_cart_inv = np.array( - similarity_transformation(lattice, rot).T, - dtype='double', order='C') + similarity_transformation(lattice, rot).T, dtype="double", order="C" + ) break if len(rot_indices) == 0: @@ -168,17 +169,15 @@ def distribute_fc3(fc3, raise RuntimeError if verbose > 2: - print(" [ %d, x, x ] to [ %d, x, x ]" % - (i_done + 1, i_target + 1)) + print(" [ %d, x, x ] to [ %d, x, x ]" % (i_done + 1, i_target + 1)) sys.stdout.flush() try: import phono3py._phono3py as phono3c - phono3c.distribute_fc3(fc3, - s2compact[i_target], - s2compact[i_done], - atom_mapping, - rot_cart_inv) + + phono3c.distribute_fc3( + fc3, s2compact[i_target], s2compact[i_done], atom_mapping, rot_cart_inv + ) except ImportError: print("Phono3py C-routine is not compiled correctly.") for j in range(n_satom): @@ -186,13 +185,15 @@ def distribute_fc3(fc3, for k in range(n_satom): k_rot = atom_mapping[k] fc3[i_target, j, k] = _third_rank_tensor_rotation( - rot_cart_inv, fc3[i_done, j_rot, k_rot]) + rot_cart_inv, fc3[i_done, j_rot, k_rot] + ) def set_permutation_symmetry_fc3(fc3): """Enforce permutation symmetry to full fc3.""" try: import phono3py._phono3py as phono3c + phono3c.permutation_symmetry_fc3(fc3) except ImportError: print("Phono3py C-routine is not compiled correctly.") @@ -208,22 +209,24 @@ def set_permutation_symmetry_compact_fc3(fc3, primitive): """Enforce permulation symmetry to compact fc3.""" try: import phono3py._phono3py as phono3c + s2p_map = primitive.s2p_map p2s_map = primitive.p2s_map p2p_map = primitive.p2p_map permutations = primitive.atomic_permutations - s2pp_map, nsym_list = get_nsym_list_and_s2pp(s2p_map, - p2p_map, - permutations) + s2pp_map, nsym_list = get_nsym_list_and_s2pp(s2p_map, p2p_map, permutations) phono3c.permutation_symmetry_compact_fc3( fc3, - np.array(permutations, dtype='int_', order='C'), - np.array(s2pp_map, dtype='int_'), - np.array(p2s_map, dtype='int_'), - np.array(nsym_list, dtype='int_')) + np.array(permutations, dtype="int_", order="C"), + np.array(s2pp_map, dtype="int_"), + np.array(p2s_map, dtype="int_"), + np.array(nsym_list, dtype="int_"), + ) except ImportError: - text = ("Import error at phono3c.permutation_symmetry_compact_fc3. " - "Corresponding python code is not implemented.") + text = ( + "Import error at phono3c.permutation_symmetry_compact_fc3. " + "Corresponding python code is not implemented." + ) raise RuntimeError(text) @@ -238,14 +241,16 @@ def _copy_permutation_symmetry_fc3_elem(fc3, fc3_elem, a, b, c): def _set_permutation_symmetry_fc3_elem(fc3, a, b, c, divisor=6): - tensor3 = np.zeros((3, 3, 3), dtype='double') + tensor3 = np.zeros((3, 3, 3), dtype="double") for (i, j, k) in list(np.ndindex(3, 3, 3)): - tensor3[i, j, k] = (fc3[a, b, c, i, j, k] + - fc3[c, a, b, k, i, j] + - fc3[b, c, a, j, k, i] + - fc3[a, c, b, i, k, j] + - fc3[b, a, c, j, i, k] + - fc3[c, b, a, k, j, i]) / divisor + tensor3[i, j, k] = ( + fc3[a, b, c, i, j, k] + + fc3[c, a, b, k, i, j] + + fc3[b, c, a, j, k, i] + + fc3[a, c, b, i, k, j] + + fc3[b, a, c, j, i, k] + + fc3[c, b, a, k, j, i] + ) / divisor return tensor3 @@ -259,39 +264,32 @@ def set_translational_invariance_compact_fc3(fc3, primitive): """Enforce translational symmetry to compact fc3.""" try: import phono3py._phono3py as phono3c + s2p_map = primitive.s2p_map p2s_map = primitive.p2s_map p2p_map = primitive.p2p_map permutations = primitive.atomic_permutations - s2pp_map, nsym_list = get_nsym_list_and_s2pp(s2p_map, - p2p_map, - permutations) + s2pp_map, nsym_list = get_nsym_list_and_s2pp(s2p_map, p2p_map, permutations) - permutations = np.array(permutations, dtype='int_', order='C') - s2pp_map = np.array(s2pp_map, dtype='int_') - p2s_map = np.array(p2s_map, dtype='int_') - nsym_list = np.array(nsym_list, dtype='int_') + permutations = np.array(permutations, dtype="int_", order="C") + s2pp_map = np.array(s2pp_map, dtype="int_") + p2s_map = np.array(p2s_map, dtype="int_") + nsym_list = np.array(nsym_list, dtype="int_") phono3c.transpose_compact_fc3( - fc3, - permutations, - s2pp_map, - p2s_map, - nsym_list, - 0) # dim[0] <--> dim[1] + fc3, permutations, s2pp_map, p2s_map, nsym_list, 0 + ) # dim[0] <--> dim[1] _set_translational_invariance_fc3_per_index(fc3, index=1) phono3c.transpose_compact_fc3( - fc3, - permutations, - s2pp_map, - p2s_map, - nsym_list, - 0) # dim[0] <--> dim[1] + fc3, permutations, s2pp_map, p2s_map, nsym_list, 0 + ) # dim[0] <--> dim[1] _set_translational_invariance_fc3_per_index(fc3, index=1) _set_translational_invariance_fc3_per_index(fc3, index=2) except ImportError: - text = ("Import error at phono3c.tranpose_compact_fc3. " - "Corresponding python code is not implemented.") + text = ( + "Import error at phono3c.tranpose_compact_fc3. " + "Corresponding python code is not implemented." + ) raise RuntimeError(text) @@ -300,49 +298,43 @@ def _set_translational_invariance_fc3_per_index(fc3, index=0): for j in range(fc3.shape[(2 + index) % 3]): for k, l, m in list(np.ndindex(3, 3, 3)): if index == 0: - fc3[:, i, j, k, l, m] -= np.sum( - fc3[:, i, j, k, l, m]) / fc3.shape[0] + fc3[:, i, j, k, l, m] -= ( + np.sum(fc3[:, i, j, k, l, m]) / fc3.shape[0] + ) elif index == 1: - fc3[j, :, i, k, l, m] -= np.sum( - fc3[j, :, i, k, l, m]) / fc3.shape[1] + fc3[j, :, i, k, l, m] -= ( + np.sum(fc3[j, :, i, k, l, m]) / fc3.shape[1] + ) elif index == 2: - fc3[i, j, :, k, l, m] -= np.sum( - fc3[i, j, :, k, l, m]) / fc3.shape[2] + fc3[i, j, :, k, l, m] -= ( + np.sum(fc3[i, j, :, k, l, m]) / fc3.shape[2] + ) def _third_rank_tensor_rotation(rot_cart, tensor): - rot_tensor = np.zeros((3, 3, 3), dtype='double') + rot_tensor = np.zeros((3, 3, 3), dtype="double") for i in (0, 1, 2): for j in (0, 1, 2): for k in (0, 1, 2): rot_tensor[i, j, k] = _third_rank_tensor_rotation_elem( - rot_cart, tensor, i, j, k) + rot_cart, tensor, i, j, k + ) return rot_tensor -def _get_delta_fc2(dataset_second_atoms, - atom1, - forces1, - fc2, - supercell, - reduced_site_sym, - symprec): +def _get_delta_fc2( + dataset_second_atoms, atom1, forces1, fc2, supercell, reduced_site_sym, symprec +): logger.debug("get_delta_fc2") - disp_fc2 = _get_constrained_fc2(supercell, - dataset_second_atoms, - atom1, - forces1, - reduced_site_sym, - symprec) + disp_fc2 = _get_constrained_fc2( + supercell, dataset_second_atoms, atom1, forces1, reduced_site_sym, symprec + ) return disp_fc2 - fc2 -def _get_constrained_fc2(supercell, - dataset_second_atoms, - atom1, - forces1, - reduced_site_sym, - symprec): +def _get_constrained_fc2( + supercell, dataset_second_atoms, atom1, forces1, reduced_site_sym, symprec +): """Return fc2 under reduced (broken) site symmetry by first displacement. dataset_second_atoms: [{'number': 7, @@ -354,60 +346,47 @@ def _get_constrained_fc2(supercell, positions = supercell.get_scaled_positions() num_atom = supercell.get_number_of_atoms() - fc2 = np.zeros((num_atom, num_atom, 3, 3), dtype='double') - atom_list = np.unique([x['number'] for x in dataset_second_atoms]) + fc2 = np.zeros((num_atom, num_atom, 3, 3), dtype="double") + atom_list = np.unique([x["number"] for x in dataset_second_atoms]) for atom2 in atom_list: disps2 = [] sets_of_forces = [] for disps_second in dataset_second_atoms: - if atom2 != disps_second['number']: + if atom2 != disps_second["number"]: continue bond_sym = get_bond_symmetry( - reduced_site_sym, - lattice, - positions, - atom1, - atom2, - symprec) + reduced_site_sym, lattice, positions, atom1, atom2, symprec + ) - disps2.append(disps_second['displacement']) - sets_of_forces.append(disps_second['forces'] - forces1) + disps2.append(disps_second["displacement"]) + sets_of_forces.append(disps_second["forces"] - forces1) - solve_force_constants(fc2, - atom2, - disps2, - sets_of_forces, - supercell, - bond_sym, - symprec) + solve_force_constants( + fc2, atom2, disps2, sets_of_forces, supercell, bond_sym, symprec + ) # Shift positions according to set atom1 is at origin pos_center = positions[atom1].copy() positions -= pos_center - rotations = np.array(reduced_site_sym, dtype='intc', order='C') - translations = np.zeros((len(reduced_site_sym), 3), - dtype='double', order='C') - permutations = compute_all_sg_permutations(positions, - rotations, - translations, - lattice, - symprec) - distribute_force_constants(fc2, - atom_list, - lattice, - rotations, - permutations) + rotations = np.array(reduced_site_sym, dtype="intc", order="C") + translations = np.zeros((len(reduced_site_sym), 3), dtype="double", order="C") + permutations = compute_all_sg_permutations( + positions, rotations, translations, lattice, symprec + ) + distribute_force_constants(fc2, atom_list, lattice, rotations, permutations) return fc2 -def _solve_fc3(first_atom_num, - supercell, - site_symmetry, - displacements_first, - delta_fc2s, - symprec, - pinv_solver="numpy", - verbose=False): +def _solve_fc3( + first_atom_num, + supercell, + site_symmetry, + displacements_first, + delta_fc2s, + symprec, + pinv_solver="numpy", + verbose=False, +): logger.debug("solve_fc3") if pinv_solver == "numpy": @@ -415,14 +394,14 @@ def _solve_fc3(first_atom_num, else: try: import phono3py._lapackepy as lapackepy + solver = "lapacke-dgesvd" except ImportError: print("Phono3py C-routine is not compiled correctly.") solver = "numpy.linalg.pinv" if verbose: - text = ("Computing fc3[ %d, x, x ] using %s with " % - (first_atom_num + 1, solver)) + text = "Computing fc3[ %d, x, x ] using %s with " % (first_atom_num + 1, solver) if len(displacements_first) > 1: text += "displacements:" else: @@ -434,15 +413,17 @@ def _solve_fc3(first_atom_num, if verbose > 2: print(" Site symmetry:") for i, v in enumerate(site_symmetry): - print(" [%2d %2d %2d] #%2d" % tuple(list(v[0])+[i + 1])) + print(" [%2d %2d %2d] #%2d" % tuple(list(v[0]) + [i + 1])) print(" [%2d %2d %2d]" % tuple(v[1])) print(" [%2d %2d %2d]\n" % tuple(v[2])) sys.stdout.flush() lattice = supercell.get_cell().T - site_sym_cart = np.array([similarity_transformation(lattice, sym) - for sym in site_symmetry], - dtype='double', order='C') + site_sym_cart = np.array( + [similarity_transformation(lattice, sym) for sym in site_symmetry], + dtype="double", + order="C", + ) num_atom = supercell.get_number_of_atoms() positions = supercell.get_scaled_positions() pos_center = positions[first_atom_num].copy() @@ -450,47 +431,40 @@ def _solve_fc3(first_atom_num, logger.debug("get_positions_sent_by_rot_inv") - rot_map_syms = get_positions_sent_by_rot_inv(lattice, - positions, - site_symmetry, - symprec) - rot_map_syms = np.array(rot_map_syms, dtype='int_', order='C') + rot_map_syms = get_positions_sent_by_rot_inv( + lattice, positions, site_symmetry, symprec + ) + rot_map_syms = np.array(rot_map_syms, dtype="int_", order="C") rot_disps = get_rotated_displacement(displacements_first, site_sym_cart) logger.debug("pinv") if "numpy" in solver: - inv_U = np.array(np.linalg.pinv(rot_disps), dtype='double', order='C') + inv_U = np.array(np.linalg.pinv(rot_disps), dtype="double", order="C") else: - inv_U = np.zeros((rot_disps.shape[1], rot_disps.shape[0]), - dtype='double', order='C') + inv_U = np.zeros( + (rot_disps.shape[1], rot_disps.shape[0]), dtype="double", order="C" + ) lapackepy.pinv(inv_U, rot_disps, 1e-13) - fc3 = np.zeros((num_atom, num_atom, 3, 3, 3), dtype='double', order='C') + fc3 = np.zeros((num_atom, num_atom, 3, 3, 3), dtype="double", order="C") logger.debug("rotate_delta_fc2s") try: import phono3py._phono3py as phono3c - phono3c.rotate_delta_fc2s(fc3, - delta_fc2s, - inv_U, - site_sym_cart, - rot_map_syms) + + phono3c.rotate_delta_fc2s(fc3, delta_fc2s, inv_U, site_sym_cart, rot_map_syms) except ImportError: for i, j in np.ndindex(num_atom, num_atom): - fc3[i, j] = np.dot(inv_U, _get_rotated_fc2s( - i, j, delta_fc2s, rot_map_syms, site_sym_cart) + fc3[i, j] = np.dot( + inv_U, _get_rotated_fc2s(i, j, delta_fc2s, rot_map_syms, site_sym_cart) ).reshape(3, 3, 3) return fc3 -def _cutoff_fc3(fc3, - supercell, - disp_dataset, - symmetry, - verbose=False): +def _cutoff_fc3(fc3, supercell, disp_dataset, symmetry, verbose=False): if verbose: print("Building atom mapping table...") fc3_done = _get_fc3_done(supercell, disp_dataset, symmetry, fc3.shape[:3]) @@ -502,7 +476,8 @@ def _cutoff_fc3(fc3, for j in range(i, num_atom): for k in range(j, num_atom): ave_fc3 = _set_permutation_symmetry_fc3_elem_with_cutoff( - fc3, fc3_done, i, j, k) + fc3, fc3_done, i, j, k + ) _copy_permutation_symmetry_fc3_elem(fc3, ave_fc3, i, j, k) @@ -510,12 +485,14 @@ def cutoff_fc3_by_zero(fc3, supercell, cutoff_distance, symprec=1e-5): """Set zero in fc3 elements where pair distances are larger than cutoff.""" num_atom = len(supercell) lattice = supercell.cell.T - min_distances = np.zeros((num_atom, num_atom), dtype='double') + min_distances = np.zeros((num_atom, num_atom), dtype="double") for i in range(num_atom): # run in supercell for j in range(num_atom): # run in primitive min_distances[i, j] = np.linalg.norm( - np.dot(lattice, get_smallest_vector_of_atom_pair( - i, j, supercell, symprec))) + np.dot( + lattice, get_smallest_vector_of_atom_pair(i, j, supercell, symprec) + ) + ) for i, j, k in np.ndindex(num_atom, num_atom, num_atom): for pair in ((i, j), (j, k), (k, i)): @@ -524,9 +501,7 @@ def cutoff_fc3_by_zero(fc3, supercell, cutoff_distance, symprec=1e-5): break -def show_drift_fc3(fc3, - primitive=None, - name="fc3"): +def show_drift_fc3(fc3, primitive=None, name="fc3"): """Show drift of fc3.""" if fc3.shape[0] == fc3.shape[1]: num_atom = fc3.shape[0] @@ -552,17 +527,16 @@ def show_drift_fc3(fc3, else: try: import phono3py._phono3py as phono3c + s2p_map = primitive.s2p_map p2s_map = primitive.p2s_map p2p_map = primitive.p2p_map permutations = primitive.atomic_permutations - s2pp_map, nsym_list = get_nsym_list_and_s2pp(s2p_map, - p2p_map, - permutations) - permutations = np.array(permutations, dtype='int_', order='C') - s2pp_map = np.array(s2pp_map, dtype='int_') - p2s_map = np.array(p2s_map, dtype='int_') - nsym_list = np.array(nsym_list, dtype='int_') + s2pp_map, nsym_list = get_nsym_list_and_s2pp(s2p_map, p2p_map, permutations) + permutations = np.array(permutations, dtype="int_", order="C") + s2pp_map = np.array(s2pp_map, dtype="int_") + p2s_map = np.array(p2s_map, dtype="int_") + nsym_list = np.array(nsym_list, dtype="int_") num_patom = fc3.shape[0] num_satom = fc3.shape[1] maxval1 = 0 @@ -571,23 +545,17 @@ def show_drift_fc3(fc3, klm1 = [0, 0, 0] klm2 = [0, 0, 0] klm3 = [0, 0, 0] - phono3c.transpose_compact_fc3(fc3, - permutations, - s2pp_map, - p2s_map, - nsym_list, - 0) # dim[0] <--> dim[1] + phono3c.transpose_compact_fc3( + fc3, permutations, s2pp_map, p2s_map, nsym_list, 0 + ) # dim[0] <--> dim[1] for i, j, k, l, m in np.ndindex((num_patom, num_satom, 3, 3, 3)): val1 = fc3[i, :, j, k, l, m].sum() if abs(val1) > abs(maxval1): maxval1 = val1 klm1 = [k, l, m] - phono3c.transpose_compact_fc3(fc3, - permutations, - s2pp_map, - p2s_map, - nsym_list, - 0) # dim[0] <--> dim[1] + phono3c.transpose_compact_fc3( + fc3, permutations, s2pp_map, p2s_map, nsym_list, 0 + ) # dim[0] <--> dim[1] for i, j, k, l, m in np.ndindex((num_patom, num_satom, 3, 3, 3)): val2 = fc3[i, :, j, k, l, m].sum() val3 = fc3[i, j, :, k, l, m].sum() @@ -598,51 +566,51 @@ def show_drift_fc3(fc3, maxval3 = val3 klm3 = [k, l, m] except ImportError: - text = ("Import error at phono3c.tranpose_compact_fc3. " - "Corresponding python code is not implemented.") + text = ( + "Import error at phono3c.tranpose_compact_fc3. " + "Corresponding python code is not implemented." + ) raise RuntimeError(text) text = "Max drift of %s: " % name - text += "%f (%s%s%s) " % (maxval1, - "xyz"[klm1[0]], "xyz"[klm1[1]], "xyz"[klm1[2]]) - text += "%f (%s%s%s) " % (maxval2, - "xyz"[klm2[0]], "xyz"[klm2[1]], "xyz"[klm2[2]]) - text += "%f (%s%s%s)" % (maxval3, - "xyz"[klm3[0]], "xyz"[klm3[1]], "xyz"[klm3[2]]) + text += "%f (%s%s%s) " % (maxval1, "xyz"[klm1[0]], "xyz"[klm1[1]], "xyz"[klm1[2]]) + text += "%f (%s%s%s) " % (maxval2, "xyz"[klm2[0]], "xyz"[klm2[1]], "xyz"[klm2[2]]) + text += "%f (%s%s%s)" % (maxval3, "xyz"[klm3[0]], "xyz"[klm3[1]], "xyz"[klm3[2]]) print(text) def _set_permutation_symmetry_fc3_elem_with_cutoff(fc3, fc3_done, a, b, c): - sum_done = (fc3_done[a, b, c] + - fc3_done[c, a, b] + - fc3_done[b, c, a] + - fc3_done[b, a, c] + - fc3_done[c, b, a] + - fc3_done[a, c, b]) - tensor3 = np.zeros((3, 3, 3), dtype='double') + sum_done = ( + fc3_done[a, b, c] + + fc3_done[c, a, b] + + fc3_done[b, c, a] + + fc3_done[b, a, c] + + fc3_done[c, b, a] + + fc3_done[a, c, b] + ) + tensor3 = np.zeros((3, 3, 3), dtype="double") if sum_done > 0: for (i, j, k) in list(np.ndindex(3, 3, 3)): - tensor3[i, j, k] = (fc3[a, b, c, i, j, k] * fc3_done[a, b, c] + - fc3[c, a, b, k, i, j] * fc3_done[c, a, b] + - fc3[b, c, a, j, k, i] * fc3_done[b, c, a] + - fc3[a, c, b, i, k, j] * fc3_done[a, c, b] + - fc3[b, a, c, j, i, k] * fc3_done[b, a, c] + - fc3[c, b, a, k, j, i] * fc3_done[c, b, a]) + tensor3[i, j, k] = ( + fc3[a, b, c, i, j, k] * fc3_done[a, b, c] + + fc3[c, a, b, k, i, j] * fc3_done[c, a, b] + + fc3[b, c, a, j, k, i] * fc3_done[b, c, a] + + fc3[a, c, b, i, k, j] * fc3_done[a, c, b] + + fc3[b, a, c, j, i, k] * fc3_done[b, a, c] + + fc3[c, b, a, k, j, i] * fc3_done[c, b, a] + ) tensor3[i, j, k] /= sum_done return tensor3 -def _get_fc3_least_atoms(supercell, - primitive, - disp_dataset, - fc2, - symmetry, - is_compact_fc=False, - verbose=True): +def _get_fc3_least_atoms( + supercell, primitive, disp_dataset, fc2, symmetry, is_compact_fc=False, verbose=True +): symprec = symmetry.tolerance num_satom = len(supercell) unique_first_atom_nums = np.unique( - [x['number'] for x in disp_dataset['first_atoms']]) + [x["number"] for x in disp_dataset["first_atoms"]] + ) if is_compact_fc: num_patom = primitive.get_number_of_atoms() @@ -655,45 +623,55 @@ def _get_fc3_least_atoms(supercell, raise RuntimeError else: first_atom_nums.append(i) - fc3 = np.zeros((num_patom, num_satom, num_satom, 3, 3, 3), - dtype='double', order='C') + fc3 = np.zeros( + (num_patom, num_satom, num_satom, 3, 3, 3), dtype="double", order="C" + ) else: first_atom_nums = unique_first_atom_nums - fc3 = np.zeros((num_satom, num_satom, num_satom, 3, 3, 3), - dtype='double', order='C') + fc3 = np.zeros( + (num_satom, num_satom, num_satom, 3, 3, 3), dtype="double", order="C" + ) for first_atom_num in first_atom_nums: site_symmetry = symmetry.get_site_symmetry(first_atom_num) displacements_first = [] delta_fc2s = [] - for dataset_first_atom in disp_dataset['first_atoms']: - if first_atom_num != dataset_first_atom['number']: + for dataset_first_atom in disp_dataset["first_atoms"]: + if first_atom_num != dataset_first_atom["number"]: continue - displacements_first.append(dataset_first_atom['displacement']) - if 'delta_fc2' in dataset_first_atom: - delta_fc2s.append(dataset_first_atom['delta_fc2']) + displacements_first.append(dataset_first_atom["displacement"]) + if "delta_fc2" in dataset_first_atom: + delta_fc2s.append(dataset_first_atom["delta_fc2"]) else: - direction = np.dot(dataset_first_atom['displacement'], - np.linalg.inv(supercell.get_cell())) + direction = np.dot( + dataset_first_atom["displacement"], + np.linalg.inv(supercell.get_cell()), + ) reduced_site_sym = get_reduced_site_symmetry( - site_symmetry, direction, symprec) - delta_fc2s.append(_get_delta_fc2( - dataset_first_atom['second_atoms'], - dataset_first_atom['number'], - dataset_first_atom['forces'], - fc2, - supercell, - reduced_site_sym, - symprec)) + site_symmetry, direction, symprec + ) + delta_fc2s.append( + _get_delta_fc2( + dataset_first_atom["second_atoms"], + dataset_first_atom["number"], + dataset_first_atom["forces"], + fc2, + supercell, + reduced_site_sym, + symprec, + ) + ) - fc3_first = _solve_fc3(first_atom_num, - supercell, - site_symmetry, - displacements_first, - np.array(delta_fc2s, dtype='double', order='C'), - symprec, - verbose=verbose) + fc3_first = _solve_fc3( + first_atom_num, + supercell, + site_symmetry, + displacements_first, + np.array(delta_fc2s, dtype="double", order="C"), + symprec, + verbose=verbose, + ) if is_compact_fc: fc3[p2p_map[s2p_map[first_atom_num]]] = fc3_first else: @@ -712,71 +690,68 @@ def _get_rotated_fc2s(i, j, fc2s, rot_map_syms, site_sym_cart): def _third_rank_tensor_rotation_elem(rot, tensor, ll, m, n): - sum_elems = 0. + sum_elems = 0.0 for i in (0, 1, 2): for j in (0, 1, 2): for k in (0, 1, 2): - sum_elems += (rot[ll, i] * rot[m, j] * rot[n, k] - * tensor[i, j, k]) + sum_elems += rot[ll, i] * rot[m, j] * rot[n, k] * tensor[i, j, k] return sum_elems def _get_fc3_done(supercell, disp_dataset, symmetry, array_shape): num_atom = len(supercell) - fc3_done = np.zeros(array_shape, dtype='byte') + fc3_done = np.zeros(array_shape, dtype="byte") symprec = symmetry.tolerance lattice = supercell.cell.T positions = supercell.scaled_positions - rotations = symmetry.get_symmetry_operations()['rotations'] - translations = symmetry.get_symmetry_operations()['translations'] + rotations = symmetry.get_symmetry_operations()["rotations"] + translations = symmetry.get_symmetry_operations()["translations"] atom_mapping = [] for rot, trans in zip(rotations, translations): atom_indices = [ - _get_atom_by_symmetry(lattice, - positions, - rot, - trans, - i, - symprec) for i in range(num_atom)] + _get_atom_by_symmetry(lattice, positions, rot, trans, i, symprec) + for i in range(num_atom) + ] atom_mapping.append(atom_indices) - for dataset_first_atom in disp_dataset['first_atoms']: - first_atom_num = dataset_first_atom['number'] + for dataset_first_atom in disp_dataset["first_atoms"]: + first_atom_num = dataset_first_atom["number"] site_symmetry = symmetry.get_site_symmetry(first_atom_num) - direction = np.dot(dataset_first_atom['displacement'], - np.linalg.inv(supercell.get_cell())) - reduced_site_sym = get_reduced_site_symmetry( - site_symmetry, direction, symprec) + direction = np.dot( + dataset_first_atom["displacement"], np.linalg.inv(supercell.get_cell()) + ) + reduced_site_sym = get_reduced_site_symmetry(site_symmetry, direction, symprec) least_second_atom_nums = [] - for second_atoms in dataset_first_atom['second_atoms']: - if 'included' in second_atoms: - if second_atoms['included']: - least_second_atom_nums.append(second_atoms['number']) - elif 'cutoff_distance' in disp_dataset: + for second_atoms in dataset_first_atom["second_atoms"]: + if "included" in second_atoms: + if second_atoms["included"]: + least_second_atom_nums.append(second_atoms["number"]) + elif "cutoff_distance" in disp_dataset: min_vec = get_smallest_vector_of_atom_pair( - first_atom_num, - second_atoms['number'], - supercell, - symprec) + first_atom_num, second_atoms["number"], supercell, symprec + ) min_distance = np.linalg.norm(np.dot(lattice, min_vec)) - if 'pair_distance' in second_atoms: - assert (abs(min_distance - second_atoms['pair_distance']) - < 1e-4) - if min_distance < disp_dataset['cutoff_distance']: - least_second_atom_nums.append(second_atoms['number']) + if "pair_distance" in second_atoms: + assert abs(min_distance - second_atoms["pair_distance"]) < 1e-4 + if min_distance < disp_dataset["cutoff_distance"]: + least_second_atom_nums.append(second_atoms["number"]) positions_shifted = positions - positions[first_atom_num] least_second_atom_nums = np.unique(least_second_atom_nums) for red_rot in reduced_site_sym: second_atom_nums = [ - _get_atom_by_symmetry(lattice, - positions_shifted, - red_rot, - np.zeros(3, dtype='double'), - i, - symprec) for i in least_second_atom_nums] + _get_atom_by_symmetry( + lattice, + positions_shifted, + red_rot, + np.zeros(3, dtype="double"), + i, + symprec, + ) + for i in least_second_atom_nums + ] second_atom_nums = np.unique(second_atom_nums) for i in range(len(rotations)): @@ -787,12 +762,7 @@ def _get_fc3_done(supercell, disp_dataset, symmetry, array_shape): return fc3_done -def _get_atom_by_symmetry(lattice, - positions, - rotation, - trans, - atom_number, - symprec): +def _get_atom_by_symmetry(lattice, positions, rotation, trans, atom_number, symprec): rot_pos = np.dot(positions[atom_number], rotation.T) + trans diffs = positions - rot_pos diffs -= np.rint(diffs) diff --git a/phono3py/phonon3/gruneisen.py b/phono3py/phonon3/gruneisen.py index 423c72bb..6b71fd0a 100644 --- a/phono3py/phonon3/gruneisen.py +++ b/phono3py/phonon3/gruneisen.py @@ -41,21 +41,23 @@ from phonopy.structure.grid_points import get_qpoints from phonopy.structure.cells import sparse_to_dense_svecs -def run_gruneisen_parameters(fc2, - fc3, - supercell, - primitive, - band_paths, - mesh, - rotations, - qpoints, - nac_params=None, - nac_q_direction=None, - ion_clamped=False, - factor=None, - symprec=1e-5, - output_filename=None, - log_level=1): +def run_gruneisen_parameters( + fc2, + fc3, + supercell, + primitive, + band_paths, + mesh, + rotations, + qpoints, + nac_params=None, + nac_q_direction=None, + ion_clamped=False, + factor=None, + symprec=1e-5, + output_filename=None, + log_level=1, +): """Run mode Grueneisen parameter calculation. The results is written into files. @@ -68,32 +70,34 @@ def run_gruneisen_parameters(fc2, elif band_paths is not None: print("Paths in reciprocal reduced coordinates:") for path in band_paths: - print("[%5.2f %5.2f %5.2f] --> [%5.2f %5.2f %5.2f]" % - (tuple(path[0]) + tuple(path[-1]))) + print( + "[%5.2f %5.2f %5.2f] --> [%5.2f %5.2f %5.2f]" + % (tuple(path[0]) + tuple(path[-1])) + ) if ion_clamped: print("To be calculated with ion clamped.") sys.stdout.flush() - gruneisen = Gruneisen(fc2, - fc3, - supercell, - primitive, - nac_params=nac_params, - nac_q_direction=nac_q_direction, - ion_clamped=ion_clamped, - factor=factor, - symprec=symprec) + gruneisen = Gruneisen( + fc2, + fc3, + supercell, + primitive, + nac_params=nac_params, + nac_q_direction=nac_q_direction, + ion_clamped=ion_clamped, + factor=factor, + symprec=symprec, + ) if log_level > 0: dm = gruneisen.dynamical_matrix - if (dm.is_nac() and dm.nac_method == 'gonze'): + if dm.is_nac() and dm.nac_method == "gonze": dm.show_Gonze_nac_message() if mesh is not None: - gruneisen.set_sampling_mesh(mesh, - rotations=rotations, - is_gamma_center=True) + gruneisen.set_sampling_mesh(mesh, rotations=rotations, is_gamma_center=True) filename_ext = ".hdf5" elif band_paths is not None: gruneisen.set_band_structure(band_paths) @@ -105,29 +109,30 @@ def run_gruneisen_parameters(fc2, gruneisen.run() if output_filename is None: - filename = 'gruneisen' + filename = "gruneisen" else: - filename = 'gruneisen.' + output_filename + filename = "gruneisen." + output_filename gruneisen.write(filename=filename) if log_level: - print("Gruneisen parameters are written in %s" % - (filename + filename_ext)) + print("Gruneisen parameters are written in %s" % (filename + filename_ext)) class Gruneisen(object): """Calculat mode Grueneisen parameters from fc3.""" - def __init__(self, - fc2, - fc3, - supercell, - primitive, - nac_params=None, - nac_q_direction=None, - ion_clamped=False, - factor=VaspToTHz, - symprec=1e-5): + def __init__( + self, + fc2, + fc3, + supercell, + primitive, + nac_params=None, + nac_q_direction=None, + ion_clamped=False, + factor=VaspToTHz, + symprec=1e-5, + ): """Init method.""" self._fc2 = fc2 self._fc3 = fc3 @@ -136,11 +141,13 @@ class Gruneisen(object): self._ion_clamped = ion_clamped self._factor = factor self._symprec = symprec - self._dm = get_dynamical_matrix(self._fc2, - self._scell, - self._pcell, - nac_params=nac_params, - symprec=self._symprec) + self._dm = get_dynamical_matrix( + self._fc2, + self._scell, + self._pcell, + nac_params=nac_params, + symprec=self._symprec, + ) self._nac_q_direction = nac_q_direction svecs, multi = self._pcell.get_smallest_vectors() @@ -168,14 +175,18 @@ class Gruneisen(object): def run(self): """Run mode Grueneisen parameter calculation.""" - if self._run_mode == 'band': - (self._gruneisen_parameters, - self._frequencies) = self._calculate_band_paths() - elif self._run_mode == 'qpoints' or self._run_mode == 'mesh': - (self._gruneisen_parameters, - self._frequencies) = self._calculate_at_qpoints(self._qpoints) + if self._run_mode == "band": + ( + self._gruneisen_parameters, + self._frequencies, + ) = self._calculate_band_paths() + elif self._run_mode == "qpoints" or self._run_mode == "mesh": + ( + self._gruneisen_parameters, + self._frequencies, + ) = self._calculate_at_qpoints(self._qpoints) else: - sys.stderr.write('Q-points are not specified.\n') + sys.stderr.write("Q-points are not specified.\n") @property def dynamical_matrix(self): @@ -188,60 +199,58 @@ class Gruneisen(object): def set_qpoints(self, qpoints): """Set q-points.""" - self._run_mode = 'qpoints' + self._run_mode = "qpoints" self._qpoints = qpoints - def set_sampling_mesh(self, - mesh, - rotations=None, - shift=None, - is_gamma_center=False): + def set_sampling_mesh( + self, mesh, rotations=None, shift=None, is_gamma_center=False + ): """Set sampling mesh.""" - self._run_mode = 'mesh' - self._mesh = np.array(mesh, dtype='intc') + self._run_mode = "mesh" + self._mesh = np.array(mesh, dtype="intc") self._qpoints, self._weights = get_qpoints( self._mesh, np.linalg.inv(self._pcell.cell), q_mesh_shift=shift, is_gamma_center=is_gamma_center, - rotations=rotations) + rotations=rotations, + ) def set_band_structure(self, paths): """Set band structure paths.""" - self._run_mode = 'band' + self._run_mode = "band" self._band_paths = paths rec_lattice = np.linalg.inv(self._pcell.get_cell()) self._band_distances = [] for path in paths: - distances_at_path = [0.] + distances_at_path = [0.0] for i in range(len(path) - 1): - distances_at_path.append(np.linalg.norm( - np.dot(rec_lattice, path[i + 1] - path[i])) + - distances_at_path[-1]) + distances_at_path.append( + np.linalg.norm(np.dot(rec_lattice, path[i + 1] - path[i])) + + distances_at_path[-1] + ) self._band_distances.append(distances_at_path) def write(self, filename="gruneisen"): """Write result in a file.""" if self._gruneisen_parameters is not None: - if self._run_mode == 'band': + if self._run_mode == "band": self._write_band_yaml(filename + ".yaml") - elif self._run_mode == 'qpoints': + elif self._run_mode == "qpoints": self._write_mesh_yaml(filename + ".yaml") - elif self._run_mode == 'mesh': + elif self._run_mode == "mesh": self._write_mesh_hdf5(filename + ".hdf5") def _write_mesh_yaml(self, filename): - with open(filename, 'w') as f: - if self._run_mode == 'mesh': + with open(filename, "w") as f: + if self._run_mode == "mesh": f.write("mesh: [ %5d, %5d, %5d ]\n" % tuple(self._mesh)) f.write("nqpoint: %d\n" % len(self._qpoints)) f.write("phonon:\n") for i, (q, g_at_q, freqs_at_q) in enumerate( - zip(self._qpoints, - self._gruneisen_parameters, - self._frequencies)): - f.write("- q-position: [ %10.7f, %10.7f, %10.7f ]\n" - % tuple(q)) + zip(self._qpoints, self._gruneisen_parameters, self._frequencies) + ): + f.write("- q-position: [ %10.7f, %10.7f, %10.7f ]\n" % tuple(q)) if self._weights is not None: f.write(" multiplicity: %d\n" % self._weights[i]) f.write(" band:\n") @@ -251,22 +260,23 @@ class Gruneisen(object): f.write(" gruneisen: %15.10f\n" % (g.trace() / 3)) f.write(" gruneisen_tensor:\n") for g_xyz in g: - f.write(" - [ %10.7f, %10.7f, %10.7f ]\n" % - tuple(g_xyz)) + f.write(" - [ %10.7f, %10.7f, %10.7f ]\n" % tuple(g_xyz)) def _write_band_yaml(self, filename): - with open(filename, 'w') as f: + with open(filename, "w") as f: f.write("path:\n\n") - for path, distances, gs, fs in zip(self._band_paths, - self._band_distances, - self._gruneisen_parameters, - self._frequencies): + for path, distances, gs, fs in zip( + self._band_paths, + self._band_distances, + self._gruneisen_parameters, + self._frequencies, + ): f.write("- nqpoint: %d\n" % len(path)) f.write(" phonon:\n") for i, (q, d, g_at_q, freqs_at_q) in enumerate( - zip(path, distances, gs, fs)): # noqa E125 - f.write(" - q-position: [ %10.7f, %10.7f, %10.7f ]\n" - % tuple(q)) + zip(path, distances, gs, fs) + ): # noqa E125 + f.write(" - q-position: [ %10.7f, %10.7f, %10.7f ]\n" % tuple(q)) f.write(" distance: %10.7f\n" % d) f.write(" band:\n") for j, (g, freq) in enumerate(zip(g_at_q, freqs_at_q)): @@ -275,8 +285,9 @@ class Gruneisen(object): f.write(" gruneisen: %15.10f\n" % (g.trace() / 3)) f.write(" gruneisen_tensor:\n") for g_xyz in g: - f.write(" - [ %10.7f, %10.7f, %10.7f ]\n" % - tuple(g_xyz)) + f.write( + " - [ %10.7f, %10.7f, %10.7f ]\n" % tuple(g_xyz) + ) f.write("\n") def _write_mesh_hdf5(self, filename="gruneisen.hdf5"): @@ -285,16 +296,17 @@ class Gruneisen(object): g = self._gruneisen_parameters gruneisen = np.array( (g[:, :, 0, 0] + g[:, :, 1, 1] + g[:, :, 2, 2]) / 3, - dtype='double', order='C') + dtype="double", + order="C", + ) - with h5py.File(filename, 'w') as w: - w.create_dataset('mesh', data=self._mesh) - w.create_dataset('gruneisen', data=gruneisen) - w.create_dataset('gruneisen_tensor', - data=self._gruneisen_parameters) - w.create_dataset('weight', data=self._weights) - w.create_dataset('frequency', data=self._frequencies) - w.create_dataset('qpoint', data=self._qpoints) + with h5py.File(filename, "w") as w: + w.create_dataset("mesh", data=self._mesh) + w.create_dataset("gruneisen", data=gruneisen) + w.create_dataset("gruneisen_tensor", data=self._gruneisen_parameters) + w.create_dataset("weight", data=self._weights) + w.create_dataset("frequency", data=self._frequencies) + w.create_dataset("qpoint", data=self._qpoints) def _calculate_at_qpoints(self, qpoints): gruneisen_parameters = [] @@ -302,7 +314,7 @@ class Gruneisen(object): for i, q in enumerate(qpoints): if self._dm.is_nac(): if (np.abs(q) < 1e-5).all(): # If q is almost at Gamma - if self._run_mode == 'band': + if self._run_mode == "band": # Direction estimated from neighboring point if i > 0: q_dir = qpoints[i] - qpoints[i - 1] @@ -310,29 +322,28 @@ class Gruneisen(object): q_dir = qpoints[i + 1] - qpoints[i] else: q_dir = None - g, omega2 = self._get_gruneisen_tensor( - q, nac_q_direction=q_dir) + g, omega2 = self._get_gruneisen_tensor(q, nac_q_direction=q_dir) else: # Specified q-vector g, omega2 = self._get_gruneisen_tensor( - q, nac_q_direction=self._nac_q_direction) + q, nac_q_direction=self._nac_q_direction + ) else: # If q is away from Gamma-point, then q-vector - g, omega2 = self._get_gruneisen_tensor( - q, nac_q_direction=q) + g, omega2 = self._get_gruneisen_tensor(q, nac_q_direction=q) else: # Without NAC g, omega2 = self._get_gruneisen_tensor(q) gruneisen_parameters.append(g) - frequencies.append( - np.sqrt(abs(omega2)) * np.sign(omega2) * self._factor) + frequencies.append(np.sqrt(abs(omega2)) * np.sign(omega2) * self._factor) - return (np.array(gruneisen_parameters, dtype='double', order='C'), - np.array(frequencies, dtype='double', order='C')) + return ( + np.array(gruneisen_parameters, dtype="double", order="C"), + np.array(frequencies, dtype="double", order="C"), + ) def _calculate_band_paths(self): gruneisen_parameters = [] frequencies = [] for path in self._band_paths: - (gruneisen_at_path, - frequencies_at_path) = self._calculate_at_qpoints(path) + (gruneisen_at_path, frequencies_at_path) = self._calculate_at_qpoints(path) gruneisen_parameters.append(gruneisen_at_path) frequencies.append(frequencies_at_path) @@ -355,9 +366,11 @@ class Gruneisen(object): for j in range(3): for nu in range(num_atom_prim): for pi in range(num_atom_prim): - g[s] += (w[nu * 3 + i, s].conjugate() * - dDdu[nu, pi, i, j] * w[pi * 3 + j, s] - ).real + g[s] += ( + w[nu * 3 + i, s].conjugate() + * dDdu[nu, pi, i, j] + * w[pi * 3 + j, s] + ).real g[s] *= -1.0 / 2 / omega2[s] @@ -365,13 +378,11 @@ class Gruneisen(object): def _get_dDdu(self, q): num_atom_prim = len(self._pcell) - num_atom_super = len(self._scell) p2s = self._pcell.p2s_map s2p = self._pcell.s2p_map m = self._pcell.masses dPhidu = self._dPhidu - dDdu = np.zeros((num_atom_prim, num_atom_prim, 3, 3, 3, 3), - dtype=complex) + dDdu = np.zeros((num_atom_prim, num_atom_prim, 3, 3, 3, 3), dtype=complex) for nu in range(num_atom_prim): for pi, p in enumerate(p2s): @@ -380,9 +391,14 @@ class Gruneisen(object): continue adrs = self._multi[Ppi, nu][1] multi = self._multi[Ppi, nu][0] - phase = np.exp(2j * np.pi * np.dot( - self._svecs[adrs:(adrs + multi), :], q) - ).sum() / multi + phase = ( + np.exp( + 2j + * np.pi + * np.dot(self._svecs[adrs : (adrs + multi), :], q) + ).sum() + / multi + ) dDdu[nu, pi] += phase * dPhidu[nu, Ppi] dDdu[nu, pi] /= np.sqrt(m[nu] * m[pi]) @@ -393,8 +409,7 @@ class Gruneisen(object): num_atom_prim = len(self._pcell) num_atom_super = len(self._scell) p2s = self._pcell.p2s_map - dPhidu = np.zeros((num_atom_prim, num_atom_super, 3, 3, 3, 3), - dtype=float) + dPhidu = np.zeros((num_atom_prim, num_atom_super, 3, 3, 3, 3), dtype=float) for nu in range(num_atom_prim): Y = self._get_Y(nu) @@ -405,20 +420,18 @@ class Gruneisen(object): for ll in range(3): for m in range(3): dPhidu[nu, pi, i, j, k, ll] = ( - fc3[p2s[nu], pi, :, i, j, :] * - Y[:, :, k, ll]).sum() + fc3[p2s[nu], pi, :, i, j, :] * Y[:, :, k, ll] + ).sum() # Symmetrization? # (Y[:,:,k,l] + Y[:,:,l,k]) / 2).sum() return dPhidu def _get_Y(self, nu): - P = self._fc2 X = self._X lat = self._pcell.cell num_atom_super = len(self._scell) R = self._get_R(num_atom_super, nu, lat) - p2s = self._pcell.p2s_map s2p = self._pcell.s2p_map p2p = self._pcell.p2p_map @@ -447,8 +460,9 @@ class Gruneisen(object): for j in range(3): for k in range(3): for ll in range(3): - X[mu, i, j, k] -= G[mu, nu, i, ll] * \ - np.dot(P[p2s[nu], :, ll, j], R[:, k]) + X[mu, i, j, k] -= G[mu, nu, i, ll] * np.dot( + P[p2s[nu], :, ll, j], R[:, k] + ) return X @@ -457,8 +471,9 @@ class Gruneisen(object): for Npi in range(num_atom_super): adrs = self._multi[Npi, nu][1] multi = self._multi[Npi, nu][0] - R.append(np.dot(self._svecs[adrs:(adrs + multi), :].sum(axis=0) / - multi, lat)) + R.append( + np.dot(self._svecs[adrs : (adrs + multi), :].sum(axis=0) / multi, lat) + ) return np.array(R) def _get_Gamma(self): @@ -475,7 +490,10 @@ class Gruneisen(object): # Eigenvectors are real. # 3: means optical modes G[pi, mu, k, i] = ( - 1.0 / np.sqrt(m[pi] * m[mu]) * - (vecs[pi * 3 + k, 3:] * vecs[mu * 3 + i, 3:] / - vals[3:]).sum()) + 1.0 + / np.sqrt(m[pi] * m[mu]) + * ( + vecs[pi * 3 + k, 3:] * vecs[mu * 3 + i, 3:] / vals[3:] + ).sum() + ) return G diff --git a/phono3py/phonon3/imag_self_energy.py b/phono3py/phonon3/imag_self_energy.py index 1b856f11..84bdb35a 100644 --- a/phono3py/phonon3/imag_self_energy.py +++ b/phono3py/phonon3/imag_self_energy.py @@ -1,3 +1,4 @@ +"""Calculation of imaginary-part of self-energy of bubble diagram.""" # Copyright (C) 2020 Atsushi Togo # All rights reserved. # @@ -33,32 +34,38 @@ # POSSIBILITY OF SUCH DAMAGE. import sys +from typing import List, Optional import numpy as np from phonopy.units import Hbar, EV, THz from phonopy.phonon.degeneracy import degenerate_sets +from phono3py.phonon3.interaction import Interaction from phono3py.phonon3.triplets import get_triplets_integration_weights from phono3py.phonon.func import bose_einstein -from phono3py.file_IO import (write_gamma_detail_to_hdf5, - write_imag_self_energy_at_grid_point) +from phono3py.file_IO import ( + write_gamma_detail_to_hdf5, + write_imag_self_energy_at_grid_point, +) -def get_imag_self_energy(interaction, - grid_points, - temperatures, - sigmas=None, - frequency_points=None, - frequency_step=None, - num_frequency_points=None, - frequency_points_at_bands=False, - num_points_in_batch=None, - scattering_event_class=None, # class 1 or 2 - write_gamma_detail=False, - return_gamma_detail=False, - output_filename=None, - log_level=0): - """Imaginary part of self energy at frequency points +def get_imag_self_energy( + interaction: Interaction, + grid_points, + temperatures, + sigmas=None, + frequency_points=None, + frequency_step=None, + num_frequency_points=None, + frequency_points_at_bands=False, + num_points_in_batch=None, + scattering_event_class=None, # class 1 or 2 + write_gamma_detail=False, + return_gamma_detail=False, + output_filename=None, + log_level=0, +): + """Imaginary-part of self-energy at frequency points. - Band indices to be calculated at are kept in Interaction instance. + Band indices to be calculated at are found in Interaction instance. Parameters ---------- @@ -136,9 +143,10 @@ def get_imag_self_energy(interaction, band_indices, num_band, num_band) """ - if sigmas is None: - _sigmas = [None, ] + _sigmas = [ + None, + ] else: _sigmas = sigmas @@ -150,29 +158,41 @@ def get_imag_self_energy(interaction, frequencies = interaction.get_phonons()[0] max_phonon_freq = np.amax(frequencies) num_band0 = len(interaction.band_indices) - mesh = interaction.mesh_numbers if frequency_points_at_bands: _frequency_points = None _num_frequency_points = num_band0 - gamma = np.zeros((len(_sigmas), len(temperatures), len(grid_points), - _num_frequency_points), dtype='double', order='C') + gamma = np.zeros( + (len(_sigmas), len(temperatures), len(grid_points), _num_frequency_points), + dtype="double", + order="C", + ) else: _frequency_points = get_frequency_points( max_phonon_freq=max_phonon_freq, sigmas=_sigmas, frequency_points=frequency_points, frequency_step=frequency_step, - num_frequency_points=num_frequency_points) + num_frequency_points=num_frequency_points, + ) _num_frequency_points = len(_frequency_points) gamma = np.zeros( - (len(_sigmas), len(temperatures), len(grid_points), - num_band0, _num_frequency_points), dtype='double', order='C') + ( + len(_sigmas), + len(temperatures), + len(grid_points), + num_band0, + _num_frequency_points, + ), + dtype="double", + order="C", + ) - detailed_gamma = [] + detailed_gamma: List[Optional[np.ndarray]] = [] ise = ImagSelfEnergy( - interaction, with_detail=(write_gamma_detail or return_gamma_detail)) + interaction, with_detail=(write_gamma_detail or return_gamma_detail) + ) for i, gp in enumerate(grid_points): ise.set_grid_point(gp) @@ -180,42 +200,46 @@ def get_imag_self_energy(interaction, bz_grid = interaction.bz_grid weights = interaction.get_triplets_at_q()[1] if len(grid_points) > 1: - print("---------------- Imaginary part of self energy -o- (%d/%d) " - "----------------" % (i + 1, len(grid_points))) + print( + "---------------- Imaginary part of self energy -o- (%d/%d) " + "----------------" % (i + 1, len(grid_points)) + ) else: - print("-------------------- Imaginary part of self energy -o- " - "--------------------") + print( + "-------------------- Imaginary part of self energy -o- " + "--------------------" + ) print("Grid point: %d" % gp) - print("Number of ir-triplets: " - "%d / %d" % (len(weights), weights.sum())) + print("Number of ir-triplets: " "%d / %d" % (len(weights), weights.sum())) ise.run_interaction() frequencies = interaction.get_phonons()[0][gp] if log_level: qpoint = np.dot(bz_grid.QDinv, bz_grid.addresses[gp]) - print("Phonon frequencies at (%4.2f, %4.2f, %4.2f):" - % tuple(qpoint)) + print("Phonon frequencies at (%4.2f, %4.2f, %4.2f):" % tuple(qpoint)) for bi, freq in enumerate(frequencies): print("%3d %f" % (bi + 1, freq)) sys.stdout.flush() - _get_imag_self_energy_at_gp(gamma, - detailed_gamma, - i, - gp, - _sigmas, - temperatures, - _frequency_points, - _num_frequency_points, - scattering_event_class, - num_points_in_batch, - interaction, - ise, - write_gamma_detail, - return_gamma_detail, - output_filename, - log_level) + _get_imag_self_energy_at_gp( + gamma, + detailed_gamma, + i, + gp, + _sigmas, + temperatures, + _frequency_points, + _num_frequency_points, + scattering_event_class, + num_points_in_batch, + interaction, + ise, + write_gamma_detail, + return_gamma_detail, + output_filename, + log_level, + ) if return_gamma_detail: return _frequency_points, gamma, detailed_gamma @@ -223,22 +247,24 @@ def get_imag_self_energy(interaction, return _frequency_points, gamma -def _get_imag_self_energy_at_gp(gamma, - detailed_gamma, - i, - gp, - _sigmas, - temperatures, - _frequency_points, - _num_frequency_points, - scattering_event_class, - num_points_in_batch, - interaction, - ise, - write_gamma_detail, - return_gamma_detail, - output_filename, - log_level): +def _get_imag_self_energy_at_gp( + gamma, + detailed_gamma, + i, + gp, + _sigmas, + temperatures, + _frequency_points, + _num_frequency_points, + scattering_event_class, + num_points_in_batch, + interaction, + ise, + write_gamma_detail, + return_gamma_detail, + output_filename, + log_level, +): num_band0 = len(interaction.band_indices) frequencies = interaction.get_phonons()[0] mesh = interaction.mesh_numbers @@ -248,14 +274,29 @@ def _get_imag_self_energy_at_gp(gamma, num_band = frequencies.shape[1] if _frequency_points is None: detailed_gamma_at_gp = np.zeros( - (len(_sigmas), len(temperatures), - len(weights), num_band0, num_band, num_band), - dtype='double') + ( + len(_sigmas), + len(temperatures), + len(weights), + num_band0, + num_band, + num_band, + ), + dtype="double", + ) else: detailed_gamma_at_gp = np.zeros( - (len(_sigmas), len(temperatures), _num_frequency_points, - len(weights), num_band0, num_band, num_band), - dtype='double') + ( + len(_sigmas), + len(temperatures), + _num_frequency_points, + len(weights), + num_band0, + num_band, + num_band, + ), + dtype="double", + ) else: detailed_gamma_at_gp = None @@ -267,18 +308,20 @@ def _get_imag_self_energy_at_gp(gamma, print("Tetrahedron method is used for BZ integration.") ise.set_sigma(sigma) - _get_imag_self_energy_at_sigma(gamma, - detailed_gamma_at_gp, - i, - j, - temperatures, - _frequency_points, - scattering_event_class, - num_points_in_batch, - ise, - write_gamma_detail, - return_gamma_detail, - log_level) + _get_imag_self_energy_at_sigma( + gamma, + detailed_gamma_at_gp, + i, + j, + temperatures, + _frequency_points, + scattering_event_class, + num_points_in_batch, + ise, + write_gamma_detail, + return_gamma_detail, + log_level, + ) if write_gamma_detail: full_filename = write_gamma_detail_to_hdf5( @@ -290,28 +333,33 @@ def _get_imag_self_energy_at_gp(gamma, weight=weights, sigma=sigma, frequency_points=_frequency_points, - filename=output_filename) + filename=output_filename, + ) if log_level: - print("Contribution of each triplet to imaginary part of " - "self energy is written in\n\"%s\"." % full_filename) + print( + "Contribution of each triplet to imaginary part of " + 'self energy is written in\n"%s".' % full_filename + ) if return_gamma_detail: detailed_gamma.append(detailed_gamma_at_gp) -def _get_imag_self_energy_at_sigma(gamma, - detailed_gamma_at_gp, - i, - j, - temperatures, - _frequency_points, - scattering_event_class, - num_points_in_batch, - ise, - write_gamma_detail, - return_gamma_detail, - log_level): +def _get_imag_self_energy_at_sigma( + gamma, + detailed_gamma_at_gp, + i, + j, + temperatures, + _frequency_points, + scattering_event_class, + num_points_in_batch, + ise, + write_gamma_detail, + return_gamma_detail, + log_level, +): # Run one by one at frequency points if detailed_gamma_at_gp is None: detailed_gamma_at_gp_at_j = None @@ -319,15 +367,13 @@ def _get_imag_self_energy_at_sigma(gamma, detailed_gamma_at_gp_at_j = detailed_gamma_at_gp[j] if _frequency_points is None: - ise.set_integration_weights( - scattering_event_class=scattering_event_class) + ise.set_integration_weights(scattering_event_class=scattering_event_class) for k, t in enumerate(temperatures): ise.set_temperature(t) ise.run() gamma[j, k, i] = ise.get_imag_self_energy() if write_gamma_detail or return_gamma_detail: - detailed_gamma_at_gp[k] = ( - ise.get_detailed_imag_self_energy()) + detailed_gamma_at_gp[k] = ise.get_detailed_imag_self_energy() else: run_ise_at_frequency_points_batch( i, @@ -341,14 +387,23 @@ def _get_imag_self_energy_at_sigma(gamma, detailed_gamma_at_gp=detailed_gamma_at_gp_at_j, scattering_event_class=scattering_event_class, nelems_in_batch=num_points_in_batch, - log_level=log_level) + log_level=log_level, + ) -def get_frequency_points(max_phonon_freq=None, - sigmas=None, - frequency_points=None, - frequency_step=None, - num_frequency_points=None): +def get_frequency_points( + max_phonon_freq=None, + sigmas=None, + frequency_points=None, + frequency_step=None, + num_frequency_points=None, +): + """Generate frequency points. + + This function may be mostly used for the phonon frequency axis of + spectrum-like calculations. + + """ if frequency_points is None: if sigmas is not None: sigma_vals = [sigma for sigma in sigmas if sigma is not None] @@ -364,42 +419,44 @@ def get_frequency_points(max_phonon_freq=None, fmin, fmax, frequency_step=frequency_step, - num_frequency_points=num_frequency_points) + num_frequency_points=num_frequency_points, + ) else: - _frequency_points = np.array(frequency_points, dtype='double') + _frequency_points = np.array(frequency_points, dtype="double") return _frequency_points -def _sample_frequency_points(f_min, - f_max, - frequency_step=None, - num_frequency_points=None): +def _sample_frequency_points( + f_min, f_max, frequency_step=None, num_frequency_points=None +): if num_frequency_points is None: if frequency_step is not None: - frequency_points = np.arange( - f_min, f_max, frequency_step, dtype='double') + frequency_points = np.arange(f_min, f_max, frequency_step, dtype="double") else: - frequency_points = np.array(np.linspace( - f_min, f_max, 201), dtype='double') + frequency_points = np.array(np.linspace(f_min, f_max, 201), dtype="double") else: - frequency_points = np.array(np.linspace( - f_min, f_max, num_frequency_points), dtype='double') + frequency_points = np.array( + np.linspace(f_min, f_max, num_frequency_points), dtype="double" + ) return frequency_points -def write_imag_self_energy(imag_self_energy, - mesh, - grid_points, - band_indices, - frequency_points, - temperatures, - sigmas, - scattering_event_class=None, - output_filename=None, - is_mesh_symmetry=True, - log_level=0): +def write_imag_self_energy( + imag_self_energy, + mesh, + grid_points, + band_indices, + frequency_points, + temperatures, + sigmas, + scattering_event_class=None, + output_filename=None, + is_mesh_symmetry=True, + log_level=0, +): + """Write imaginary-part of self-energies into text files.""" for sigma, ise_temps in zip(sigmas, imag_self_energy): for t, ise_gps in zip(temperatures, ise_temps): for gp, ise in zip(grid_points, ise_gps): @@ -412,18 +469,22 @@ def write_imag_self_energy(imag_self_energy, bi, mesh, frequency_points, - ise[pos:(pos + len(bi))].sum(axis=0) / len(bi), + ise[pos : (pos + len(bi))].sum(axis=0) / len(bi), sigma=sigma, temperature=t, scattering_event_class=scattering_event_class, filename=output_filename, - is_mesh_symmetry=is_mesh_symmetry) + is_mesh_symmetry=is_mesh_symmetry, + ) if log_level: - print("Imaginary parts of self-energies were " - "written to \"%s\"." % filename) + print( + "Imaginary part of self-energies were " + 'written to "%s".' % filename + ) def average_by_degeneracy(imag_self_energy, band_indices, freqs_at_gp): + """Take averages of values of energetically degenerated bands.""" deg_sets = degenerate_sets(freqs_at_gp) imag_se = np.zeros_like(imag_self_energy) for dset in deg_sets: @@ -433,32 +494,97 @@ def average_by_degeneracy(imag_self_energy, band_indices, freqs_at_gp): bi_set.append(i) for i in bi_set: if imag_self_energy.ndim == 1: - imag_se[i] = (imag_self_energy[bi_set].sum() / - len(bi_set)) + imag_se[i] = imag_self_energy[bi_set].sum() / len(bi_set) else: - imag_se[:, i] = ( - imag_self_energy[:, bi_set].sum(axis=1) / - len(bi_set)) + imag_se[:, i] = imag_self_energy[:, bi_set].sum(axis=1) / len(bi_set) return imag_se -class ImagSelfEnergy(object): - def __init__(self, - interaction, - frequency_points=None, - temperature=None, - sigma=None, - sigma_cutoff=None, - with_detail=False, - unit_conversion=None, - lang='C'): +def run_ise_at_frequency_points_batch( + i, + j, + _frequency_points, + ise, + temperatures, + gamma, + write_gamma_detail=False, + return_gamma_detail=False, + detailed_gamma_at_gp=None, + scattering_event_class=None, + nelems_in_batch=50, + log_level=0, +): + """Run calculations at frequency points batch by batch. + + See the details about batch in docstring of ``get_imag_self_energy``. + + """ + if nelems_in_batch is None: + _nelems_in_batch = 10 + else: + _nelems_in_batch = nelems_in_batch + + batches = _get_batches(len(_frequency_points), _nelems_in_batch) + + if log_level: + print( + "Calculations at %d frequency points are devided into " + "%d batches." % (len(_frequency_points), len(batches)) + ) + + for bi, fpts_batch in enumerate(batches): + if log_level: + print("%d/%d: %s" % (bi + 1, len(batches), fpts_batch + 1)) + sys.stdout.flush() + + ise.set_frequency_points(_frequency_points[fpts_batch]) + ise.set_integration_weights(scattering_event_class=scattering_event_class) + for ll, t in enumerate(temperatures): + ise.set_temperature(t) + ise.run() + gamma[j, ll, i, :, fpts_batch] = ise.get_imag_self_energy() + if write_gamma_detail or return_gamma_detail: + detailed_gamma_at_gp[ + ll, fpts_batch + ] = ise.get_detailed_imag_self_energy() + + +def _get_batches(tot_nelems, nelems=10): + nbatch = tot_nelems // nelems + batches = [np.arange(i * nelems, (i + 1) * nelems) for i in range(nbatch)] + if tot_nelems % nelems > 0: + batches.append(np.arange(nelems * nbatch, tot_nelems)) + return batches + + +class ImagSelfEnergy: + """Class for imaginary-part of self-energy of bubble diagram.""" + + def __init__( + self, + interaction: Interaction, + with_detail=False, + lang="C", + ): + """Init method. + + Band indices to be calculated at are kept in Interaction instance. + + Parameters + ---------- + interaction : Interaction + Class instance of ph-ph interaction. + with_detail : bool, optional + Contributions to gammas for each triplets are computed. Default is + False. + lang : str, optional + This is used for debugging purpose. + + """ self._pp = interaction self._sigma = None - self.set_sigma(sigma, sigma_cutoff=sigma_cutoff) self._temperature = None - self.set_temperature(temperature) self._frequency_points = None - self.set_frequency_points(frequency_points) self._grid_point = None self._lang = lang @@ -469,51 +595,50 @@ class ImagSelfEnergy(object): self._triplets_at_q = None self._weights_at_q = None self._with_detail = with_detail - self._unit_conversion = None self._cutoff_frequency = interaction.cutoff_frequency self._g = None # integration weights self._g_zero = None # Necessary elements of interaction strength self._g_zero_frequency_points = None - self._g_zero_zeros = None # always zeros for frequency sampling mode + self._g_zero_zeros = None # always zeros for frequency sampling mode self._is_collision_matrix = False # Unit to THz of Gamma - if unit_conversion is None: - self._unit_conversion = (18 * np.pi / (Hbar * EV) ** 2 - / (2 * np.pi * THz) ** 2 - * EV ** 2) - else: - self._unit_conversion = unit_conversion + self._unit_conversion = ( + 18 * np.pi / (Hbar * EV) ** 2 / (2 * np.pi * THz) ** 2 * EV ** 2 + ) def run(self): + """Calculate imaginary-part of self-energies.""" if self._pp_strength is None: self.run_interaction() num_band0 = self._pp_strength.shape[1] if self._frequency_points is None: - self._imag_self_energy = np.zeros(num_band0, dtype='double') + self._imag_self_energy = np.zeros(num_band0, dtype="double") if self._with_detail: - self._detailed_imag_self_energy = np.empty_like( - self._pp_strength) + self._detailed_imag_self_energy = np.empty_like(self._pp_strength) self._detailed_imag_self_energy[:] = 0 self._ise_N = np.zeros_like(self._imag_self_energy) self._ise_U = np.zeros_like(self._imag_self_energy) self._run_with_band_indices() else: self._imag_self_energy = np.zeros( - (len(self._frequency_points), num_band0), - order='C', dtype='double') + (len(self._frequency_points), num_band0), order="C", dtype="double" + ) if self._with_detail: self._detailed_imag_self_energy = np.zeros( (len(self._frequency_points),) + self._pp_strength.shape, - order='C', dtype='double') + order="C", + dtype="double", + ) self._ise_N = np.zeros_like(self._imag_self_energy) self._ise_U = np.zeros_like(self._imag_self_energy) self._run_with_frequency_points() def run_interaction(self, is_full_pp=True): + """Calculate ph-ph interaction.""" if is_full_pp or self._frequency_points is not None: self._pp.run(lang=self._lang) else: @@ -521,6 +646,7 @@ class ImagSelfEnergy(object): self._pp_strength = self._pp.interaction_strength def set_integration_weights(self, scattering_event_class=None): + """Compute integration weights at grid points.""" if self._frequency_points is None: bi = self._pp.band_indices f_points = self._frequencies[self._grid_point][bi] @@ -529,10 +655,11 @@ class ImagSelfEnergy(object): self._g, _g_zero = get_triplets_integration_weights( self._pp, - np.array(f_points, dtype='double'), + np.array(f_points, dtype="double"), self._sigma, self._sigma_cutoff, - is_collision_matrix=self._is_collision_matrix) + is_collision_matrix=self._is_collision_matrix, + ) if self._frequency_points is None: self._g_zero = _g_zero else: @@ -541,46 +668,64 @@ class ImagSelfEnergy(object): # shape = [num_triplets, num_band0, num_band, num_band] shape = list(self._g.shape[1:]) shape[1] = len(self._pp.band_indices) - self._g_zero_zeros = np.zeros(shape=shape, dtype='byte', order='C') + self._g_zero_zeros = np.zeros(shape=shape, dtype="byte", order="C") self._g_zero_frequency_points = _g_zero if scattering_event_class == 1 or scattering_event_class == 2: self._g[scattering_event_class - 1] = 0 def get_imag_self_energy(self): + """Return calculated imaginary-part of self-energies.""" if self._cutoff_frequency is None: return self._imag_self_energy else: return self._average_by_degeneracy(self._imag_self_energy) def get_imag_self_energy_N_and_U(self): + """Return normal and Umklapp contributions. + + Three-phonon scatterings are categorized into normal and Umklapp and + the contributions of the triplets to imaginary-part of self-energies + are returned. + + """ if self._cutoff_frequency is None: return self._ise_N, self._ise_U else: - return (self._average_by_degeneracy(self._ise_N), - self._average_by_degeneracy(self._ise_U)) + return ( + self._average_by_degeneracy(self._ise_N), + self._average_by_degeneracy(self._ise_U), + ) def get_detailed_imag_self_energy(self): + """Return triplets contributions to imaginary-part of self-energies.""" return self._detailed_imag_self_energy def get_integration_weights(self): + """Return integration weights. + + See the details of returns at ``get_triplets_integration_weights``. + + """ return self._g, self._g_zero def get_unit_conversion_factor(self): + """Return unit conversion factor of gamma.""" return self._unit_conversion def set_grid_point(self, grid_point=None): + """Set a grid point at which calculation will be performed.""" if grid_point is None: self._grid_point = None else: self._pp.set_grid_point(grid_point) self._pp_strength = None - (self._triplets_at_q, - self._weights_at_q) = self._pp.get_triplets_at_q()[:2] + (self._triplets_at_q, self._weights_at_q) = self._pp.get_triplets_at_q()[:2] self._grid_point = grid_point self._frequencies, self._eigenvectors, _ = self._pp.get_phonons() def set_sigma(self, sigma, sigma_cutoff=None): + """Set sigma value. None means tetrahedron method.""" if sigma is None: self._sigma = None else: @@ -594,40 +739,52 @@ class ImagSelfEnergy(object): self.delete_integration_weights() def set_frequency_points(self, frequency_points): + """Set frequency points where spectrum calculation will be performed.""" if frequency_points is None: self._frequency_points = None else: - self._frequency_points = np.array(frequency_points, dtype='double') + self._frequency_points = np.array(frequency_points, dtype="double") def set_temperature(self, temperature): + """Set temperatures where calculation will be peformed.""" if temperature is None: self._temperature = None else: self._temperature = float(temperature) def set_averaged_pp_interaction(self, ave_pp): + """Set averaged ph-ph interactions. + + This is used for analysis of the calculated results by introducing + averaged value as an approximation. + Setting this, ph-ph interaction calculation will not be executed. + + """ num_triplets = len(self._triplets_at_q) num_band = len(self._pp.primitive) * 3 num_grid = np.prod(self._pp.mesh_numbers) bi = self._pp.get_band_indices() self._pp_strength = np.zeros( - (num_triplets, len(bi), num_band, num_band), dtype='double') + (num_triplets, len(bi), num_band, num_band), dtype="double" + ) for i, v_ave in enumerate(ave_pp): self._pp_strength[:, i, :, :] = v_ave / num_grid def set_interaction_strength(self, pp_strength): + """Set ph-ph interaction strengths.""" self._pp_strength = pp_strength self._pp.set_interaction_strength(pp_strength, g_zero=self._g_zero) def delete_integration_weights(self): + """Delete large ndarray's.""" self._g = None self._g_zero = None self._pp_strength = None def _run_with_band_indices(self): if self._g is not None: - if self._lang == 'C': + if self._lang == "C": if self._with_detail: # self._detailed_imag_self_energy.shape = # (num_triplets, num_band0, num_band, num_band) @@ -641,14 +798,17 @@ class ImagSelfEnergy(object): print("This routine is super slow and only for the test.") self._run_py_with_band_indices_with_g() else: - print("get_triplets_integration_weights must be executed " - "before calling this method.") + print( + "get_triplets_integration_weights must be executed " + "before calling this method." + ) import sys + sys.exit(1) def _run_with_frequency_points(self): if self._g is not None: - if self._lang == 'C': + if self._lang == "C": if self._with_detail: self._run_c_detailed_with_frequency_points_with_g() else: @@ -658,38 +818,41 @@ class ImagSelfEnergy(object): print("This routine is super slow and only for the test.") self._run_py_with_frequency_points_with_g() else: - print("get_triplets_integration_weights must be executed " - "before calling this method.") + print( + "get_triplets_integration_weights must be executed " + "before calling this method." + ) import sys + sys.exit(1) def _run_c_with_band_indices_with_g(self): import phono3py._phono3py as phono3c if self._g_zero is None: - _g_zero = np.zeros(self._pp_strength.shape, - dtype='byte', order='C') + _g_zero = np.zeros(self._pp_strength.shape, dtype="byte", order="C") else: _g_zero = self._g_zero - phono3c.imag_self_energy_with_g(self._imag_self_energy, - self._pp_strength, - self._triplets_at_q, - self._weights_at_q, - self._frequencies, - self._temperature, - self._g, - _g_zero, - self._cutoff_frequency, - -1) + phono3c.imag_self_energy_with_g( + self._imag_self_energy, + self._pp_strength, + self._triplets_at_q, + self._weights_at_q, + self._frequencies, + self._temperature, + self._g, + _g_zero, + self._cutoff_frequency, + -1, + ) self._imag_self_energy *= self._unit_conversion def _run_c_detailed_with_band_indices_with_g(self): import phono3py._phono3py as phono3c if self._g_zero is None: - _g_zero = np.zeros(self._pp_strength.shape, - dtype='byte', order='C') + _g_zero = np.zeros(self._pp_strength.shape, dtype="byte", order="C") else: _g_zero = self._g_zero @@ -705,7 +868,8 @@ class ImagSelfEnergy(object): self._temperature, self._g, _g_zero, - self._cutoff_frequency) + self._cutoff_frequency, + ) self._detailed_imag_self_energy *= self._unit_conversion self._ise_N *= self._unit_conversion @@ -714,35 +878,39 @@ class ImagSelfEnergy(object): def _run_c_with_frequency_points_with_g(self): import phono3py._phono3py as phono3c + num_band0 = self._pp_strength.shape[1] - ise_at_f = np.zeros(num_band0, dtype='double') + ise_at_f = np.zeros(num_band0, dtype="double") for i in range(len(self._frequency_points)): - phono3c.imag_self_energy_with_g(ise_at_f, - self._pp_strength, - self._triplets_at_q, - self._weights_at_q, - self._frequencies, - self._temperature, - self._g, - self._g_zero_frequency_points, - self._cutoff_frequency, - i) + phono3c.imag_self_energy_with_g( + ise_at_f, + self._pp_strength, + self._triplets_at_q, + self._weights_at_q, + self._frequencies, + self._temperature, + self._g, + self._g_zero_frequency_points, + self._cutoff_frequency, + i, + ) self._imag_self_energy[i] = ise_at_f self._imag_self_energy *= self._unit_conversion def _run_c_detailed_with_frequency_points_with_g(self): import phono3py._phono3py as phono3c + num_band0 = self._pp_strength.shape[1] g_shape = list(self._g.shape) g_shape[2] = num_band0 - g = np.zeros((2,) + self._pp_strength.shape, order='C', dtype='double') + g = np.zeros((2,) + self._pp_strength.shape, order="C", dtype="double") detailed_ise_at_f = np.zeros( - self._detailed_imag_self_energy.shape[1:5], - order='C', dtype='double') - ise_at_f_N = np.zeros(num_band0, dtype='double') - ise_at_f_U = np.zeros(num_band0, dtype='double') - _g_zero = np.zeros(g_shape, dtype='byte', order='C') + self._detailed_imag_self_energy.shape[1:5], order="C", dtype="double" + ) + ise_at_f_N = np.zeros(num_band0, dtype="double") + ise_at_f_U = np.zeros(num_band0, dtype="double") + _g_zero = np.zeros(g_shape, dtype="byte", order="C") for i in range(len(self._frequency_points)): for j in range(g.shape[2]): @@ -759,9 +927,11 @@ class ImagSelfEnergy(object): self._temperature, g, _g_zero, - self._cutoff_frequency) - self._detailed_imag_self_energy[i] = (detailed_ise_at_f * - self._unit_conversion) + self._cutoff_frequency, + ) + self._detailed_imag_self_energy[i] = ( + detailed_ise_at_f * self._unit_conversion + ) self._ise_N[i] = ise_at_f_N * self._unit_conversion self._ise_U[i] = ise_at_f_U * self._unit_conversion self._imag_self_energy[i] = self._ise_N[i] + self._ise_U[i] @@ -776,27 +946,29 @@ class ImagSelfEnergy(object): freqs = self._frequencies[self._triplets_at_q[:, [1, 2]]] freqs = np.where(freqs > self._cutoff_frequency, freqs, 1) n = bose_einstein(freqs, self._temperature) - for i, (tp, w, interaction) in enumerate(zip(self._triplets_at_q, - self._weights_at_q, - self._pp_strength)): + for i, (tp, w, interaction) in enumerate( + zip(self._triplets_at_q, self._weights_at_q, self._pp_strength) + ): for j, k in list(np.ndindex(interaction.shape[1:])): f1 = self._frequencies[tp[1]][j] f2 = self._frequencies[tp[2]][k] - if (f1 > self._cutoff_frequency and - f2 > self._cutoff_frequency): + if f1 > self._cutoff_frequency and f2 > self._cutoff_frequency: n2 = n[i, 0, j] n3 = n[i, 1, k] g1 = self._g[0, i, :, j, k] g2_g3 = self._g[1, i, :, j, k] # g2 - g3 self._imag_self_energy[:] += ( - (n2 + n3 + 1) * g1 + - (n2 - n3) * (g2_g3)) * interaction[:, j, k] * w + ((n2 + n3 + 1) * g1 + (n2 - n3) * (g2_g3)) + * interaction[:, j, k] + * w + ) self._imag_self_energy *= self._unit_conversion def _ise_thm_with_band_indices_0K(self): - for i, (w, interaction) in enumerate(zip(self._weights_at_q, - self._pp_strength)): + for i, (w, interaction) in enumerate( + zip(self._weights_at_q, self._pp_strength) + ): for j, k in list(np.ndindex(interaction.shape[1:])): g1 = self._g[0, i, :, j, k] self._imag_self_energy[:] += g1 * interaction[:, j, k] * w @@ -810,86 +982,38 @@ class ImagSelfEnergy(object): self._ise_thm_with_frequency_points_0K() def _ise_thm_with_frequency_points(self): - for i, (tp, w, interaction) in enumerate(zip(self._triplets_at_q, - self._weights_at_q, - self._pp_strength)): + for i, (tp, w, interaction) in enumerate( + zip(self._triplets_at_q, self._weights_at_q, self._pp_strength) + ): for j, k in list(np.ndindex(interaction.shape[1:])): f1 = self._frequencies[tp[1]][j] f2 = self._frequencies[tp[2]][k] - if (f1 > self._cutoff_frequency and - f2 > self._cutoff_frequency): + if f1 > self._cutoff_frequency and f2 > self._cutoff_frequency: n2 = bose_einstein(f1, self._temperature) n3 = bose_einstein(f2, self._temperature) g1 = self._g[0, i, :, j, k] g2_g3 = self._g[1, i, :, j, k] # g2 - g3 - for l in range(len(interaction)): - self._imag_self_energy[:, l] += ( - (n2 + n3 + 1) * g1 + - (n2 - n3) * (g2_g3)) * interaction[l, j, k] * w + for ll in range(len(interaction)): + self._imag_self_energy[:, ll] += ( + ((n2 + n3 + 1) * g1 + (n2 - n3) * (g2_g3)) + * interaction[ll, j, k] + * w + ) self._imag_self_energy *= self._unit_conversion def _ise_thm_with_frequency_points_0K(self): - for i, (w, interaction) in enumerate(zip(self._weights_at_q, - self._pp_strength)): + for i, (w, interaction) in enumerate( + zip(self._weights_at_q, self._pp_strength) + ): for j, k in list(np.ndindex(interaction.shape[1:])): g1 = self._g[0, i, :, j, k] - for l in range(len(interaction)): - self._imag_self_energy[:, l] += g1 * interaction[l, j, k] * w + for ll in range(len(interaction)): + self._imag_self_energy[:, ll] += g1 * interaction[ll, j, k] * w self._imag_self_energy *= self._unit_conversion def _average_by_degeneracy(self, imag_self_energy): - return average_by_degeneracy(imag_self_energy, - self._pp.band_indices, - self._frequencies[self._grid_point]) - - -def run_ise_at_frequency_points_batch( - i, - j, - _frequency_points, - ise, - temperatures, - gamma, - write_gamma_detail=False, - return_gamma_detail=False, - detailed_gamma_at_gp=None, - scattering_event_class=None, - nelems_in_batch=50, - log_level=0): - if nelems_in_batch is None: - _nelems_in_batch = 10 - else: - _nelems_in_batch = nelems_in_batch - - batches = _get_batches(len(_frequency_points), _nelems_in_batch) - - if log_level: - print("Calculations at %d frequency points are devided into " - "%d batches." % (len(_frequency_points), len(batches))) - - for bi, fpts_batch in enumerate(batches): - if log_level: - print("%d/%d: %s" % (bi + 1, len(batches), fpts_batch + 1)) - sys.stdout.flush() - - ise.set_frequency_points(_frequency_points[fpts_batch]) - ise.set_integration_weights( - scattering_event_class=scattering_event_class) - for l, t in enumerate(temperatures): - ise.set_temperature(t) - ise.run() - gamma[j, l, i, :, fpts_batch] = ise.get_imag_self_energy() - if write_gamma_detail or return_gamma_detail: - detailed_gamma_at_gp[l, fpts_batch] = ( - ise.get_detailed_imag_self_energy()) - - -def _get_batches(tot_nelems, nelems=10): - nbatch = tot_nelems // nelems - batches = [np.arange(i * nelems, (i + 1) * nelems) - for i in range(nbatch)] - if tot_nelems % nelems > 0: - batches.append(np.arange(nelems * nbatch, tot_nelems)) - return batches + return average_by_degeneracy( + imag_self_energy, self._pp.band_indices, self._frequencies[self._grid_point] + ) diff --git a/phono3py/phonon3/interaction.py b/phono3py/phonon3/interaction.py index 93d234a5..13078a8d 100644 --- a/phono3py/phonon3/interaction.py +++ b/phono3py/phonon3/interaction.py @@ -34,7 +34,6 @@ # POSSIBILITY OF SUCH DAMAGE. import warnings -from typing import Union import numpy as np from phonopy.harmonic.dynamical_matrix import get_dynamical_matrix from phonopy.structure.cells import Primitive, sparse_to_dense_svecs @@ -42,12 +41,14 @@ from phonopy.structure.symmetry import Symmetry from phonopy.units import VaspToTHz, Hbar, EV, Angstrom, THz, AMU from phonopy.structure.cells import compute_all_sg_permutations from phono3py.phonon.grid import ( - get_ir_grid_points, get_grid_points_by_rotations, BZGrid) + get_ir_grid_points, + get_grid_points_by_rotations, + BZGrid, +) from phono3py.phonon.solver import run_phonon_solver_c, run_phonon_solver_py from phono3py.phonon3.real_to_reciprocal import RealToReciprocal from phono3py.phonon3.reciprocal_to_normal import ReciprocalToNormal -from phono3py.phonon3.triplets import (get_triplets_at_q, - get_nosym_triplets_at_q) +from phono3py.phonon3.triplets import get_triplets_at_q, get_nosym_triplets_at_q class Interaction(object): @@ -81,20 +82,22 @@ class Interaction(object): """ - def __init__(self, - primitive: Primitive, - bz_grid: BZGrid, - primitive_symmetry: Symmetry, - fc3=None, - band_indices=None, - constant_averaged_interaction=None, - frequency_factor_to_THz=VaspToTHz, - frequency_scale_factor=None, - unit_conversion=None, - is_mesh_symmetry=True, - symmetrize_fc3q=False, - cutoff_frequency=None, - lapack_zheev_uplo='L'): + def __init__( + self, + primitive: Primitive, + bz_grid: BZGrid, + primitive_symmetry: Symmetry, + fc3=None, + band_indices=None, + constant_averaged_interaction=None, + frequency_factor_to_THz=VaspToTHz, + frequency_scale_factor=None, + unit_conversion=None, + is_mesh_symmetry=True, + symmetrize_fc3q=False, + cutoff_frequency=None, + lapack_zheev_uplo="L", + ): """Init method.""" self._primitive = primitive self._bz_grid = bz_grid @@ -112,11 +115,17 @@ class Interaction(object): # Unit to eV^2 if unit_conversion is None: num_grid = np.prod(self.mesh_numbers) - self._unit_conversion = ((Hbar * EV) ** 3 / 36 / 8 - * EV ** 2 / Angstrom ** 6 - / (2 * np.pi * THz) ** 3 - / AMU ** 3 / num_grid - / EV ** 2) + self._unit_conversion = ( + (Hbar * EV) ** 3 + / 36 + / 8 + * EV ** 2 + / Angstrom ** 6 + / (2 * np.pi * THz) ** 3 + / AMU ** 3 + / num_grid + / EV ** 2 + ) else: self._unit_conversion = unit_conversion if cutoff_frequency is None: @@ -152,11 +161,11 @@ class Interaction(object): else: self._svecs, self._multi = sparse_to_dense_svecs(svecs, multi) - self._masses = np.array(self._primitive.masses, dtype='double') - self._p2s = np.array(self._primitive.p2s_map, dtype='int_') - self._s2p = np.array(self._primitive.s2p_map, dtype='int_') + self._masses = np.array(self._primitive.masses, dtype="double") + self._p2s = np.array(self._primitive.p2s_map, dtype="int_") + self._s2p = np.array(self._primitive.s2p_map, dtype="int_") - def run(self, lang='C', g_zero=None): + def run(self, lang="C", g_zero=None): """Run ph-ph interaction calculation.""" if (self._phonon_done == 0).any(): self.run_phonon_solver() @@ -165,18 +174,19 @@ class Interaction(object): num_triplets = len(self._triplets_at_q) self._interaction_strength = np.empty( - (num_triplets, len(self._band_indices), num_band, num_band), - dtype='double') + (num_triplets, len(self._band_indices), num_band, num_band), dtype="double" + ) if self._constant_averaged_interaction is None: self._interaction_strength[:] = 0 - if lang == 'C': + if lang == "C": self._run_c(g_zero) else: self._run_py() else: num_grid = np.prod(self.mesh_numbers) self._interaction_strength[:] = ( - self._constant_averaged_interaction / num_grid) + self._constant_averaged_interaction / num_grid + ) @property def interaction_strength(self): @@ -193,9 +203,11 @@ class Interaction(object): def get_interaction_strength(self): """Return ph-ph interaction strength.""" - warnings.warn("Use attribute, Interaction.interaction_strength " - "instead of Interaction.get_interaction_strength().", - DeprecationWarning) + warnings.warn( + "Use attribute, Interaction.interaction_strength " + "instead of Interaction.get_interaction_strength().", + DeprecationWarning, + ) return self.interaction_strength @property @@ -212,9 +224,11 @@ class Interaction(object): def get_mesh_numbers(self): """Return mesh numbers.""" - warnings.warn("Use attribute, Interaction.mesh_numbers " - "instead of Interaction.get_mesh_numbers().", - DeprecationWarning) + warnings.warn( + "Use attribute, Interaction.mesh_numbers " + "instead of Interaction.get_mesh_numbers().", + DeprecationWarning, + ) return self.mesh_numbers @property @@ -229,9 +243,10 @@ class Interaction(object): def get_fc3(self): """Return fc3.""" - warnings.warn("Use attribute, Interaction.fc3 " - "instead of Interaction.get_fc3().", - DeprecationWarning) + warnings.warn( + "Use attribute, Interaction.fc3 " "instead of Interaction.get_fc3().", + DeprecationWarning, + ) return self.fc3 @property @@ -241,9 +256,11 @@ class Interaction(object): def get_dynamical_matrix(self): """Return DynamicalMatrix class instance.""" - warnings.warn("Use attribute, Interaction.dynamical_matrix " - "instead of Interaction.get_dynamical_matrix().", - DeprecationWarning) + warnings.warn( + "Use attribute, Interaction.dynamical_matrix " + "instead of Interaction.get_dynamical_matrix().", + DeprecationWarning, + ) return self.dynamical_matrix @property @@ -253,9 +270,11 @@ class Interaction(object): def get_primitive(self): """Return Primitive class instance.""" - warnings.warn("Use attribute, Interaction.primitive " - "instead of Interaction.get_primitive().", - DeprecationWarning) + warnings.warn( + "Use attribute, Interaction.primitive " + "instead of Interaction.get_primitive().", + DeprecationWarning, + ) return self.primitive @property @@ -265,10 +284,12 @@ class Interaction(object): def get_triplets_at_q(self): """Return grid point triplets information.""" - return (self._triplets_at_q, - self._weights_at_q, - self._triplets_map_at_q, - self._ir_map_at_q) + return ( + self._triplets_at_q, + self._weights_at_q, + self._triplets_map_at_q, + self._ir_map_at_q, + ) @property def bz_grid(self): @@ -289,9 +310,11 @@ class Interaction(object): def get_band_indices(self): """Return band indices.""" - warnings.warn("Use attribute, Interaction.band_indices " - "instead of Interaction.get_band_indices().", - DeprecationWarning) + warnings.warn( + "Use attribute, Interaction.band_indices " + "instead of Interaction.get_band_indices().", + DeprecationWarning, + ) return self.band_indices @property @@ -318,20 +341,24 @@ class Interaction(object): if nac_q_direction is None: self._nac_q_direction = None else: - self._nac_q_direction = np.array(nac_q_direction, dtype='double') + self._nac_q_direction = np.array(nac_q_direction, dtype="double") def get_nac_q_direction(self): """Return q-direction used for NAC at q->0.""" - warnings.warn("Use attribute, Interaction.nac_q_direction " - "instead of Interaction.get_nac_q_direction().", - DeprecationWarning) + warnings.warn( + "Use attribute, Interaction.nac_q_direction " + "instead of Interaction.get_nac_q_direction().", + DeprecationWarning, + ) return self.nac_q_direction def set_nac_q_direction(self, nac_q_direction=None): """Set NAC q-point direction valid at q->0.""" - warnings.warn("Use attribute, Interaction.nac_q_direction " - "instead of Interaction.set_nac_q_direction().", - DeprecationWarning) + warnings.warn( + "Use attribute, Interaction.nac_q_direction " + "instead of Interaction.set_nac_q_direction().", + DeprecationWarning, + ) self.nac_q_direction = nac_q_direction @property @@ -347,9 +374,11 @@ class Interaction(object): def get_zero_value_positions(self): """Return zero ph-ph interaction elements information.""" - warnings.warn("Use attribute, Interaction.zero_value_positions " - "instead of Interaction.get_zero_value_positions().", - DeprecationWarning) + warnings.warn( + "Use attribute, Interaction.zero_value_positions " + "instead of Interaction.get_zero_value_positions().", + DeprecationWarning, + ) return self.zero_value_positions def get_phonons(self): @@ -379,9 +408,11 @@ class Interaction(object): def get_frequency_factor_to_THz(self): """Return phonon frequency conversion factor to THz.""" - warnings.warn("Use attribute, Interaction.frequency_factor_to_THz ", - "instead of Interaction.get_frequency_factor_to_THz().", - DeprecationWarning) + warnings.warn( + "Use attribute, Interaction.frequency_factor_to_THz ", + "instead of Interaction.get_frequency_factor_to_THz().", + DeprecationWarning, + ) return self.frequency_factor_to_THz @property @@ -391,9 +422,11 @@ class Interaction(object): def get_lapack_zheev_uplo(self): """Return U or L for lapack zheev solver.""" - warnings.warn("Use attribute, Interaction.lapack_zheev_uplo " - "instead of Interaction.get_lapack_zheev_uplo().", - DeprecationWarning) + warnings.warn( + "Use attribute, Interaction.lapack_zheev_uplo " + "instead of Interaction.get_lapack_zheev_uplo().", + DeprecationWarning, + ) return self.lapack_zheev_uplo @property @@ -403,9 +436,11 @@ class Interaction(object): def get_cutoff_frequency(self): """Return cutoff phonon frequency to judge imaginary phonon.""" - warnings.warn("Use attribute, Interaction.cutoff_frequency " - "instead of Interaction.get_cutoff_frequency().", - DeprecationWarning) + warnings.warn( + "Use attribute, Interaction.cutoff_frequency " + "instead of Interaction.get_cutoff_frequency().", + DeprecationWarning, + ) return self.cutoff_frequency def get_averaged_interaction(self): @@ -422,11 +457,7 @@ class Interaction(object): def get_primitive_and_supercell_correspondence(self): """Return atomic pair information.""" - return (self._svecs, - self._multi, - self._p2s, - self._s2p, - self._masses) + return (self._svecs, self._multi, self._p2s, self._s2p, self._masses) def get_unit_conversion_factor(self): """Return unit conversion factor.""" @@ -445,40 +476,51 @@ class Interaction(object): """Set grid point and prepare grid point triplets.""" reciprocal_lattice = np.linalg.inv(self._primitive.cell) if not self._is_mesh_symmetry: - (triplets_at_q, - weights_at_q, - triplets_map_at_q, - ir_map_at_q) = get_nosym_triplets_at_q( - grid_point, self._bz_grid) + ( + triplets_at_q, + weights_at_q, + triplets_map_at_q, + ir_map_at_q, + ) = get_nosym_triplets_at_q(grid_point, self._bz_grid) else: - (triplets_at_q, - weights_at_q, - triplets_map_at_q, - ir_map_at_q) = get_triplets_at_q(grid_point, self._bz_grid) + ( + triplets_at_q, + weights_at_q, + triplets_map_at_q, + ir_map_at_q, + ) = get_triplets_at_q(grid_point, self._bz_grid) # Special treatment of symmetry is applied when q_direction is # used. if self._nac_q_direction is not None: if (self._bz_grid.addresses[grid_point] == 0).all(): self._phonon_done[grid_point] = 0 - self.run_phonon_solver(np.array([grid_point, ], - dtype='int_')) + self.run_phonon_solver( + np.array( + [ + grid_point, + ], + dtype="int_", + ) + ) rotations = [] - for i, r in enumerate( - self._bz_grid.reciprocal_operations): + for i, r in enumerate(self._bz_grid.reciprocal_operations): dq = self._nac_q_direction dq /= np.linalg.norm(dq) diff = np.dot(r, dq) - dq if (abs(diff) < 1e-5).all(): rotations.append(self._bz_grid.rotations[i]) - (triplets_at_q, - weights_at_q, - triplets_map_at_q, - ir_map_at_q) = get_triplets_at_q( - grid_point, - self._bz_grid, - reciprocal_rotations=rotations, - is_time_reversal=False) + ( + triplets_at_q, + weights_at_q, + triplets_map_at_q, + ir_map_at_q, + ) = get_triplets_at_q( + grid_point, + self._bz_grid, + reciprocal_rotations=rotations, + is_time_reversal=False, + ) for triplet in triplets_at_q: sum_q = (self._bz_grid.addresses[triplet]).sum(axis=0) @@ -486,12 +528,19 @@ class Interaction(object): print("============= Warning ==================") print("%s" % triplet) for tp in triplet: - print("%s %s" % - (self._bz_grid.addresses[tp], - np.linalg.norm( - np.dot(reciprocal_lattice, - self._bz_grid.addresses[tp] / - self.mesh_numbers.astype('double'))))) + print( + "%s %s" + % ( + self._bz_grid.addresses[tp], + np.linalg.norm( + np.dot( + reciprocal_lattice, + self._bz_grid.addresses[tp] + / self.mesh_numbers.astype("double"), + ) + ), + ) + ) print("%s" % sum_q) print("============= Warning ==================") @@ -502,13 +551,15 @@ class Interaction(object): self._triplets_map_at_q = triplets_map_at_q self._ir_map_at_q = ir_map_at_q - def init_dynamical_matrix(self, - fc2, - supercell, - primitive, - nac_params=None, - solve_dynamical_matrices=True, - decimals=None): + def init_dynamical_matrix( + self, + fc2, + supercell, + primitive, + nac_params=None, + solve_dynamical_matrices=True, + decimals=None, + ): """Prepare for phonon calculation on grid. solve_dynamical_matrices : bool @@ -524,13 +575,14 @@ class Interaction(object): nac_params=nac_params, frequency_scale_factor=self._frequency_scale_factor, decimals=decimals, - symprec=self._symprec) + symprec=self._symprec, + ) self._phonon_done[0] = 0 if solve_dynamical_matrices: self.run_phonon_solver() else: - self.run_phonon_solver(np.array([0], dtype='int_')) + self.run_phonon_solver(np.array([0], dtype="int_")) if (self._bz_grid.addresses[0] == 0).all(): if np.sum(self._frequencies[0] < self._cutoff_frequency) < 3: @@ -538,20 +590,24 @@ class Interaction(object): if not (f < self._cutoff_frequency): self._frequencies[0, i] = 0 print("=" * 26 + " Warning " + "=" * 26) - print(" Phonon frequency of band index %d at Gamma " - "is calculated to be %f." % (i + 1, f)) + print( + " Phonon frequency of band index %d at Gamma " + "is calculated to be %f." % (i + 1, f) + ) print(" But this frequency is forced to be zero.") print("=" * 61) def set_phonon_data(self, frequencies, eigenvectors, bz_grid_addresses): """Set phonons on grid.""" if bz_grid_addresses.shape != self._bz_grid.addresses.shape: - raise RuntimeError("Input grid address size is inconsistent. " - "Setting phonons faild.") + raise RuntimeError( + "Input grid address size is inconsistent. " "Setting phonons faild." + ) if (self._bz_grid.addresses - bz_grid_addresses).all(): - raise RuntimeError("Input grid addresses are inconsistent. " - "Setting phonons faild.") + raise RuntimeError( + "Input grid addresses are inconsistent. " "Setting phonons faild." + ) else: self._phonon_done[:] = 1 self._frequencies[:] = frequencies @@ -570,7 +626,7 @@ class Interaction(object): if expand_phonons: self._expand_phonons() else: - grid_points = np.arange(len(self._bz_grid.addresses), dtype='int_') + grid_points = np.arange(len(self._bz_grid.addresses), dtype="int_") self._run_phonon_solver_c(grid_points) def _expand_phonons(self): @@ -593,29 +649,32 @@ class Interaction(object): # perms.shape = (len(spg_ops), len(primitive)), dtype='intc' perms = compute_all_sg_permutations( self._primitive.scaled_positions, - self._bz_grid.symmetry_dataset['rotations'], - self._bz_grid.symmetry_dataset['translations'], - np.array(self._primitive.cell.T, dtype='double', order='C'), - symprec=self._symprec) + self._bz_grid.symmetry_dataset["rotations"], + self._bz_grid.symmetry_dataset["translations"], + np.array(self._primitive.cell.T, dtype="double", order="C"), + symprec=self._symprec, + ) for d_i, r_i in enumerate(d2r_map): r = self._bz_grid.rotations[r_i] r_cart = self._bz_grid.rotations_cartesian[r_i] for irgp in ir_bz_grid_points: - bzgp = get_grid_points_by_rotations(irgp, - self._bz_grid, - reciprocal_rotations=[r, ], - with_surface=True)[0] + bzgp = get_grid_points_by_rotations( + irgp, + self._bz_grid, + reciprocal_rotations=[ + r, + ], + with_surface=True, + )[0] if self._phonon_done[bzgp]: continue - self._rotate_eigvecs( - irgp, bzgp, r_cart, perms[d_i], d_i) + self._rotate_eigvecs(irgp, bzgp, r_cart, perms[d_i], d_i) bz_grid_points_solved = self._get_phonons_at_minus_q() if bz_grid_points_solved: - print("DEBUG: BZ-grid points additionally solved " - "than ir-grid-points.") + print("DEBUG: BZ-grid points additionally solved " "than ir-grid-points.") print(bz_grid_points_solved) def _get_reciprocal_rotations_in_space_group_operations(self): @@ -630,13 +689,13 @@ class Interaction(object): """ d2r_map = [] - for r in self._bz_grid.symmetry_dataset['rotations']: + for r in self._bz_grid.symmetry_dataset["rotations"]: for i, rec_r in enumerate(self._bz_grid.reciprocal_operations): if (rec_r.T == r).all(): d2r_map.append(i) break - assert len(d2r_map) == len(self._bz_grid.symmetry_dataset['rotations']) + assert len(d2r_map) == len(self._bz_grid.symmetry_dataset["rotations"]) return d2r_map @@ -647,7 +706,7 @@ class Interaction(object): """ Rq = np.dot(self._bz_grid.QDinv, self._bz_grid.addresses[bzgp]) - tau = self._bz_grid.symmetry_dataset['translations'][t_i] + tau = self._bz_grid.symmetry_dataset["translations"][t_i] phase_factor = np.exp(-2j * np.pi * np.dot(Rq, tau)) self._phonon_done[bzgp] = 1 self._frequencies[bzgp, :] = self._frequencies[orig_gp, :] @@ -669,7 +728,7 @@ class Interaction(object): in this method. """ - r_inv = -np.eye(3, dtype='int_') + r_inv = -np.eye(3, dtype="int_") bz_grid_points_solved = [] for bzgp, done in enumerate(self._phonon_done): if done: @@ -679,17 +738,26 @@ class Interaction(object): bzgp_mq = get_grid_points_by_rotations( bzgp, self._bz_grid, - reciprocal_rotations=[r_inv, ], - with_surface=True)[0] + reciprocal_rotations=[ + r_inv, + ], + with_surface=True, + )[0] if self._phonon_done[bzgp_mq] == 0: - self._run_phonon_solver_c(np.array([bzgp_mq, ], dtype='int_')) + self._run_phonon_solver_c( + np.array( + [ + bzgp_mq, + ], + dtype="int_", + ) + ) bz_grid_points_solved.append(bzgp_mq) self._phonon_done[bzgp] = 1 self._frequencies[bzgp, :] = self._frequencies[bzgp_mq, :] - self._eigenvectors[bzgp, :, :] = np.conj( - self._eigenvectors[bzgp_mq, :, :]) + self._eigenvectors[bzgp, :, :] = np.conj(self._eigenvectors[bzgp_mq, :, :]) return bz_grid_points_solved @@ -704,52 +772,58 @@ class Interaction(object): self._g_zero = None def _set_fc3(self, fc3): - if (type(fc3) == np.ndarray and - fc3.dtype == np.dtype('double') and - fc3.flags.aligned and - fc3.flags.owndata and - fc3.flags.c_contiguous and - self._frequency_scale_factor is None): # noqa E129 + if ( + type(fc3) == np.ndarray + and fc3.dtype == np.dtype("double") + and fc3.flags.aligned + and fc3.flags.owndata + and fc3.flags.c_contiguous + and self._frequency_scale_factor is None + ): # noqa E129 self._fc3 = fc3 elif self._frequency_scale_factor is None: - self._fc3 = np.array(fc3, dtype='double', order='C') + self._fc3 = np.array(fc3, dtype="double", order="C") else: - self._fc3 = np.array(fc3 * self._frequency_scale_factor ** 2, - dtype='double', order='C') + self._fc3 = np.array( + fc3 * self._frequency_scale_factor ** 2, dtype="double", order="C" + ) def _set_band_indices(self, band_indices): num_band = len(self._primitive) * 3 if band_indices is None: - self._band_indices = np.arange(num_band, dtype='int_') + self._band_indices = np.arange(num_band, dtype="int_") else: - self._band_indices = np.array(band_indices, dtype='int_') + self._band_indices = np.array(band_indices, dtype="int_") def _run_c(self, g_zero): import phono3py._phono3py as phono3c if g_zero is None or self._symmetrize_fc3q: - _g_zero = np.zeros(self._interaction_strength.shape, - dtype='byte', order='C') + _g_zero = np.zeros( + self._interaction_strength.shape, dtype="byte", order="C" + ) else: _g_zero = g_zero - phono3c.interaction(self._interaction_strength, - _g_zero, - self._frequencies, - self._eigenvectors, - self._triplets_at_q, - self._bz_grid.addresses, - self._bz_grid.D_diag, - self._bz_grid.Q, - self._fc3, - self._svecs, - self._multi, - self._masses, - self._p2s, - self._s2p, - self._band_indices, - self._symmetrize_fc3q, - self._cutoff_frequency) + phono3c.interaction( + self._interaction_strength, + _g_zero, + self._frequencies, + self._eigenvectors, + self._triplets_at_q, + self._bz_grid.addresses, + self._bz_grid.D_diag, + self._bz_grid.Q, + self._fc3, + self._svecs, + self._multi, + self._masses, + self._p2s, + self._s2p, + self._band_indices, + self._symmetrize_fc3q, + self._cutoff_frequency, + ) self._interaction_strength *= self._unit_conversion self._g_zero = g_zero @@ -764,18 +838,20 @@ class Interaction(object): self._bz_grid.QDinv, frequency_conversion_factor=self._frequency_factor_to_THz, nac_q_direction=self._nac_q_direction, - lapack_zheev_uplo=self._lapack_zheev_uplo) + lapack_zheev_uplo=self._lapack_zheev_uplo, + ) def _run_py(self): - r2r = RealToReciprocal(self._fc3, - self._primitive, - self.mesh_numbers, - symprec=self._symprec) - r2n = ReciprocalToNormal(self._primitive, - self._frequencies, - self._eigenvectors, - self._band_indices, - cutoff_frequency=self._cutoff_frequency) + r2r = RealToReciprocal( + self._fc3, self._primitive, self.mesh_numbers, symprec=self._symprec + ) + r2n = ReciprocalToNormal( + self._primitive, + self._frequencies, + self._eigenvectors, + self._band_indices, + cutoff_frequency=self._cutoff_frequency, + ) for i, grid_triplet in enumerate(self._triplets_at_q): print("%d / %d" % (i + 1, len(self._triplets_at_q))) @@ -784,27 +860,29 @@ class Interaction(object): for gp in grid_triplet: self._run_phonon_solver_py(gp) r2n.run(fc3_reciprocal, grid_triplet) - self._interaction_strength[i] = np.abs( - r2n.get_reciprocal_to_normal()) ** 2 * self._unit_conversion + self._interaction_strength[i] = ( + np.abs(r2n.get_reciprocal_to_normal()) ** 2 * self._unit_conversion + ) def _run_phonon_solver_py(self, grid_point): - run_phonon_solver_py(grid_point, - self._phonon_done, - self._frequencies, - self._eigenvectors, - self._bz_grid.addresses, - self._bz_grid.QDinv, - self._dm, - self._frequency_factor_to_THz, - self._lapack_zheev_uplo) + run_phonon_solver_py( + grid_point, + self._phonon_done, + self._frequencies, + self._eigenvectors, + self._bz_grid.addresses, + self._bz_grid.QDinv, + self._dm, + self._frequency_factor_to_THz, + self._lapack_zheev_uplo, + ) def _allocate_phonon(self): num_band = len(self._primitive) * 3 num_grid = len(self._bz_grid.addresses) - self._phonon_done = np.zeros(num_grid, dtype='byte') - self._frequencies = np.zeros((num_grid, num_band), - dtype='double', order='C') + self._phonon_done = np.zeros(num_grid, dtype="byte") + self._frequencies = np.zeros((num_grid, num_band), dtype="double", order="C") itemsize = self._frequencies.itemsize - self._eigenvectors = np.zeros((num_grid, num_band, num_band), - dtype=("c%d" % (itemsize * 2)), - order='C') + self._eigenvectors = np.zeros( + (num_grid, num_band, num_band), dtype=("c%d" % (itemsize * 2)), order="C" + ) diff --git a/phono3py/phonon3/joint_dos.py b/phono3py/phonon3/joint_dos.py index 3efc26a1..319d1b31 100644 --- a/phono3py/phonon3/joint_dos.py +++ b/phono3py/phonon3/joint_dos.py @@ -1,3 +1,4 @@ +"""Joint-density of states calculation.""" # Copyright (C) 2020 Atsushi Togo # All rights reserved. # @@ -36,39 +37,48 @@ import warnings import sys import numpy as np from phonopy.units import VaspToTHz -from phono3py.phonon3.triplets import (get_triplets_at_q, - get_nosym_triplets_at_q, - get_tetrahedra_vertices, - get_triplets_integration_weights) +from phonopy.structure.cells import Primitive +from phonopy.harmonic.dynamical_matrix import DynamicalMatrix +from phono3py.phonon3.triplets import ( + get_triplets_at_q, + get_nosym_triplets_at_q, + get_tetrahedra_vertices, + get_triplets_integration_weights, +) from phono3py.phonon.solver import run_phonon_solver_c from phono3py.phonon.func import bose_einstein +from phono3py.phonon.grid import BZGrid from phono3py.phonon3.imag_self_energy import get_frequency_points from phonopy.harmonic.dynamical_matrix import get_dynamical_matrix from phonopy.structure.tetrahedron_method import TetrahedronMethod class JointDos(object): - def __init__(self, - primitive, - supercell, - bz_grid, - fc2, - nac_params=None, - nac_q_direction=None, - sigma=None, - cutoff_frequency=None, - frequency_step=None, - num_frequency_points=None, - temperatures=None, - frequency_factor_to_THz=VaspToTHz, - frequency_scale_factor=1.0, - is_mesh_symmetry=True, - store_dense_gp_map=False, - symprec=1e-5, - filename=None, - log_level=False, - lapack_zheev_uplo='L'): + """Calculate joint-density-of-states.""" + def __init__( + self, + primitive, + supercell, + bz_grid, + fc2, + nac_params=None, + nac_q_direction=None, + sigma=None, + cutoff_frequency=None, + frequency_step=None, + num_frequency_points=None, + temperatures=None, + frequency_factor_to_THz=VaspToTHz, + frequency_scale_factor=1.0, + is_mesh_symmetry=True, + store_dense_gp_map=False, + symprec=1e-5, + filename=None, + log_level=False, + lapack_zheev_uplo="L", + ): + """Init method.""" self._grid_point = None self._primitive = primitive self._supercell = supercell @@ -108,60 +118,72 @@ class JointDos(object): self._frequency_points = None def run(self): - self.run_phonon_solver( - np.arange(len(self._bz_grid.addresses), dtype='int_')) + """Calculate joint-density-of-states.""" + self.run_phonon_solver(np.arange(len(self._bz_grid.addresses), dtype="int_")) try: - import phono3py._phono3py as phono3c + import phono3py._phono3py as phono3c # noqa F401 + self._run_c() except ImportError: print("Joint density of states in python is not implemented.") return None, None @property - def dynamical_matrix(self): + def dynamical_matrix(self) -> DynamicalMatrix: + """Return dynamical matrix class instance.""" return self._dm @property def joint_dos(self): + """Return joint-density-of-states.""" return self._joint_dos def get_joint_dos(self): + """Return joint-density-of-states.""" warnings.warn("Use attribute, joint_dos", DeprecationWarning) return self.joint_dos @property def frequency_points(self): + """Getter and setter of frequency points.""" return self._frequency_points @frequency_points.setter def frequency_points(self, frequency_points): - self._frequency_points = np.array(frequency_points, dtype='double') + self._frequency_points = np.array(frequency_points, dtype="double") def get_frequency_points(self): + """Return frequency points.""" warnings.warn("Use attribute, frequency_points", DeprecationWarning) return self.frequency_points def get_phonons(self): + """Return phonon calculation results.""" return self._frequencies, self._eigenvectors, self._phonon_done @property - def primitive(self): + def primitive(self) -> Primitive: + """Return primitive cell.""" return self._primitive def get_primitive(self): + """Return primitive cell.""" warnings.warn("Use attribute, primitive", DeprecationWarning) return self.primitive @property def mesh_numbers(self): + """Return mesh numbers by three integer values.""" return self._bz_grid.D_diag def get_mesh_numbers(self): + """Return mesh numbers by three integer values.""" warnings.warn("Use attribute, mesh_numbers", DeprecationWarning) return self.mesh @property def nac_q_direction(self): + """Getter and setter of q-direction for NAC.""" return self._nac_q_direction @nac_q_direction.setter @@ -169,19 +191,22 @@ class JointDos(object): if nac_q_direction is None: self._nac_q_direction = None else: - self._nac_q_direction = np.array(nac_q_direction, dtype='double') + self._nac_q_direction = np.array(nac_q_direction, dtype="double") def set_nac_q_direction(self, nac_q_direction=None): + """Set q-direction for NAC.""" warnings.warn("Use attribute, nac_q_direction", DeprecationWarning) self.nac_q_direction = nac_q_direction def set_sigma(self, sigma): + """Set sigma value. None means tetrahedron method.""" if sigma is None: self._sigma = None else: self._sigma = float(sigma) def set_grid_point(self, grid_point): + """Set a grid point at which joint-DOS is calculated.""" self._grid_point = grid_point self._set_triplets() if self._phonon_done is None: @@ -189,41 +214,47 @@ class JointDos(object): self._joint_dos = None self._frequency_points = None self._phonon_done[0] = 0 - self.run_phonon_solver(np.array([grid_point], dtype='int_')) + self.run_phonon_solver(np.array([grid_point], dtype="int_")) def get_triplets_at_q(self): + """Return triplets information.""" return self._triplets_at_q, self._weights_at_q @property - def bz_grid(self): + def bz_grid(self) -> BZGrid: + """Return BZGrid.""" return self._bz_grid def run_phonon_solver(self, grid_points): - """Calculate phonons at grid_points + """Calculate phonons at grid_points. This method is used in get_triplets_integration_weights by this method name. So this name is not allowed to change. """ - run_phonon_solver_c(self._dm, - self._frequencies, - self._eigenvectors, - self._phonon_done, - grid_points, - self._bz_grid.addresses, - self._bz_grid.QDinv, - self._frequency_factor_to_THz, - self._nac_q_direction, - self._lapack_zheev_uplo) + run_phonon_solver_c( + self._dm, + self._frequencies, + self._eigenvectors, + self._phonon_done, + grid_points, + self._bz_grid.addresses, + self._bz_grid.QDinv, + self._frequency_factor_to_THz, + self._nac_q_direction, + self._lapack_zheev_uplo, + ) - def _run_c(self, lang='C'): + def _run_c(self, lang="C"): if self._sigma is None: - if lang == 'C': + if lang == "C": self._run_c_with_g() else: if self._temperatures is not None: - print("JDOS with phonon occupation numbers doesn't work " - "in this option.") + print( + "JDOS with phonon occupation numbers doesn't work " + "in this option." + ) self._run_py_tetrahedron_method() else: self._run_c_with_g() @@ -233,57 +264,68 @@ class JointDos(object): max_phonon_freq = np.max(self._frequencies) self._frequency_points = get_frequency_points( max_phonon_freq=max_phonon_freq, - sigmas=[self._sigma, ], + sigmas=[ + self._sigma, + ], frequency_points=None, frequency_step=self._frequency_step, - num_frequency_points=self._num_frequency_points) + num_frequency_points=self._num_frequency_points, + ) num_freq_points = len(self._frequency_points) if self._temperatures is None: - jdos = np.zeros((num_freq_points, 2), dtype='double') + jdos = np.zeros((num_freq_points, 2), dtype="double") else: num_temps = len(self._temperatures) - jdos = np.zeros((num_temps, num_freq_points, 2), dtype='double') + jdos = np.zeros((num_temps, num_freq_points, 2), dtype="double") occ_phonons = [] for t in self._temperatures: freqs = self._frequencies[self._triplets_at_q[:, 1:]] - occ_phonons.append(np.where(freqs > self._cutoff_frequency, - bose_einstein(freqs, t), 0)) + occ_phonons.append( + np.where(freqs > self._cutoff_frequency, bose_einstein(freqs, t), 0) + ) for i, freq_point in enumerate(self._frequency_points): g, _ = get_triplets_integration_weights( self, - np.array([freq_point], dtype='double'), + np.array([freq_point], dtype="double"), self._sigma, is_collision_matrix=True, - neighboring_phonons=(i == 0)) + neighboring_phonons=(i == 0), + ) if self._temperatures is None: jdos[i, 1] = np.sum( - np.tensordot(g[0, :, 0], self._weights_at_q, axes=(0, 0))) + np.tensordot(g[0, :, 0], self._weights_at_q, axes=(0, 0)) + ) gx = g[2] - g[0] jdos[i, 0] = np.sum( - np.tensordot(gx[:, 0], self._weights_at_q, axes=(0, 0))) + np.tensordot(gx[:, 0], self._weights_at_q, axes=(0, 0)) + ) else: for j, n in enumerate(occ_phonons): for k, l in list(np.ndindex(g.shape[3:])): jdos[j, i, 1] += np.dot( - (n[:, 0, k] + n[:, 1, l] + 1) * - g[0, :, 0, k, l], self._weights_at_q) - jdos[j, i, 0] += np.dot((n[:, 0, k] - n[:, 1, l]) * - g[1, :, 0, k, l], - self._weights_at_q) + (n[:, 0, k] + n[:, 1, l] + 1) * g[0, :, 0, k, l], + self._weights_at_q, + ) + jdos[j, i, 0] += np.dot( + (n[:, 0, k] - n[:, 1, l]) * g[1, :, 0, k, l], + self._weights_at_q, + ) self._joint_dos = jdos / np.prod(self._bz_grid.D_diag) def _run_py_tetrahedron_method(self): thm = TetrahedronMethod(self._bz_grid.microzone_lattice) self._vertices = get_tetrahedra_vertices( - np.array(np.dot(thm.get_tetrahedra(), self._bz_grid.P.T), - dtype='int_', order='C'), + np.array( + np.dot(thm.get_tetrahedra(), self._bz_grid.P.T), dtype="int_", order="C" + ), self._bz_grid.D_diag, self._triplets_at_q, - self._bz_grid) + self._bz_grid, + ) self.run_phonon_solver(self._vertices.ravel()) f_max = np.max(self._frequencies) * 2 f_max *= 1.005 @@ -291,7 +333,7 @@ class JointDos(object): self._set_uniform_frequency_points(f_min, f_max) num_freq_points = len(self._frequency_points) - jdos = np.zeros((num_freq_points, 2), dtype='double') + jdos = np.zeros((num_freq_points, 2), dtype="double") for vertices, w in zip(self._vertices, self._weights_at_q): for i, j in list(np.ndindex(self._num_band, self._num_band)): f1 = self._frequencies[vertices[0], i] @@ -320,7 +362,8 @@ class JointDos(object): self._primitive, nac_params=self._nac_params, frequency_scale_factor=self._frequency_scale_factor, - symprec=self._symprec) + symprec=self._symprec, + ) def _set_triplets(self): if not self._is_mesh_symmetry: @@ -328,22 +371,20 @@ class JointDos(object): print("Triplets at q without considering symmetry") sys.stdout.flush() - (self._triplets_at_q, - self._weights_at_q, - _, - _) = get_nosym_triplets_at_q( - self._grid_point, self._bz_grid) + (self._triplets_at_q, self._weights_at_q, _, _) = get_nosym_triplets_at_q( + self._grid_point, self._bz_grid + ) else: - (self._triplets_at_q, - self._weights_at_q, - _, - _) = get_triplets_at_q(self._grid_point, self._bz_grid) + (self._triplets_at_q, self._weights_at_q, _, _) = get_triplets_at_q( + self._grid_point, self._bz_grid + ) def _allocate_phonons(self): num_grid = len(self._bz_grid.addresses) num_band = self._num_band - self._phonon_done = np.zeros(num_grid, dtype='byte') - self._frequencies = np.zeros((num_grid, num_band), dtype='double') + self._phonon_done = np.zeros(num_grid, dtype="byte") + self._frequencies = np.zeros((num_grid, num_band), dtype="double") itemsize = self._frequencies.itemsize - self._eigenvectors = np.zeros((num_grid, num_band, num_band), - dtype=("c%d" % (itemsize * 2))) + self._eigenvectors = np.zeros( + (num_grid, num_band, num_band), dtype=("c%d" % (itemsize * 2)) + ) diff --git a/phono3py/phonon3/real_self_energy.py b/phono3py/phonon3/real_self_energy.py index f567acc0..8f248232 100644 --- a/phono3py/phonon3/real_self_energy.py +++ b/phono3py/phonon3/real_self_energy.py @@ -38,21 +38,25 @@ from phonopy.units import Hbar, EV, THz from phonopy.phonon.degeneracy import degenerate_sets from phono3py.phonon.func import bose_einstein from phono3py.file_IO import ( - write_real_self_energy_at_grid_point, write_real_self_energy_to_hdf5) + write_real_self_energy_at_grid_point, + write_real_self_energy_to_hdf5, +) from phono3py.phonon3.imag_self_energy import get_frequency_points -def get_real_self_energy(interaction, - grid_points, - temperatures, - epsilons=None, - frequency_points=None, - frequency_step=None, - num_frequency_points=None, - frequency_points_at_bands=False, - write_hdf5=True, - output_filename=None, - log_level=0): +def get_real_self_energy( + interaction, + grid_points, + temperatures, + epsilons=None, + frequency_points=None, + frequency_step=None, + num_frequency_points=None, + frequency_points_at_bands=False, + write_hdf5=True, + output_filename=None, + log_level=0, +): """Real part of self energy at frequency points Band indices to be calculated at are kept in Interaction instance. @@ -113,11 +117,13 @@ def get_real_self_energy(interaction, """ if epsilons is None: - _epsilons = [None, ] + _epsilons = [ + None, + ] else: _epsilons = epsilons - _temperatures = np.array(temperatures, dtype='double') + _temperatures = np.array(temperatures, dtype="double") if (interaction.get_phonons()[2] == 0).any(): if log_level: @@ -132,20 +138,30 @@ def get_real_self_energy(interaction, if frequency_points_at_bands: _frequency_points = None - all_deltas = np.zeros((len(_epsilons), len(_temperatures), - len(grid_points), len(band_indices)), - dtype='double', order='C') + all_deltas = np.zeros( + (len(_epsilons), len(_temperatures), len(grid_points), len(band_indices)), + dtype="double", + order="C", + ) else: _frequency_points = get_frequency_points( max_phonon_freq=max_phonon_freq, sigmas=epsilons, frequency_points=frequency_points, frequency_step=frequency_step, - num_frequency_points=num_frequency_points) - all_deltas = np.zeros((len(_epsilons), len(_temperatures), - len(grid_points), len(band_indices), - len(_frequency_points)), - dtype='double', order='C') + num_frequency_points=num_frequency_points, + ) + all_deltas = np.zeros( + ( + len(_epsilons), + len(_temperatures), + len(grid_points), + len(band_indices), + len(_frequency_points), + ), + dtype="double", + order="C", + ) fst.frequency_points = _frequency_points for j, gp in enumerate(grid_points): @@ -153,14 +169,17 @@ def get_real_self_energy(interaction, if log_level: weights = interaction.get_triplets_at_q()[1] if len(grid_points) > 1: - print("------------------- Real part of self energy -o- (%d/%d) " - "-------------------" % (j + 1, len(grid_points))) + print( + "------------------- Real part of self energy -o- (%d/%d) " + "-------------------" % (j + 1, len(grid_points)) + ) else: - print("----------------------- Real part of self energy -o- " - "-----------------------") + print( + "----------------------- Real part of self energy -o- " + "-----------------------" + ) print("Grid point: %d" % gp) - print("Number of ir-triplets: %d / %d" - % (len(weights), weights.sum())) + print("Number of ir-triplets: %d / %d" % (len(weights), weights.sum())) fst.run_interaction() frequencies = interaction.get_phonons()[0][gp] @@ -168,8 +187,7 @@ def get_real_self_energy(interaction, if log_level: bz_grid = interaction.bz_grid qpoint = np.dot(bz_grid.QDinv, bz_grid.addresses[gp]) - print("Phonon frequencies at (%4.2f, %4.2f, %4.2f):" - % tuple(qpoint)) + print("Phonon frequencies at (%4.2f, %4.2f, %4.2f):" % tuple(qpoint)) for bi, freq in enumerate(frequencies): print("%3d %f" % (bi + 1, freq)) sys.stdout.flush() @@ -210,28 +228,32 @@ def get_real_self_energy(interaction, fst.epsilon, frequency_points=_frequency_points, frequencies=frequencies, - filename=output_filename) + filename=output_filename, + ) if log_level: - print("Real part of self energies were stored in \"%s\"." - % filename) + print('Real part of self energies were stored in "%s".' % filename) sys.stdout.flush() return _frequency_points, all_deltas -def write_real_self_energy(real_self_energy, - mesh, - grid_points, - band_indices, - frequency_points, - temperatures, - epsilons, - output_filename=None, - is_mesh_symmetry=True, - log_level=0): +def write_real_self_energy( + real_self_energy, + mesh, + grid_points, + band_indices, + frequency_points, + temperatures, + epsilons, + output_filename=None, + is_mesh_symmetry=True, + log_level=0, +): if epsilons is None: - _epsilons = [RealSelfEnergy.default_epsilon, ] + _epsilons = [ + RealSelfEnergy.default_epsilon, + ] else: _epsilons = epsilons @@ -246,15 +268,18 @@ def write_real_self_energy(real_self_energy, gp, bi, frequency_points, - rse[pos:(pos + len(bi))].sum(axis=0) / len(bi), + rse[pos : (pos + len(bi))].sum(axis=0) / len(bi), mesh, epsilon, t, filename=output_filename, - is_mesh_symmetry=is_mesh_symmetry) + is_mesh_symmetry=is_mesh_symmetry, + ) if log_level: - print("Real parts of self-energies were " - "written to \"%s\"." % filename) + print( + "Real parts of self-energies were " + 'written to "%s".' % filename + ) class RealSelfEnergy(object): @@ -280,12 +305,9 @@ class RealSelfEnergy(object): """ - def __init__(self, - interaction, - grid_point=None, - temperature=None, - epsilon=None, - lang='C'): + def __init__( + self, interaction, grid_point=None, temperature=None, epsilon=None, lang="C" + ): """ Parameters @@ -323,9 +345,7 @@ class RealSelfEnergy(object): self._real_self_energies = None # Unit to THz of Delta - self._unit_conversion = (18 / (Hbar * EV) ** 2 - / (2 * np.pi * THz) ** 2 - * EV ** 2) + self._unit_conversion = 18 / (Hbar * EV) ** 2 / (2 * np.pi * THz) ** 2 * EV ** 2 def run(self): if self._pp_strength is None: @@ -333,20 +353,19 @@ class RealSelfEnergy(object): num_band0 = len(self._pp.band_indices) if self._frequency_points is None: - self._real_self_energies = np.zeros(num_band0, dtype='double') + self._real_self_energies = np.zeros(num_band0, dtype="double") self._run_with_band_indices() else: self._real_self_energies = np.zeros( - (len(self._frequency_points), num_band0), dtype='double') + (len(self._frequency_points), num_band0), dtype="double" + ) self._run_with_frequency_points() def run_interaction(self): self._pp.run(lang=self._lang) self._pp_strength = self._pp.interaction_strength - (self._frequencies, - self._eigenvectors) = self._pp.get_phonons()[:2] - (self._triplets_at_q, - self._weights_at_q) = self._pp.get_triplets_at_q()[:2] + (self._frequencies, self._eigenvectors) = self._pp.get_phonons()[:2] + (self._triplets_at_q, self._weights_at_q) = self._pp.get_triplets_at_q()[:2] self._band_indices = self._pp.band_indices @property @@ -365,13 +384,13 @@ class RealSelfEnergy(object): if len(bi_set) > 0: for i in bi_set: if self._frequency_points is None: - shifts[i] = ( - self._real_self_energies[bi_set].sum() - / len(bi_set)) + shifts[i] = self._real_self_energies[bi_set].sum() / len( + bi_set + ) else: - shifts[:, i] = ( - self._real_self_energies[:, bi_set].sum(axis=1) - / len(bi_set)) + shifts[:, i] = self._real_self_energies[:, bi_set].sum( + axis=1 + ) / len(bi_set) return shifts @property @@ -385,8 +404,7 @@ class RealSelfEnergy(object): else: self._pp.set_grid_point(grid_point) self._pp_strength = None - (self._triplets_at_q, - self._weights_at_q) = self._pp.get_triplets_at_q()[:2] + (self._triplets_at_q, self._weights_at_q) = self._pp.get_triplets_at_q()[:2] self._grid_point = self._triplets_at_q[0, 0] @property @@ -417,58 +435,60 @@ class RealSelfEnergy(object): @frequency_points.setter def frequency_points(self, frequency_points): - self._frequency_points = np.array(frequency_points, dtype='double') + self._frequency_points = np.array(frequency_points, dtype="double") def _run_with_band_indices(self): - if self._lang == 'C': + if self._lang == "C": self._run_c_with_band_indices() else: self._run_py_with_band_indices() def _run_with_frequency_points(self): - if self._lang == 'C': + if self._lang == "C": self._run_c_with_frequency_points() else: self._run_py_with_frequency_points() def _run_c_with_band_indices(self): import phono3py._phono3py as phono3c - phono3c.real_self_energy_at_bands(self._real_self_energies, - self._pp_strength, - self._triplets_at_q, - self._weights_at_q, - self._frequencies, - self._band_indices, - self._temperature, - self._epsilon, - self._unit_conversion, - self._cutoff_frequency) + + phono3c.real_self_energy_at_bands( + self._real_self_energies, + self._pp_strength, + self._triplets_at_q, + self._weights_at_q, + self._frequencies, + self._band_indices, + self._temperature, + self._epsilon, + self._unit_conversion, + self._cutoff_frequency, + ) def _run_py_with_band_indices(self): for i, (triplet, w, interaction) in enumerate( - zip(self._triplets_at_q, - self._weights_at_q, - self._pp_strength)): + zip(self._triplets_at_q, self._weights_at_q, self._pp_strength) + ): freqs = self._frequencies[triplet] for j, bi in enumerate(self._band_indices): fpoint = freqs[0, bi] if self._temperature > 0: - self._real_self_energies[j] += ( - self._real_self_energies_at_bands( - j, fpoint, freqs, interaction, w)) + self._real_self_energies[j] += self._real_self_energies_at_bands( + j, fpoint, freqs, interaction, w + ) else: - self._real_self_energies[j] += ( - self._real_self_energies_at_bands_0K( - j, fpoint, freqs, interaction, w)) + self._real_self_energies[j] += self._real_self_energies_at_bands_0K( + j, fpoint, freqs, interaction, w + ) self._real_self_energies *= self._unit_conversion def _run_c_with_frequency_points(self): import phono3py._phono3py as phono3c + for i, fpoint in enumerate(self._frequency_points): - shifts = np.zeros(self._real_self_energies.shape[1], - dtype='double') + shifts = np.zeros(self._real_self_energies.shape[1], dtype="double") phono3c.real_self_energy_at_frequency_point( shifts, fpoint, @@ -480,31 +500,34 @@ class RealSelfEnergy(object): self._temperature, self._epsilon, self._unit_conversion, - self._cutoff_frequency) + self._cutoff_frequency, + ) self._real_self_energies[i][:] = shifts def _run_py_with_frequency_points(self): for k, fpoint in enumerate(self._frequency_points): for i, (triplet, w, interaction) in enumerate( - zip(self._triplets_at_q, - self._weights_at_q, - self._pp_strength)): + zip(self._triplets_at_q, self._weights_at_q, self._pp_strength) + ): freqs = self._frequencies[triplet] for j, bi in enumerate(self._band_indices): if self._temperature > 0: - self._real_self_energies[k, j] += ( - self._real_self_energies_at_bands( - j, fpoint, freqs, interaction, w)) + self._real_self_energies[ + k, j + ] += self._real_self_energies_at_bands( + j, fpoint, freqs, interaction, w + ) else: - self._real_self_energies[k, j] += ( - self._real_self_energies_at_bands_0K( - j, fpoint, freqs, interaction, w)) + self._real_self_energies[ + k, j + ] += self._real_self_energies_at_bands_0K( + j, fpoint, freqs, interaction, w + ) self._real_self_energies *= self._unit_conversion - def _real_self_energies_at_bands(self, i, fpoint, freqs, - interaction, weight): + def _real_self_energies_at_bands(self, i, fpoint, freqs, interaction, weight): if fpoint < self._cutoff_frequency: return 0 @@ -513,8 +536,10 @@ class RealSelfEnergy(object): if fpoint < self._cutoff_frequency: continue - if (freqs[1, j] > self._cutoff_frequency and - freqs[2, k] > self._cutoff_frequency): + if ( + freqs[1, j] > self._cutoff_frequency + and freqs[2, k] > self._cutoff_frequency + ): d = 0.0 n2 = bose_einstein(freqs[1, j], self._temperature) n3 = bose_einstein(freqs[2, k], self._temperature) @@ -539,15 +564,16 @@ class RealSelfEnergy(object): sum_d += d * interaction[i, j, k] * weight return sum_d - def _real_self_energies_at_bands_0K(self, i, fpoint, freqs, - interaction, weight): + def _real_self_energies_at_bands_0K(self, i, fpoint, freqs, interaction, weight): if fpoint < self._cutoff_frequency: return 0 sum_d = 0 for (j, k) in list(np.ndindex(interaction.shape[1:])): - if (freqs[1, j] > self._cutoff_frequency and - freqs[2, k] > self._cutoff_frequency): + if ( + freqs[1, j] > self._cutoff_frequency + and freqs[2, k] > self._cutoff_frequency + ): d = 0.0 f1 = fpoint + freqs[1, j] + freqs[2, k] f2 = fpoint - freqs[1, j] - freqs[2, k] @@ -572,10 +598,7 @@ def imag_to_real(im_part, frequency_points): class ImagToReal(object): """Calculate real part of self-energy using Kramers-Kronig relation""" - def __init__(self, - im_part, - frequency_points, - diagram='bubble'): + def __init__(self, im_part, frequency_points, diagram="bubble"): """ Parameters @@ -593,10 +616,12 @@ class ImagToReal(object): """ - if diagram == 'bubble': - (self._im_part, - self._all_frequency_points, - self._df) = self._expand_bubble_im_part(im_part, frequency_points) + if diagram == "bubble": + ( + self._im_part, + self._all_frequency_points, + self._df, + ) = self._expand_bubble_im_part(im_part, frequency_points) else: raise RuntimeError("Only daigram='bubble' is implemented.") @@ -611,10 +636,10 @@ class ImagToReal(object): def frequency_points(self): return self._frequency_points - def run(self, method='pick_one'): - if method == 'pick_one': + def run(self, method="pick_one"): + if method == "pick_one": self._re_part, self._frequency_points = self._pick_one() - elif method == 'half_shift': + elif method == "half_shift": self._re_part, self._frequency_points = self._half_shift() else: raise RuntimeError("No method is found.") @@ -633,8 +658,7 @@ class ImagToReal(object): val = ((self._im_part / freqs).sum() - im_part_at_i) * coef re_part.append(val) fpoints.append(fpoint) - return (np.array(re_part, dtype='double'), - np.array(fpoints, dtype='double')) + return (np.array(re_part, dtype="double"), np.array(fpoints, dtype="double")) def _half_shift(self): re_part = [] @@ -649,24 +673,20 @@ class ImagToReal(object): val = (self._im_part / freqs).sum() * coef re_part.append(val) fpoints.append(fpoint) - return (np.array(re_part, dtype='double'), - np.array(fpoints, dtype='double')) + return (np.array(re_part, dtype="double"), np.array(fpoints, dtype="double")) def _expand_bubble_im_part(self, im_part, frequency_points): if (np.abs(frequency_points[0]) > 1e-8).any(): - raise RuntimeError( - "The first element of frequency_points is not zero.") + raise RuntimeError("The first element of frequency_points is not zero.") all_df = np.subtract(frequency_points[1:], frequency_points[:-1]) df = np.mean(all_df) if (np.abs(all_df - df) > 1e-6).any(): print(all_df) - raise RuntimeError( - "Frequency interval of frequency_points is not uniform.") + raise RuntimeError("Frequency interval of frequency_points is not uniform.") # im_part is inverted at omega < 0. _im_part = np.hstack([-im_part[::-1], im_part[1:]]) - _frequency_points = np.hstack([-frequency_points[::-1], - frequency_points[1:]]) + _frequency_points = np.hstack([-frequency_points[::-1], frequency_points[1:]]) return _im_part, _frequency_points, df diff --git a/phono3py/phonon3/real_to_reciprocal.py b/phono3py/phonon3/real_to_reciprocal.py index 9eef15cc..8b0f3dff 100644 --- a/phono3py/phonon3/real_to_reciprocal.py +++ b/phono3py/phonon3/real_to_reciprocal.py @@ -40,11 +40,7 @@ from phonopy.structure.cells import sparse_to_dense_svecs class RealToReciprocal(object): """Transform fc3 in real space to reciprocal space.""" - def __init__(self, - fc3, - primitive, - mesh, - symprec=1e-5): + def __init__(self, fc3, primitive, mesh, symprec=1e-5): """Init method.""" self._fc3 = fc3 self._primitive = primitive @@ -66,9 +62,10 @@ class RealToReciprocal(object): """Run at each triplet of q-vectors.""" self._triplet = triplet num_patom = len(self._primitive) - dtype = "c%d" % (np.dtype('double').itemsize * 2) + dtype = "c%d" % (np.dtype("double").itemsize * 2) self._fc3_reciprocal = np.zeros( - (num_patom, num_patom, num_patom, 3, 3, 3), dtype=dtype) + (num_patom, num_patom, num_patom, 3, 3, 3), dtype=dtype + ) self._real_to_reciprocal() def get_fc3_reciprocal(self): @@ -78,13 +75,15 @@ class RealToReciprocal(object): def _real_to_reciprocal(self): num_patom = len(self._primitive) sum_triplets = np.where( - np.all(self._triplet != 0, axis=0), self._triplet.sum(axis=0), 0) - sum_q = sum_triplets.astype('double') / self._mesh + np.all(self._triplet != 0, axis=0), self._triplet.sum(axis=0), 0 + ) + sum_q = sum_triplets.astype("double") / self._mesh for i in range(num_patom): for j in range(num_patom): for k in range(num_patom): - self._fc3_reciprocal[ - i, j, k] = self._real_to_reciprocal_elements((i, j, k)) + self._fc3_reciprocal[i, j, k] = self._real_to_reciprocal_elements( + (i, j, k) + ) prephase = self._get_prephase(sum_q, i) self._fc3_reciprocal[i] *= prephase @@ -93,7 +92,7 @@ class RealToReciprocal(object): num_satom = len(self._s2p_map) pi = patom_indices i = self._p2s_map[pi[0]] - dtype = "c%d" % (np.dtype('double').itemsize * 2) + dtype = "c%d" % (np.dtype("double").itemsize * 2) fc3_reciprocal = np.zeros((3, 3, 3), dtype=dtype) for j in range(num_satom): if self._s2p_map[j] != self._p2s_map[pi[1]]: @@ -112,12 +111,17 @@ class RealToReciprocal(object): def _get_phase(self, satom_indices, patom0_index): si = satom_indices p0 = patom0_index - phase = 1+0j + phase = 1 + 0j for i in (0, 1): svecs_adrs = self._multi[si[i], p0, 1] multi = self._multi[si[i], p0, 0] - vs = self._svecs[svecs_adrs:(svecs_adrs + multi)] - phase *= (np.exp(2j * np.pi * np.dot( - vs, self._triplet[i + 1].astype('double') / - self._mesh)).sum() / multi) + vs = self._svecs[svecs_adrs : (svecs_adrs + multi)] + phase *= ( + np.exp( + 2j + * np.pi + * np.dot(vs, self._triplet[i + 1].astype("double") / self._mesh) + ).sum() + / multi + ) return phase diff --git a/phono3py/phonon3/reciprocal_to_normal.py b/phono3py/phonon3/reciprocal_to_normal.py index 6c70cb4f..ea1e08e9 100644 --- a/phono3py/phonon3/reciprocal_to_normal.py +++ b/phono3py/phonon3/reciprocal_to_normal.py @@ -1,3 +1,4 @@ +"""Transform fc3 in reciprocal space to phonon space.""" # Copyright (C) 2020 Atsushi Togo # All rights reserved. # @@ -35,33 +36,42 @@ import numpy as np -class ReciprocalToNormal(object): - def __init__(self, - primitive, - frequencies, - eigenvectors, - band_indices, - cutoff_frequency=0): +class ReciprocalToNormal: + """Class to transform fc3 in reciprocal space to phonon space. + + This is an implementation in python for prototyping and the test. + Equivalent routine is implementated in C, and this is what usually + we use. + + """ + + def __init__( + self, primitive, frequencies, eigenvectors, band_indices, cutoff_frequency=0 + ): + """Init method.""" self._primitive = primitive self._frequencies = frequencies self._eigenvectors = eigenvectors self._band_indices = band_indices self._cutoff_frequency = cutoff_frequency - self._masses = self._primitive.get_masses() + self._masses = self._primitive.masses self._fc3_normal = None self._fc3_reciprocal = None def run(self, fc3_reciprocal, grid_triplet): - num_band = self._primitive.get_number_of_atoms() * 3 + """Calculate fc3 in phonon coordinates.""" + num_band = len(self._primitive) * 3 self._fc3_reciprocal = fc3_reciprocal - dtype = "c%d" % (np.dtype('double').itemsize * 2) + dtype = "c%d" % (np.dtype("double").itemsize * 2) self._fc3_normal = np.zeros( - (len(self._band_indices), num_band, num_band), dtype=dtype) + (len(self._band_indices), num_band, num_band), dtype=dtype + ) self._reciprocal_to_normal(grid_triplet) def get_reciprocal_to_normal(self): + """Return fc3 in phonon coordinates.""" return self._fc3_normal def _reciprocal_to_normal(self, grid_triplet): @@ -69,8 +79,7 @@ class ReciprocalToNormal(object): f1, f2, f3 = self._frequencies[grid_triplet] num_band = len(f1) cutoff = self._cutoff_frequency - for (i, j, k) in list(np.ndindex( - len(self._band_indices), num_band, num_band)): + for (i, j, k) in list(np.ndindex(len(self._band_indices), num_band, num_band)): bi = self._band_indices[i] if f1[bi] > cutoff and f2[j] > cutoff and f3[k] > cutoff: fc3_elem = self._sum_in_atoms((bi, j, k), (e1, e2, e3)) @@ -86,10 +95,12 @@ class ReciprocalToNormal(object): for (i, j, k) in list(np.ndindex((num_atom,) * 3)): sum_fc3_cart = 0 for (l, m, n) in list(np.ndindex((3, 3, 3))): - sum_fc3_cart += (e1[i * 3 + l, b1] * - e2[j * 3 + m, b2] * - e3[k * 3 + n, b3] * - self._fc3_reciprocal[i, j, k, l, m, n]) + sum_fc3_cart += ( + e1[i * 3 + l, b1] + * e2[j * 3 + m, b2] + * e3[k * 3 + n, b3] + * self._fc3_reciprocal[i, j, k, l, m, n] + ) mass_sqrt = np.sqrt(np.prod(self._masses[[i, j, k]])) sum_fc3 += sum_fc3_cart / mass_sqrt diff --git a/phono3py/phonon3/spectral_function.py b/phono3py/phonon3/spectral_function.py index 3f9e82cc..d9e7b298 100644 --- a/phono3py/phonon3/spectral_function.py +++ b/phono3py/phonon3/spectral_function.py @@ -35,25 +35,32 @@ import sys import numpy as np from phono3py.phonon3.imag_self_energy import ( - run_ise_at_frequency_points_batch, get_frequency_points, ImagSelfEnergy) + run_ise_at_frequency_points_batch, + get_frequency_points, + ImagSelfEnergy, +) from phono3py.phonon3.real_self_energy import imag_to_real from phono3py.file_IO import ( - write_spectral_function_at_grid_point, write_spectral_function_to_hdf5) + write_spectral_function_at_grid_point, + write_spectral_function_to_hdf5, +) -def run_spectral_function(interaction, - grid_points, - temperatures=None, - sigmas=None, - frequency_points=None, - frequency_step=None, - num_frequency_points=None, - num_points_in_batch=None, - band_indices=None, - write_txt=False, - write_hdf5=False, - output_filename=None, - log_level=0): +def run_spectral_function( + interaction, + grid_points, + temperatures=None, + sigmas=None, + frequency_points=None, + frequency_step=None, + num_frequency_points=None, + num_points_in_batch=None, + band_indices=None, + write_txt=False, + write_hdf5=False, + output_filename=None, + log_level=0, +): """Spectral function of self energy at frequency points Band indices to be calculated at are kept in Interaction instance. @@ -106,20 +113,21 @@ def run_spectral_function(interaction, """ - spf = SpectralFunction(interaction, - grid_points, - frequency_points=frequency_points, - frequency_step=frequency_step, - num_frequency_points=num_frequency_points, - num_points_in_batch=num_points_in_batch, - sigmas=sigmas, - temperatures=temperatures, - log_level=log_level) + spf = SpectralFunction( + interaction, + grid_points, + frequency_points=frequency_points, + frequency_step=frequency_step, + num_frequency_points=num_frequency_points, + num_points_in_batch=num_points_in_batch, + sigmas=sigmas, + temperatures=temperatures, + log_level=log_level, + ) for i, gp in enumerate(spf): frequencies = interaction.get_phonons()[0] for sigma_i, sigma in enumerate(spf.sigmas): - for t, spf_at_t in zip( - temperatures, spf.spectral_functions[sigma_i, :, i]): + for t, spf_at_t in zip(temperatures, spf.spectral_functions[sigma_i, :, i]): for j, bi in enumerate(band_indices): pos = 0 for k in range(j): @@ -128,15 +136,16 @@ def run_spectral_function(interaction, gp, bi, spf.frequency_points, - spf_at_t[pos:(pos + len(bi))].sum(axis=0) / len(bi), + spf_at_t[pos : (pos + len(bi))].sum(axis=0) / len(bi), interaction.mesh_numbers, t, sigma=sigma, filename=output_filename, - is_mesh_symmetry=interaction.is_mesh_symmetry) + is_mesh_symmetry=interaction.is_mesh_symmetry, + ) if log_level: print("Spectral functions were written to") - print("\"%s\"." % filename) + print('"%s".' % filename) filename = write_spectral_function_to_hdf5( gp, @@ -149,10 +158,11 @@ def run_spectral_function(interaction, sigma=sigma, frequency_points=spf.frequency_points, frequencies=frequencies[gp], - filename=output_filename) + filename=output_filename, + ) if log_level: - print("Spectral functions were stored in \"%s\"." % filename) + print('Spectral functions were stored in "%s".' % filename) sys.stdout.flush() return spf @@ -161,16 +171,18 @@ def run_spectral_function(interaction, class SpectralFunction(object): """Calculate spectral function""" - def __init__(self, - interaction, - grid_points, - frequency_points=None, - frequency_step=None, - num_frequency_points=None, - num_points_in_batch=None, - sigmas=None, - temperatures=None, - log_level=0): + def __init__( + self, + interaction, + grid_points, + frequency_points=None, + frequency_step=None, + num_frequency_points=None, + num_points_in_batch=None, + sigmas=None, + temperatures=None, + log_level=0, + ): self._interaction = interaction self._grid_points = grid_points self._frequency_points_in = frequency_points @@ -181,7 +193,9 @@ class SpectralFunction(object): self._log_level = log_level if sigmas is None: - self._sigmas = [None, ] + self._sigmas = [ + None, + ] else: self._sigmas = sigmas self._frequency_points = None @@ -209,8 +223,10 @@ class SpectralFunction(object): raise StopIteration if self._log_level: - print(("-" * 24 + " Spectral function (%d/%d) " + "-" * 24) - % (self._gp_index + 1, len(self._grid_points))) + print( + ("-" * 24 + " Spectral function (%d/%d) " + "-" * 24) + % (self._gp_index + 1, len(self._grid_points)) + ) gp = self._grid_points[self._gp_index] ise = ImagSelfEnergy(self._interaction) @@ -257,10 +273,16 @@ class SpectralFunction(object): def _prepare(self): self._set_frequency_points() self._gammas = np.zeros( - (len(self._sigmas), len(self._temperatures), - len(self._grid_points), len(self._interaction.band_indices), - len(self._frequency_points)), - dtype='double', order='C') + ( + len(self._sigmas), + len(self._temperatures), + len(self._grid_points), + len(self._interaction.band_indices), + len(self._frequency_points), + ), + dtype="double", + order="C", + ) self._deltas = np.zeros_like(self._gammas) self._spectral_functions = np.zeros_like(self._gammas) self._gp_index = 0 @@ -278,7 +300,8 @@ class SpectralFunction(object): self._temperatures, self._gammas, nelems_in_batch=self._num_points_in_batch, - log_level=self._log_level) + log_level=self._log_level, + ) def _run_delta(self, i, sigma_i): if self._log_level: @@ -288,7 +311,8 @@ class SpectralFunction(object): for j, temp in enumerate(self._temperatures): for k, bi in enumerate(self._interaction.band_indices): re_part, fpoints = imag_to_real( - self._gammas[sigma_i, j, i, k], self._frequency_points) + self._gammas[sigma_i, j, i, k], self._frequency_points + ) self._deltas[sigma_i, j, i, k] = -re_part assert (np.abs(self._frequency_points - fpoints) < 1e-8).all() @@ -323,8 +347,9 @@ class SpectralFunction(object): def _get_spectral_function(self, gammas, deltas, freq): fpoints = self._frequency_points nums = 4 * freq ** 2 * gammas / np.pi - denoms = ((fpoints ** 2 - freq ** 2 - 2 * freq * deltas) ** 2 - + (2 * freq * gammas) ** 2) + denoms = (fpoints ** 2 - freq ** 2 - 2 * freq * deltas) ** 2 + ( + 2 * freq * gammas + ) ** 2 vals = np.where(denoms > 0, nums / denoms, 0) return vals @@ -339,4 +364,5 @@ class SpectralFunction(object): sigmas=self._sigmas, frequency_points=self._frequency_points_in, frequency_step=self._frequency_step, - num_frequency_points=self._num_frequency_points) + num_frequency_points=self._num_frequency_points, + ) diff --git a/phono3py/phonon3/triplets.py b/phono3py/phonon3/triplets.py index 7f9d62a7..90a9f2c6 100644 --- a/phono3py/phonon3/triplets.py +++ b/phono3py/phonon3/triplets.py @@ -1,3 +1,4 @@ +"""Utilities to handle q-point triplets.""" # Copyright (C) 2020 Atsushi Togo # All rights reserved. # @@ -37,12 +38,16 @@ from phonopy.structure.tetrahedron_method import TetrahedronMethod from phono3py.phonon.func import gaussian -def get_triplets_at_q(grid_point, - bz_grid, - reciprocal_rotations=None, - is_time_reversal=True, - swappable=True): - """Parameters +def get_triplets_at_q( + grid_point, + bz_grid, + reciprocal_rotations=None, + is_time_reversal=True, + swappable=True, +): + """Generate q-point triplets. + + Parameters ---------- grid_point : int A grid point in the grid type chosen by `store_dense_gp_map`. @@ -82,7 +87,6 @@ def get_triplets_at_q(grid_point, shape=(prod(mesh),), dtype='int_' """ - if reciprocal_rotations is None: rotations = bz_grid.rotations else: @@ -93,53 +97,54 @@ def get_triplets_at_q(grid_point, bz_grid.D_diag, rotations, is_time_reversal=is_time_reversal, - swappable=swappable) - triplets_at_q, weights = _get_BZ_triplets_at_q( - grid_point, - bz_grid, - map_triplets) + swappable=swappable, + ) + triplets_at_q, weights = _get_BZ_triplets_at_q(grid_point, bz_grid, map_triplets) - assert np.prod(bz_grid.D_diag) == weights.sum(), \ - "Num grid points %d, sum of weight %d" % ( - np.prod(bz_grid.D_diag), weights.sum()) + assert ( + np.prod(bz_grid.D_diag) == weights.sum() + ), "Num grid points %d, sum of weight %d" % (np.prod(bz_grid.D_diag), weights.sum()) return triplets_at_q, weights, map_triplets, map_q def get_all_triplets(grid_point, bz_grid): + """Return all triplets of a grid point. + + Almost equivalent to ``get_nosym_triplets_at_q``. + Symmetry reduced set of triplets is obtained by ``get_triplets_at_q``. + + """ triplets_at_q, _ = _get_BZ_triplets_at_q( - grid_point, - bz_grid, - np.arange(np.prod(bz_grid.D_diag), dtype='int_')) + grid_point, bz_grid, np.arange(np.prod(bz_grid.D_diag), dtype="int_") + ) return triplets_at_q def get_nosym_triplets_at_q(grid_point, bz_grid): - """Returns triplets information without imposing mesh symmetry + """Return triplets information without imposing mesh symmetry. See the docstring of get_triplets_at_q. """ - - map_triplets = np.arange(np.prod(bz_grid.D_diag), dtype='int_') - triplets_at_q, weights = _get_BZ_triplets_at_q( - grid_point, - bz_grid, - map_triplets) + map_triplets = np.arange(np.prod(bz_grid.D_diag), dtype="int_") + triplets_at_q, weights = _get_BZ_triplets_at_q(grid_point, bz_grid, map_triplets) map_q = map_triplets.copy() return triplets_at_q, weights, map_triplets, map_q -def get_triplets_integration_weights(interaction, - frequency_points, - sigma, - sigma_cutoff=None, - is_collision_matrix=False, - neighboring_phonons=False, - lang='C'): - """Calculate triplets integration weights +def get_triplets_integration_weights( + interaction, + frequency_points, + sigma, + sigma_cutoff=None, + is_collision_matrix=False, + neighboring_phonons=False, + lang="C", +): + """Calculate triplets integration weights. Returns ------- @@ -151,7 +156,6 @@ def get_triplets_integration_weights(interaction, shape=(triplets, ), dtype='byte' """ - triplets = interaction.get_triplets_at_q()[0] frequencies = interaction.get_phonons()[0] num_band = frequencies.shape[1] @@ -160,30 +164,30 @@ def get_triplets_integration_weights(interaction, if is_collision_matrix: g = np.empty( (3, len(triplets), len(frequency_points), num_band, num_band), - dtype='double', order='C') + dtype="double", + order="C", + ) else: g = np.empty( (2, len(triplets), len(frequency_points), num_band, num_band), - dtype='double', order='C') + dtype="double", + order="C", + ) g[:] = 0 if sigma: - if lang == 'C': + if lang == "C": import phono3py._phono3py as phono3c - g_zero = np.zeros(g.shape[1:], dtype='byte', order='C') + + g_zero = np.zeros(g.shape[1:], dtype="byte", order="C") if sigma_cutoff is None: cutoff = -1 else: cutoff = float(sigma_cutoff) # cutoff < 0 disables g_zero feature. phono3c.triplets_integration_weights_with_sigma( - g, - g_zero, - frequency_points, - triplets, - frequencies, - sigma, - cutoff) + g, g_zero, frequency_points, triplets, frequencies, sigma, cutoff + ) else: for i, tp in enumerate(triplets): f1s = frequencies[tp[1]] @@ -199,33 +203,35 @@ def get_triplets_integration_weights(interaction, if len(g) == 3: g[2, i, :, j, k] = g0 + g1 + g2 else: - if lang == 'C': - g_zero = np.zeros(g.shape[1:], dtype='byte', order='C') + if lang == "C": + g_zero = np.zeros(g.shape[1:], dtype="byte", order="C") _set_triplets_integration_weights_c( g, g_zero, interaction, frequency_points, - neighboring_phonons=neighboring_phonons) + neighboring_phonons=neighboring_phonons, + ) else: - _set_triplets_integration_weights_py( - g, interaction, frequency_points) + _set_triplets_integration_weights_py(g, interaction, frequency_points) return g, g_zero -def get_tetrahedra_vertices(relative_address, - mesh, - triplets_at_q, - bz_grid): +def get_tetrahedra_vertices(relative_address, mesh, triplets_at_q, bz_grid): + """Return vertices of tetrahedra used for tetrahedron method. + + Equivalent function is implemented in C and this python version exists + only for the test and assumes q1+q2+q3=G. + + """ bzmesh = mesh * 2 grid_order = [1, mesh[0], mesh[0] * mesh[1]] bz_grid_order = [1, bzmesh[0], bzmesh[0] * bzmesh[1]] num_triplets = len(triplets_at_q) - vertices = np.zeros((num_triplets, 2, 24, 4), dtype='int_') + vertices = np.zeros((num_triplets, 2, 24, 4), dtype="int_") for i, tp in enumerate(triplets_at_q): - for j, adrs_shift in enumerate( - (relative_address, -relative_address)): + for j, adrs_shift in enumerate((relative_address, -relative_address)): adrs = bz_grid.addresses[tp[j + 1]] + adrs_shift bz_gp = np.dot(adrs % bzmesh, bz_grid_order) gp = np.dot(adrs % mesh, grid_order) @@ -234,12 +240,10 @@ def get_tetrahedra_vertices(relative_address, return vertices -def _get_triplets_reciprocal_mesh_at_q(fixed_grid_number, - D_diag, - rec_rotations, - is_time_reversal=True, - swappable=True): - """Search symmetry reduced triplets fixing one q-point +def _get_triplets_reciprocal_mesh_at_q( + fixed_grid_number, D_diag, rec_rotations, is_time_reversal=True, swappable=True +): + """Search symmetry reduced triplets fixing one q-point. Triplets of (q0, q1, q2) are searched. This method doesn't consider translationally equivalent points on BZ surface. @@ -276,20 +280,20 @@ def _get_triplets_reciprocal_mesh_at_q(fixed_grid_number, shape=(prod(mesh),), dtype='int_' """ - import phono3py._phono3py as phono3c - map_triplets = np.zeros(np.prod(D_diag), dtype='int_') - map_q = np.zeros(np.prod(D_diag), dtype='int_') + map_triplets = np.zeros(np.prod(D_diag), dtype="int_") + map_q = np.zeros(np.prod(D_diag), dtype="int_") phono3c.triplets_reciprocal_mesh_at_q( map_triplets, map_q, fixed_grid_number, - np.array(D_diag, dtype='int_'), + np.array(D_diag, dtype="int_"), is_time_reversal * 1, - np.array(rec_rotations, dtype='int_', order='C'), - swappable * 1) + np.array(rec_rotations, dtype="int_", order="C"), + swappable * 1, + ) return map_triplets, map_q @@ -328,64 +332,63 @@ def _get_BZ_triplets_at_q(grid_point, bz_grid, map_triplets): shape=(n_triplets,), dtype='int_' """ - import phono3py._phono3py as phono3c - weights = np.zeros(len(map_triplets), dtype='int_') + weights = np.zeros(len(map_triplets), dtype="int_") for g in map_triplets: weights[g] += 1 ir_weights = np.extract(weights > 0, weights) - triplets = -np.ones((len(ir_weights), 3), dtype='int_') - Q = np.eye(3, dtype='int_', order='C') + triplets = -np.ones((len(ir_weights), 3), dtype="int_") + Q = np.eye(3, dtype="int_", order="C") num_ir_ret = phono3c.BZ_triplets_at_q( triplets, grid_point, bz_grid.addresses, bz_grid.gp_map, map_triplets, - np.array(bz_grid.D_diag, dtype='int_'), + np.array(bz_grid.D_diag, dtype="int_"), Q, - bz_grid.store_dense_gp_map * 1 + 1) + bz_grid.store_dense_gp_map * 1 + 1, + ) assert num_ir_ret == len(ir_weights) - return triplets, np.array(ir_weights, dtype='int_') + return triplets, np.array(ir_weights, dtype="int_") -def _set_triplets_integration_weights_c(g, - g_zero, - pp, - frequency_points, - neighboring_phonons=False): +def _set_triplets_integration_weights_c( + g, g_zero, pp, frequency_points, neighboring_phonons=False +): import phono3py._phono3py as phono3c thm = TetrahedronMethod(pp.bz_grid.microzone_lattice) triplets_at_q = pp.get_triplets_at_q()[0] if neighboring_phonons: - unique_vertices = np.dot( - thm.get_unique_tetrahedra_vertices(), pp.bz_grid.P.T) + unique_vertices = np.dot(thm.get_unique_tetrahedra_vertices(), pp.bz_grid.P.T) for i, j in zip((1, 2), (1, -1)): neighboring_grid_points = np.zeros( - len(unique_vertices) * len(triplets_at_q), dtype='int_') + len(unique_vertices) * len(triplets_at_q), dtype="int_" + ) phono3c.neighboring_grid_points( neighboring_grid_points, - np.array(triplets_at_q[:, i], dtype='int_').ravel(), - np.array(j * unique_vertices, dtype='int_', order='C'), + np.array(triplets_at_q[:, i], dtype="int_").ravel(), + np.array(j * unique_vertices, dtype="int_", order="C"), pp.bz_grid.D_diag, pp.bz_grid.addresses, pp.bz_grid.gp_map, - pp.bz_grid.store_dense_gp_map * 1 + 1) + pp.bz_grid.store_dense_gp_map * 1 + 1, + ) pp.run_phonon_solver( - np.array(np.unique(neighboring_grid_points), dtype='int_')) + np.array(np.unique(neighboring_grid_points), dtype="int_") + ) frequencies = pp.get_phonons()[0] phono3c.triplets_integration_weights( g, g_zero, frequency_points, # f0 - np.array(np.dot(thm.get_tetrahedra(), pp.bz_grid.P.T), - dtype='int_', order='C'), + np.array(np.dot(thm.get_tetrahedra(), pp.bz_grid.P.T), dtype="int_", order="C"), pp.bz_grid.D_diag, triplets_at_q, frequencies, # f1 @@ -393,20 +396,20 @@ def _set_triplets_integration_weights_c(g, pp.bz_grid.addresses, pp.bz_grid.gp_map, pp.bz_grid.store_dense_gp_map * 1 + 1, - g.shape[0]) + g.shape[0], + ) def _set_triplets_integration_weights_py(g, pp, frequency_points): thm = TetrahedronMethod(pp.bz_grid.microzone_lattice) triplets_at_q = pp.get_triplets_at_q()[0] tetrahedra_vertices = get_tetrahedra_vertices( - np.array(np.dot(thm.get_tetrahedra(), pp.bz_grid.P.T), - dtype='int_', order='C'), + np.array(np.dot(thm.get_tetrahedra(), pp.bz_grid.P.T), dtype="int_", order="C"), pp.bz_grid.D_diag, triplets_at_q, - pp.bz_grid) - pp.run_phonon_solver( - np.array(np.unique(tetrahedra_vertices), dtype='int_')) + pp.bz_grid, + ) + pp.run_phonon_solver(np.array(np.unique(tetrahedra_vertices), dtype="int_")) frequencies = pp.get_phonons()[0] num_band = frequencies.shape[1] for i, vertices in enumerate(tetrahedra_vertices): diff --git a/phono3py/sscha/__init__.py b/phono3py/sscha/__init__.py index e69de29b..b3fbc75c 100644 --- a/phono3py/sscha/__init__.py +++ b/phono3py/sscha/__init__.py @@ -0,0 +1 @@ +"""Routines for SSCHA.""" diff --git a/phono3py/sscha/sscha.py b/phono3py/sscha/sscha.py index 9a440200..dfdae2bc 100644 --- a/phono3py/sscha/sscha.py +++ b/phono3py/sscha/sscha.py @@ -32,7 +32,7 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -"""SSCHA calculation +"""SSCHA calculation. Formulae implemented are based on these papers: @@ -47,8 +47,8 @@ from phonopy.harmonic.dynmat_to_fc import DynmatToForceConstants from phono3py.phonon.func import mode_length -class SupercellPhonon(object): - """Supercell phonon class +class SupercellPhonon: + """Supercell phonon class. Dynamical matrix is created for supercell atoms and solved in real. All phonons at commensurate points are folded to those at Gamma point. @@ -75,11 +75,8 @@ class SupercellPhonon(object): """ - def __init__(self, - supercell, - force_constants, - frequency_factor_to_THz=VaspToTHz): - """ + def __init__(self, supercell, force_constants, frequency_factor_to_THz=VaspToTHz): + """Init method. Parameters ---------- @@ -92,47 +89,53 @@ class SupercellPhonon(object): Frequency conversion factor to THz. """ - self._supercell = supercell N = len(supercell) - _fc2 = np.array(np.transpose(force_constants, axes=[0, 2, 1, 3]), - dtype='double', order='C') + _fc2 = np.array( + np.transpose(force_constants, axes=[0, 2, 1, 3]), dtype="double", order="C" + ) _fc2 = _fc2.reshape((3 * N, 3 * N)) - _fc2 = np.array(_fc2, dtype='double', order='C') + _fc2 = np.array(_fc2, dtype="double", order="C") inv_sqrt_masses = 1.0 / np.repeat(np.sqrt(supercell.masses), 3) - dynmat = np.array(inv_sqrt_masses * (inv_sqrt_masses * _fc2).T, - dtype='double', order='C') + dynmat = np.array( + inv_sqrt_masses * (inv_sqrt_masses * _fc2).T, dtype="double", order="C" + ) eigvals, eigvecs = np.linalg.eigh(dynmat) freqs = np.sqrt(np.abs(eigvals)) * np.sign(eigvals) freqs *= frequency_factor_to_THz - self._eigenvalues = np.array(eigvals, dtype='double', order='C') - self._eigenvectors = np.array(eigvecs, dtype='double', order='C') - self._frequencies = np.array(freqs, dtype='double', order='C') + self._eigenvalues = np.array(eigvals, dtype="double", order="C") + self._eigenvectors = np.array(eigvecs, dtype="double", order="C") + self._frequencies = np.array(freqs, dtype="double", order="C") self._force_constants = _fc2 @property def eigenvalues(self): + """Return eigenvalues.""" return self._eigenvalues @property def eigenvectors(self): + """Return eigenvectors.""" return self._eigenvectors @property def frequencies(self): + """Return frequencies.""" return self._frequencies @property def force_constants(self): + """Return harmonic force cosntants.""" return self._force_constants @property def supercell(self): + """Return supercell.""" return self._supercell -class DispCorrMatrix(object): - """Calculate displacement correlation matrix +class DispCorrMatrix: + """Calculate displacement correlation matrix from supercell phonon. Attributes ---------- @@ -150,10 +153,8 @@ class DispCorrMatrix(object): """ - def __init__(self, - supercell_phonon, - cutoff_frequency=1e-5): - """ + def __init__(self, supercell_phonon, cutoff_frequency=1e-5): + """Init method. Parameters ---------- @@ -164,7 +165,6 @@ class DispCorrMatrix(object): Phonons are ignored if they have frequencies less than this value. """ - self._supercell_phonon = supercell_phonon self._cutoff_frequency = cutoff_frequency self._psi_matrix = None @@ -172,12 +172,13 @@ class DispCorrMatrix(object): self._determinant = None def run(self, T): + """Calculate displacement correlation matrix from supercell phonon.""" freqs = self._supercell_phonon.frequencies eigvecs = self._supercell_phonon.eigenvectors - sqrt_masses = np.repeat( - np.sqrt(self._supercell_phonon.supercell.masses), 3) + sqrt_masses = np.repeat(np.sqrt(self._supercell_phonon.supercell.masses), 3) inv_sqrt_masses = np.repeat( - 1.0 / np.sqrt(self._supercell_phonon.supercell.masses), 3) + 1.0 / np.sqrt(self._supercell_phonon.supercell.masses), 3 + ) # ignore zero and imaginary frequency modes condition = freqs > self._cutoff_frequency @@ -188,35 +189,39 @@ class DispCorrMatrix(object): matrix = np.dot(a2 * eigvecs, eigvecs.T) self._psi_matrix = np.array( - inv_sqrt_masses * (inv_sqrt_masses * matrix).T, - dtype='double', order='C') + inv_sqrt_masses * (inv_sqrt_masses * matrix).T, dtype="double", order="C" + ) matrix = np.dot(a2_inv * eigvecs, eigvecs.T) self._upsilon_matrix = np.array( - sqrt_masses * (sqrt_masses * matrix).T, - dtype='double', order='C') + sqrt_masses * (sqrt_masses * matrix).T, dtype="double", order="C" + ) self._determinant = np.prod(2 * np.pi * np.extract(condition, a2)) @property def upsilon_matrix(self): + """Return Upsilon matrix.""" return self._upsilon_matrix @property def psi_matrix(self): + """Return Psi matrix.""" return self._psi_matrix @property def supercell_phonon(self): + """Return SupercellPhonon class instance.""" return self._supercell_phonon @property def determinant(self): + """Return determinant.""" return self._determinant -class DispCorrMatrixMesh(object): - """Calculate upsilon and psi matrix +class DispCorrMatrixMesh: + """Calculate upsilon and psi matrix from normal phonon. This calculation is similar to the transformation from dynamical matrices to force constants. Instead of creating @@ -238,12 +243,9 @@ class DispCorrMatrixMesh(object): """ - def __init__(self, - primitive, - supercell, - cutoff_frequency=1e-5): - self._d2f = DynmatToForceConstants( - primitive, supercell, is_full_fc=True) + def __init__(self, primitive, supercell, cutoff_frequency=1e-5): + """Init method.""" + self._d2f = DynmatToForceConstants(primitive, supercell, is_full_fc=True) self._masses = supercell.masses self._cutoff_frequency = cutoff_frequency @@ -252,10 +254,11 @@ class DispCorrMatrixMesh(object): @property def commensurate_points(self): + """Return commensurate points.""" return self._d2f.commensurate_points def run(self, frequencies, eigenvectors, T): - """ + """Calculate displacement correlation matrix from normal phonon results. Parameters ---------- @@ -280,7 +283,7 @@ class DispCorrMatrixMesh(object): self._d2f.run() matrix = self._d2f.force_constants matrix = np.transpose(matrix, axes=[0, 2, 1, 3]).reshape(shape) - self._upsilon_matrix = np.array(matrix, dtype='double', order='C') + self._upsilon_matrix = np.array(matrix, dtype="double", order="C") self._d2f.create_dynamical_matrices(a2, eigenvectors) self._d2f.run() @@ -289,19 +292,21 @@ class DispCorrMatrixMesh(object): for j, m_j in enumerate(self._masses): matrix[i, j] /= m_i * m_j matrix = np.transpose(matrix, axes=[0, 2, 1, 3]).reshape(shape) - self._psi_matrix = np.array(matrix, dtype='double', order='C') + self._psi_matrix = np.array(matrix, dtype="double", order="C") @property def upsilon_matrix(self): + """Return Upsilon matrix.""" return self._upsilon_matrix @property def psi_matrix(self): + """Return Psi matrix.""" return self._psi_matrix class SecondOrderFC(object): - r"""SSCHA second order force constants by ensemble average + r"""SSCHA second order force constants by ensemble average. This class is made just for the test of the ensemble average in Ref. 1, and will not be used for usual fc2 calculation. @@ -320,13 +325,15 @@ class SecondOrderFC(object): """ - def __init__(self, - displacements, - forces, - supercell_phonon, - cutoff_frequency=1e-5, - log_level=0): - """ + def __init__( + self, + displacements, + forces, + supercell_phonon, + cutoff_frequency=1e-5, + log_level=0, + ): + """Init method. Parameters ---------- @@ -342,34 +349,34 @@ class SecondOrderFC(object): """ - assert (displacements.shape == forces.shape) + assert displacements.shape == forces.shape shape = displacements.shape - u = np.array(displacements.reshape(shape[0], -1), - dtype='double', order='C') - f = np.array(forces.reshape(shape[0], -1), - dtype='double', order='C') + u = np.array(displacements.reshape(shape[0], -1), dtype="double", order="C") + f = np.array(forces.reshape(shape[0], -1), dtype="double", order="C") self._displacements = u self._forces = f - self._uu = DispCorrMatrix( - supercell_phonon, cutoff_frequency=cutoff_frequency) + self._uu = DispCorrMatrix(supercell_phonon, cutoff_frequency=cutoff_frequency) self._force_constants = supercell_phonon.force_constants self._cutoff_frequency = cutoff_frequency self._log_level = log_level @property def displacements(self): + """Return input displacements.""" return self._displacements @property def forces(self): + """Return input forces.""" return self._forces @property def fc2(self): + """Return fc2 calculated stochastically.""" return self._fc2 def run(self, T=300.0): - """Calculate fc2 stochastically + """Calculate fc2 stochastically. As displacement correlation matrix ^-1, two choices exist. @@ -385,7 +392,6 @@ class SecondOrderFC(object): condition. """ - u = self._displacements f = self._forces Y = np.linalg.pinv(np.dot(u.T, u) / u.shape[0]) @@ -401,15 +407,17 @@ class SecondOrderFC(object): # print("drift forces:", # self._forces.sum(axis=0) / self._forces.shape[0]) - fc2 = - np.dot(u_inv.T, f) / f.shape[0] + fc2 = -np.dot(u_inv.T, f) / f.shape[0] N = Y.shape[0] // 3 self._fc2 = np.array( np.transpose(fc2.reshape(N, 3, N, 3), axes=[0, 2, 1, 3]), - dtype='double', order='C') + dtype="double", + order="C", + ) class ThirdOrderFC(object): - r"""SSCHA third order force constants + r"""SSCHA third order force constants. Eq. 45a in Ref.1 (See top docstring of this file) @@ -431,13 +439,15 @@ class ThirdOrderFC(object): """ - def __init__(self, - displacements, - forces, - supercell_phonon, - cutoff_frequency=1e-5, - log_level=0): - """ + def __init__( + self, + displacements, + forces, + supercell_phonon, + cutoff_frequency=1e-5, + log_level=0, + ): + """Init method. Parameters ---------- @@ -451,17 +461,13 @@ class ThirdOrderFC(object): Phonons are ignored if they have frequencies less than this value. """ - - assert (displacements.shape == forces.shape) + assert displacements.shape == forces.shape shape = displacements.shape - u = np.array(displacements.reshape(shape[0], -1), - dtype='double', order='C') - f = np.array(forces.reshape(shape[0], -1), - dtype='double', order='C') + u = np.array(displacements.reshape(shape[0], -1), dtype="double", order="C") + f = np.array(forces.reshape(shape[0], -1), dtype="double", order="C") self._displacements = u self._forces = f - self._uu = DispCorrMatrix( - supercell_phonon, cutoff_frequency=cutoff_frequency) + self._uu = DispCorrMatrix(supercell_phonon, cutoff_frequency=cutoff_frequency) self._force_constants = supercell_phonon.force_constants self._cutoff_frequency = cutoff_frequency self._log_level = log_level @@ -472,21 +478,26 @@ class ThirdOrderFC(object): @property def displacements(self): + """Return input displacements.""" return self._displacements @property def forces(self): + """Return input forces""" return self._forces @property def fc3(self): + """Return fc3 calculated stochastically.""" return self._fc3 @property def ff(self): + """Return force matrix.""" return self._fmat def run(self, T=300.0): + """Calculate fc3 stochastically.""" if self._fmat is None: self._fmat = self._run_fmat() @@ -494,8 +505,8 @@ class ThirdOrderFC(object): N = fc3.shape[0] // 3 fc3 = fc3.reshape((N, 3, N, 3, N, 3)) self._fc3 = np.array( - np.transpose(fc3, axes=[0, 2, 4, 1, 3, 5]), - dtype='double', order='C') + np.transpose(fc3, axes=[0, 2, 4, 1, 3, 5]), dtype="double", order="C" + ) def _run_fmat(self): f = self._forces @@ -521,4 +532,4 @@ class ThirdOrderFC(object): print("rms forces:", np.sqrt((self._forces ** 2).sum() / N)) print("rms f:", np.sqrt((f ** 2).sum() / N)) - return - np.einsum('li,lj,lk->ijk', u_inv, u_inv, f) / f.shape[0] + return -np.einsum("li,lj,lk->ijk", u_inv, u_inv, f) / f.shape[0] diff --git a/pyproject.toml b/pyproject.toml index 8b88f611..55cd9ace 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,9 @@ [build-system] requires = ["setuptools", "wheel", "numpy"] + +[tool.flake8] +max-line-length = 88 +extend-ignore = "E203,W503" + +[tool.black] +line-length = 88 diff --git a/scripts/phono3py b/scripts/phono3py index 7b7801ba..dda1d230 100755 --- a/scripts/phono3py +++ b/scripts/phono3py @@ -36,8 +36,10 @@ from phono3py.cui.phono3py_script import main -if __name__ == '__main__': - argparse_control = {'fc_symmetry': False, - 'is_nac': False, - 'load_phono3py_yaml': False} +if __name__ == "__main__": + argparse_control = { + "fc_symmetry": False, + "is_nac": False, + "load_phono3py_yaml": False, + } main(**argparse_control) diff --git a/scripts/phono3py-coleigplot b/scripts/phono3py-coleigplot index 92e17949..7d9929a1 100755 --- a/scripts/phono3py-coleigplot +++ b/scripts/phono3py-coleigplot @@ -11,12 +11,15 @@ epsilon = 1.0e-8 def get_options(): # Arg-parser - parser = argparse.ArgumentParser( - description="Plot collision matrix eigenvalues") + parser = argparse.ArgumentParser(description="Plot collision matrix eigenvalues") parser.add_argument( - '--temperature', type=float, default=300.0, dest='temperature', - help='Temperature to output data at') - parser.add_argument('filenames', nargs='*') + "--temperature", + type=float, + default=300.0, + dest="temperature", + help="Temperature to output data at", + ) + parser.add_argument("filenames", nargs="*") args = parser.parse_args() return args @@ -24,9 +27,9 @@ def get_options(): def main(args): filename = args.filenames[0] if os.path.isfile(filename): - with h5py.File(filename, 'r') as f: - coleigs = f['collision_eigenvalues'][:] - temperatures = f['temperature'][:] + with h5py.File(filename, "r") as f: + coleigs = f["collision_eigenvalues"][:] + temperatures = f["temperature"][:] else: print("File %s doens't exist." % filename) sys.exit(1) @@ -34,10 +37,10 @@ def main(args): import matplotlib.pyplot as plt fig, ax = plt.subplots() - ax.xaxis.set_ticks_position('bottom') - ax.yaxis.set_ticks_position('left') - ax.xaxis.set_tick_params(which='both', direction='in') - ax.yaxis.set_tick_params(which='both', direction='in') + ax.xaxis.set_ticks_position("bottom") + ax.yaxis.set_ticks_position("left") + ax.xaxis.set_tick_params(which="both", direction="in") + ax.yaxis.set_tick_params(which="both", direction="in") if len(temperatures) > 29: t_index = 30 @@ -53,8 +56,8 @@ def main(args): coleigs_p[coleigs_p < 0] = np.nan coleigs_n[coleigs_n >= 0] = np.nan - ax.semilogy(coleigs_p, 'b.', markersize=1) - ax.semilogy(-coleigs_n, 'r.', markersize=1) + ax.semilogy(coleigs_p, "b.", markersize=1) + ax.semilogy(-coleigs_n, "r.", markersize=1) ax.set_xlim(0, len(coleigs_p)) plt.show() diff --git a/scripts/phono3py-kaccum b/scripts/phono3py-kaccum index 477ffe67..0cfa3211 100755 --- a/scripts/phono3py-kaccum +++ b/scripts/phono3py-kaccum @@ -36,5 +36,5 @@ from phono3py.cui.kaccum import main -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/scripts/phono3py-kdeplot b/scripts/phono3py-kdeplot index 98edf3c3..7df30629 100755 --- a/scripts/phono3py-kdeplot +++ b/scripts/phono3py-kdeplot @@ -9,10 +9,10 @@ import argparse epsilon = 1.0e-8 + def collect_data(gamma, weights, frequencies, cutoff, max_freq): freqs = [] mode_prop = [] - mode_weights = [] for w, freq, g in zip(weights, frequencies, gamma): tau = 1.0 / np.where(g > 0, g, -1) / (2 * 2 * np.pi) @@ -35,9 +35,9 @@ def collect_data(gamma, weights, frequencies, cutoff, max_freq): return x, y + def run_KDE(x, y, nbins, x_max=None, y_max=None, density_ratio=0.1): - """Running Gaussian-KDE by scipy - """ + """Running Gaussian-KDE by scipy""" x_min = 0 if x_max is None: @@ -52,7 +52,7 @@ def run_KDE(x, y, nbins, x_max=None, y_max=None, density_ratio=0.1): values = np.vstack([x.ravel(), y.ravel()]) kernel = stats.gaussian_kde(values) - xi, yi = np.mgrid[x_min:_x_max:nbins*1j, y_min:_y_max:nbins*1j] + xi, yi = np.mgrid[x_min : _x_max : nbins * 1j, y_min : _y_max : nbins * 1j] positions = np.vstack([xi.ravel(), yi.ravel()]) zi = np.reshape(kernel(positions).T, xi.shape) @@ -67,7 +67,7 @@ def run_KDE(x, y, nbins, x_max=None, y_max=None, density_ratio=0.1): short_nbinds = len(indices) ynbins = nbins ** 2 // short_nbinds - xi, yi = np.mgrid[x_min:_x_max:nbins*1j, y_min:_y_max:ynbins*1j] + xi, yi = np.mgrid[x_min : _x_max : nbins * 1j, y_min : _y_max : ynbins * 1j] positions = np.vstack([xi.ravel(), yi.ravel()]) zi = np.reshape(kernel(positions).T, xi.shape) else: @@ -75,52 +75,67 @@ def run_KDE(x, y, nbins, x_max=None, y_max=None, density_ratio=0.1): return xi, yi, zi, short_nbinds -def plot(plt, xi, yi, zi, x, y, short_nbinds, nbins, - y_max=None, z_max=None, cmap=None, aspect=None, - flip=False, no_points=False, show_colorbar=True, - point_size=5, title=None): + +def plot( + plt, + xi, + yi, + zi, + x, + y, + short_nbinds, + nbins, + y_max=None, + z_max=None, + cmap=None, + aspect=None, + flip=False, + no_points=False, + show_colorbar=True, + point_size=5, + title=None, +): xmax = np.max(x) ymax = np.max(y) x_cut = [] y_cut = [] threshold = ymax / nbins * short_nbinds / nbins * (nbins - 1) for _x, _y in zip(x, y): - if (epsilon < _y and _y < threshold and - epsilon < _x and _x < xmax - epsilon): + if epsilon < _y and _y < threshold and epsilon < _x and _x < xmax - epsilon: x_cut.append(_x) y_cut.append(_y) fig, ax = plt.subplots() - ax.xaxis.set_ticks_position('bottom') - ax.yaxis.set_ticks_position('left') - ax.xaxis.set_tick_params(which='both', direction='out') - ax.yaxis.set_tick_params(which='both', direction='out') + ax.xaxis.set_ticks_position("bottom") + ax.yaxis.set_ticks_position("left") + ax.xaxis.set_tick_params(which="both", direction="out") + ax.yaxis.set_tick_params(which="both", direction="out") if flip: # Start Flip - plt.pcolormesh(yi[:,:nbins], xi[:,:nbins], zi[:,:nbins], - vmax=z_max, cmap=cmap) + plt.pcolormesh( + yi[:, :nbins], xi[:, :nbins], zi[:, :nbins], vmax=z_max, cmap=cmap + ) if show_colorbar: plt.colorbar() if not no_points: - plt.scatter(y_cut, x_cut, s=point_size, - c='k', marker='.', linewidth=0) + plt.scatter(y_cut, x_cut, s=point_size, c="k", marker=".", linewidth=0) plt.ylim(ymin=0, ymax=xi.max()) if y_max is None: plt.xlim(xmin=0, xmax=(np.max(y_cut) + epsilon)) else: plt.xlim(xmin=0, xmax=(y_max + epsilon)) - plt.xlabel('Lifetime (ps)', fontsize=18) - plt.ylabel('Phonon frequency (THz)', fontsize=18) + plt.xlabel("Lifetime (ps)", fontsize=18) + plt.ylabel("Phonon frequency (THz)", fontsize=18) # End Flip else: - plt.pcolormesh(xi[:,:nbins], yi[:,:nbins], zi[:,:nbins], - vmax=z_max, cmap=cmap) + plt.pcolormesh( + xi[:, :nbins], yi[:, :nbins], zi[:, :nbins], vmax=z_max, cmap=cmap + ) if show_colorbar: plt.colorbar() if not no_points: - plt.scatter(x_cut, y_cut, s=point_size, - c='k', marker='.', linewidth=0) + plt.scatter(x_cut, y_cut, s=point_size, c="k", marker=".", linewidth=0) plt.xlim(xmin=0, xmax=xi.max()) if y_max is None: plt.ylim(ymin=0, ymax=(np.max(y_cut) + epsilon)) @@ -128,8 +143,8 @@ def plot(plt, xi, yi, zi, x, y, short_nbinds, nbins, plt.ylim(ymin=0, ymax=(y_max + epsilon)) if title: plt.title(title, fontsize=20) - plt.xlabel('Phonon frequency (THz)', fontsize=18) - plt.ylabel('Lifetime (ps)', fontsize=18) + plt.xlabel("Phonon frequency (THz)", fontsize=18) + plt.ylabel("Lifetime (ps)", fontsize=18) if aspect is not None: xlim = ax.get_xlim() @@ -142,88 +157,115 @@ def plot(plt, xi, yi, zi, x, y, short_nbinds, nbins, return fig + def get_options(): # Arg-parser parser = argparse.ArgumentParser( - description="Plot property density with gaussian KDE") + description="Plot property density with gaussian KDE" + ) parser.add_argument( - "--aspect", type=float, default=None, - help="The ration, height/width of canvas") + "--aspect", type=float, default=None, help="The ration, height/width of canvas" + ) + parser.add_argument("--cmap", dest="cmap", default=None, help="Matplotlib cmap") parser.add_argument( - "--cmap", dest="cmap", default=None, - help="Matplotlib cmap") + "--cutoff", + type=float, + default=None, + help=( + "Property (y-axis) below this value is included in " + "data before running Gaussian-KDE" + ), + ) parser.add_argument( - "--cutoff", type=float, default=None, - help=("Property (y-axis) below this value is included in " - "data before running Gaussian-KDE")) - parser.add_argument( - "--dr", "--density-ratio", dest="density_ratio", type=float, + "--dr", + "--density-ratio", + dest="density_ratio", + type=float, default=0.1, - help=("Minimum density ratio with respect to maximum " - "density used to determine drawing region")) + help=( + "Minimum density ratio with respect to maximum " + "density used to determine drawing region" + ), + ) + parser.add_argument("--flip", action="store_true", help="Flip x and y.") parser.add_argument( - "--flip", action='store_true', - help='Flip x and y.') + "--fmax", type=float, default=None, help="Max frequency to plot" + ) parser.add_argument( - "--fmax", type=float, default=None, - help="Max frequency to plot") + "--hc", + "--hide-colorbar", + dest="hide_colorbar", + action="store_true", + help="Do not show colorbar", + ) parser.add_argument( - "--hc", "--hide-colorbar", dest="hide_colorbar", action='store_true', - help='Do not show colorbar') + "--nbins", + type=int, + default=100, + help=( + "Number of bins in which data are assigned, " + "i.e., determining resolution of plot" + ), + ), parser.add_argument( - "--nbins", type=int, default=100, - help=("Number of bins in which data are assigned, " - "i.e., determining resolution of plot")), + "--no-points", dest="no_points", action="store_true", help="Do not show points" + ) + parser.add_argument("--nu", action="store_true", help="Plot N and U.") parser.add_argument( - "--no-points", dest="no_points", action='store_true', - help='Do not show points') + "-o", + "--output", + dest="output_filename", + default=None, + help="Output filename, e.g., to PDF", + ) parser.add_argument( - "--nu", action='store_true', - help="Plot N and U.") + "--point-size", + dest="point_size", + type=float, + default=5, + help="Point size (default=5)", + ) parser.add_argument( - "-o", "--output", dest="output_filename", default=None, - help="Output filename, e.g., to PDF") + "--temperature", + type=float, + default=300.0, + dest="temperature", + help="Temperature to output data at", + ) + parser.add_argument("--title", dest="title", default=None, help="Plot title") parser.add_argument( - '--point-size', dest="point_size", type=float, default=5, - help='Point size (default=5)') + "--xmax", type=float, default=None, help="Set maximum x of draw area" + ) parser.add_argument( - '--temperature', type=float, default=300.0, dest='temperature', - help='Temperature to output data at') - parser.add_argument( - "--title", dest="title", default=None, - help="Plot title") - parser.add_argument( - "--xmax", type=float, default=None, - help="Set maximum x of draw area") - parser.add_argument( - "--ymax", type=float, default=None, - help="Set maximum y of draw area") - parser.add_argument( - "--zmax", type=float, default=None, - help="Set maximum indisity") - parser.add_argument('filenames', nargs='*') + "--ymax", type=float, default=None, help="Set maximum y of draw area" + ) + parser.add_argument("--zmax", type=float, default=None, help="Set maximum indisity") + parser.add_argument("filenames", nargs="*") args = parser.parse_args() return args + def main(args): # # Matplotlib setting # import matplotlib - matplotlib.use('Agg') + + matplotlib.use("Agg") import matplotlib.pyplot as plt from matplotlib import rc - rc('text', usetex=True) - rc('font', family='serif') + + rc("text", usetex=True) + rc("font", family="serif") # rc('font', serif='Times New Roman') - rc('font', serif='Liberation Serif') + rc("font", serif="Liberation Serif") # plt.rcParams['pdf.fonttype'] = 42 # # Initial setting # if os.path.isfile(args.filenames[0]): - f = h5py.File(args.filenames[0], 'r') + f = h5py.File(args.filenames[0], "r") else: print("File %s doens't exist." % args.filenames[0]) sys.exit(1) @@ -236,7 +278,7 @@ def main(args): # # Set temperature # - temperatures = f['temperature'][:] + temperatures = f["temperature"][:] if len(temperatures) > 29: t_index = 30 else: @@ -246,40 +288,62 @@ def main(args): t_index = i break - print("Temperature at which lifetime density is drawn: %7.3f" - % temperatures[t_index]) + print( + "Temperature at which lifetime density is drawn: %7.3f" % temperatures[t_index] + ) # # Set data # - weights = f['weight'][:] - frequencies = f['frequency'][:] - symbols = ['',] + weights = f["weight"][:] + frequencies = f["frequency"][:] + symbols = [ + "", + ] - gammas = [f['gamma'][t_index],] + gammas = [ + f["gamma"][t_index], + ] if args.nu: - if 'gamma_N' in f: - gammas.append(f['gamma_N'][t_index]) - symbols.append('N') - if 'gamma_U' in f: - gammas.append(f['gamma_U'][t_index]) - symbols.append('U') + if "gamma_N" in f: + gammas.append(f["gamma_N"][t_index]) + symbols.append("N") + if "gamma_U" in f: + gammas.append(f["gamma_U"][t_index]) + symbols.append("U") # # Run # for gamma, s in zip(gammas, symbols): x, y = collect_data(gamma, weights, frequencies, args.cutoff, args.fmax) - xi, yi, zi, short_nbinds = run_KDE(x, y, args.nbins, - x_max=args.xmax, - y_max=args.ymax, - density_ratio=args.density_ratio) - fig = plot(plt, xi, yi, zi, x, y, short_nbinds, args.nbins, - y_max=args.ymax, z_max=args.zmax, cmap=args.cmap, - aspect=args.aspect, flip=args.flip, - no_points=args.no_points, - show_colorbar=(not args.hide_colorbar), - point_size=args.point_size, title=title) + xi, yi, zi, short_nbinds = run_KDE( + x, + y, + args.nbins, + x_max=args.xmax, + y_max=args.ymax, + density_ratio=args.density_ratio, + ) + fig = plot( + plt, + xi, + yi, + zi, + x, + y, + short_nbinds, + args.nbins, + y_max=args.ymax, + z_max=args.zmax, + cmap=args.cmap, + aspect=args.aspect, + flip=args.flip, + no_points=args.no_points, + show_colorbar=(not args.hide_colorbar), + point_size=args.point_size, + title=title, + ) if args.output_filename: fig.savefig(args.output_filename) @@ -290,5 +354,6 @@ def main(args): fig.savefig("lifetime.png") plt.close(fig) + if __name__ == "__main__": main(get_options()) diff --git a/scripts/phono3py-load b/scripts/phono3py-load index 4e362d28..9dc5a633 100755 --- a/scripts/phono3py-load +++ b/scripts/phono3py-load @@ -36,8 +36,6 @@ from phono3py.cui.phono3py_script import main -if __name__ == '__main__': - argparse_control = {'fc_symmetry': True, - 'is_nac': True, - 'load_phono3py_yaml': True} +if __name__ == "__main__": + argparse_control = {"fc_symmetry": True, "is_nac": True, "load_phono3py_yaml": True} main(**argparse_control) diff --git a/setup.py b/setup.py index d115bc74..3066e9de 100644 --- a/setup.py +++ b/setup.py @@ -7,10 +7,12 @@ import sysconfig try: from setuptools import setup, Extension + use_setuptools = True print("setuptools is used.") except ImportError: from distutils.core import setup, Extension + use_setuptools = False print("distutils is used.") @@ -19,10 +21,10 @@ try: except ImportError: git_num = None -if 'setuptools_scm' in sys.modules.keys(): +if "setuptools_scm" in sys.modules.keys(): try: git_ver = get_version() - git_num = int(git_ver.split('.')[3].split('+')[0].replace("dev", "")) + git_num = int(git_ver.split(".")[3].split("+")[0].replace("dev", "")) except Exception: git_num = None @@ -30,19 +32,27 @@ include_dirs_numpy = [numpy.get_include()] extra_link_args = [] # Workaround Python issue 21121 config_var = sysconfig.get_config_var("CFLAGS") -if (config_var is not None and - "-Werror=declaration-after-statement" in config_var): # noqa E129 - os.environ['CFLAGS'] = config_var.replace( - "-Werror=declaration-after-statement", "") +if ( + config_var is not None and "-Werror=declaration-after-statement" in config_var +): # noqa E129 + os.environ["CFLAGS"] = config_var.replace("-Werror=declaration-after-statement", "") -extra_compile_args = ['-fopenmp', ] -include_dirs = ['c', ] + include_dirs_numpy +extra_compile_args = [ + "-fopenmp", +] +include_dirs = [ + "c", +] + include_dirs_numpy define_macros = [] if use_setuptools: - extra_compile_args += ['-DPHPYOPENMP', ] + extra_compile_args += [ + "-DPHPYOPENMP", + ] else: - define_macros += [('PHPYOPENMP', None), ] + define_macros += [ + ("PHPYOPENMP", None), + ] use_mkl = False @@ -94,11 +104,9 @@ if os.path.isfile("setup_mkl.py"): include_dirs_lapacke = mkl_include_dirs_lapacke if use_setuptools: - extra_compile_args += ['-DMKL_LAPACKE', - '-DMULTITHREADED_BLAS'] + extra_compile_args += ["-DMKL_LAPACKE", "-DMULTITHREADED_BLAS"] else: - define_macros += [('MKL_LAPACKE', None), - ('MULTITHREADED_BLAS', None)] + define_macros += [("MKL_LAPACKE", None), ("MULTITHREADED_BLAS", None)] elif os.path.isfile("libopenblas.py"): # This supposes that multithread openBLAS is used. # This is invoked when libopenblas.py exists on the current directory. @@ -108,66 +116,72 @@ elif os.path.isfile("libopenblas.py"): from libopenblas import ( extra_link_args_lapacke as obl_extra_link_args_lapacke, - include_dirs_lapacke as obl_include_dirs_lapacke) + include_dirs_lapacke as obl_include_dirs_lapacke, + ) + extra_link_args_lapacke = obl_extra_link_args_lapacke include_dirs_lapacke = obl_include_dirs_lapacke if use_setuptools: - extra_compile_args += ['-DMULTITHREADED_BLAS'] + extra_compile_args += ["-DMULTITHREADED_BLAS"] else: - define_macros += [('MULTITHREADED_BLAS', None)] -elif (platform.system() == 'Darwin' and - os.path.isfile('/opt/local/lib/libopenblas.a')): + define_macros += [("MULTITHREADED_BLAS", None)] +elif platform.system() == "Darwin" and os.path.isfile("/opt/local/lib/libopenblas.a"): # This supposes lapacke with single-thread openBLAS provided by MacPort is # used. # % sudo port install gcc6 # % sudo port select --set gcc mp-gcc # % sudo port install OpenBLAS +gcc6 - extra_link_args_lapacke = ['/opt/local/lib/libopenblas.a'] - include_dirs_lapacke = ['/opt/local/include'] -elif ('CONDA_PREFIX' in os.environ and - (os.path.isfile(os.path.join(os.environ['CONDA_PREFIX'], - 'lib', 'liblapacke.dylib')) or - os.path.isfile(os.path.join(os.environ['CONDA_PREFIX'], - 'lib', 'liblapacke.so')))): + extra_link_args_lapacke = ["/opt/local/lib/libopenblas.a"] + include_dirs_lapacke = ["/opt/local/include"] +elif "CONDA_PREFIX" in os.environ and ( + os.path.isfile(os.path.join(os.environ["CONDA_PREFIX"], "lib", "liblapacke.dylib")) + or os.path.isfile(os.path.join(os.environ["CONDA_PREFIX"], "lib", "liblapacke.so")) +): # This is for the system prepared with conda openblas. - extra_link_args_lapacke = ['-llapacke'] + extra_link_args_lapacke = ["-llapacke"] include_dirs_lapacke = [ - os.path.join(os.environ['CONDA_PREFIX'], 'include'), ] - if os.path.isfile(os.path.join(os.environ['CONDA_PREFIX'], - 'include', 'mkl.h')): + os.path.join(os.environ["CONDA_PREFIX"], "include"), + ] + if os.path.isfile(os.path.join(os.environ["CONDA_PREFIX"], "include", "mkl.h")): use_mkl = True if use_setuptools: - extra_compile_args += ['-DMKL_LAPACKE', - '-DMULTITHREADED_BLAS'] + extra_compile_args += ["-DMKL_LAPACKE", "-DMULTITHREADED_BLAS"] else: - define_macros += [('MKL_LAPACKE', None), - ('MULTITHREADED_BLAS', None)] + define_macros += [("MKL_LAPACKE", None), ("MULTITHREADED_BLAS", None)] else: if use_setuptools: - extra_compile_args += ['-DMULTITHREADED_BLAS'] + extra_compile_args += ["-DMULTITHREADED_BLAS"] else: - define_macros += [('MULTITHREADED_BLAS', None)] -elif ('CONDA_PREFIX' in os.environ and - (os.path.isfile(os.path.join(os.environ['CONDA_PREFIX'], - 'lib', 'libmkl_rt.dylib')) or - os.path.isfile(os.path.join(os.environ['CONDA_PREFIX'], - 'lib', 'libmkl_rt.so'))) and - (os.path.isfile(os.path.join(os.environ['CONDA_PREFIX'], - 'include', 'mkl_lapacke.h')))): + define_macros += [("MULTITHREADED_BLAS", None)] +elif ( + "CONDA_PREFIX" in os.environ + and ( + os.path.isfile( + os.path.join(os.environ["CONDA_PREFIX"], "lib", "libmkl_rt.dylib") + ) + or os.path.isfile( + os.path.join(os.environ["CONDA_PREFIX"], "lib", "libmkl_rt.so") + ) + ) + and ( + os.path.isfile( + os.path.join(os.environ["CONDA_PREFIX"], "include", "mkl_lapacke.h") + ) + ) +): include_dirs_lapacke = [ - os.path.join(os.environ['CONDA_PREFIX'], 'include'), ] - extra_link_args_lapacke = ['-lmkl_rt'] + os.path.join(os.environ["CONDA_PREFIX"], "include"), + ] + extra_link_args_lapacke = ["-lmkl_rt"] if use_setuptools: - extra_compile_args += ['-DMKL_LAPACKE', - '-DMULTITHREADED_BLAS'] + extra_compile_args += ["-DMKL_LAPACKE", "-DMULTITHREADED_BLAS"] else: - define_macros += [('MKL_LAPACKE', None), - ('MULTITHREADED_BLAS', None)] -elif os.path.isfile('/usr/lib/liblapacke.so'): + define_macros += [("MKL_LAPACKE", None), ("MULTITHREADED_BLAS", None)] +elif os.path.isfile("/usr/lib/liblapacke.so"): # This supposes that lapacke with single-thread BLAS is installed on # system. - extra_link_args_lapacke = ['-llapacke', '-llapack', '-lblas'] + extra_link_args_lapacke = ["-llapacke", "-llapack", "-lblas"] include_dirs_lapacke = [] else: # Here is the default lapacke linkage setting. @@ -183,41 +197,51 @@ else: # # For conda: Try installing with dynamic link library of openblas by # % conda install numpy scipy h5py pyyaml matplotlib openblas libgfortran - extra_link_args_lapacke = ['-lopenblas', '-lgfortran'] - if 'CONDA_PREFIX' in os.environ: + extra_link_args_lapacke = ["-lopenblas", "-lgfortran"] + if "CONDA_PREFIX" in os.environ: include_dirs_lapacke = [ - os.path.join(os.environ['CONDA_PREFIX'], 'include'), ] + os.path.join(os.environ["CONDA_PREFIX"], "include"), + ] if use_setuptools: - extra_compile_args += ['-DMULTITHREADED_BLAS'] + extra_compile_args += ["-DMULTITHREADED_BLAS"] else: - define_macros += [('MULTITHREADED_BLAS', None)] + define_macros += [("MULTITHREADED_BLAS", None)] cc = None lib_omp = None -if 'CC' in os.environ: - if 'clang' in os.environ['CC']: - cc = 'clang' +if "CC" in os.environ: + if "clang" in os.environ["CC"]: + cc = "clang" if not use_mkl: - lib_omp = '-lomp' + lib_omp = "-lomp" # lib_omp = '-liomp5' - if 'gcc' in os.environ['CC'] or 'gnu-cc' in os.environ['CC']: - cc = 'gcc' -if cc == 'gcc' or cc is None: - lib_omp = '-lgomp' + if "gcc" in os.environ["CC"] or "gnu-cc" in os.environ["CC"]: + cc = "gcc" +if cc == "gcc" or cc is None: + lib_omp = "-lgomp" - if 'CC' in os.environ and 'gcc-' in os.environ['CC']: + if "CC" in os.environ and "gcc-" in os.environ["CC"]: # For macOS & homebrew gcc: # Using conda's gcc is more recommended though. Suppose using # homebrew gcc whereas conda is used as general environment. # This is to avoid linking conda libgomp that is incompatible # with homebrew gcc. try: - v = int(os.environ['CC'].split('-')[1]) + v = int(os.environ["CC"].split("-")[1]) except ValueError: pass else: - ary = [os.sep, "usr", "local", "opt", "gcc@%d" % v, "lib", "gcc", - "%d" % v, "libgomp.a"] + ary = [ + os.sep, + "usr", + "local", + "opt", + "gcc@%d" % v, + "lib", + "gcc", + "%d" % v, + "libgomp.a", + ] libgomp_a = os.path.join(*ary) if os.path.isfile(libgomp_a): lib_omp = libgomp_a @@ -232,87 +256,96 @@ extra_link_args += extra_link_args_lapacke include_dirs += include_dirs_lapacke print("extra_link_args", extra_link_args) -sources_phono3py = ['c/_phono3py.c', - 'c/bzgrid.c', - 'c/collision_matrix.c', - 'c/fc3.c', - 'c/grgrid.c', - 'c/imag_self_energy_with_g.c', - 'c/interaction.c', - 'c/isotope.c', - 'c/lagrid.c', - 'c/lapack_wrapper.c', - 'c/phono3py.c', - 'c/phonoc_utils.c', - 'c/pp_collision.c', - 'c/real_self_energy.c', - 'c/real_to_reciprocal.c', - 'c/reciprocal_to_normal.c', - 'c/snf3x3.c', - 'c/tetrahedron_method.c', - 'c/triplet.c', - 'c/triplet_grid.c', - 'c/triplet_iw.c'] +sources_phono3py = [ + "c/_phono3py.c", + "c/bzgrid.c", + "c/collision_matrix.c", + "c/fc3.c", + "c/grgrid.c", + "c/imag_self_energy_with_g.c", + "c/interaction.c", + "c/isotope.c", + "c/lagrid.c", + "c/lapack_wrapper.c", + "c/phono3py.c", + "c/phonoc_utils.c", + "c/pp_collision.c", + "c/real_self_energy.c", + "c/real_to_reciprocal.c", + "c/reciprocal_to_normal.c", + "c/snf3x3.c", + "c/tetrahedron_method.c", + "c/triplet.c", + "c/triplet_grid.c", + "c/triplet_iw.c", +] extension_phono3py = Extension( - 'phono3py._phono3py', + "phono3py._phono3py", include_dirs=include_dirs, extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, define_macros=define_macros, - sources=sources_phono3py) + sources=sources_phono3py, +) -sources_phononmod = ['c/_phononmod.c', - 'c/dynmat.c', - 'c/lapack_wrapper.c', - 'c/phonon.c', - 'c/phononmod.c'] +sources_phononmod = [ + "c/_phononmod.c", + "c/dynmat.c", + "c/lapack_wrapper.c", + "c/phonon.c", + "c/phononmod.c", +] extension_phononmod = Extension( - 'phono3py._phononmod', + "phono3py._phononmod", include_dirs=include_dirs, extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, - sources=sources_phononmod) + sources=sources_phononmod, +) -sources_lapackepy = ['c/_lapackepy.c', - 'c/lapack_wrapper.c'] +sources_lapackepy = ["c/_lapackepy.c", "c/lapack_wrapper.c"] extension_lapackepy = Extension( - 'phono3py._lapackepy', + "phono3py._lapackepy", extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, include_dirs=include_dirs, - sources=sources_lapackepy) + sources=sources_lapackepy, +) -packages_phono3py = ['phono3py', - 'phono3py.cui', - 'phono3py.interface', - 'phono3py.other', - 'phono3py.phonon', - 'phono3py.phonon3', - 'phono3py.sscha'] -scripts_phono3py = ['scripts/phono3py', - 'scripts/phono3py-load', - 'scripts/phono3py-kaccum', - 'scripts/phono3py-kdeplot', - 'scripts/phono3py-coleigplot'] +packages_phono3py = [ + "phono3py", + "phono3py.cui", + "phono3py.interface", + "phono3py.other", + "phono3py.phonon", + "phono3py.phonon3", + "phono3py.sscha", +] +scripts_phono3py = [ + "scripts/phono3py", + "scripts/phono3py-load", + "scripts/phono3py-kaccum", + "scripts/phono3py-kdeplot", + "scripts/phono3py-coleigplot", +] ######################## # _lapackepy extension # ######################## -if __name__ == '__main__': +if __name__ == "__main__": version_nums = [None, None, None] with open("phono3py/version.py") as w: for line in w: if "__version__" in line: - for i, num in enumerate( - line.split()[2].strip('\"').split('.')): + for i, num in enumerate(line.split()[2].strip('"').split(".")): version_nums[i] = num break # To deploy to pypi by travis-CI if os.path.isfile("__nanoversion__.txt"): nanoversion = 0 - with open('__nanoversion__.txt') as nv: + with open("__nanoversion__.txt") as nv: try: for line in nv: nanoversion = int(line.strip()) @@ -333,33 +366,47 @@ if __name__ == '__main__': version += "-%d" % version_nums[3] if use_setuptools: - setup(name='phono3py', - version=version, - description='This is the phono3py module.', - author='Atsushi Togo', - author_email='atz.togo@gmail.com', - url='http://phonopy.github.io/phono3py/', - packages=packages_phono3py, - python_requires='>=3.5', - install_requires=['numpy', 'scipy', 'PyYAML', 'matplotlib', - 'h5py', 'spglib', 'phonopy>=2.11,<2.12'], - provides=['phono3py'], - scripts=scripts_phono3py, - ext_modules=[extension_phono3py, - extension_lapackepy, - extension_phononmod]) + setup( + name="phono3py", + version=version, + description="This is the phono3py module.", + author="Atsushi Togo", + author_email="atz.togo@gmail.com", + url="http://phonopy.github.io/phono3py/", + packages=packages_phono3py, + python_requires=">=3.5", + install_requires=[ + "numpy", + "scipy", + "PyYAML", + "matplotlib", + "h5py", + "spglib", + "phonopy>=2.11,<2.12", + ], + provides=["phono3py"], + scripts=scripts_phono3py, + ext_modules=[extension_phono3py, extension_lapackepy, extension_phononmod], + ) else: - setup(name='phono3py', - version=version, - description='This is the phono3py module.', - author='Atsushi Togo', - author_email='atz.togo@gmail.com', - url='http://phonopy.github.io/phono3py/', - packages=packages_phono3py, - requires=['numpy', 'scipy', 'PyYAML', 'matplotlib', 'h5py', - 'phonopy', 'spglib'], - provides=['phono3py'], - scripts=scripts_phono3py, - ext_modules=[extension_phono3py, - extension_lapackepy, - extension_phononmod]) + setup( + name="phono3py", + version=version, + description="This is the phono3py module.", + author="Atsushi Togo", + author_email="atz.togo@gmail.com", + url="http://phonopy.github.io/phono3py/", + packages=packages_phono3py, + requires=[ + "numpy", + "scipy", + "PyYAML", + "matplotlib", + "h5py", + "phonopy", + "spglib", + ], + provides=["phono3py"], + scripts=scripts_phono3py, + ext_modules=[extension_phono3py, extension_lapackepy, extension_phononmod], + ) diff --git a/test/FORCES_FC3_si_pbesol b/test/FORCES_FC3_si_pbesol index 9fe6ca7b..a6db2bb8 100644 --- a/test/FORCES_FC3_si_pbesol +++ b/test/FORCES_FC3_si_pbesol @@ -1,4 +1,4 @@ -# File: 1 +# File: 1 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3968201400 0.0000000000 0.0000000000 0.0005878300 0.0000000000 0.0000000000 @@ -64,7 +64,7 @@ -0.0003760000 0.0009874300 -0.0009874300 -0.0014775900 0.0009712500 -0.0011918000 0.0006882300 0.0007423100 -0.0007584100 -# File: 2 +# File: 2 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 1 0.0212132034355964 0.0212132034355964 0.0000000000000000 -0.6772678900 -0.2819277000 -0.0358889800 @@ -131,7 +131,7 @@ 0.0000464900 0.0006116300 -0.0025198500 -0.0018160900 0.0013707700 -0.0027515600 0.0017720700 0.0018204600 -0.0018547700 -# File: 3 +# File: 3 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 1 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 -0.1163652300 0.2806988700 0.0061513100 @@ -198,7 +198,7 @@ -0.0008199100 0.0013657300 0.0005330100 -0.0011352000 0.0005498300 0.0003556500 -0.0003131800 -0.0002539400 0.0002896400 -# File: 4 +# File: 4 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 2 0.0212132034355964 0.0212132034355964 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -265,7 +265,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 5 +# File: 5 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 2 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -332,7 +332,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 6 +# File: 6 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 3 0.0212132034355964 0.0212132034355964 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -399,7 +399,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 7 +# File: 7 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 3 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -466,7 +466,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 8 +# File: 8 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 3 0.0000000000000000 0.0000000000000000 0.0300000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -533,7 +533,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 9 +# File: 9 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 4 0.0212132034355964 0.0212132034355964 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -600,7 +600,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 10 +# File: 10 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 4 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -667,7 +667,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 11 +# File: 11 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 4 0.0000000000000000 0.0000000000000000 0.0300000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -734,7 +734,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 12 +# File: 12 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 7 0.0212132034355964 0.0212132034355964 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -801,7 +801,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 13 +# File: 13 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 7 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -868,7 +868,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 14 +# File: 14 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 8 0.0212132034355964 0.0212132034355964 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -935,7 +935,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 15 +# File: 15 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 8 -0.0212132034355964 -0.0212132034355964 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -1002,7 +1002,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 16 +# File: 16 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3939519800 0.0058183400 0.0055670600 @@ -1069,7 +1069,7 @@ -0.0011158200 0.0071295100 -0.0017236700 -0.0021824700 0.0016148900 -0.0018983100 -0.0000840200 0.0001823900 -0.0015351500 -# File: 17 +# File: 17 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3995693700 -0.0056732700 -0.0054537400 @@ -1136,7 +1136,7 @@ 0.0003523300 -0.0050800000 -0.0002632500 -0.0007213000 0.0002821600 -0.0004471400 0.0014498900 0.0013010900 0.0000075200 -# File: 18 +# File: 18 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4096762700 -0.0027672400 -0.0027672400 @@ -1203,7 +1203,7 @@ 0.0003150300 0.0002352300 -0.0002470100 0.0045852800 0.0002387800 -0.0004704200 0.0001221800 -0.0000216700 0.0000057500 -# File: 19 +# File: 19 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 9 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3840574800 0.0026527000 0.0026527000 @@ -1270,7 +1270,7 @@ -0.0010215900 0.0016873400 -0.0016892500 -0.0076171900 0.0017148000 -0.0019246100 0.0012551900 0.0015167100 -0.0015331800 -# File: 20 +# File: 20 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -1337,7 +1337,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 21 +# File: 21 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0000000000000000 -0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -1404,7 +1404,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 22 +# File: 22 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -1471,7 +1471,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 23 +# File: 23 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 10 -0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -1538,7 +1538,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 24 +# File: 24 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3942721300 0.0055232600 -0.0055693500 @@ -1605,7 +1605,7 @@ -0.0011499800 0.0004245700 -0.0017635200 -0.0026397000 -0.0005482000 -0.0022072200 -0.0000416200 0.0068803000 -0.0014963400 -# File: 25 +# File: 25 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3994511000 -0.0056719200 0.0056871700 @@ -1672,7 +1672,7 @@ 0.0003878200 0.0015493200 -0.0002221700 -0.0002819400 0.0024461600 -0.0002141500 0.0014056300 -0.0053204600 -0.0000317000 -# File: 26 +# File: 26 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4094040500 -0.0026590200 0.0026590200 @@ -1739,7 +1739,7 @@ -0.0009416200 0.0002241800 -0.0002241800 -0.0029449200 -0.0002196900 -0.0002196900 0.0013761300 -0.0000185400 -0.0000185400 -# File: 27 +# File: 27 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 11 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3841483200 0.0027636500 -0.0027636500 @@ -1806,7 +1806,7 @@ 0.0001909600 0.0017614800 -0.0017614800 0.0000339600 0.0021291800 -0.0022017700 0.0000443400 0.0014513300 -0.0014599500 -# File: 28 +# File: 28 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0000000000000000 0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -1873,7 +1873,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 29 +# File: 29 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0000000000000000 -0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -1940,7 +1940,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 30 +# File: 30 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -2007,7 +2007,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 31 +# File: 31 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 12 -0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -2074,7 +2074,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 32 +# File: 32 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3912195600 0.0028279300 0.0054555400 @@ -2141,7 +2141,7 @@ 0.0002656400 0.0002862400 -0.0016890300 0.0046556100 0.0002316900 -0.0019368100 0.0001290900 -0.0000268600 -0.0015301000 -# File: 33 +# File: 33 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4022598900 -0.0027286100 -0.0053310000 @@ -2208,7 +2208,7 @@ -0.0010619900 0.0017406700 -0.0002478100 -0.0075354300 0.0016990100 -0.0004580200 0.0012456800 0.0015011500 0.0000026100 -# File: 34 +# File: 34 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3994687700 -0.0127760000 -0.0027506100 @@ -2275,7 +2275,7 @@ -0.0011004300 0.0070552500 -0.0002603300 -0.0022238500 0.0016535300 -0.0004484400 -0.0000694700 0.0001870000 -0.0000080800 -# File: 35 +# File: 35 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3942633300 0.0126801700 0.0026584600 @@ -2342,7 +2342,7 @@ 0.0003603700 -0.0051557700 -0.0017261500 -0.0007833600 0.0003330800 -0.0018971100 0.0014562500 0.0012990700 -0.0015190500 -# File: 36 +# File: 36 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3913025800 0.0026982300 0.0055713200 @@ -2409,7 +2409,7 @@ -0.0011172800 0.0017446000 -0.0003033800 -0.0022495100 0.0017173300 -0.0004984200 -0.0000734500 0.0015063600 -0.0013129100 -# File: 37 +# File: 37 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 17 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.4022123900 -0.0025993400 -0.0054154600 @@ -2476,7 +2476,7 @@ 0.0003277600 0.0002820900 -0.0016269400 -0.0007572900 0.0002624200 -0.0018406900 0.0014602000 -0.0000321000 -0.0002026000 -# File: 38 +# File: 38 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3910727700 0.0025787300 -0.0056932700 @@ -2543,7 +2543,7 @@ -0.0018978800 -0.0001687600 -0.0019961700 -0.0020425100 0.0001951200 -0.0019656400 0.0068282400 -0.0000010700 -0.0014910300 -# File: 39 +# File: 39 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4026992700 -0.0026814200 0.0057988800 @@ -2610,7 +2610,7 @@ 0.0011020100 0.0021762000 -0.0000163700 -0.0009140200 0.0017362800 -0.0004283900 -0.0053761900 0.0014741000 -0.0000373600 -# File: 40 +# File: 40 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3995611300 -0.0126866900 0.0026337500 @@ -2677,7 +2677,7 @@ -0.0015659200 -0.0004928900 -0.0000141500 -0.0022390100 0.0004112000 -0.0004265700 -0.0000770100 0.0014263300 -0.0000135700 -# File: 41 +# File: 41 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3939515700 0.0127725200 -0.0027612100 @@ -2744,7 +2744,7 @@ 0.0007814900 0.0025119400 -0.0019984800 -0.0007057500 0.0015317400 -0.0019676600 0.0014017500 0.0001028200 -0.0014650400 -# File: 42 +# File: 42 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.4025581500 -0.0028185000 0.0059146900 @@ -2811,7 +2811,7 @@ -0.0013599000 0.0019795600 -0.0013599000 -0.0022392200 0.0017345700 -0.0017501200 -0.0000726800 0.0014863900 -0.0000726800 -# File: 43 +# File: 43 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 18 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3911868900 0.0027150800 -0.0057777000 @@ -2878,7 +2878,7 @@ 0.0006137700 -0.0000098100 -0.0006209000 -0.0007054500 0.0001968400 -0.0006323400 0.0013966300 0.0000364600 -0.0013995100 -# File: 44 +# File: 44 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -2945,7 +2945,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 45 +# File: 45 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 -0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3012,7 +3012,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 46 +# File: 46 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3079,7 +3079,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 47 +# File: 47 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 -0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3146,7 +3146,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 48 +# File: 48 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0000000000000000 0.0300000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3213,7 +3213,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 49 +# File: 49 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 19 0.0000000000000000 0.0000000000000000 -0.0300000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3280,7 +3280,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 50 +# File: 50 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3347,7 +3347,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 51 +# File: 51 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 -0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3414,7 +3414,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 52 +# File: 52 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3481,7 +3481,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 53 +# File: 53 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 -0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3548,7 +3548,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 54 +# File: 54 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0000000000000000 0.0300000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3615,7 +3615,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 55 +# File: 55 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 20 0.0000000000000000 0.0000000000000000 -0.0300000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3682,7 +3682,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 56 +# File: 56 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0000000000000000 0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3749,7 +3749,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 57 +# File: 57 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0000000000000000 -0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3816,7 +3816,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 58 +# File: 58 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3883,7 +3883,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 59 +# File: 59 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 33 -0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -3950,7 +3950,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 60 +# File: 60 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0000000000000000 0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -4017,7 +4017,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 61 +# File: 61 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0000000000000000 -0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -4084,7 +4084,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 62 +# File: 62 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -4151,7 +4151,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 63 +# File: 63 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 34 -0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -4218,7 +4218,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 64 +# File: 64 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -4285,7 +4285,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 65 +# File: 65 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 -0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -4352,7 +4352,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 66 +# File: 66 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -4419,7 +4419,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 67 +# File: 67 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 -0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -4486,7 +4486,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 68 +# File: 68 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0000000000000000 0.0300000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -4553,7 +4553,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 69 +# File: 69 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 35 0.0000000000000000 0.0000000000000000 -0.0300000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -4620,7 +4620,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 70 +# File: 70 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3983412100 0.0012465100 0.0009906200 @@ -4687,7 +4687,7 @@ 0.0006894700 0.0028241900 -0.0007455800 -0.0004142700 0.0028222400 -0.0014325600 0.0017550100 -0.0010964100 -0.0009985600 -# File: 71 +# File: 71 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3952542700 -0.0012124900 -0.0010290400 @@ -4754,7 +4754,7 @@ -0.0014370900 -0.0008636900 -0.0012297100 -0.0025449300 -0.0008658100 -0.0009514600 -0.0003748500 0.0025960700 -0.0005177300 -# File: 72 +# File: 72 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3956611600 -0.0014223600 0.0009709800 @@ -4821,7 +4821,7 @@ 0.0014767500 0.0020501100 -0.0012302400 0.0003607500 0.0020380100 -0.0009486600 -0.0011486200 0.0018093900 -0.0010012400 -# File: 73 +# File: 73 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3979468600 0.0014677600 -0.0010099800 @@ -4888,7 +4888,7 @@ -0.0022135500 -0.0000793100 -0.0007448500 -0.0033301500 -0.0000922000 -0.0014350500 0.0025393600 -0.0003204400 -0.0005152800 -# File: 74 +# File: 74 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3957947400 0.0009494800 -0.0003788600 @@ -4955,7 +4955,7 @@ -0.0006146600 0.0012267600 -0.0010249800 -0.0012401100 0.0007324300 -0.0012281200 0.0009333200 0.0009868900 -0.0007684300 -# File: 75 +# File: 75 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 36 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3978485800 -0.0009568600 0.0003728800 @@ -5022,7 +5022,7 @@ -0.0001307100 0.0007419500 -0.0009746000 -0.0017211600 0.0012155700 -0.0011800900 0.0004491400 0.0005042700 -0.0007237000 -# File: 76 +# File: 76 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3958428300 -0.0014597800 0.0011913500 @@ -5089,7 +5089,7 @@ 0.0051363000 0.0065841100 0.0016759800 0.0041531900 0.0067145400 -0.0039459300 -0.0049390600 0.0064864900 0.0020007300 -# File: 77 +# File: 77 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3978331200 0.0015031600 -0.0011598500 @@ -5156,7 +5156,7 @@ -0.0060033500 -0.0047559900 -0.0037523000 -0.0069926400 -0.0046258300 0.0014612500 0.0061995600 -0.0048546800 -0.0034162600 -# File: 78 +# File: 78 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3971898300 0.0009842300 0.0009842300 @@ -5223,7 +5223,7 @@ 0.0052211100 0.0064986700 0.0016718500 0.0042657900 0.0065951800 -0.0039506000 0.0062829300 -0.0047702600 -0.0034153900 -# File: 79 +# File: 79 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 39 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3964552900 -0.0009894900 -0.0009894900 @@ -5290,7 +5290,7 @@ -0.0061194500 -0.0046397000 -0.0037478200 -0.0070741500 -0.0045377600 0.0014659400 -0.0050535900 0.0063708400 0.0019997700 -# File: 80 +# File: 80 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3259103400 0.1011996400 0.0731806400 @@ -5357,7 +5357,7 @@ -0.0058795400 0.0065857300 -0.0036704000 -0.0071339400 0.0067334700 0.0015759200 0.0063148700 0.0065112900 -0.0035701800 -# File: 81 +# File: 81 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.4734658100 -0.1040813600 -0.0791169700 @@ -5424,7 +5424,7 @@ 0.0052433600 -0.0047589300 0.0017964300 0.0040636400 -0.0046444700 -0.0038603700 -0.0048236300 -0.0048780500 0.0019509300 -# File: 82 +# File: 82 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.2984766100 0.0710577600 0.0710577600 @@ -5491,7 +5491,7 @@ 0.0053588800 -0.0046358300 0.0017625400 0.0041196900 -0.0045453800 -0.0038215100 0.0063960300 0.0063885700 -0.0034945400 -# File: 83 +# File: 83 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 40 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4976123500 -0.0766133800 -0.0766133800 @@ -5558,7 +5558,7 @@ -0.0059625600 0.0064947800 -0.0036361700 -0.0072202000 0.0066026400 0.0015382500 -0.0048723100 -0.0047884200 0.0018754700 -# File: 84 +# File: 84 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3982967000 -0.0009912600 0.0011047900 @@ -5625,7 +5625,7 @@ -0.0003861000 0.0012296000 -0.0007420400 -0.0142556800 0.0037332000 -0.0039533800 0.0006523100 0.0009814200 -0.0009941000 -# File: 85 +# File: 85 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3953871700 0.0009543800 -0.0011362300 @@ -5692,7 +5692,7 @@ -0.0003409200 0.0007513500 -0.0012266200 0.0112097700 -0.0016815100 0.0014600600 0.0006993500 0.0004973300 -0.0005166000 -# File: 86 +# File: 86 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3977680500 -0.0003737100 -0.0010249400 @@ -5759,7 +5759,7 @@ -0.0006158000 0.0020540300 -0.0028240100 -0.0041367100 0.0065638900 -0.0067019100 0.0004458700 0.0018036100 0.0010909200 -# File: 87 +# File: 87 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3958649400 0.0003677000 0.0010280600 @@ -5826,7 +5826,7 @@ -0.0001354800 -0.0000752000 0.0008634600 0.0012823500 -0.0047689200 0.0044337500 0.0009299700 -0.0003226500 -0.0025931000 -# File: 88 +# File: 88 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0000000000000000 0.0300000000000000 -0.3956283600 -0.0010072400 -0.0015755800 @@ -5893,7 +5893,7 @@ -0.0006164800 -0.0008500300 0.0000787900 0.0012815900 -0.0046546400 0.0045491100 0.0009292800 0.0025766100 0.0003078600 -# File: 89 +# File: 89 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 49 0.0000000000000000 0.0000000000000000 -0.0300000000000000 -0.3980447900 0.0009709500 0.0015326000 @@ -5960,7 +5960,7 @@ -0.0001347700 0.0028393800 -0.0020496500 -0.0041361100 0.0064811000 -0.0067859400 0.0004465800 -0.0011061500 -0.0018207500 -# File: 90 +# File: 90 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -6027,7 +6027,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 91 +# File: 91 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 -0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -6094,7 +6094,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 92 +# File: 92 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -6161,7 +6161,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 93 +# File: 93 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 -0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -6228,7 +6228,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 94 +# File: 94 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0000000000000000 0.0300000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -6295,7 +6295,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 95 +# File: 95 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 50 0.0000000000000000 0.0000000000000000 -0.0300000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -6362,7 +6362,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 96 +# File: 96 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.4571417700 0.0903113000 -0.0584047600 @@ -6429,7 +6429,7 @@ -0.0006199600 0.0020587400 0.0008626400 -0.0042382900 0.0067158000 0.0044205900 0.0004377500 0.0018017100 -0.0025776600 -# File: 97 +# File: 97 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3313446300 -0.0929414100 0.0633816100 @@ -6496,7 +6496,7 @@ -0.0001322600 -0.0000878000 -0.0028235700 0.0011829100 -0.0046276200 -0.0066884100 0.0009391500 -0.0003134200 0.0010745000 -# File: 98 +# File: 98 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3012259200 -0.0654834700 0.0654834700 @@ -6563,7 +6563,7 @@ -0.0004016400 0.0012272000 -0.0012272000 -0.0141716700 0.0036370400 0.0014766100 0.0006679400 0.0009776600 -0.0005061300 -# File: 99 +# File: 99 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 51 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.4893953100 0.0601783600 -0.0601783600 @@ -6630,7 +6630,7 @@ -0.0003750300 0.0007416000 -0.0007416000 0.0113051700 -0.0018040000 -0.0039688600 0.0007326300 0.0005130700 -0.0010050100 -# File: 100 +# File: 100 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0000000000000000 0.0300000000000000 0.0000000000000000 -0.3977851900 -0.0014959500 -0.0011912300 @@ -6697,7 +6697,7 @@ -0.0030341100 0.0065870500 -0.0064997600 -0.0017166400 0.0020374900 -0.0030292900 -0.0020709400 0.0064873400 0.0048654500 -# File: 101 +# File: 101 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0000000000000000 -0.0300000000000000 0.0000000000000000 -0.3958154300 0.0015410800 0.0011570700 @@ -6764,7 +6764,7 @@ 0.0023835100 -0.0047589600 0.0046404200 -0.0012382300 -0.0000916700 0.0006601800 0.0033463000 -0.0048550600 -0.0062665500 -# File: 102 +# File: 102 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3971955700 -0.0009945400 0.0009945400 @@ -6831,7 +6831,7 @@ -0.0131484300 0.0037489900 -0.0037489900 -0.0014878100 0.0012141900 -0.0009478800 -0.0120006500 0.0034003000 0.0018962100 -# File: 103 +# File: 103 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 52 -0.0300000000000000 0.0000000000000000 0.0000000000000000 -0.3964374700 0.0009893800 -0.0009893800 @@ -6898,7 +6898,7 @@ 0.0123058700 -0.0016643900 0.0016643900 -0.0014426300 0.0007341800 -0.0014293800 0.0134673900 -0.0020249000 -0.0035227600 -# File: 104 +# File: 104 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0000000000000000 0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -6965,7 +6965,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 105 +# File: 105 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0000000000000000 -0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -7032,7 +7032,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 106 +# File: 106 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -7099,7 +7099,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 107 +# File: 107 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 53 -0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -7166,7 +7166,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 108 +# File: 108 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0000000000000000 0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -7233,7 +7233,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 109 +# File: 109 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0000000000000000 -0.0300000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -7300,7 +7300,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 110 +# File: 110 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 @@ -7367,7 +7367,7 @@ 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 -# File: 111 +# File: 111 # 1 0.0300000000000000 0.0000000000000000 0.0000000000000000 # 54 -0.0300000000000000 0.0000000000000000 0.0000000000000000 0.0000000000 0.0000000000 0.0000000000 diff --git a/test/conftest.py b/test/conftest.py index 545839e6..aa9a3c2d 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -13,19 +13,21 @@ store_dense_gp_map = True def pytest_addoption(parser): """Activate v1 emulation with --v1 option.""" parser.addoption( - "--v1", action="store_false", default=True, - help="Run with phono3py v1.x emulation." + "--v1", + action="store_false", + default=True, + help="Run with phono3py v1.x emulation.", ) -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def agno2_cell(): """Return AgNO2 cell (Imm2).""" cell = read_cell_yaml(os.path.join(current_dir, "AgNO2_cell.yaml")) return cell -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def si_pbesol(request): """Return Phono3py instance of Si 2x2x2. @@ -35,15 +37,17 @@ def si_pbesol(request): """ yaml_filename = os.path.join(current_dir, "phono3py_si_pbesol.yaml") forces_fc3_filename = os.path.join(current_dir, "FORCES_FC3_si_pbesol") - enable_v2 = request.config.getoption('--v1') - return phono3py.load(yaml_filename, - forces_fc3_filename=forces_fc3_filename, - store_dense_gp_map=enable_v2, - store_dense_svecs=enable_v2, - log_level=1) + enable_v2 = request.config.getoption("--v1") + return phono3py.load( + yaml_filename, + forces_fc3_filename=forces_fc3_filename, + store_dense_gp_map=enable_v2, + store_dense_svecs=enable_v2, + log_level=1, + ) -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def si_pbesol_nosym(request): """Return Phono3py instance of Si 2x2x2. @@ -53,17 +57,19 @@ def si_pbesol_nosym(request): """ yaml_filename = os.path.join(current_dir, "phono3py_si_pbesol.yaml") forces_fc3_filename = os.path.join(current_dir, "FORCES_FC3_si_pbesol") - enable_v2 = request.config.getoption('--v1') - return phono3py.load(yaml_filename, - forces_fc3_filename=forces_fc3_filename, - is_symmetry=False, - produce_fc=False, - store_dense_gp_map=enable_v2, - store_dense_svecs=enable_v2, - log_level=1) + enable_v2 = request.config.getoption("--v1") + return phono3py.load( + yaml_filename, + forces_fc3_filename=forces_fc3_filename, + is_symmetry=False, + produce_fc=False, + store_dense_gp_map=enable_v2, + store_dense_svecs=enable_v2, + log_level=1, + ) -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def si_pbesol_nomeshsym(request): """Return Phono3py instance of Si 2x2x2. @@ -73,17 +79,19 @@ def si_pbesol_nomeshsym(request): """ yaml_filename = os.path.join(current_dir, "phono3py_si_pbesol.yaml") forces_fc3_filename = os.path.join(current_dir, "FORCES_FC3_si_pbesol") - enable_v2 = request.config.getoption('--v1') - return phono3py.load(yaml_filename, - forces_fc3_filename=forces_fc3_filename, - is_mesh_symmetry=False, - produce_fc=False, - store_dense_gp_map=enable_v2, - store_dense_svecs=enable_v2, - log_level=1) + enable_v2 = request.config.getoption("--v1") + return phono3py.load( + yaml_filename, + forces_fc3_filename=forces_fc3_filename, + is_mesh_symmetry=False, + produce_fc=False, + store_dense_gp_map=enable_v2, + store_dense_svecs=enable_v2, + log_level=1, + ) -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def si_pbesol_compact_fc(request): """Return Phono3py instance of Si 2x2x2. @@ -93,16 +101,18 @@ def si_pbesol_compact_fc(request): """ yaml_filename = os.path.join(current_dir, "phono3py_si_pbesol.yaml") forces_fc3_filename = os.path.join(current_dir, "FORCES_FC3_si_pbesol") - enable_v2 = request.config.getoption('--v1') - return phono3py.load(yaml_filename, - forces_fc3_filename=forces_fc3_filename, - is_compact_fc=True, - store_dense_gp_map=enable_v2, - store_dense_svecs=enable_v2, - log_level=1) + enable_v2 = request.config.getoption("--v1") + return phono3py.load( + yaml_filename, + forces_fc3_filename=forces_fc3_filename, + is_compact_fc=True, + store_dense_gp_map=enable_v2, + store_dense_svecs=enable_v2, + log_level=1, + ) -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def si_pbesol_111(request): """Return Phono3py instance of Si 1x1x1. @@ -111,14 +121,16 @@ def si_pbesol_111(request): """ yaml_filename = os.path.join(current_dir, "phono3py_params_Si111.yaml") - enable_v2 = request.config.getoption('--v1') - return phono3py.load(yaml_filename, - store_dense_gp_map=enable_v2, - store_dense_svecs=enable_v2, - log_level=1) + enable_v2 = request.config.getoption("--v1") + return phono3py.load( + yaml_filename, + store_dense_gp_map=enable_v2, + store_dense_svecs=enable_v2, + log_level=1, + ) -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def si_pbesol_iterha_111(): """Return Phono3py instance of Si 1x1x1. @@ -126,14 +138,11 @@ def si_pbesol_iterha_111(): * no fc """ - yaml_filename = os.path.join(current_dir, - "phonopy_params-Si111-iterha.yaml.gz") - return phonopy.load(yaml_filename, - log_level=1, - produce_fc=False) + yaml_filename = os.path.join(current_dir, "phonopy_params-Si111-iterha.yaml.gz") + return phonopy.load(yaml_filename, log_level=1, produce_fc=False) -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def nacl_pbe(request): """Return Phono3py instance of NaCl 2x2x2. @@ -141,47 +150,49 @@ def nacl_pbe(request): * compact fc """ - yaml_filename = os.path.join(current_dir, - "phono3py_params_NaCl222.yaml.xz") - enable_v2 = request.config.getoption('--v1') - return phono3py.load(yaml_filename, - store_dense_gp_map=enable_v2, - store_dense_svecs=enable_v2, - log_level=1) + yaml_filename = os.path.join(current_dir, "phono3py_params_NaCl222.yaml.xz") + enable_v2 = request.config.getoption("--v1") + return phono3py.load( + yaml_filename, + store_dense_gp_map=enable_v2, + store_dense_svecs=enable_v2, + log_level=1, + ) -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def nacl_pbe_cutoff_fc3(request): """Return Phono3py instance of NaCl 2x2x2. * cutoff pair with 5 """ - yaml_filename = os.path.join(current_dir, - "phono3py_params_NaCl222.yaml.xz") - enable_v2 = request.config.getoption('--v1') - ph3 = phono3py.load(yaml_filename, - store_dense_gp_map=enable_v2, - store_dense_svecs=enable_v2, - produce_fc=False, - log_level=1) + yaml_filename = os.path.join(current_dir, "phono3py_params_NaCl222.yaml.xz") + enable_v2 = request.config.getoption("--v1") + ph3 = phono3py.load( + yaml_filename, + store_dense_gp_map=enable_v2, + store_dense_svecs=enable_v2, + produce_fc=False, + log_level=1, + ) forces = ph3.forces ph3.generate_displacements(cutoff_pair_distance=5) dataset = ph3.dataset - dataset['first_atoms'][0]['forces'] = forces[0] - dataset['first_atoms'][1]['forces'] = forces[1] + dataset["first_atoms"][0]["forces"] = forces[0] + dataset["first_atoms"][1]["forces"] = forces[1] count = 2 - for first_atoms in dataset['first_atoms']: - for second_atoms in first_atoms['second_atoms']: - assert second_atoms['id'] == count + 1 - second_atoms['forces'] = forces[count] + for first_atoms in dataset["first_atoms"]: + for second_atoms in first_atoms["second_atoms"]: + assert second_atoms["id"] == count + 1 + second_atoms["forces"] = forces[count] count += 1 ph3.dataset = dataset ph3.produce_fc3(symmetrize_fc3r=True) return ph3 -@pytest.fixture(scope='session') +@pytest.fixture(scope="session") def aln_lda(request): """Return Phono3py instance of AlN 3x3x2. @@ -189,10 +200,11 @@ def aln_lda(request): * full fc. """ - yaml_filename = os.path.join(current_dir, - "phono3py_params_AlN332.yaml.xz") - enable_v2 = request.config.getoption('--v1') - return phono3py.load(yaml_filename, - store_dense_gp_map=enable_v2, - store_dense_svecs=enable_v2, - log_level=1) + yaml_filename = os.path.join(current_dir, "phono3py_params_AlN332.yaml.xz") + enable_v2 = request.config.getoption("--v1") + return phono3py.load( + yaml_filename, + store_dense_gp_map=enable_v2, + store_dense_svecs=enable_v2, + log_level=1, + ) diff --git a/test/cui/test_kaccum.py b/test/cui/test_kaccum.py index 014e8ab8..9723adfe 100644 --- a/test/cui/test_kaccum.py +++ b/test/cui/test_kaccum.py @@ -1,69 +1,200 @@ """Test for kaccum.py.""" import numpy as np -from phono3py.cui.kaccum import ( - KappaDOS, _get_mfp) +from phono3py.cui.kaccum import KappaDOS, _get_mfp from phono3py.phonon.grid import get_ir_grid_points -kappados_si = [-0.0000002, 0.0000000, 0.0000000, - 1.6966400, 2.1977566, 5.1814323, - 3.3932803, 25.8022392, 15.5096766, - 5.0899206, 56.6994259, 19.4995156, - 6.7865608, 68.7759426, 3.2465477, - 8.4832011, 72.8398965, 1.6583881, - 10.1798413, 74.8143686, 0.7945952, - 11.8764816, 77.2489625, 5.4385183, - 13.5731219, 80.9162245, 0.5998735, - 15.2697621, 81.4303646, 0.0000000] -mfpdos_si = [0.0000000, 0.0000000, 0.0000000, - 806.8089241, 33.7703552, 0.0225548, - 1613.6178483, 45.0137786, 0.0103479, - 2420.4267724, 53.3456168, 0.0106724, - 3227.2356966, 62.4915811, 0.0107850, - 4034.0446207, 69.8839011, 0.0075919, - 4840.8535449, 74.8662085, 0.0049228, - 5647.6624690, 78.2273252, 0.0035758, - 6454.4713932, 80.5493065, 0.0020836, - 7261.2803173, 81.4303646, 0.0000000] -gammados_si = [-0.0000002, 0.0000000, 0.0000000, - 1.6966400, 0.0000063, 0.0000149, - 3.3932803, 0.0004133, 0.0012312, - 5.0899206, 0.0071709, 0.0057356, - 6.7865608, 0.0099381, 0.0006492, - 8.4832011, 0.0133390, 0.0049604, - 10.1798413, 0.0394030, 0.0198106, - 11.8764816, 0.0495160, 0.0044113, - 13.5731219, 0.0560223, 0.0050103, - 15.2697621, 0.1300596, 0.0000000] -kappados_nacl = [-0.0000002, 0.0000000, 0.0000000, - 0.8051732, 0.0366488, 0.1820668, - 1.6103466, 0.7748514, 1.5172957, - 2.4155199, 2.0165794, 2.0077744, - 3.2206933, 4.6670801, 2.8357892, - 4.0258667, 6.6123781, 32.8560281, - 4.8310401, 7.7105916, 0.6136893, - 5.6362134, 7.9112790, 0.2391300, - 6.4413868, 8.0272187, 0.0604842, - 7.2465602, 8.0430831, 0.0000000] -mfpdos_nacl = [0.0000000, 0.0000000, 0.0000000, - 117.4892903, 3.1983595, 0.0266514, - 234.9785806, 5.7974129, 0.0153383, - 352.4678709, 7.2012603, 0.0075057, - 469.9571612, 7.5964440, 0.0017477, - 587.4464515, 7.7823291, 0.0013915, - 704.9357418, 7.9195460, 0.0009363, - 822.4250321, 8.0024702, 0.0004844, - 939.9143223, 8.0375053, 0.0001382, - 1057.4036126, 8.0430831, 0.0000000] -gammados_nacl = [-0.0000002, 0.0000000, 0.0000000, - 0.8051732, 0.0000822, 0.0004081, - 1.6103466, 0.0018975, 0.0053389, - 2.4155199, 0.0114668, 0.0182495, - 3.2206933, 0.0353621, 0.0329440, - 4.0258667, 0.0604996, 0.1138884, - 4.8310401, 0.1038315, 0.0716216, - 5.6362134, 0.1481243, 0.0468421, - 6.4413868, 0.1982823, 0.0662494, - 7.2465602, 0.2429551, 0.0000000] +kappados_si = [ + -0.0000002, + 0.0000000, + 0.0000000, + 1.6966400, + 2.1977566, + 5.1814323, + 3.3932803, + 25.8022392, + 15.5096766, + 5.0899206, + 56.6994259, + 19.4995156, + 6.7865608, + 68.7759426, + 3.2465477, + 8.4832011, + 72.8398965, + 1.6583881, + 10.1798413, + 74.8143686, + 0.7945952, + 11.8764816, + 77.2489625, + 5.4385183, + 13.5731219, + 80.9162245, + 0.5998735, + 15.2697621, + 81.4303646, + 0.0000000, +] +mfpdos_si = [ + 0.0000000, + 0.0000000, + 0.0000000, + 806.8089241, + 33.7703552, + 0.0225548, + 1613.6178483, + 45.0137786, + 0.0103479, + 2420.4267724, + 53.3456168, + 0.0106724, + 3227.2356966, + 62.4915811, + 0.0107850, + 4034.0446207, + 69.8839011, + 0.0075919, + 4840.8535449, + 74.8662085, + 0.0049228, + 5647.6624690, + 78.2273252, + 0.0035758, + 6454.4713932, + 80.5493065, + 0.0020836, + 7261.2803173, + 81.4303646, + 0.0000000, +] +gammados_si = [ + -0.0000002, + 0.0000000, + 0.0000000, + 1.6966400, + 0.0000063, + 0.0000149, + 3.3932803, + 0.0004133, + 0.0012312, + 5.0899206, + 0.0071709, + 0.0057356, + 6.7865608, + 0.0099381, + 0.0006492, + 8.4832011, + 0.0133390, + 0.0049604, + 10.1798413, + 0.0394030, + 0.0198106, + 11.8764816, + 0.0495160, + 0.0044113, + 13.5731219, + 0.0560223, + 0.0050103, + 15.2697621, + 0.1300596, + 0.0000000, +] +kappados_nacl = [ + -0.0000002, + 0.0000000, + 0.0000000, + 0.8051732, + 0.0366488, + 0.1820668, + 1.6103466, + 0.7748514, + 1.5172957, + 2.4155199, + 2.0165794, + 2.0077744, + 3.2206933, + 4.6670801, + 2.8357892, + 4.0258667, + 6.6123781, + 32.8560281, + 4.8310401, + 7.7105916, + 0.6136893, + 5.6362134, + 7.9112790, + 0.2391300, + 6.4413868, + 8.0272187, + 0.0604842, + 7.2465602, + 8.0430831, + 0.0000000, +] +mfpdos_nacl = [ + 0.0000000, + 0.0000000, + 0.0000000, + 117.4892903, + 3.1983595, + 0.0266514, + 234.9785806, + 5.7974129, + 0.0153383, + 352.4678709, + 7.2012603, + 0.0075057, + 469.9571612, + 7.5964440, + 0.0017477, + 587.4464515, + 7.7823291, + 0.0013915, + 704.9357418, + 7.9195460, + 0.0009363, + 822.4250321, + 8.0024702, + 0.0004844, + 939.9143223, + 8.0375053, + 0.0001382, + 1057.4036126, + 8.0430831, + 0.0000000, +] +gammados_nacl = [ + -0.0000002, + 0.0000000, + 0.0000000, + 0.8051732, + 0.0000822, + 0.0004081, + 1.6103466, + 0.0018975, + 0.0053389, + 2.4155199, + 0.0114668, + 0.0182495, + 3.2206933, + 0.0353621, + 0.0329440, + 4.0258667, + 0.0604996, + 0.1138884, + 4.8310401, + 0.1038315, + 0.0716216, + 5.6362134, + 0.1481243, + 0.0468421, + 6.4413868, + 0.1982823, + 0.0662494, + 7.2465602, + 0.2429551, + 0.0000000, +] def test_kappados_si(si_pbesol): @@ -77,33 +208,36 @@ def test_kappados_si(si_pbesol): ph3 = si_pbesol ph3.mesh_numbers = [7, 7, 7] ph3.init_phph_interaction() - ph3.run_thermal_conductivity(temperatures=[300, ]) + ph3.run_thermal_conductivity( + temperatures=[ + 300, + ] + ) tc = ph3.thermal_conductivity freq_points_in = np.array(kappados_si).reshape(-1, 3)[:, 0] freq_points, kdos = _calculate_kappados( - ph3, tc.mode_kappa[0], freq_points=freq_points_in) + ph3, tc.mode_kappa[0], freq_points=freq_points_in + ) for f, (jval, ival) in zip(freq_points, kdos): print("%.7f, %.7f, %.7f," % (f, jval, ival)) np.testing.assert_allclose( - kappados_si, - np.vstack((freq_points, kdos.T)).T.ravel(), - rtol=0, atol=0.5) + kappados_si, np.vstack((freq_points, kdos.T)).T.ravel(), rtol=0, atol=0.5 + ) freq_points, kdos = _calculate_kappados( - ph3, tc.gamma[0, :, :, :, None], freq_points=freq_points_in) + ph3, tc.gamma[0, :, :, :, None], freq_points=freq_points_in + ) np.testing.assert_allclose( - gammados_si, - np.vstack((freq_points, kdos.T)).T.ravel(), - rtol=0, atol=0.5) + gammados_si, np.vstack((freq_points, kdos.T)).T.ravel(), rtol=0, atol=0.5 + ) mfp_points_in = np.array(mfpdos_si).reshape(-1, 3)[:, 0] mfp_points, mfpdos = _calculate_mfpdos(ph3, mfp_points_in) # for f, (jval, ival) in zip(freq_points, mfpdos): # print("%.7f, %.7f, %.7f," % (f, jval, ival)) np.testing.assert_allclose( - mfpdos_si, - np.vstack((mfp_points, mfpdos.T)).T.ravel(), - rtol=0, atol=0.5) + mfpdos_si, np.vstack((mfp_points, mfpdos.T)).T.ravel(), rtol=0, atol=0.5 + ) def test_kappados_nacl(nacl_pbe): @@ -117,33 +251,36 @@ def test_kappados_nacl(nacl_pbe): ph3 = nacl_pbe ph3.mesh_numbers = [7, 7, 7] ph3.init_phph_interaction() - ph3.run_thermal_conductivity(temperatures=[300, ]) + ph3.run_thermal_conductivity( + temperatures=[ + 300, + ] + ) tc = ph3.thermal_conductivity freq_points_in = np.array(kappados_nacl).reshape(-1, 3)[:, 0] freq_points, kdos = _calculate_kappados( - ph3, tc.mode_kappa[0], freq_points=freq_points_in) + ph3, tc.mode_kappa[0], freq_points=freq_points_in + ) # for f, (jval, ival) in zip(freq_points, kdos): # print("%.7f, %.7f, %.7f," % (f, jval, ival)) np.testing.assert_allclose( - kappados_nacl, - np.vstack((freq_points, kdos.T)).T.ravel(), - rtol=0, atol=0.5) + kappados_nacl, np.vstack((freq_points, kdos.T)).T.ravel(), rtol=0, atol=0.5 + ) freq_points, kdos = _calculate_kappados( - ph3, tc.gamma[0, :, :, :, None], freq_points=freq_points_in) + ph3, tc.gamma[0, :, :, :, None], freq_points=freq_points_in + ) np.testing.assert_allclose( - gammados_nacl, - np.vstack((freq_points, kdos.T)).T.ravel(), - rtol=0, atol=0.5) + gammados_nacl, np.vstack((freq_points, kdos.T)).T.ravel(), rtol=0, atol=0.5 + ) mfp_points_in = np.array(mfpdos_nacl).reshape(-1, 3)[:, 0] mfp_points, mfpdos = _calculate_mfpdos(ph3, mfp_points_in) # for f, (jval, ival) in zip(freq_points, mfpdos): # print("%.7f, %.7f, %.7f," % (f, jval, ival)) np.testing.assert_allclose( - mfpdos_nacl, - np.vstack((mfp_points, mfpdos.T)).T.ravel(), - rtol=0, atol=0.5) + mfpdos_nacl, np.vstack((mfp_points, mfpdos.T)).T.ravel(), rtol=0, atol=0.5 + ) def _calculate_kappados(ph3, mode_prop, freq_points=None): @@ -151,11 +288,8 @@ def _calculate_kappados(ph3, mode_prop, freq_points=None): bz_grid = ph3.grid frequencies, _, _ = ph3.get_phonon_data() kappados = KappaDOS( - mode_prop, - frequencies, - bz_grid, - tc.grid_points, - frequency_points=freq_points) + mode_prop, frequencies, bz_grid, tc.grid_points, frequency_points=freq_points + ) freq_points, kdos = kappados.get_kdos() ir_grid_points, _, ir_grid_map = get_ir_grid_points(bz_grid) @@ -165,7 +299,8 @@ def _calculate_kappados(ph3, mode_prop, freq_points=None): bz_grid, tc.grid_points, ir_grid_map=ir_grid_map, - frequency_points=freq_points) + frequency_points=freq_points, + ) ir_freq_points, ir_kdos = kappados.get_kdos() np.testing.assert_equal(bz_grid.bzg2grg[tc.grid_points], ir_grid_points) np.testing.assert_allclose(ir_freq_points, freq_points, rtol=0, atol=1e-5) @@ -185,7 +320,8 @@ def _calculate_mfpdos(ph3, mfp_points=None): tc.grid_points, ir_grid_map=ir_grid_map, frequency_points=mfp_points, - num_sampling_points=10) + num_sampling_points=10, + ) freq_points, kdos = mfpdos.get_kdos() return freq_points, kdos[0, :, :, 0] diff --git a/test/other/test_isotope.py b/test/other/test_isotope.py index 9dce0774..01e1e710 100644 --- a/test/other/test_isotope.py +++ b/test/other/test_isotope.py @@ -1,46 +1,81 @@ +"""Tests for isotope scatterings.""" import numpy as np from phono3py import Phono3pyIsotope si_pbesol_iso = [ - [8.32325038e-07, 9.45389739e-07, 1.57942189e-05, 1.28121297e-03, - 1.13842605e-03, 3.84915211e-04], - [2.89457649e-05, 1.57841863e-04, 3.97462227e-04, 1.03489892e-02, - 4.45981554e-03, 2.67184355e-03]] + [ + 8.32325038e-07, + 9.45389739e-07, + 1.57942189e-05, + 1.28121297e-03, + 1.13842605e-03, + 3.84915211e-04, + ], + [ + 2.89457649e-05, + 1.57841863e-04, + 3.97462227e-04, + 1.03489892e-02, + 4.45981554e-03, + 2.67184355e-03, + ], +] si_pbesol_iso_sigma = [ - [1.57262391e-06, 1.64031282e-06, 2.02007165e-05, 1.41999212e-03, - 1.26361419e-03, 7.91243161e-04], - [3.10266472e-05, 1.53059329e-04, 3.80963936e-04, 1.05238031e-02, - 6.72552880e-03, 3.21592329e-03]] + [ + 1.57262391e-06, + 1.64031282e-06, + 2.02007165e-05, + 1.41999212e-03, + 1.26361419e-03, + 7.91243161e-04, + ], + [ + 3.10266472e-05, + 1.53059329e-04, + 3.80963936e-04, + 1.05238031e-02, + 6.72552880e-03, + 3.21592329e-03, + ], +] def test_Phono3pyIsotope(si_pbesol): + """Phono3pyIsotope with tetrahedron method.""" si_pbesol.mesh_numbers = [21, 21, 21] iso = Phono3pyIsotope( si_pbesol.mesh_numbers, si_pbesol.phonon_primitive, - symprec=si_pbesol.symmetry.tolerance) + symprec=si_pbesol.symmetry.tolerance, + ) iso.init_dynamical_matrix( si_pbesol.fc2, si_pbesol.phonon_supercell, si_pbesol.phonon_primitive, - nac_params=si_pbesol.nac_params) + nac_params=si_pbesol.nac_params, + ) iso.run([23, 103]) # print(iso.gamma[0]) np.testing.assert_allclose(si_pbesol_iso, iso.gamma[0], atol=3e-4) def test_Phono3pyIsotope_with_sigma(si_pbesol): + """Phono3pyIsotope with smearing method.""" si_pbesol.mesh_numbers = [21, 21, 21] iso = Phono3pyIsotope( si_pbesol.mesh_numbers, si_pbesol.phonon_primitive, - sigmas=[0.1, ], - symprec=si_pbesol.symmetry.tolerance) + sigmas=[ + 0.1, + ], + symprec=si_pbesol.symmetry.tolerance, + ) iso.init_dynamical_matrix( si_pbesol.fc2, si_pbesol.phonon_supercell, si_pbesol.phonon_primitive, - nac_params=si_pbesol.nac_params) + nac_params=si_pbesol.nac_params, + ) iso.run([23, 103]) # print(iso.gamma[0]) np.testing.assert_allclose(si_pbesol_iso_sigma, iso.gamma[0], atol=3e-4) diff --git a/test/phonon/__init__.py b/test/phonon/__init__.py index e69de29b..1f598a8a 100644 --- a/test/phonon/__init__.py +++ b/test/phonon/__init__.py @@ -0,0 +1 @@ +"""Tests for harmonic phonon level properties.""" diff --git a/test/phonon/test_grid.py b/test/phonon/test_grid.py index e93b6145..ec9d5f66 100644 --- a/test/phonon/test_grid.py +++ b/test/phonon/test_grid.py @@ -1,9 +1,13 @@ import numpy as np from phonopy.structure.tetrahedron_method import TetrahedronMethod from phono3py.phonon.grid import ( - get_grid_point_from_address, get_grid_point_from_address_py, BZGrid, - _get_grid_points_by_rotations, _get_grid_points_by_bz_rotations_c, - _get_grid_points_by_bz_rotations_py) + get_grid_point_from_address, + get_grid_point_from_address_py, + BZGrid, + _get_grid_points_by_rotations, + _get_grid_points_by_bz_rotations_c, + _get_grid_points_by_bz_rotations_py, +) def test_get_grid_point_from_address(agno2_cell): @@ -30,16 +34,78 @@ def test_BZGrid(si_pbesol_111): reclat = np.linalg.inv(lat) mesh = [4, 4, 4] - gp_map2 = [0, 1, 2, 4, 5, 6, 7, 8, 9, 11, 12, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 34, 35, - 36, 40, 41, 43, 44, 46, 47, 48, 49, 50, 54, 56, 57, 59, - 60, 61, 65, 66, 67, 68, 69, 70, 71, 72, 73, 77, 78, 79, - 83, 84, 85, 86, 87, 88, 89] + gp_map2 = [ + 0, + 1, + 2, + 4, + 5, + 6, + 7, + 8, + 9, + 11, + 12, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 34, + 35, + 36, + 40, + 41, + 43, + 44, + 46, + 47, + 48, + 49, + 50, + 54, + 56, + 57, + 59, + 60, + 61, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 77, + 78, + 79, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + ] bzgrid1 = BZGrid(mesh, lattice=lat, store_dense_gp_map=False) bzgrid2 = BZGrid(mesh, lattice=lat, store_dense_gp_map=True) - adrs1 = bzgrid1.addresses[:np.prod(mesh)] + adrs1 = bzgrid1.addresses[: np.prod(mesh)] adrs2 = bzgrid2.addresses[bzgrid2.gp_map[:-1]] assert ((adrs1 - adrs2) % mesh == 0).all() np.testing.assert_equal(bzgrid1.addresses.shape, bzgrid2.addresses.shape) @@ -78,18 +144,22 @@ def test_BZGrid_SNF(si_pbesol_111): """SNF in BZGrid""" lat = si_pbesol_111.primitive.cell mesh = 10 - bzgrid1 = BZGrid(mesh, - lattice=lat, - symmetry_dataset=si_pbesol_111.primitive_symmetry.dataset, - use_grg=True, - store_dense_gp_map=False) + bzgrid1 = BZGrid( + mesh, + lattice=lat, + symmetry_dataset=si_pbesol_111.primitive_symmetry.dataset, + use_grg=True, + store_dense_gp_map=False, + ) _test_BZGrid_SNF(bzgrid1) - bzgrid2 = BZGrid(mesh, - lattice=lat, - symmetry_dataset=si_pbesol_111.primitive_symmetry.dataset, - use_grg=True, - store_dense_gp_map=True) + bzgrid2 = BZGrid( + mesh, + lattice=lat, + symmetry_dataset=si_pbesol_111.primitive_symmetry.dataset, + use_grg=True, + store_dense_gp_map=True, + ) _test_BZGrid_SNF(bzgrid2) @@ -117,43 +187,543 @@ def _test_BZGrid_SNF(bzgrid): # for line in gr_addresses.reshape(-1, 12): # print("".join(["%d, " % i for i in line])) - ref = [0, 0, 0, -1, 0, 0, 0, 1, 0, 1, 1, 0, - 0, -2, 0, -1, -2, 0, 0, -1, 0, -1, -1, 0, - 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, - 0, 2, 1, 1, 2, 1, 0, -1, 1, -1, -1, 1, - 0, 0, -2, -1, 0, -2, 0, 1, 2, 1, 1, 2, - 0, -2, -2, -1, -2, -2, 0, -1, -2, -1, -1, -2, - 0, 0, -1, -1, 0, -1, 0, 1, -1, -1, 1, -1, - 0, -2, -1, -1, -2, -1, 0, -1, -1, -1, -1, -1] + ref = [ + 0, + 0, + 0, + -1, + 0, + 0, + 0, + 1, + 0, + 1, + 1, + 0, + 0, + -2, + 0, + -1, + -2, + 0, + 0, + -1, + 0, + -1, + -1, + 0, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 0, + 2, + 1, + 1, + 2, + 1, + 0, + -1, + 1, + -1, + -1, + 1, + 0, + 0, + -2, + -1, + 0, + -2, + 0, + 1, + 2, + 1, + 1, + 2, + 0, + -2, + -2, + -1, + -2, + -2, + 0, + -1, + -2, + -1, + -1, + -2, + 0, + 0, + -1, + -1, + 0, + -1, + 0, + 1, + -1, + -1, + 1, + -1, + 0, + -2, + -1, + -1, + -2, + -1, + 0, + -1, + -1, + -1, + -1, + -1, + ] - assert (((np.reshape(ref, (-1, 3)) - gr_addresses) - % bzgrid.D_diag).ravel() == 0).all() + assert ( + ((np.reshape(ref, (-1, 3)) - gr_addresses) % bzgrid.D_diag).ravel() == 0 + ).all() ref_rots = [ - 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 2, 1, -1, 2, 2, -1, - 1, 0, 0, 2, -1, 0, 4, 0, -1, 1, 0, 0, 0, -1, 1, 2, -2, 1, - -1, 0, 0, 0, -1, 0, -2, -2, 1, -1, 0, 0, 0, 1, -1, 0, 0, -1, - -1, 0, 0, -2, 1, 0, -2, 2, -1, -1, 0, 0, -2, -1, 1, -4, 0, 1, - -1, -1, 1, 0, -1, 1, -2, -1, 2, -1, -1, 1, 0, -2, 1, 0, -3, 2, - -1, -1, 1, -2, -1, 1, -2, -3, 2, -1, -1, 1, -2, 0, 1, -4, -1, 2, - 1, 1, -1, 0, 1, -1, 0, 3, -2, 1, 1, -1, 2, 0, -1, 2, 1, -2, - 1, 1, -1, 2, 1, -1, 4, 1, -2, 1, 1, -1, 0, 2, -1, 2, 3, -2, - -1, 1, 0, -2, 0, 1, -2, 1, 1, -1, 1, 0, -2, 1, 0, -4, 1, 1, - -1, 1, 0, 0, 2, -1, -2, 3, -1, -1, 1, 0, 0, 1, 0, 0, 3, -1, - 1, -1, 0, 2, 0, -1, 4, -1, -1, 1, -1, 0, 0, -1, 0, 2, -1, -1, - 1, -1, 0, 0, -2, 1, 0, -3, 1, 1, -1, 0, 2, -1, 0, 2, -3, 1, - -1, 0, 0, 0, -1, 0, 0, 0, -1, -1, 0, 0, -2, -1, 1, -2, -2, 1, - -1, 0, 0, -2, 1, 0, -4, 0, 1, -1, 0, 0, 0, 1, -1, -2, 2, -1, - 1, 0, 0, 0, 1, 0, 2, 2, -1, 1, 0, 0, 0, -1, 1, 0, 0, 1, - 1, 0, 0, 2, -1, 0, 2, -2, 1, 1, 0, 0, 2, 1, -1, 4, 0, -1, - 1, 1, -1, 0, 1, -1, 2, 1, -2, 1, 1, -1, 0, 2, -1, 0, 3, -2, - 1, 1, -1, 2, 1, -1, 2, 3, -2, 1, 1, -1, 2, 0, -1, 4, 1, -2, - -1, -1, 1, 0, -1, 1, 0, -3, 2, -1, -1, 1, -2, 0, 1, -2, -1, 2, - -1, -1, 1, -2, -1, 1, -4, -1, 2, -1, -1, 1, 0, -2, 1, -2, -3, 2, - 1, -1, 0, 2, 0, -1, 2, -1, -1, 1, -1, 0, 2, -1, 0, 4, -1, -1, - 1, -1, 0, 0, -2, 1, 2, -3, 1, 1, -1, 0, 0, -1, 0, 0, -3, 1, - -1, 1, 0, -2, 0, 1, -4, 1, 1, -1, 1, 0, 0, 1, 0, -2, 1, 1, - -1, 1, 0, 0, 2, -1, 0, 3, -1, -1, 1, 0, -2, 1, 0, -2, 3, -1] + 1, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 2, + 1, + -1, + 2, + 2, + -1, + 1, + 0, + 0, + 2, + -1, + 0, + 4, + 0, + -1, + 1, + 0, + 0, + 0, + -1, + 1, + 2, + -2, + 1, + -1, + 0, + 0, + 0, + -1, + 0, + -2, + -2, + 1, + -1, + 0, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + -1, + 0, + 0, + -2, + 1, + 0, + -2, + 2, + -1, + -1, + 0, + 0, + -2, + -1, + 1, + -4, + 0, + 1, + -1, + -1, + 1, + 0, + -1, + 1, + -2, + -1, + 2, + -1, + -1, + 1, + 0, + -2, + 1, + 0, + -3, + 2, + -1, + -1, + 1, + -2, + -1, + 1, + -2, + -3, + 2, + -1, + -1, + 1, + -2, + 0, + 1, + -4, + -1, + 2, + 1, + 1, + -1, + 0, + 1, + -1, + 0, + 3, + -2, + 1, + 1, + -1, + 2, + 0, + -1, + 2, + 1, + -2, + 1, + 1, + -1, + 2, + 1, + -1, + 4, + 1, + -2, + 1, + 1, + -1, + 0, + 2, + -1, + 2, + 3, + -2, + -1, + 1, + 0, + -2, + 0, + 1, + -2, + 1, + 1, + -1, + 1, + 0, + -2, + 1, + 0, + -4, + 1, + 1, + -1, + 1, + 0, + 0, + 2, + -1, + -2, + 3, + -1, + -1, + 1, + 0, + 0, + 1, + 0, + 0, + 3, + -1, + 1, + -1, + 0, + 2, + 0, + -1, + 4, + -1, + -1, + 1, + -1, + 0, + 0, + -1, + 0, + 2, + -1, + -1, + 1, + -1, + 0, + 0, + -2, + 1, + 0, + -3, + 1, + 1, + -1, + 0, + 2, + -1, + 0, + 2, + -3, + 1, + -1, + 0, + 0, + 0, + -1, + 0, + 0, + 0, + -1, + -1, + 0, + 0, + -2, + -1, + 1, + -2, + -2, + 1, + -1, + 0, + 0, + -2, + 1, + 0, + -4, + 0, + 1, + -1, + 0, + 0, + 0, + 1, + -1, + -2, + 2, + -1, + 1, + 0, + 0, + 0, + 1, + 0, + 2, + 2, + -1, + 1, + 0, + 0, + 0, + -1, + 1, + 0, + 0, + 1, + 1, + 0, + 0, + 2, + -1, + 0, + 2, + -2, + 1, + 1, + 0, + 0, + 2, + 1, + -1, + 4, + 0, + -1, + 1, + 1, + -1, + 0, + 1, + -1, + 2, + 1, + -2, + 1, + 1, + -1, + 0, + 2, + -1, + 0, + 3, + -2, + 1, + 1, + -1, + 2, + 1, + -1, + 2, + 3, + -2, + 1, + 1, + -1, + 2, + 0, + -1, + 4, + 1, + -2, + -1, + -1, + 1, + 0, + -1, + 1, + 0, + -3, + 2, + -1, + -1, + 1, + -2, + 0, + 1, + -2, + -1, + 2, + -1, + -1, + 1, + -2, + -1, + 1, + -4, + -1, + 2, + -1, + -1, + 1, + 0, + -2, + 1, + -2, + -3, + 2, + 1, + -1, + 0, + 2, + 0, + -1, + 2, + -1, + -1, + 1, + -1, + 0, + 2, + -1, + 0, + 4, + -1, + -1, + 1, + -1, + 0, + 0, + -2, + 1, + 2, + -3, + 1, + 1, + -1, + 0, + 0, + -1, + 0, + 0, + -3, + 1, + -1, + 1, + 0, + -2, + 0, + 1, + -4, + 1, + 1, + -1, + 1, + 0, + 0, + 1, + 0, + -2, + 1, + 1, + -1, + 1, + 0, + 0, + 2, + -1, + 0, + 3, + -1, + -1, + 1, + 0, + -2, + 1, + 0, + -2, + 3, + -1, + ] np.testing.assert_equal(ref_rots, bzgrid.rotations.ravel()) @@ -183,7 +753,8 @@ def test_SNF_tetrahedra_relative_grid(aln_lda): np.testing.assert_allclose( np.dot(mtet, mlat.T), np.dot(np.dot(ptet, bz_grid.QDinv.T), plat.T), - atol=1e-8) + atol=1e-8, + ) # print(np.dot(mtet, mlat.T)) # print(np.dot(np.dot(ptet, bz_grid.QDinv.T), plat.T)) @@ -198,25 +769,207 @@ def test_get_grid_points_by_bz_rotations(si_pbesol_111): _get_grid_points_by_bz_rotations_py """ - ref10_type1 = [10, 26, 10, 26, 26, 10, 26, 10, 88, 80, 200, 208, - 200, 208, 88, 80, 208, 88, 80, 200, 208, 88, 80, 200, - 26, 10, 26, 10, 10, 26, 10, 26, 200, 208, 88, 80, - 88, 80, 200, 208, 80, 200, 208, 88, 80, 200, 208, 88] - ref12_type2 = [12, 39, 12, 39, 39, 12, 39, 12, 122, 109, 265, 278, - 265, 278, 122, 109, 278, 122, 109, 265, 278, 122, 109, 265, - 39, 12, 39, 12, 12, 39, 12, 39, 265, 278, 122, 109, - 122, 109, 265, 278, 109, 265, 278, 122, 109, 265, 278, 122] + ref10_type1 = [ + 10, + 26, + 10, + 26, + 26, + 10, + 26, + 10, + 88, + 80, + 200, + 208, + 200, + 208, + 88, + 80, + 208, + 88, + 80, + 200, + 208, + 88, + 80, + 200, + 26, + 10, + 26, + 10, + 10, + 26, + 10, + 26, + 200, + 208, + 88, + 80, + 88, + 80, + 200, + 208, + 80, + 200, + 208, + 88, + 80, + 200, + 208, + 88, + ] + ref12_type2 = [ + 12, + 39, + 12, + 39, + 39, + 12, + 39, + 12, + 122, + 109, + 265, + 278, + 265, + 278, + 122, + 109, + 278, + 122, + 109, + 265, + 278, + 122, + 109, + 265, + 39, + 12, + 39, + 12, + 12, + 39, + 12, + 39, + 265, + 278, + 122, + 109, + 122, + 109, + 265, + 278, + 109, + 265, + 278, + 122, + 109, + 265, + 278, + 122, + ] ref10_bz_type1 = [ - 10, 26, 260, 270, 269, 258, 271, 259, 88, 285, 200, 328, - 322, 208, 291, 286, 327, 292, 287, 321, 326, 290, 80, 323, - 269, 258, 271, 259, 10, 26, 260, 270, 200, 328, 88, 285, - 291, 286, 322, 208, 80, 323, 326, 290, 287, 321, 327, 292] + 10, + 26, + 260, + 270, + 269, + 258, + 271, + 259, + 88, + 285, + 200, + 328, + 322, + 208, + 291, + 286, + 327, + 292, + 287, + 321, + 326, + 290, + 80, + 323, + 269, + 258, + 271, + 259, + 10, + 26, + 260, + 270, + 200, + 328, + 88, + 285, + 291, + 286, + 322, + 208, + 80, + 323, + 326, + 290, + 287, + 321, + 327, + 292, + ] ref12_bz_type2 = [ - 12, 39, 15, 41, 40, 13, 42, 14, 122, 110, 265, 281, - 267, 278, 124, 111, 280, 125, 112, 266, 279, 123, 109, 268, - 40, 13, 42, 14, 12, 39, 15, 41, 265, 281, 122, 110, - 124, 111, 267, 278, 109, 268, 279, 123, 112, 266, 280, 125] + 12, + 39, + 15, + 41, + 40, + 13, + 42, + 14, + 122, + 110, + 265, + 281, + 267, + 278, + 124, + 111, + 280, + 125, + 112, + 266, + 279, + 123, + 109, + 268, + 40, + 13, + 42, + 14, + 12, + 39, + 15, + 41, + 265, + 281, + 122, + 110, + 124, + 111, + 267, + 278, + 109, + 268, + 279, + 123, + 112, + 266, + 280, + 125, + ] lat = si_pbesol_111.primitive.cell mesh = 20 @@ -226,46 +979,53 @@ def test_get_grid_points_by_bz_rotations(si_pbesol_111): lattice=lat, symmetry_dataset=si_pbesol_111.primitive_symmetry.dataset, use_grg=True, - store_dense_gp_map=False) + store_dense_gp_map=False, + ) bz_grid_type2 = BZGrid( mesh, lattice=lat, symmetry_dataset=si_pbesol_111.primitive_symmetry.dataset, use_grg=True, - store_dense_gp_map=True) + store_dense_gp_map=True, + ) # Check data consistency by reducing to GR-grid. # Grid point 10 in type-1 and 12 in type-2 are the same points in GR-grid. assert bz_grid_type1.bzg2grg[10] == bz_grid_type2.bzg2grg[12] - np.testing.assert_equal(bz_grid_type1.bzg2grg[ref10_type1], - bz_grid_type2.bzg2grg[ref12_type2]) - np.testing.assert_equal(bz_grid_type1.bzg2grg[ref10_type1], - bz_grid_type1.bzg2grg[ref10_bz_type1]) - np.testing.assert_equal(bz_grid_type1.bzg2grg[ref10_type1], - bz_grid_type2.bzg2grg[ref12_bz_type2]) + np.testing.assert_equal( + bz_grid_type1.bzg2grg[ref10_type1], bz_grid_type2.bzg2grg[ref12_type2] + ) + np.testing.assert_equal( + bz_grid_type1.bzg2grg[ref10_type1], bz_grid_type1.bzg2grg[ref10_bz_type1] + ) + np.testing.assert_equal( + bz_grid_type1.bzg2grg[ref10_type1], bz_grid_type2.bzg2grg[ref12_bz_type2] + ) - bzgps = _get_grid_points_by_rotations( - 10, bz_grid_type1, bz_grid_type1.rotations) + bzgps = _get_grid_points_by_rotations(10, bz_grid_type1, bz_grid_type1.rotations) np.testing.assert_equal(bzgps, ref10_type1) - bzgps = _get_grid_points_by_rotations( - 12, bz_grid_type2, bz_grid_type2.rotations) + bzgps = _get_grid_points_by_rotations(12, bz_grid_type2, bz_grid_type2.rotations) np.testing.assert_equal(bzgps, ref12_type2) bzgps = _get_grid_points_by_bz_rotations_c( - 10, bz_grid_type1, bz_grid_type1.rotations) + 10, bz_grid_type1, bz_grid_type1.rotations + ) np.testing.assert_equal(bzgps, ref10_bz_type1) bzgps = _get_grid_points_by_bz_rotations_c( - 12, bz_grid_type2, bz_grid_type2.rotations) + 12, bz_grid_type2, bz_grid_type2.rotations + ) np.testing.assert_equal(bzgps, ref12_bz_type2) bzgps = _get_grid_points_by_bz_rotations_py( - 10, bz_grid_type1, bz_grid_type1.rotations) + 10, bz_grid_type1, bz_grid_type1.rotations + ) np.testing.assert_equal(bzgps, ref10_bz_type1) bzgps = _get_grid_points_by_bz_rotations_py( - 12, bz_grid_type2, bz_grid_type2.rotations) + 12, bz_grid_type2, bz_grid_type2.rotations + ) np.testing.assert_equal(bzgps, ref12_bz_type2) # Exhaustive consistency check among methods @@ -275,34 +1035,54 @@ def test_get_grid_points_by_bz_rotations(si_pbesol_111): rot_grgps = bz_grid_type1.bzg2grg[ _get_grid_points_by_rotations( - bzgp_type1, bz_grid_type1, bz_grid_type1.rotations)] + bzgp_type1, bz_grid_type1, bz_grid_type1.rotations + ) + ] np.testing.assert_equal( rot_grgps, - bz_grid_type2.bzg2grg[_get_grid_points_by_rotations( - bzgp_type2, bz_grid_type2, bz_grid_type2.rotations)]) + bz_grid_type2.bzg2grg[ + _get_grid_points_by_rotations( + bzgp_type2, bz_grid_type2, bz_grid_type2.rotations + ) + ], + ) np.testing.assert_equal( _get_grid_points_by_bz_rotations_c( - bzgp_type1, bz_grid_type1, bz_grid_type1.rotations), + bzgp_type1, bz_grid_type1, bz_grid_type1.rotations + ), _get_grid_points_by_bz_rotations_py( - bzgp_type1, bz_grid_type1, bz_grid_type1.rotations)) + bzgp_type1, bz_grid_type1, bz_grid_type1.rotations + ), + ) np.testing.assert_equal( _get_grid_points_by_bz_rotations_c( - bzgp_type2, bz_grid_type2, bz_grid_type2.rotations), + bzgp_type2, bz_grid_type2, bz_grid_type2.rotations + ), _get_grid_points_by_bz_rotations_py( - bzgp_type2, bz_grid_type2, bz_grid_type2.rotations)) + bzgp_type2, bz_grid_type2, bz_grid_type2.rotations + ), + ) np.testing.assert_equal( rot_grgps, - bz_grid_type1.bzg2grg[_get_grid_points_by_bz_rotations_c( - bzgp_type1, bz_grid_type1, bz_grid_type1.rotations)]) + bz_grid_type1.bzg2grg[ + _get_grid_points_by_bz_rotations_c( + bzgp_type1, bz_grid_type1, bz_grid_type1.rotations + ) + ], + ) np.testing.assert_equal( rot_grgps, - bz_grid_type2.bzg2grg[_get_grid_points_by_bz_rotations_c( - bzgp_type2, bz_grid_type2, bz_grid_type2.rotations)]) + bz_grid_type2.bzg2grg[ + _get_grid_points_by_bz_rotations_c( + bzgp_type2, bz_grid_type2, bz_grid_type2.rotations + ) + ], + ) # for gps in bzgps.reshape(-1, 12): # print("".join(["%d, " % gp for gp in gps])) diff --git a/test/phonon3/test_displacements.py b/test/phonon3/test_displacements.py index 5682a2b9..ba109cb2 100644 --- a/test/phonon3/test_displacements.py +++ b/test/phonon3/test_displacements.py @@ -5,31 +5,95 @@ from phono3py.phonon3.displacement_fc3 import get_smallest_vector_of_atom_pair distances_NaCl = [ - 0.0000000, 5.6903015, 5.6903015, 8.0473015, 5.6903015, - 8.0473015, 8.0473015, 9.8558913, 4.0236508, 6.9691675, - 4.0236508, 6.9691675, 4.0236508, 6.9691675, 4.0236508, - 6.9691675, 4.0236508, 4.0236508, 6.9691675, 6.9691675, - 4.0236508, 4.0236508, 6.9691675, 6.9691675, 4.0236508, - 4.0236508, 4.0236508, 4.0236508, 6.9691675, 6.9691675, - 6.9691675, 6.9691675, 4.9279456, 4.9279456, 4.9279456, - 4.9279456, 4.9279456, 4.9279456, 4.9279456, 4.9279456, - 2.8451507, 2.8451507, 6.3619505, 6.3619505, 6.3619505, - 6.3619505, 8.5354522, 8.5354522, 2.8451507, 6.3619505, - 2.8451507, 6.3619505, 6.3619505, 8.5354522, 6.3619505, - 8.5354522, 2.8451507, 6.3619505, 6.3619505, 8.5354522, - 2.8451507, 6.3619505, 6.3619505, 8.5354522] + 0.0000000, + 5.6903015, + 5.6903015, + 8.0473015, + 5.6903015, + 8.0473015, + 8.0473015, + 9.8558913, + 4.0236508, + 6.9691675, + 4.0236508, + 6.9691675, + 4.0236508, + 6.9691675, + 4.0236508, + 6.9691675, + 4.0236508, + 4.0236508, + 6.9691675, + 6.9691675, + 4.0236508, + 4.0236508, + 6.9691675, + 6.9691675, + 4.0236508, + 4.0236508, + 4.0236508, + 4.0236508, + 6.9691675, + 6.9691675, + 6.9691675, + 6.9691675, + 4.9279456, + 4.9279456, + 4.9279456, + 4.9279456, + 4.9279456, + 4.9279456, + 4.9279456, + 4.9279456, + 2.8451507, + 2.8451507, + 6.3619505, + 6.3619505, + 6.3619505, + 6.3619505, + 8.5354522, + 8.5354522, + 2.8451507, + 6.3619505, + 2.8451507, + 6.3619505, + 6.3619505, + 8.5354522, + 6.3619505, + 8.5354522, + 2.8451507, + 6.3619505, + 6.3619505, + 8.5354522, + 2.8451507, + 6.3619505, + 6.3619505, + 8.5354522, +] def test_duplicates_agno2(agno2_cell): """Test duplicated pairs of displacements.""" - ph3 = phono3py.load(unitcell=agno2_cell, - supercell_matrix=[1, 1, 1]) + ph3 = phono3py.load(unitcell=agno2_cell, supercell_matrix=[1, 1, 1]) ph3.generate_displacements() duplicates_ref = [ - [106, 22], [220, 80], [252, 81], [221, 96], [253, 97], - [290, 142], [348, 244], [364, 245], [349, 276], [365, 277], - [119, 0], [261, 0], [229, 0], [260, 0], [228, 0]] - np.testing.assert_equal(duplicates_ref, ph3.dataset['duplicates']) + [106, 22], + [220, 80], + [252, 81], + [221, 96], + [253, 97], + [290, 142], + [348, 244], + [364, 245], + [349, 276], + [365, 277], + [119, 0], + [261, 0], + [229, 0], + [260, 0], + [228, 0], + ] + np.testing.assert_equal(duplicates_ref, ph3.dataset["duplicates"]) def test_nacl_pbe(nacl_pbe): @@ -37,24 +101,113 @@ def test_nacl_pbe(nacl_pbe): ph3 = nacl_pbe ph3.generate_displacements() duplicates_ref = [[77, 41]] - ph3.dataset['duplicates'] - np.testing.assert_equal(duplicates_ref, ph3.dataset['duplicates']) + ph3.dataset["duplicates"] + np.testing.assert_equal(duplicates_ref, ph3.dataset["duplicates"]) - pairs_ref = [0, 0, 0, 1, 0, 2, 0, 3, 0, 6, - 0, 7, 0, 8, 0, 9, 0, 16, 0, 17, - 0, 18, 0, 19, 0, 32, 0, 33, 0, 40, - 0, 41, 0, 42, 0, 43, 0, 46, 0, 47, - 0, 48, 0, 49, 0, 52, 0, 53, 32, 0, - 32, 1, 32, 8, 32, 9, 32, 10, 32, 11, - 32, 14, 32, 15, 32, 16, 32, 17, 32, 20, - 32, 21, 32, 32, 32, 33, 32, 34, 32, 35, - 32, 38, 32, 39, 32, 40, 32, 41, 32, 48, - 32, 49, 32, 50, 32, 51] + pairs_ref = [ + 0, + 0, + 0, + 1, + 0, + 2, + 0, + 3, + 0, + 6, + 0, + 7, + 0, + 8, + 0, + 9, + 0, + 16, + 0, + 17, + 0, + 18, + 0, + 19, + 0, + 32, + 0, + 33, + 0, + 40, + 0, + 41, + 0, + 42, + 0, + 43, + 0, + 46, + 0, + 47, + 0, + 48, + 0, + 49, + 0, + 52, + 0, + 53, + 32, + 0, + 32, + 1, + 32, + 8, + 32, + 9, + 32, + 10, + 32, + 11, + 32, + 14, + 32, + 15, + 32, + 16, + 32, + 17, + 32, + 20, + 32, + 21, + 32, + 32, + 32, + 33, + 32, + 34, + 32, + 35, + 32, + 38, + 32, + 39, + 32, + 40, + 32, + 41, + 32, + 48, + 32, + 49, + 32, + 50, + 32, + 51, + ] pairs = [] - for first_atoms in ph3.dataset['first_atoms']: - n1 = first_atoms['number'] - n2s = np.unique([second_atoms['number'] - for second_atoms in first_atoms['second_atoms']]) + for first_atoms in ph3.dataset["first_atoms"]: + n1 = first_atoms["number"] + n2s = np.unique( + [second_atoms["number"] for second_atoms in first_atoms["second_atoms"]] + ) pairs += [[n1, n2] for n2 in n2s] # print("".join(["%d, " % i for i in np.array(pairs).ravel()])) @@ -66,8 +219,7 @@ def test_get_smallest_vector_of_atom_pair(nacl_pbe): ph3 = nacl_pbe distances = [] for i in range(len(ph3.supercell)): - vec = get_smallest_vector_of_atom_pair( - i, 0, ph3.supercell, 1e-5) + vec = get_smallest_vector_of_atom_pair(i, 0, ph3.supercell, 1e-5) if vec.ndim == 2: vec = vec[0] distances.append(np.linalg.norm(np.dot(vec, ph3.supercell.cell))) diff --git a/test/phonon3/test_fc3.py b/test/phonon3/test_fc3.py index 69815575..ecac88a8 100644 --- a/test/phonon3/test_fc3.py +++ b/test/phonon3/test_fc3.py @@ -1,8 +1,10 @@ +"""Tests for fc3.""" import numpy as np from phono3py.phonon3.fc3 import cutoff_fc3_by_zero def test_cutoff_fc3(nacl_pbe_cutoff_fc3, nacl_pbe): + """Test for cutoff pair option.""" fc3_cut = nacl_pbe_cutoff_fc3.fc3 fc3 = nacl_pbe.fc3 abs_delta = np.abs(fc3_cut - fc3).sum() @@ -10,6 +12,7 @@ def test_cutoff_fc3(nacl_pbe_cutoff_fc3, nacl_pbe): def test_cutoff_fc3_zero(nacl_pbe): + """Test for abrupt cut of fc3 by distance.""" ph = nacl_pbe fc3 = ph.fc3.copy() cutoff_fc3_by_zero(fc3, ph.supercell, 5) diff --git a/test/phonon3/test_imag_self_energy.py b/test/phonon3/test_imag_self_energy.py index f5e73141..d691e8ce 100644 --- a/test/phonon3/test_imag_self_energy.py +++ b/test/phonon3/test_imag_self_energy.py @@ -1,138 +1,740 @@ """Test for imag_free_energy.py.""" -import pytest import numpy as np gammas = [ - 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, - 0.0005412, 0.0005412, 0.0008843, 0.0191694, 0.0206316, 0.0206316, - 0.0019424, 0.0019424, 0.0067566, 0.0548967, 0.0506115, 0.0506115, - 0.0062204, 0.0062204, 0.0088148, 0.0426150, 0.0417223, 0.0417223, - 0.0016263, 0.0016263, 0.0017293, 0.0279509, 0.0289259, 0.0289259, - 0.0097926, 0.0097926, 0.0170092, 0.0438828, 0.0523105, 0.0523105, - 0.0035542, 0.0035542, 0.0135109, 0.0623533, 0.0343746, 0.0343746, - 0.0073140, 0.0073140, 0.0289659, 0.5006760, 0.5077932, 0.5077932, - 0.0016144, 0.0016144, 0.0126326, 0.2731933, 0.2791702, 0.2791702, - 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, - 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, - 0.0023304, 0.0026469, 0.0052513, 0.0209641, 0.0220092, 0.0234752, - 0.0035532, 0.0038158, 0.0087882, 0.0276654, 0.0315055, 0.0286975, - 0.0345193, 0.0277533, 0.0495734, 0.0511798, 0.0465938, 0.0436605, - 0.0071705, 0.0081615, 0.0139063, 0.0204058, 0.0307320, 0.0237855, - 0.0202095, 0.0197716, 0.0316074, 0.0402461, 0.0438103, 0.0394924, - 0.0171448, 0.0176446, 0.0567310, 0.0930479, 0.0570520, 0.0622142, - 0.0292639, 0.0328821, 0.0667957, 0.2541887, 0.4592188, 0.4234131, - 0.0104887, 0.0179753, 0.0827533, 0.2659557, 0.3242633, 0.3189804, - 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000] + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0005412, + 0.0005412, + 0.0008843, + 0.0191694, + 0.0206316, + 0.0206316, + 0.0019424, + 0.0019424, + 0.0067566, + 0.0548967, + 0.0506115, + 0.0506115, + 0.0062204, + 0.0062204, + 0.0088148, + 0.0426150, + 0.0417223, + 0.0417223, + 0.0016263, + 0.0016263, + 0.0017293, + 0.0279509, + 0.0289259, + 0.0289259, + 0.0097926, + 0.0097926, + 0.0170092, + 0.0438828, + 0.0523105, + 0.0523105, + 0.0035542, + 0.0035542, + 0.0135109, + 0.0623533, + 0.0343746, + 0.0343746, + 0.0073140, + 0.0073140, + 0.0289659, + 0.5006760, + 0.5077932, + 0.5077932, + 0.0016144, + 0.0016144, + 0.0126326, + 0.2731933, + 0.2791702, + 0.2791702, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0023304, + 0.0026469, + 0.0052513, + 0.0209641, + 0.0220092, + 0.0234752, + 0.0035532, + 0.0038158, + 0.0087882, + 0.0276654, + 0.0315055, + 0.0286975, + 0.0345193, + 0.0277533, + 0.0495734, + 0.0511798, + 0.0465938, + 0.0436605, + 0.0071705, + 0.0081615, + 0.0139063, + 0.0204058, + 0.0307320, + 0.0237855, + 0.0202095, + 0.0197716, + 0.0316074, + 0.0402461, + 0.0438103, + 0.0394924, + 0.0171448, + 0.0176446, + 0.0567310, + 0.0930479, + 0.0570520, + 0.0622142, + 0.0292639, + 0.0328821, + 0.0667957, + 0.2541887, + 0.4592188, + 0.4234131, + 0.0104887, + 0.0179753, + 0.0827533, + 0.2659557, + 0.3242633, + 0.3189804, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, +] gammas_sigma = [ - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00046029, 0.00046029, 0.00071545, 0.02242054, 0.01975435, 0.01975435, - 0.00143860, 0.00143860, 0.00715263, 0.05481156, 0.04396936, 0.04396936, - 0.00826301, 0.00826301, 0.00950813, 0.04304817, 0.04400210, 0.04400210, - 0.00203560, 0.00203560, 0.00207048, 0.02226551, 0.03531839, 0.03531839, - 0.00746195, 0.00746195, 0.01268396, 0.02380441, 0.03074892, 0.03074892, - 0.00389360, 0.00389360, 0.01154058, 0.05602348, 0.04034627, 0.04034627, - 0.00642767, 0.00642767, 0.02338437, 0.43710790, 0.48306584, 0.48306584, - 0.00291728, 0.00291728, 0.11718631, 0.84620157, 0.80881708, 0.80881708, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00224835, 0.00288498, 0.00554574, 0.02261273, 0.02349047, 0.02647988, - 0.00330612, 0.00430468, 0.00975355, 0.02954525, 0.03242621, 0.03052183, - 0.03210358, 0.02583317, 0.04906091, 0.04609366, 0.04064508, 0.04250035, - 0.00888799, 0.00936948, 0.01541312, 0.02079095, 0.03001210, 0.02721119, - 0.02593986, 0.02559304, 0.04760672, 0.04958274, 0.04942973, 0.03703768, - 0.01005313, 0.01125217, 0.05423798, 0.10135670, 0.06021902, 0.09005459, - 0.02358822, 0.03737522, 0.06633807, 0.22190369, 0.41562743, 0.32601504, - 0.01240071, 0.02372173, 0.20217767, 0.49239981, 0.52883866, 0.50769018, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000] + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00046029, + 0.00046029, + 0.00071545, + 0.02242054, + 0.01975435, + 0.01975435, + 0.00143860, + 0.00143860, + 0.00715263, + 0.05481156, + 0.04396936, + 0.04396936, + 0.00826301, + 0.00826301, + 0.00950813, + 0.04304817, + 0.04400210, + 0.04400210, + 0.00203560, + 0.00203560, + 0.00207048, + 0.02226551, + 0.03531839, + 0.03531839, + 0.00746195, + 0.00746195, + 0.01268396, + 0.02380441, + 0.03074892, + 0.03074892, + 0.00389360, + 0.00389360, + 0.01154058, + 0.05602348, + 0.04034627, + 0.04034627, + 0.00642767, + 0.00642767, + 0.02338437, + 0.43710790, + 0.48306584, + 0.48306584, + 0.00291728, + 0.00291728, + 0.11718631, + 0.84620157, + 0.80881708, + 0.80881708, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00224835, + 0.00288498, + 0.00554574, + 0.02261273, + 0.02349047, + 0.02647988, + 0.00330612, + 0.00430468, + 0.00975355, + 0.02954525, + 0.03242621, + 0.03052183, + 0.03210358, + 0.02583317, + 0.04906091, + 0.04609366, + 0.04064508, + 0.04250035, + 0.00888799, + 0.00936948, + 0.01541312, + 0.02079095, + 0.03001210, + 0.02721119, + 0.02593986, + 0.02559304, + 0.04760672, + 0.04958274, + 0.04942973, + 0.03703768, + 0.01005313, + 0.01125217, + 0.05423798, + 0.10135670, + 0.06021902, + 0.09005459, + 0.02358822, + 0.03737522, + 0.06633807, + 0.22190369, + 0.41562743, + 0.32601504, + 0.01240071, + 0.02372173, + 0.20217767, + 0.49239981, + 0.52883866, + 0.50769018, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, +] gammas_class1 = [ - 0.00000000, 0.00000000, 0.00000000, -0.00000000, 0.00000000, 0.00000000, - 0.00053387, 0.00053387, 0.00086230, 0.01894313, 0.02034210, 0.02034210, - 0.00155506, 0.00155506, 0.00260125, 0.01821681, 0.01820381, 0.01820381, - 0.00571765, 0.00571765, 0.00544460, 0.01325570, 0.01118428, 0.01118428, - 0.00016153, 0.00016153, 0.00032679, 0.00020002, 0.00020927, 0.00020927, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00233036, 0.00264690, 0.00525130, 0.02096414, 0.02200915, 0.02347515, - 0.00297698, 0.00348529, 0.00638118, 0.01776255, 0.02740917, 0.02217207, - 0.03234423, 0.02580162, 0.03682891, 0.03904463, 0.01942315, 0.02072384, - 0.00004097, 0.00005101, 0.00007457, 0.00003508, 0.00004210, 0.00003803, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000] + 0.00000000, + 0.00000000, + 0.00000000, + -0.00000000, + 0.00000000, + 0.00000000, + 0.00053387, + 0.00053387, + 0.00086230, + 0.01894313, + 0.02034210, + 0.02034210, + 0.00155506, + 0.00155506, + 0.00260125, + 0.01821681, + 0.01820381, + 0.01820381, + 0.00571765, + 0.00571765, + 0.00544460, + 0.01325570, + 0.01118428, + 0.01118428, + 0.00016153, + 0.00016153, + 0.00032679, + 0.00020002, + 0.00020927, + 0.00020927, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00233036, + 0.00264690, + 0.00525130, + 0.02096414, + 0.02200915, + 0.02347515, + 0.00297698, + 0.00348529, + 0.00638118, + 0.01776255, + 0.02740917, + 0.02217207, + 0.03234423, + 0.02580162, + 0.03682891, + 0.03904463, + 0.01942315, + 0.02072384, + 0.00004097, + 0.00005101, + 0.00007457, + 0.00003508, + 0.00004210, + 0.00003803, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, +] gammas_class2 = [ - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000728, 0.00000728, 0.00002201, 0.00022624, 0.00028946, 0.00028946, - 0.00038736, 0.00038736, 0.00415534, 0.03667993, 0.03240766, 0.03240766, - 0.00050274, 0.00050274, 0.00337024, 0.02935928, 0.03053801, 0.03053801, - 0.00146473, 0.00146473, 0.00140248, 0.02775086, 0.02871662, 0.02871662, - 0.00979262, 0.00979262, 0.01700920, 0.04388280, 0.05231049, 0.05231049, - 0.00355424, 0.00355424, 0.01351094, 0.06235333, 0.03437465, 0.03437465, - 0.00731397, 0.00731397, 0.02896588, 0.50067605, 0.50779324, 0.50779324, - 0.00161440, 0.00161440, 0.01263256, 0.27319333, 0.27917018, 0.27917018, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00057618, 0.00033051, 0.00240702, 0.00990280, 0.00409632, 0.00652547, - 0.00217505, 0.00195163, 0.01274449, 0.01213516, 0.02717067, 0.02293662, - 0.00712953, 0.00811051, 0.01383178, 0.02037067, 0.03068992, 0.02374747, - 0.02020952, 0.01977157, 0.03160744, 0.04024612, 0.04381027, 0.03949241, - 0.01714475, 0.01764459, 0.05673104, 0.09304789, 0.05705200, 0.06221421, - 0.02926385, 0.03288210, 0.06679574, 0.25418868, 0.45921877, 0.42341309, - 0.01048868, 0.01797532, 0.08275328, 0.26595568, 0.32426329, 0.31898043, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000] -freq_points = [0.0, 3.41024688, 6.82049376, 10.23074063, 13.64098751, - 17.05123439, 20.46148127, 23.87172814, 27.28197502, 30.6922219] + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000728, + 0.00000728, + 0.00002201, + 0.00022624, + 0.00028946, + 0.00028946, + 0.00038736, + 0.00038736, + 0.00415534, + 0.03667993, + 0.03240766, + 0.03240766, + 0.00050274, + 0.00050274, + 0.00337024, + 0.02935928, + 0.03053801, + 0.03053801, + 0.00146473, + 0.00146473, + 0.00140248, + 0.02775086, + 0.02871662, + 0.02871662, + 0.00979262, + 0.00979262, + 0.01700920, + 0.04388280, + 0.05231049, + 0.05231049, + 0.00355424, + 0.00355424, + 0.01351094, + 0.06235333, + 0.03437465, + 0.03437465, + 0.00731397, + 0.00731397, + 0.02896588, + 0.50067605, + 0.50779324, + 0.50779324, + 0.00161440, + 0.00161440, + 0.01263256, + 0.27319333, + 0.27917018, + 0.27917018, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00057618, + 0.00033051, + 0.00240702, + 0.00990280, + 0.00409632, + 0.00652547, + 0.00217505, + 0.00195163, + 0.01274449, + 0.01213516, + 0.02717067, + 0.02293662, + 0.00712953, + 0.00811051, + 0.01383178, + 0.02037067, + 0.03068992, + 0.02374747, + 0.02020952, + 0.01977157, + 0.03160744, + 0.04024612, + 0.04381027, + 0.03949241, + 0.01714475, + 0.01764459, + 0.05673104, + 0.09304789, + 0.05705200, + 0.06221421, + 0.02926385, + 0.03288210, + 0.06679574, + 0.25418868, + 0.45921877, + 0.42341309, + 0.01048868, + 0.01797532, + 0.08275328, + 0.26595568, + 0.32426329, + 0.31898043, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, +] +freq_points = [ + 0.0, + 3.41024688, + 6.82049376, + 10.23074063, + 13.64098751, + 17.05123439, + 20.46148127, + 23.87172814, + 27.28197502, + 30.6922219, +] freq_points_sigma = [ - 0.0, 3.45491354, 6.90982709, 10.36474063, 13.81965418, - 17.27456772, 20.72948127, 24.18439481, 27.63930835, 31.09422190] + 0.0, + 3.45491354, + 6.90982709, + 10.36474063, + 13.81965418, + 17.27456772, + 20.72948127, + 24.18439481, + 27.63930835, + 31.09422190, +] -detailed_gamma = [0.00000000, 0.00653193, 0.02492913, 0.01682092, 0.01001680, - 0.02181888, 0.01858641, 0.16208762, 0.09598706, 0.00000000] +detailed_gamma = [ + 0.00000000, + 0.00653193, + 0.02492913, + 0.01682092, + 0.01001680, + 0.02181888, + 0.01858641, + 0.16208762, + 0.09598706, + 0.00000000, +] gammas_nacl = [ - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.03396688, 0.03396688, 0.00687452, 0.21001764, 0.21001764, 0.12310439, - 0.00297385, 0.00297385, 0.00227915, 0.10673763, 0.10673763, 0.06918881, - 0.01003326, 0.01003326, 0.00996780, 0.03414868, 0.03414868, 0.02258494, - 0.04027592, 0.04027592, 0.03603612, 0.57995646, 0.57995646, 0.39737731, - 0.12705253, 0.12705253, 0.09246595, 0.88750309, 0.88750309, 0.60334780, - 0.29968747, 0.29968747, 0.14257862, 0.22134950, 0.22134950, 0.09606896, - 0.03941985, 0.03941985, 0.01632766, 0.00222574, 0.00222574, 0.00627294, - 0.00240808, 0.00240808, 0.00688951, 0.00008074, 0.00008074, 0.00003641, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.02850846, 0.09000833, 0.19582553, 0.13715943, 0.19892888, 0.14203618, - 0.00861856, 0.02747203, 0.05000735, 0.04441740, 0.11080545, 0.04172184, - 0.00738182, 0.01722875, 0.03273830, 0.04517923, 0.02441539, 0.03277688, - 0.03233818, 0.08459289, 0.19264167, 0.11281266, 0.45667245, 0.18491212, - 0.10846241, 0.47768641, 1.04554356, 0.64678566, 0.83834225, 0.61795504, - 0.19485590, 0.43708391, 0.24896003, 0.35882984, 0.30654914, 0.22471014, - 0.03624311, 0.13350831, 0.12479592, 0.06750776, 0.02503182, 0.04543786, - 0.00155614, 0.01088453, 0.00064712, 0.00392933, 0.00058749, 0.00022448, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000] + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.03396688, + 0.03396688, + 0.00687452, + 0.21001764, + 0.21001764, + 0.12310439, + 0.00297385, + 0.00297385, + 0.00227915, + 0.10673763, + 0.10673763, + 0.06918881, + 0.01003326, + 0.01003326, + 0.00996780, + 0.03414868, + 0.03414868, + 0.02258494, + 0.04027592, + 0.04027592, + 0.03603612, + 0.57995646, + 0.57995646, + 0.39737731, + 0.12705253, + 0.12705253, + 0.09246595, + 0.88750309, + 0.88750309, + 0.60334780, + 0.29968747, + 0.29968747, + 0.14257862, + 0.22134950, + 0.22134950, + 0.09606896, + 0.03941985, + 0.03941985, + 0.01632766, + 0.00222574, + 0.00222574, + 0.00627294, + 0.00240808, + 0.00240808, + 0.00688951, + 0.00008074, + 0.00008074, + 0.00003641, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.02850846, + 0.09000833, + 0.19582553, + 0.13715943, + 0.19892888, + 0.14203618, + 0.00861856, + 0.02747203, + 0.05000735, + 0.04441740, + 0.11080545, + 0.04172184, + 0.00738182, + 0.01722875, + 0.03273830, + 0.04517923, + 0.02441539, + 0.03277688, + 0.03233818, + 0.08459289, + 0.19264167, + 0.11281266, + 0.45667245, + 0.18491212, + 0.10846241, + 0.47768641, + 1.04554356, + 0.64678566, + 0.83834225, + 0.61795504, + 0.19485590, + 0.43708391, + 0.24896003, + 0.35882984, + 0.30654914, + 0.22471014, + 0.03624311, + 0.13350831, + 0.12479592, + 0.06750776, + 0.02503182, + 0.04543786, + 0.00155614, + 0.01088453, + 0.00064712, + 0.00392933, + 0.00058749, + 0.00022448, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, +] freq_points_nacl = [ - 0.0, 1.63223063, 3.26446125, 4.89669188, 6.5289225, - 8.16115313, 9.79338375, 11.42561438, 13.057845, 14.69007563] + 0.0, + 1.63223063, + 3.26446125, + 4.89669188, + 6.5289225, + 8.16115313, + 9.79338375, + 11.42561438, + 13.057845, + 14.69007563, +] gammas_nacl_nac = [ - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.20104463, 0.20104463, 0.12311129, - 0.00000000, 0.00000000, 0.00000000, 0.10448465, 0.10448465, 0.06445738, - 0.00000000, 0.00000000, 0.00000000, 0.03814089, 0.03814089, 0.02351398, - 0.00000000, 0.00000000, 0.00000000, 0.79562828, 0.79562828, 0.49265042, - 0.00000000, 0.00000000, 0.00000000, 0.71487838, 0.71487838, 0.44811019, - 0.00000000, 0.00000000, 0.00000000, 0.29194862, 0.29194862, 0.18098946, - 0.00000000, 0.00000000, 0.00000000, 0.00006218, 0.00006218, 0.00004024, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000] + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.20104463, + 0.20104463, + 0.12311129, + 0.00000000, + 0.00000000, + 0.00000000, + 0.10448465, + 0.10448465, + 0.06445738, + 0.00000000, + 0.00000000, + 0.00000000, + 0.03814089, + 0.03814089, + 0.02351398, + 0.00000000, + 0.00000000, + 0.00000000, + 0.79562828, + 0.79562828, + 0.49265042, + 0.00000000, + 0.00000000, + 0.00000000, + 0.71487838, + 0.71487838, + 0.44811019, + 0.00000000, + 0.00000000, + 0.00000000, + 0.29194862, + 0.29194862, + 0.18098946, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00006218, + 0.00006218, + 0.00004024, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, +] freq_points_nacl_nac = [ - 0.0, 1.65531064, 3.31062129, 4.96593193, 6.62124257, 8.27655322, - 9.93186386, 11.58717451, 13.24248515, 14.89779579] + 0.0, + 1.65531064, + 3.31062129, + 4.96593193, + 6.62124257, + 8.27655322, + 9.93186386, + 11.58717451, + 13.24248515, + 14.89779579, +] def test_imag_self_energy_at_bands(si_pbesol): @@ -143,17 +745,33 @@ def test_imag_self_energy_at_bands(si_pbesol): """ si_pbesol.mesh_numbers = [9, 9, 9] si_pbesol.init_phph_interaction() - gammas_ref = np.reshape([ - 0.00021553, 0.00021553, 0.00084329, - 0.04693498, 0.04388354, 0.04388354, - 0.00383646, 0.00494357, 0.02741665, - 0.01407101, 0.04133322, 0.03013125], - (2, -1)) + gammas_ref = np.reshape( + [ + 0.00021553, + 0.00021553, + 0.00084329, + 0.04693498, + 0.04388354, + 0.04388354, + 0.00383646, + 0.00494357, + 0.02741665, + 0.01407101, + 0.04133322, + 0.03013125, + ], + (2, -1), + ) for i, grgp in enumerate((1, 103)): _fpoints, _gammas = si_pbesol.run_imag_self_energy( - [si_pbesol.grid.grg2bzg[grgp], ], - [300, ], - frequency_points_at_bands=True) + [ + si_pbesol.grid.grg2bzg[grgp], + ], + [ + 300, + ], + frequency_points_at_bands=True, + ) np.testing.assert_allclose(_gammas.ravel(), gammas_ref[i], atol=1e-2) @@ -168,27 +786,110 @@ def test_imag_self_energy_at_bands_detailed(si_pbesol): si_pbesol.init_phph_interaction() _fpoints, _gammas, _detailed_gammas = si_pbesol.run_imag_self_energy( si_pbesol.grid.grg2bzg[[1, 103]], - [300, ], + [ + 300, + ], frequency_points_at_bands=True, - keep_gamma_detail=True) + keep_gamma_detail=True, + ) - weights_1 = [2, 2, 2, 2, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 12, 12, 12, 12, 6, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 6, 12, 12, 12, 12, 12, 12, 12, - 12, 6, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 6] - weights_103 = [2, ] * 364 + [1, ] + weights_1 = [ + 2, + 2, + 2, + 2, + 1, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 12, + 12, + 12, + 12, + 6, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 6, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 6, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 12, + 6, + ] + weights_103 = [2] * 364 + [1] gammas_1_ref = _gammas[:, :, 0].ravel() gammas_103_ref = _gammas[:, :, 1].ravel() - gammas_1 = np.dot(weights_1, - _detailed_gammas[0][0, 0].sum(axis=-1).sum(axis=-1)) - gammas_103 = np.dot(weights_103, - _detailed_gammas[1][0, 0].sum(axis=-1).sum(axis=-1)) - np.testing.assert_allclose(gammas_1[:2].sum(), gammas_1_ref[:2].sum(), - atol=1e-2) - np.testing.assert_allclose(gammas_1[-2:].sum(), gammas_1_ref[-2:].sum(), - atol=1e-2) + gammas_1 = np.dot(weights_1, _detailed_gammas[0][0, 0].sum(axis=-1).sum(axis=-1)) + gammas_103 = np.dot( + weights_103, _detailed_gammas[1][0, 0].sum(axis=-1).sum(axis=-1) + ) + np.testing.assert_allclose(gammas_1[:2].sum(), gammas_1_ref[:2].sum(), atol=1e-2) + np.testing.assert_allclose(gammas_1[-2:].sum(), gammas_1_ref[-2:].sum(), atol=1e-2) np.testing.assert_allclose(gammas_1[2:4], gammas_1_ref[2:4], atol=1e-2) np.testing.assert_allclose(gammas_103, gammas_103_ref, atol=1e-2) @@ -203,12 +904,13 @@ def test_imag_self_energy_npoints(si_pbesol): si_pbesol.init_phph_interaction() _fpoints, _gammas = si_pbesol.run_imag_self_energy( si_pbesol.grid.grg2bzg[[1, 103]], - [300, ], - num_frequency_points=10) - np.testing.assert_allclose( - gammas, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2) - np.testing.assert_allclose( - freq_points, _fpoints.ravel(), atol=1e-5) + [ + 300, + ], + num_frequency_points=10, + ) + np.testing.assert_allclose(gammas, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2) + np.testing.assert_allclose(freq_points, _fpoints.ravel(), atol=1e-5) def test_imag_self_energy_npoints_with_sigma(si_pbesol): @@ -218,20 +920,25 @@ def test_imag_self_energy_npoints_with_sigma(si_pbesol): * with smearing method """ - si_pbesol.sigmas = [0.1, ] + si_pbesol.sigmas = [ + 0.1, + ] si_pbesol.mesh_numbers = [9, 9, 9] si_pbesol.init_phph_interaction() _fpoints, _gammas = si_pbesol.run_imag_self_energy( si_pbesol.grid.grg2bzg[[1, 103]], - [300, ], - num_frequency_points=10) + [ + 300, + ], + num_frequency_points=10, + ) # for _g_line in np.swapaxes(_gammas, -1, -2).reshape(-1, 6): # print("".join(["%.8f, " % g for g in _g_line])) # print("".join(["%.8f, " % f for f in _fpoints])) np.testing.assert_allclose( - gammas_sigma, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2) - np.testing.assert_allclose( - freq_points_sigma, _fpoints.ravel(), atol=1e-5) + gammas_sigma, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2 + ) + np.testing.assert_allclose(freq_points_sigma, _fpoints.ravel(), atol=1e-5) si_pbesol.sigmas = None @@ -245,12 +952,13 @@ def test_imag_self_energy_freq_points(si_pbesol): si_pbesol.init_phph_interaction() _fpoints, _gammas = si_pbesol.run_imag_self_energy( si_pbesol.grid.grg2bzg[[1, 103]], - [300, ], - frequency_points=freq_points) - np.testing.assert_allclose( - gammas, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2) - np.testing.assert_allclose( - freq_points, _fpoints.ravel(), atol=1e-5) + [ + 300, + ], + frequency_points=freq_points, + ) + np.testing.assert_allclose(gammas, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2) + np.testing.assert_allclose(freq_points, _fpoints.ravel(), atol=1e-5) def test_imag_self_energy_detailed(si_pbesol): @@ -263,14 +971,20 @@ def test_imag_self_energy_detailed(si_pbesol): si_pbesol.mesh_numbers = [9, 9, 9] si_pbesol.init_phph_interaction() _fpoints, _gammas, _detailed_gammas = si_pbesol.run_imag_self_energy( - si_pbesol.grid.grg2bzg[[1, ]], - [300, ], + si_pbesol.grid.grg2bzg[ + [ + 1, + ] + ], + [ + 300, + ], frequency_points=freq_points, - keep_gamma_detail=True) + keep_gamma_detail=True, + ) np.testing.assert_allclose( - detailed_gamma, - _detailed_gammas[0][0, 0].sum(axis=(1, 2, 3, 4)), - atol=1e-2) + detailed_gamma, _detailed_gammas[0][0, 0].sum(axis=(1, 2, 3, 4)), atol=1e-2 + ) def test_imag_self_energy_scat_class1(si_pbesol): @@ -284,13 +998,17 @@ def test_imag_self_energy_scat_class1(si_pbesol): si_pbesol.init_phph_interaction() _fpoints, _gammas = si_pbesol.run_imag_self_energy( si_pbesol.grid.grg2bzg[[1, 103]], - [300, ], + [ + 300, + ], frequency_points=freq_points, - scattering_event_class=1) + scattering_event_class=1, + ) # for line in si_pbesol.gammas.reshape(-1, 6): # print(("%10.8f, " * 6) % tuple(line)) np.testing.assert_allclose( - gammas_class1, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2) + gammas_class1, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2 + ) def test_imag_self_energy_scat_class2(si_pbesol): @@ -304,13 +1022,17 @@ def test_imag_self_energy_scat_class2(si_pbesol): si_pbesol.init_phph_interaction() _fpoints, _gammas = si_pbesol.run_imag_self_energy( si_pbesol.grid.grg2bzg[[1, 103]], - [300, ], + [ + 300, + ], frequency_points=freq_points, - scattering_event_class=2) + scattering_event_class=2, + ) # for line in si_pbesol.gammas.reshape(-1, 6): # print(("%10.8f, " * 6) % tuple(line)) np.testing.assert_allclose( - gammas_class2, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2) + gammas_class2, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2 + ) def test_imag_self_energy_nacl_npoints(nacl_pbe): @@ -323,15 +1045,18 @@ def test_imag_self_energy_nacl_npoints(nacl_pbe): nacl_pbe.init_phph_interaction() _fpoints, _gammas = nacl_pbe.run_imag_self_energy( nacl_pbe.grid.grg2bzg[[1, 103]], - [300, ], - num_frequency_points=10) + [ + 300, + ], + num_frequency_points=10, + ) # for line in np.swapaxes(_gammas, -1, -2).ravel().reshape(-1, 6): # print(("%10.8f, " * 6) % tuple(line)) # print(_fpoints.ravel()) np.testing.assert_allclose( - gammas_nacl, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2) - np.testing.assert_allclose( - freq_points_nacl, _fpoints.ravel(), atol=1e-5) + gammas_nacl, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2 + ) + np.testing.assert_allclose(freq_points_nacl, _fpoints.ravel(), atol=1e-5) def test_imag_self_energy_nacl_nac_npoints(nacl_pbe): @@ -344,13 +1069,20 @@ def test_imag_self_energy_nacl_nac_npoints(nacl_pbe): nacl_pbe.mesh_numbers = [9, 9, 9] nacl_pbe.init_phph_interaction(nac_q_direction=[1, 0, 0]) _fpoints, _gammas = nacl_pbe.run_imag_self_energy( - nacl_pbe.grid.grg2bzg[[0, ]], - [300, ], - num_frequency_points=10) + nacl_pbe.grid.grg2bzg[ + [ + 0, + ] + ], + [ + 300, + ], + num_frequency_points=10, + ) # for line in np.swapaxes(_gammas, -1, -2).ravel().reshape(-1, 6): # print(("%10.8f, " * 6) % tuple(line)) # print(_fpoints.ravel()) np.testing.assert_allclose( - gammas_nacl_nac, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2) - np.testing.assert_allclose( - freq_points_nacl_nac, _fpoints.ravel(), atol=1e-5) + gammas_nacl_nac, np.swapaxes(_gammas, -1, -2).ravel(), atol=1e-2 + ) + np.testing.assert_allclose(freq_points_nacl_nac, _fpoints.ravel(), atol=1e-5) diff --git a/test/phonon3/test_interaction.py b/test/phonon3/test_interaction.py index 409f7423..9819d796 100644 --- a/test/phonon3/test_interaction.py +++ b/test/phonon3/test_interaction.py @@ -4,23 +4,84 @@ import numpy as np from phono3py.phonon3.interaction import Interaction itr_RTA_Si = [ - 4.522052e-08, 4.896362e-08, 4.614211e-08, 4.744361e-08, 4.832248e-08, - 4.698535e-08, 4.597876e-08, 4.645423e-08, 4.659572e-08, 4.730222e-08] + 4.522052e-08, + 4.896362e-08, + 4.614211e-08, + 4.744361e-08, + 4.832248e-08, + 4.698535e-08, + 4.597876e-08, + 4.645423e-08, + 4.659572e-08, + 4.730222e-08, +] itr_RTA_AlN = [ - 7.456796e-08, 7.242121e-08, 7.068141e-08, 7.059521e-08, 7.289497e-08, - 7.127172e-08, 7.082734e-08, 7.394367e-08, 7.084351e-08, 7.083299e-08, - 7.085792e-08, 7.124150e-08, 7.048386e-08, 7.062840e-08, 7.036795e-08, - 7.043995e-08, 7.366440e-08, 7.136803e-08, 6.988469e-08, 6.989518e-08, - 7.179516e-08, 7.038043e-08, 7.011416e-08, 7.278196e-08, 6.999028e-08, - 7.009615e-08, 7.018236e-08, 7.025054e-08, 6.977425e-08, 6.993095e-08, - 6.962119e-08, 6.964423e-08, 7.121739e-08, 6.939940e-08, 6.834705e-08, - 6.847351e-08, 6.977063e-08, 6.872065e-08, 6.863218e-08, 7.055696e-08, - 6.836064e-08, 6.854052e-08, 6.864199e-08, 6.849059e-08, 6.826958e-08, - 6.837379e-08, 6.808307e-08, 6.804480e-08, 6.961289e-08, 6.816170e-08, - 6.730028e-08, 6.746055e-08, 6.851460e-08, 6.764892e-08, 6.754060e-08, - 6.913662e-08, 6.729303e-08, 6.736722e-08, 6.734663e-08, 6.743441e-08, - 6.713107e-08, 6.710084e-08, 6.698233e-08, 6.694871e-08] + 7.456796e-08, + 7.242121e-08, + 7.068141e-08, + 7.059521e-08, + 7.289497e-08, + 7.127172e-08, + 7.082734e-08, + 7.394367e-08, + 7.084351e-08, + 7.083299e-08, + 7.085792e-08, + 7.124150e-08, + 7.048386e-08, + 7.062840e-08, + 7.036795e-08, + 7.043995e-08, + 7.366440e-08, + 7.136803e-08, + 6.988469e-08, + 6.989518e-08, + 7.179516e-08, + 7.038043e-08, + 7.011416e-08, + 7.278196e-08, + 6.999028e-08, + 7.009615e-08, + 7.018236e-08, + 7.025054e-08, + 6.977425e-08, + 6.993095e-08, + 6.962119e-08, + 6.964423e-08, + 7.121739e-08, + 6.939940e-08, + 6.834705e-08, + 6.847351e-08, + 6.977063e-08, + 6.872065e-08, + 6.863218e-08, + 7.055696e-08, + 6.836064e-08, + 6.854052e-08, + 6.864199e-08, + 6.849059e-08, + 6.826958e-08, + 6.837379e-08, + 6.808307e-08, + 6.804480e-08, + 6.961289e-08, + 6.816170e-08, + 6.730028e-08, + 6.746055e-08, + 6.851460e-08, + 6.764892e-08, + 6.754060e-08, + 6.913662e-08, + 6.729303e-08, + 6.736722e-08, + 6.734663e-08, + 6.743441e-08, + 6.713107e-08, + 6.710084e-08, + 6.698233e-08, + 6.694871e-08, +] @pytest.mark.parametrize("lang", ["C", "Py"]) @@ -32,8 +93,8 @@ def test_interaction_RTA_si(si_pbesol, lang): # _show(itr) # (10, 6, 6, 6) np.testing.assert_allclose( - itr.interaction_strength.sum(axis=(1, 2, 3)), - itr_RTA_Si, rtol=0, atol=1e-6) + itr.interaction_strength.sum(axis=(1, 2, 3)), itr_RTA_Si, rtol=0, atol=1e-6 + ) def test_interaction_RTA_AlN(aln_lda): @@ -43,21 +104,16 @@ def test_interaction_RTA_AlN(aln_lda): itr.run() # _show(itr) np.testing.assert_allclose( - itr.interaction_strength.sum(axis=(1, 2, 3)), - itr_RTA_AlN, rtol=0, atol=1e-6) + itr.interaction_strength.sum(axis=(1, 2, 3)), itr_RTA_AlN, rtol=0, atol=1e-6 + ) def _get_irt(ph3, mesh): ph3.mesh_numbers = mesh - itr = Interaction(ph3.primitive, - ph3.grid, - ph3.primitive_symmetry, - ph3.fc3, - cutoff_frequency=1e-4) - itr.init_dynamical_matrix( - ph3.fc2, - ph3.phonon_supercell, - ph3.phonon_primitive) + itr = Interaction( + ph3.primitive, ph3.grid, ph3.primitive_symmetry, ph3.fc3, cutoff_frequency=1e-4 + ) + itr.init_dynamical_matrix(ph3.fc2, ph3.phonon_supercell, ph3.phonon_primitive) return itr diff --git a/test/phonon3/test_joint_dos.py b/test/phonon3/test_joint_dos.py index 73652897..3a34b62b 100644 --- a/test/phonon3/test_joint_dos.py +++ b/test/phonon3/test_joint_dos.py @@ -1,68 +1,166 @@ import numpy as np from phono3py.api_jointdos import Phono3pyJointDos -si_freq_points = [0.0000000, 3.4102469, 6.8204938, 10.2307406, 13.6409875, - 17.0512344, 20.4614813, 23.8717281, 27.2819750, 30.6922219] -si_jdos_12 = [10.8993284, 0.0000000, - 1.9825862, 0.0000000, - 1.6458638, 0.4147573, - 3.7550744, 0.8847213, - 0.0176267, 1.0774414, - 0.0000000, 2.1981098, - 0.0000000, 1.4959386, - 0.0000000, 2.0987108, - 0.0000000, 1.1648722, - 0.0000000, 0.0000000] -si_jdos_nomeshsym_12 = [10.9478722, 0.0000000, - 1.9825862, 0.0000000, - 1.6458638, 0.4147573, - 3.7550744, 0.8847213, - 0.0176267, 1.0774414, - 0.0000000, 2.1981098, - 0.0000000, 1.4959386, - 0.0000000, 2.0987108, - 0.0000000, 1.1648722, - 0.0000000, 0.0000000] +si_freq_points = [ + 0.0000000, + 3.4102469, + 6.8204938, + 10.2307406, + 13.6409875, + 17.0512344, + 20.4614813, + 23.8717281, + 27.2819750, + 30.6922219, +] +si_jdos_12 = [ + 10.8993284, + 0.0000000, + 1.9825862, + 0.0000000, + 1.6458638, + 0.4147573, + 3.7550744, + 0.8847213, + 0.0176267, + 1.0774414, + 0.0000000, + 2.1981098, + 0.0000000, + 1.4959386, + 0.0000000, + 2.0987108, + 0.0000000, + 1.1648722, + 0.0000000, + 0.0000000, +] +si_jdos_nomeshsym_12 = [ + 10.9478722, + 0.0000000, + 1.9825862, + 0.0000000, + 1.6458638, + 0.4147573, + 3.7550744, + 0.8847213, + 0.0176267, + 1.0774414, + 0.0000000, + 2.1981098, + 0.0000000, + 1.4959386, + 0.0000000, + 2.0987108, + 0.0000000, + 1.1648722, + 0.0000000, + 0.0000000, +] -nacl_freq_points = [0.0000000, 1.6322306, 3.2644613, 4.8966919, 6.5289225, - 8.1611531, 9.7933838, 11.4256144, 13.0578450, 14.6900756] -nacl_jdos_12 = [20.5529946, 0.0000000, - 11.3095088, 0.0000000, - 2.3068141, 0.1854566, - 0.2624358, 1.1781852, - 0.0000000, 4.9673048, - 0.0000000, 8.0794774, - 0.0000000, 5.3993210, - 0.0000000, 1.3717314, - 0.0000000, 0.1144440, - 0.0000000, 0.0000000] +nacl_freq_points = [ + 0.0000000, + 1.6322306, + 3.2644613, + 4.8966919, + 6.5289225, + 8.1611531, + 9.7933838, + 11.4256144, + 13.0578450, + 14.6900756, +] +nacl_jdos_12 = [ + 20.5529946, + 0.0000000, + 11.3095088, + 0.0000000, + 2.3068141, + 0.1854566, + 0.2624358, + 1.1781852, + 0.0000000, + 4.9673048, + 0.0000000, + 8.0794774, + 0.0000000, + 5.3993210, + 0.0000000, + 1.3717314, + 0.0000000, + 0.1144440, + 0.0000000, + 0.0000000, +] nacl_freq_points_gamma = [ - 0.0000000, 1.6553106, 3.3106213, 4.9659319, 6.6212426, - 8.2765532, 9.9318639, 11.5871745, 13.2424851, 14.8977958] -nacl_jdos_12_gamma = [1742452844146884.7500000, 0.0000000, - 8.8165476, 0.0415488, - 1.4914142, 0.3104766, - 0.3679421, 1.0509976, - 0.0358263, 5.8578016, - 0.0000000, 7.2272898, - 0.0000000, 5.7740314, - 0.0000000, 0.6663207, - 0.0000000, 0.1348658, - 0.0000000, 0.0000000] + 0.0000000, + 1.6553106, + 3.3106213, + 4.9659319, + 6.6212426, + 8.2765532, + 9.9318639, + 11.5871745, + 13.2424851, + 14.8977958, +] +nacl_jdos_12_gamma = [ + 1742452844146884.7500000, + 0.0000000, + 8.8165476, + 0.0415488, + 1.4914142, + 0.3104766, + 0.3679421, + 1.0509976, + 0.0358263, + 5.8578016, + 0.0000000, + 7.2272898, + 0.0000000, + 5.7740314, + 0.0000000, + 0.6663207, + 0.0000000, + 0.1348658, + 0.0000000, + 0.0000000, +] nacl_freq_points_at_300K = [ - 0.0000000, 1.6322306, 3.2644613, 4.8966919, 6.5289225, - 8.1611531, 9.7933838, 11.4256144, 13.0578450, 14.6900756] -nacl_jdos_12_at_300K = [0.0000000, 0.0000000, - 8.4625631, 0.0000000, - 4.1076174, 1.5151176, - 0.7992725, 6.7993659, - 0.0000000, 21.2271309, - 0.0000000, 26.9803907, - 0.0000000, 14.9103483, - 0.0000000, 3.2833064, - 0.0000000, 0.2398336, - 0.0000000, 0.0000000] + 0.0000000, + 1.6322306, + 3.2644613, + 4.8966919, + 6.5289225, + 8.1611531, + 9.7933838, + 11.4256144, + 13.0578450, + 14.6900756, +] +nacl_jdos_12_at_300K = [ + 0.0000000, + 0.0000000, + 8.4625631, + 0.0000000, + 4.1076174, + 1.5151176, + 0.7992725, + 6.7993659, + 0.0000000, + 21.2271309, + 0.0000000, + 26.9803907, + 0.0000000, + 14.9103483, + 0.0000000, + 3.2833064, + 0.0000000, + 0.2398336, + 0.0000000, + 0.0000000, +] def test_jdos_si(si_pbesol): @@ -73,14 +171,15 @@ def test_jdos_si(si_pbesol): si_pbesol.fc2, mesh=si_pbesol.mesh_numbers, num_frequency_points=10, - log_level=1) + log_level=1, + ) jdos.run([103]) # print(", ".join(["%.7f" % fp for fp in jdos.frequency_points])) - np.testing.assert_allclose(si_freq_points, jdos.frequency_points, - atol=1e-5) + np.testing.assert_allclose(si_freq_points, jdos.frequency_points, atol=1e-5) # print(", ".join(["%.7f" % jd for jd in jdos.joint_dos.ravel()])) - np.testing.assert_allclose(si_jdos_12[2:], jdos.joint_dos.ravel()[2:], - rtol=1e-2, atol=1e-5) + np.testing.assert_allclose( + si_jdos_12[2:], jdos.joint_dos.ravel()[2:], rtol=1e-2, atol=1e-5 + ) def test_jdso_si_nomeshsym(si_pbesol): @@ -92,14 +191,15 @@ def test_jdso_si_nomeshsym(si_pbesol): mesh=si_pbesol.mesh_numbers, num_frequency_points=10, is_mesh_symmetry=False, - log_level=1) + log_level=1, + ) jdos.run([103]) # print(", ".join(["%.7f" % fp for fp in jdos.frequency_points])) - np.testing.assert_allclose(si_freq_points, jdos.frequency_points, - atol=1e-5) + np.testing.assert_allclose(si_freq_points, jdos.frequency_points, atol=1e-5) # print(", ".join(["%.7f" % jd for jd in jdos.joint_dos.ravel()])) - np.testing.assert_allclose(si_jdos_nomeshsym_12[2:], jdos.joint_dos.ravel()[2:], - rtol=1e-2, atol=1e-5) + np.testing.assert_allclose( + si_jdos_nomeshsym_12[2:], jdos.joint_dos.ravel()[2:], rtol=1e-2, atol=1e-5 + ) def test_jdos_nacl(nacl_pbe): @@ -111,14 +211,15 @@ def test_jdos_nacl(nacl_pbe): mesh=nacl_pbe.mesh_numbers, nac_params=nacl_pbe.nac_params, num_frequency_points=10, - log_level=1) + log_level=1, + ) jdos.run([103]) # print(", ".join(["%.7f" % fp for fp in jdos.frequency_points])) - np.testing.assert_allclose(nacl_freq_points, jdos.frequency_points, - atol=1e-5) + np.testing.assert_allclose(nacl_freq_points, jdos.frequency_points, atol=1e-5) # print(", ".join(["%.7f" % jd for jd in jdos.joint_dos.ravel()])) - np.testing.assert_allclose(nacl_jdos_12[2:], jdos.joint_dos.ravel()[2:], - rtol=1e-2, atol=1e-5) + np.testing.assert_allclose( + nacl_jdos_12[2:], jdos.joint_dos.ravel()[2:], rtol=1e-2, atol=1e-5 + ) def test_jdos_nacl_gamma(nacl_pbe): @@ -131,15 +232,15 @@ def test_jdos_nacl_gamma(nacl_pbe): nac_params=nacl_pbe.nac_params, nac_q_direction=[1, 0, 0], num_frequency_points=10, - log_level=1) + log_level=1, + ) jdos.run([0]) # print(", ".join(["%.7f" % fp for fp in jdos.frequency_points])) - np.testing.assert_allclose(nacl_freq_points_gamma, jdos.frequency_points, - atol=1e-5) + np.testing.assert_allclose(nacl_freq_points_gamma, jdos.frequency_points, atol=1e-5) # print(", ".join(["%.7f" % jd for jd in jdos.joint_dos.ravel()])) np.testing.assert_allclose( - nacl_jdos_12_gamma[2:], jdos.joint_dos.ravel()[2:], - rtol=1e-2, atol=1e-5) + nacl_jdos_12_gamma[2:], jdos.joint_dos.ravel()[2:], rtol=1e-2, atol=1e-5 + ) def test_jdos_nacl_at_300K(nacl_pbe): @@ -151,14 +252,17 @@ def test_jdos_nacl_at_300K(nacl_pbe): mesh=nacl_pbe.mesh_numbers, nac_params=nacl_pbe.nac_params, num_frequency_points=10, - temperatures=[300, ], - log_level=1) + temperatures=[ + 300, + ], + log_level=1, + ) jdos.run([103]) # print(", ".join(["%.7f" % fp for fp in jdos.frequency_points])) np.testing.assert_allclose( - nacl_freq_points_at_300K, jdos.frequency_points, - atol=1e-5) + nacl_freq_points_at_300K, jdos.frequency_points, atol=1e-5 + ) # print(", ".join(["%.7f" % jd for jd in jdos.joint_dos.ravel()])) np.testing.assert_allclose( - nacl_jdos_12_at_300K[2:], jdos.joint_dos.ravel()[2:], - rtol=1e-2, atol=1e-5) + nacl_jdos_12_at_300K[2:], jdos.joint_dos.ravel()[2:], rtol=1e-2, atol=1e-5 + ) diff --git a/test/phonon3/test_kappa_LBTE.py b/test/phonon3/test_kappa_LBTE.py index b1483ea5..3924e5b7 100644 --- a/test/phonon3/test_kappa_LBTE.py +++ b/test/phonon3/test_kappa_LBTE.py @@ -1,3 +1,4 @@ +"""Tests for direct solution of LBTE.""" import numpy as np si_pbesol_kappa_LBTE = [111.802, 111.802, 111.802, 0, 0, 0] @@ -5,19 +6,29 @@ si_pbesol_kappa_LBTE_redcol = [61.3504328, 61.3504328, 61.3504328, 0, 0, 0] def test_kappa_LBTE(si_pbesol): + """Test for symmetry reduced collision matrix.""" si_pbesol.mesh_numbers = [9, 9, 9] si_pbesol.init_phph_interaction() - si_pbesol.run_thermal_conductivity(is_LBTE=True, temperatures=[300, ]) + si_pbesol.run_thermal_conductivity( + is_LBTE=True, + temperatures=[ + 300, + ], + ) kappa = si_pbesol.thermal_conductivity.kappa.ravel() np.testing.assert_allclose(si_pbesol_kappa_LBTE, kappa, atol=0.5) def test_kappa_LBTE_full_colmat(si_pbesol): + """Test for full collision matrix.""" si_pbesol.mesh_numbers = [5, 5, 5] si_pbesol.init_phph_interaction() si_pbesol.run_thermal_conductivity( is_LBTE=True, - temperatures=[300, ], - is_reducible_collision_matrix=True) + temperatures=[ + 300, + ], + is_reducible_collision_matrix=True, + ) kappa = si_pbesol.thermal_conductivity.kappa.ravel() np.testing.assert_allclose(si_pbesol_kappa_LBTE_redcol, kappa, atol=0.5) diff --git a/test/phonon3/test_kappa_RTA.py b/test/phonon3/test_kappa_RTA.py index 47fb7706..60e09c04 100644 --- a/test/phonon3/test_kappa_RTA.py +++ b/test/phonon3/test_kappa_RTA.py @@ -5,8 +5,14 @@ si_pbesol_kappa_RTA = [107.991, 107.991, 107.991, 0, 0, 0] si_pbesol_kappa_RTA_with_sigmas = [109.6985, 109.6985, 109.6985, 0, 0, 0] si_pbesol_kappa_RTA_iso = [96.92419, 96.92419, 96.92419, 0, 0, 0] si_pbesol_kappa_RTA_with_sigmas_iso = [96.03248, 96.03248, 96.03248, 0, 0, 0] -si_pbesol_kappa_RTA_si_nosym = [38.242347, 38.700219, 39.198018, - 0.3216, 0.207731, 0.283] +si_pbesol_kappa_RTA_si_nosym = [ + 38.242347, + 38.700219, + 39.198018, + 0.3216, + 0.207731, + 0.283, +] si_pbesol_kappa_RTA_si_nomeshsym = [38.90918, 38.90918, 38.90918, 0, 0, 0] nacl_pbe_kappa_RTA = [7.72798252, 7.72798252, 7.72798252, 0, 0, 0] nacl_pbe_kappa_RTA_with_sigma = [7.71913708, 7.71913708, 7.71913708, 0, 0, 0] @@ -32,27 +38,30 @@ def test_kappa_RTA_si_iso(si_pbesol): def test_kappa_RTA_si_with_sigma(si_pbesol): - si_pbesol.sigmas = [0.1, ] + si_pbesol.sigmas = [ + 0.1, + ] kappa = _get_kappa(si_pbesol, [9, 9, 9]).ravel() - np.testing.assert_allclose( - si_pbesol_kappa_RTA_with_sigmas, kappa, atol=0.5) + np.testing.assert_allclose(si_pbesol_kappa_RTA_with_sigmas, kappa, atol=0.5) si_pbesol.sigmas = None def test_kappa_RTA_si_with_sigma_full_pp(si_pbesol): - si_pbesol.sigmas = [0.1, ] + si_pbesol.sigmas = [ + 0.1, + ] kappa = _get_kappa(si_pbesol, [9, 9, 9], is_full_pp=True).ravel() print(kappa) - np.testing.assert_allclose( - si_pbesol_kappa_RTA_with_sigmas, kappa, atol=0.5) + np.testing.assert_allclose(si_pbesol_kappa_RTA_with_sigmas, kappa, atol=0.5) si_pbesol.sigmas = None def test_kappa_RTA_si_with_sigma_iso(si_pbesol): - si_pbesol.sigmas = [0.1, ] + si_pbesol.sigmas = [ + 0.1, + ] kappa = _get_kappa(si_pbesol, [9, 9, 9], is_isotope=True).ravel() - np.testing.assert_allclose( - si_pbesol_kappa_RTA_with_sigmas_iso, kappa, atol=0.5) + np.testing.assert_allclose(si_pbesol_kappa_RTA_with_sigmas_iso, kappa, atol=0.5) si_pbesol.sigmas = None @@ -83,35 +92,119 @@ def test_kappa_RTA_si_N_U(si_pbesol): is_N_U = True ph3.mesh_numbers = mesh ph3.init_phph_interaction() - ph3.run_thermal_conductivity(temperatures=[300, ], is_N_U=is_N_U) + ph3.run_thermal_conductivity( + temperatures=[ + 300, + ], + is_N_U=is_N_U, + ) gN, gU = ph3.thermal_conductivity.get_gamma_N_U() gN_ref = [ - 0.00000000, 0.00000000, 0.00000000, 0.07402084, 0.07402084, - 0.07402084, 0.00078535, 0.00078535, 0.00917995, 0.02178049, - 0.04470075, 0.04470075, 0.00173337, 0.00173337, 0.01240191, - 0.00198981, 0.03165195, 0.03165195, 0.00224713, 0.00224713, - 0.00860026, 0.03083611, 0.03083611, 0.02142118, 0.00277534, - 0.00330170, 0.02727451, 0.00356415, 0.01847744, 0.01320643, - 0.00155072, 0.00365611, 0.01641919, 0.00650083, 0.02576069, - 0.01161589, 0.00411969, 0.00411969, 0.00168211, 0.00168211, - 0.01560092, 0.01560092, 0.00620091, 0.00620091, 0.03764912, - 0.03764912, 0.02668523, 0.02668523] + 0.00000000, + 0.00000000, + 0.00000000, + 0.07402084, + 0.07402084, + 0.07402084, + 0.00078535, + 0.00078535, + 0.00917995, + 0.02178049, + 0.04470075, + 0.04470075, + 0.00173337, + 0.00173337, + 0.01240191, + 0.00198981, + 0.03165195, + 0.03165195, + 0.00224713, + 0.00224713, + 0.00860026, + 0.03083611, + 0.03083611, + 0.02142118, + 0.00277534, + 0.00330170, + 0.02727451, + 0.00356415, + 0.01847744, + 0.01320643, + 0.00155072, + 0.00365611, + 0.01641919, + 0.00650083, + 0.02576069, + 0.01161589, + 0.00411969, + 0.00411969, + 0.00168211, + 0.00168211, + 0.01560092, + 0.01560092, + 0.00620091, + 0.00620091, + 0.03764912, + 0.03764912, + 0.02668523, + 0.02668523, + ] gU_ref = [ - 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00015178, 0.00015178, 0.00076936, 0.00727539, - 0.00113112, 0.00113112, 0.00022696, 0.00022696, 0.00072558, - 0.00000108, 0.00021968, 0.00021968, 0.00079397, 0.00079397, - 0.00111068, 0.00424761, 0.00424761, 0.00697760, 0.00221593, - 0.00259510, 0.01996296, 0.00498962, 0.01258375, 0.00513825, - 0.00148802, 0.00161955, 0.01589219, 0.00646134, 0.00577275, - 0.00849711, 0.00313208, 0.00313208, 0.00036610, 0.00036610, - 0.01135335, 0.01135335, 0.00000000, 0.00000000, 0.00000000, - 0.00000000, 0.00000000, 0.00000000] + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00015178, + 0.00015178, + 0.00076936, + 0.00727539, + 0.00113112, + 0.00113112, + 0.00022696, + 0.00022696, + 0.00072558, + 0.00000108, + 0.00021968, + 0.00021968, + 0.00079397, + 0.00079397, + 0.00111068, + 0.00424761, + 0.00424761, + 0.00697760, + 0.00221593, + 0.00259510, + 0.01996296, + 0.00498962, + 0.01258375, + 0.00513825, + 0.00148802, + 0.00161955, + 0.01589219, + 0.00646134, + 0.00577275, + 0.00849711, + 0.00313208, + 0.00313208, + 0.00036610, + 0.00036610, + 0.01135335, + 0.01135335, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + 0.00000000, + ] # print(np.sum(gN), np.sum(gU)) - np.testing.assert_allclose(np.sum([gN_ref, gU_ref], axis=0), - gN.ravel() + gU.ravel(), atol=1e-2) + np.testing.assert_allclose( + np.sum([gN_ref, gU_ref], axis=0), gN.ravel() + gU.ravel(), atol=1e-2 + ) np.testing.assert_allclose(gN_ref, gN.ravel(), atol=1e-2) np.testing.assert_allclose(gU_ref, gU.ravel(), atol=1e-2) @@ -122,7 +215,9 @@ def test_kappa_RTA_nacl(nacl_pbe): def test_kappa_RTA_nacl_with_sigma(nacl_pbe): - nacl_pbe.sigmas = [0.1, ] + nacl_pbe.sigmas = [ + 0.1, + ] nacl_pbe.sigma_cutoff = 3 kappa = _get_kappa(nacl_pbe, [9, 9, 9]).ravel() np.testing.assert_allclose(nacl_pbe_kappa_RTA_with_sigma, kappa, atol=0.5) @@ -136,7 +231,9 @@ def test_kappa_RTA_aln(aln_lda): def test_kappa_RTA_aln_with_sigma(aln_lda): - aln_lda.sigmas = [0.1, ] + aln_lda.sigmas = [ + 0.1, + ] aln_lda.sigma_cutoff = 3 kappa = _get_kappa(aln_lda, [7, 7, 5]).ravel() np.testing.assert_allclose(aln_lda_kappa_RTA_with_sigmas, kappa, atol=0.5) @@ -147,7 +244,11 @@ def test_kappa_RTA_aln_with_sigma(aln_lda): def _get_kappa(ph3, mesh, is_isotope=False, is_full_pp=False): ph3.mesh_numbers = mesh ph3.init_phph_interaction() - ph3.run_thermal_conductivity(temperatures=[300, ], - is_isotope=is_isotope, - is_full_pp=is_full_pp) + ph3.run_thermal_conductivity( + temperatures=[ + 300, + ], + is_isotope=is_isotope, + is_full_pp=is_full_pp, + ) return ph3.thermal_conductivity.kappa diff --git a/test/phonon3/test_real_self_energy.py b/test/phonon3/test_real_self_energy.py index bede25c5..20a87af1 100644 --- a/test/phonon3/test_real_self_energy.py +++ b/test/phonon3/test_real_self_energy.py @@ -3,23 +3,64 @@ import numpy as np from phono3py.phonon3.real_self_energy import ImagToReal si_pbesol_Delta = [ - [-0.0057666, -0.0057666, -0.01639729, -0.14809965, - -0.15091765, -0.15091765], - [-0.02078728, -0.02102094, -0.06573269, -0.11432603, - -0.1366966, -0.14371315]] + [-0.0057666, -0.0057666, -0.01639729, -0.14809965, -0.15091765, -0.15091765], + [-0.02078728, -0.02102094, -0.06573269, -0.11432603, -0.1366966, -0.14371315], +] -si_pbesol_Delta_fps = [[-0.00576660, -0.00594616, -0.00840087, -0.00960344, - -0.00576660, -0.00594616, -0.00840087, -0.00960344, - -0.01493508, -0.01639729, -0.01997820, -0.02070427, - -0.15511645, -0.14747203, -0.14809966, -0.14230763, - -0.15674925, -0.15684992, -0.15983868, -0.15091767, - -0.15674925, -0.15684992, -0.15983868, -0.15091767], - [-0.01990306, -0.02077094, -0.01798066, -0.01935581, - -0.02158076, -0.02190634, -0.02195633, -0.01882258, - -0.05740055, -0.05240406, -0.06252644, -0.05651015, - -0.13072273, -0.11929265, -0.13472599, -0.13105120, - -0.15191900, -0.14202698, -0.14371246, -0.14168892, - -0.14760248, -0.13907618, -0.14275290, -0.14100562]] +si_pbesol_Delta_fps = [ + [ + -0.00576660, + -0.00594616, + -0.00840087, + -0.00960344, + -0.00576660, + -0.00594616, + -0.00840087, + -0.00960344, + -0.01493508, + -0.01639729, + -0.01997820, + -0.02070427, + -0.15511645, + -0.14747203, + -0.14809966, + -0.14230763, + -0.15674925, + -0.15684992, + -0.15983868, + -0.15091767, + -0.15674925, + -0.15684992, + -0.15983868, + -0.15091767, + ], + [ + -0.01990306, + -0.02077094, + -0.01798066, + -0.01935581, + -0.02158076, + -0.02190634, + -0.02195633, + -0.01882258, + -0.05740055, + -0.05240406, + -0.06252644, + -0.05651015, + -0.13072273, + -0.11929265, + -0.13472599, + -0.13105120, + -0.15191900, + -0.14202698, + -0.14371246, + -0.14168892, + -0.14760248, + -0.13907618, + -0.14275290, + -0.14100562, + ], +] # imag-self-energy Si-PBEsol 50x50x50 gp=5, bi=4, 101 points, 300K im_part = [ @@ -123,7 +164,8 @@ im_part = [ [29.7714552, 0.2258269, 29.7714552, 0.6147208, 29.9249163, 0.6117702], [30.0783775, 0.1397870, 30.0783775, 0.5578788, 30.2318386, 0.5591731], [30.3852997, 0.0468188, 30.3852997, 0.4941608, 30.5387608, 0.4706733], - [30.6922219, 0.0000000, 30.6922219, 0.4173657, 30.8456830, 0.3821416]] + [30.6922219, 0.0000000, 30.6922219, 0.4173657, 30.8456830, 0.3821416], +] def test_real_self_energy_with_band_indices(si_pbesol): @@ -136,9 +178,12 @@ def test_real_self_energy_with_band_indices(si_pbesol): si_pbesol.init_phph_interaction() _, delta = si_pbesol.run_real_self_energy( si_pbesol.grid.grg2bzg[[1, 103]], - [300, ], + [ + 300, + ], write_hdf5=False, - frequency_points_at_bands=True) + frequency_points_at_bands=True, + ) np.testing.assert_allclose(si_pbesol_Delta, delta[0, 0, :], atol=0.01) @@ -153,16 +198,21 @@ def test_real_self_energy_with_frequency_points(si_pbesol): frequency_points = [1.469947, 3.085309, 14.997187, 15.129080] fps, delta = si_pbesol.run_real_self_energy( si_pbesol.grid.grg2bzg[[1, 103]], - [300, ], + [ + 300, + ], frequency_points=frequency_points, write_hdf5=False, - frequency_points_at_bands=False) + frequency_points_at_bands=False, + ) np.testing.assert_allclose(frequency_points, fps, atol=1e-5) np.testing.assert_allclose( - si_pbesol_Delta_fps[0], delta[0, 0, 0].ravel(), atol=0.01) + si_pbesol_Delta_fps[0], delta[0, 0, 0].ravel(), atol=0.01 + ) np.testing.assert_allclose( - si_pbesol_Delta_fps[1], delta[0, 0, 1].ravel(), atol=0.01) + si_pbesol_Delta_fps[1], delta[0, 0, 1].ravel(), atol=0.01 + ) # for b in delta[0, 0, 0]: # print("".join("%.8f, " % s for s in b)) @@ -177,7 +227,7 @@ def test_ImagToReal(): i2r.run() pick_one_vals = -1 * i2r.re_part # -1 to make it freq-shift pick_one_freqs = i2r.frequency_points - i2r.run(method='half_shift') + i2r.run(method="half_shift") half_shift_vals = -1 * i2r.re_part # -1 to make it freq-shift half_shift_freqs = i2r.frequency_points # for f, im, f1, re1, f2, re2, in zip( diff --git a/test/phonon3/test_spectral_function.py b/test/phonon3/test_spectral_function.py index 8c9a1253..000f4f7c 100644 --- a/test/phonon3/test_spectral_function.py +++ b/test/phonon3/test_spectral_function.py @@ -3,59 +3,265 @@ import numpy as np from phono3py.phonon3.spectral_function import SpectralFunction shifts = [ - -0.0049592, -0.0049592, -0.0120983, -0.1226471, -0.1214069, -0.1214069, - -0.0051678, -0.0051678, -0.0128471, -0.1224616, -0.1200362, -0.1200362, - -0.0055308, -0.0055308, -0.0122157, -0.1093754, -0.1077399, -0.1077399, - -0.0037992, -0.0037992, -0.0089979, -0.0955525, -0.0958995, -0.0958995, - -0.0034397, -0.0034397, -0.0107575, -0.1068741, -0.1067815, -0.1067815, - -0.0017800, -0.0017800, -0.0102865, -0.1348585, -0.1275650, -0.1275650, - 0.0006728, 0.0006728, -0.0065349, -0.2011702, -0.2015991, -0.2015991, - 0.0021133, 0.0021133, 0.0020353, -0.0740009, -0.0833644, -0.0833644, - 0.0037739, 0.0037739, 0.0121357, 0.1597195, 0.1585307, 0.1585307, - 0.0026257, 0.0026257, 0.0103523, 0.1626420, 0.1634832, 0.1634832, - -0.0189694, -0.0188985, -0.0415773, -0.0955391, -0.1180182, -0.1126508, - -0.0194533, -0.0191057, -0.0420358, -0.0913521, -0.1140995, -0.1075009, - -0.0233933, -0.0219600, -0.0466734, -0.0865867, -0.1086070, -0.1014454, - -0.0140271, -0.0150165, -0.0344515, -0.0755416, -0.1018518, -0.0951606, - -0.0058780, -0.0089457, -0.0256867, -0.0775726, -0.1070427, -0.1018654, - -0.0069737, -0.0092857, -0.0333909, -0.1014042, -0.1320678, -0.1288315, - -0.0030075, -0.0060858, -0.0245855, -0.1186313, -0.1963719, -0.1857004, - 0.0058243, 0.0030539, -0.0049966, -0.0583228, -0.0921850, -0.0893692, - 0.0141517, 0.0149365, 0.0312156, 0.0898626, 0.1454759, 0.1347802, - 0.0110954, 0.0137260, 0.0427527, 0.1280421, 0.1715647, 0.1648037] + -0.0049592, + -0.0049592, + -0.0120983, + -0.1226471, + -0.1214069, + -0.1214069, + -0.0051678, + -0.0051678, + -0.0128471, + -0.1224616, + -0.1200362, + -0.1200362, + -0.0055308, + -0.0055308, + -0.0122157, + -0.1093754, + -0.1077399, + -0.1077399, + -0.0037992, + -0.0037992, + -0.0089979, + -0.0955525, + -0.0958995, + -0.0958995, + -0.0034397, + -0.0034397, + -0.0107575, + -0.1068741, + -0.1067815, + -0.1067815, + -0.0017800, + -0.0017800, + -0.0102865, + -0.1348585, + -0.1275650, + -0.1275650, + 0.0006728, + 0.0006728, + -0.0065349, + -0.2011702, + -0.2015991, + -0.2015991, + 0.0021133, + 0.0021133, + 0.0020353, + -0.0740009, + -0.0833644, + -0.0833644, + 0.0037739, + 0.0037739, + 0.0121357, + 0.1597195, + 0.1585307, + 0.1585307, + 0.0026257, + 0.0026257, + 0.0103523, + 0.1626420, + 0.1634832, + 0.1634832, + -0.0189694, + -0.0188985, + -0.0415773, + -0.0955391, + -0.1180182, + -0.1126508, + -0.0194533, + -0.0191057, + -0.0420358, + -0.0913521, + -0.1140995, + -0.1075009, + -0.0233933, + -0.0219600, + -0.0466734, + -0.0865867, + -0.1086070, + -0.1014454, + -0.0140271, + -0.0150165, + -0.0344515, + -0.0755416, + -0.1018518, + -0.0951606, + -0.0058780, + -0.0089457, + -0.0256867, + -0.0775726, + -0.1070427, + -0.1018654, + -0.0069737, + -0.0092857, + -0.0333909, + -0.1014042, + -0.1320678, + -0.1288315, + -0.0030075, + -0.0060858, + -0.0245855, + -0.1186313, + -0.1963719, + -0.1857004, + 0.0058243, + 0.0030539, + -0.0049966, + -0.0583228, + -0.0921850, + -0.0893692, + 0.0141517, + 0.0149365, + 0.0312156, + 0.0898626, + 0.1454759, + 0.1347802, + 0.0110954, + 0.0137260, + 0.0427527, + 0.1280421, + 0.1715647, + 0.1648037, +] spec_funcs = [ - 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, - 0.0000520, 0.0000520, 0.0070211, 0.0003925, 0.0004139, 0.0004139, - 0.0000085, 0.0000085, 0.0001872, 0.0016104, 0.0014443, 0.0014443, - 0.0000051, 0.0000051, 0.0000370, 0.0027822, 0.0025951, 0.0025951, - 0.0000004, 0.0000004, 0.0000021, 0.0197933, 0.0168956, 0.0168956, - 0.0000010, 0.0000010, 0.0000082, 0.0080833, 0.0110838, 0.0110838, - 0.0000002, 0.0000002, 0.0000031, 0.0014052, 0.0008202, 0.0008202, - 0.0000002, 0.0000002, 0.0000035, 0.0037304, 0.0039325, 0.0039325, - 0.0000000, 0.0000000, 0.0000009, 0.0009279, 0.0009800, 0.0009800, - 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, - 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, - 0.0101136, 0.0017460, 0.0004489, 0.0005850, 0.0005048, 0.0005229, - 0.0002283, 0.0006942, 0.0050470, 0.0012772, 0.0010867, 0.0009498, - 0.0002702, 0.0004036, 0.0106017, 0.0086169, 0.0041489, 0.0035906, - 0.0000154, 0.0000295, 0.0002803, 0.0434066, 0.1278558, 0.0549209, - 0.0000166, 0.0000264, 0.0001776, 0.0018060, 0.0042557, 0.0043927, - 0.0000066, 0.0000108, 0.0001284, 0.0010011, 0.0009471, 0.0011088, - 0.0000059, 0.0000105, 0.0000738, 0.0010751, 0.0027300, 0.0026490, - 0.0000012, 0.0000033, 0.0000504, 0.0005539, 0.0009128, 0.0009358, - 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000] + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000520, + 0.0000520, + 0.0070211, + 0.0003925, + 0.0004139, + 0.0004139, + 0.0000085, + 0.0000085, + 0.0001872, + 0.0016104, + 0.0014443, + 0.0014443, + 0.0000051, + 0.0000051, + 0.0000370, + 0.0027822, + 0.0025951, + 0.0025951, + 0.0000004, + 0.0000004, + 0.0000021, + 0.0197933, + 0.0168956, + 0.0168956, + 0.0000010, + 0.0000010, + 0.0000082, + 0.0080833, + 0.0110838, + 0.0110838, + 0.0000002, + 0.0000002, + 0.0000031, + 0.0014052, + 0.0008202, + 0.0008202, + 0.0000002, + 0.0000002, + 0.0000035, + 0.0037304, + 0.0039325, + 0.0039325, + 0.0000000, + 0.0000000, + 0.0000009, + 0.0009279, + 0.0009800, + 0.0009800, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0101136, + 0.0017460, + 0.0004489, + 0.0005850, + 0.0005048, + 0.0005229, + 0.0002283, + 0.0006942, + 0.0050470, + 0.0012772, + 0.0010867, + 0.0009498, + 0.0002702, + 0.0004036, + 0.0106017, + 0.0086169, + 0.0041489, + 0.0035906, + 0.0000154, + 0.0000295, + 0.0002803, + 0.0434066, + 0.1278558, + 0.0549209, + 0.0000166, + 0.0000264, + 0.0001776, + 0.0018060, + 0.0042557, + 0.0043927, + 0.0000066, + 0.0000108, + 0.0001284, + 0.0010011, + 0.0009471, + 0.0011088, + 0.0000059, + 0.0000105, + 0.0000738, + 0.0010751, + 0.0027300, + 0.0026490, + 0.0000012, + 0.0000033, + 0.0000504, + 0.0005539, + 0.0009128, + 0.0009358, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, + 0.0000000, +] def test_SpectralFunction(si_pbesol): """Spectral function of Si.""" si_pbesol.mesh_numbers = [9, 9, 9] si_pbesol.init_phph_interaction() - sf = SpectralFunction(si_pbesol.phph_interaction, - si_pbesol.grid.grg2bzg[[1, 103]], - temperatures=[300, ], - num_frequency_points=10, - log_level=1) + sf = SpectralFunction( + si_pbesol.phph_interaction, + si_pbesol.grid.grg2bzg[[1, 103]], + temperatures=[ + 300, + ], + num_frequency_points=10, + log_level=1, + ) sf.run() # for line in np.swapaxes(sf.spectral_functions, -2, -1).reshape(-1, 6): @@ -63,7 +269,11 @@ def test_SpectralFunction(si_pbesol): # raise np.testing.assert_allclose( - shifts, np.swapaxes(sf.shifts, -2, -1).ravel(), atol=1e-2) + shifts, np.swapaxes(sf.shifts, -2, -1).ravel(), atol=1e-2 + ) np.testing.assert_allclose( - spec_funcs, np.swapaxes(sf.spectral_functions * np.pi, -2, -1).ravel(), - atol=1e-2, rtol=1e-2) + spec_funcs, + np.swapaxes(sf.spectral_functions * np.pi, -2, -1).ravel(), + atol=1e-2, + rtol=1e-2, + ) diff --git a/test/phonon3/test_triplets.py b/test/phonon3/test_triplets.py index d2699fe4..af00e136 100644 --- a/test/phonon3/test_triplets.py +++ b/test/phonon3/test_triplets.py @@ -12,14 +12,45 @@ def test_get_triplets_at_q_type1(si_pbesol_111): grid_point = 1 mesh = [4, 4, 4] - bz_grid = BZGrid(mesh, - lattice=pcell.cell, - symmetry_dataset=psym.dataset, - store_dense_gp_map=False) + bz_grid = BZGrid( + mesh, + lattice=pcell.cell, + symmetry_dataset=psym.dataset, + store_dense_gp_map=False, + ) triplets, weights = get_triplets_at_q(grid_point, bz_grid)[:2] - triplets_ref = [1, 0, 3, 1, 1, 2, 1, 4, 15, 1, - 5, 14, 1, 6, 13, 1, 7, 12, 1, 65, - 11, 1, 9, 10, 1, 24, 59, 1, 26, 88] + triplets_ref = [ + 1, + 0, + 3, + 1, + 1, + 2, + 1, + 4, + 15, + 1, + 5, + 14, + 1, + 6, + 13, + 1, + 7, + 12, + 1, + 65, + 11, + 1, + 9, + 10, + 1, + 24, + 59, + 1, + 26, + 88, + ] weights_ref = [2, 2, 6, 6, 6, 6, 6, 6, 12, 12] # print("".join(["%d, " % i for i in triplets.ravel()])) # print("".join(["%d, " % i for i in weights])) @@ -36,14 +67,43 @@ def test_get_triplets_at_q_type2(si_pbesol_111): grid_point = 1 mesh = [4, 4, 4] - bz_grid = BZGrid(mesh, - lattice=pcell.cell, - symmetry_dataset=psym.dataset, - store_dense_gp_map=True) + bz_grid = BZGrid( + mesh, lattice=pcell.cell, symmetry_dataset=psym.dataset, store_dense_gp_map=True + ) triplets, weights = get_triplets_at_q(grid_point, bz_grid)[:2] - triplets_ref = [1, 0, 4, 1, 1, 2, 1, 5, 18, 1, 6, 17, 1, 7, 16, 1, - 8, 15, 1, 10, 14, 1, 11, 12, 1, 27, 84, 1, 29, 82] + triplets_ref = [ + 1, + 0, + 4, + 1, + 1, + 2, + 1, + 5, + 18, + 1, + 6, + 17, + 1, + 7, + 16, + 1, + 8, + 15, + 1, + 10, + 14, + 1, + 11, + 12, + 1, + 27, + 84, + 1, + 29, + 82, + ] weights_ref = [2, 2, 6, 6, 6, 6, 6, 6, 12, 12] _show_triplets_info(mesh, bz_grid, triplets, np.linalg.inv(pcell.cell)) @@ -54,8 +114,9 @@ def test_get_triplets_at_q_type2(si_pbesol_111): np.testing.assert_equal(weights, weights_ref) -def _show_triplets_info(mesh: list, bz_grid: BZGrid, triplets: np.ndarray, - reclat: np.ndarray) -> None: +def _show_triplets_info( + mesh: list, bz_grid: BZGrid, triplets: np.ndarray, reclat: np.ndarray +) -> None: """Show triplets details in grid type-1 and 2.""" shift = np.prod(mesh) double_shift = np.prod(mesh) * 8 @@ -69,12 +130,18 @@ def _show_triplets_info(mesh: list, bz_grid: BZGrid, triplets: np.ndarray, adrs.append(bz_grid.addresses[bzgp + j].tolist()) else: bzgp = i - multi = (bz_grid.gp_map[double_shift + i + 1] - - bz_grid.gp_map[double_shift + i] + 1) + multi = ( + bz_grid.gp_map[double_shift + i + 1] + - bz_grid.gp_map[double_shift + i] + + 1 + ) adrs.append(bz_grid.addresses[bzgp].tolist()) for j in range(multi - 1): - adrs.append(bz_grid.addresses[ - shift + bz_grid.gp_map[double_shift + i] + j].tolist()) + adrs.append( + bz_grid.addresses[ + shift + bz_grid.gp_map[double_shift + i] + j + ].tolist() + ) print(bzgp, adrs, multi) for tp in triplets: @@ -85,10 +152,10 @@ def _show_triplets_info(mesh: list, bz_grid: BZGrid, triplets: np.ndarray, multis.append(bz_grid.gp_map[gp + 1] - bz_grid.gp_map[gp]) else: shift = np.prod(mesh) * 8 - multis.append(bz_grid.gp_map[shift + gp + 1] - - bz_grid.gp_map[shift + gp] + 1) + multis.append( + bz_grid.gp_map[shift + gp + 1] - bz_grid.gp_map[shift + gp] + 1 + ) bztp = bz_grid.addresses[tp] gadrs = bz_grid.addresses[tp].sum(axis=0) / mesh d = np.sqrt(np.linalg.norm(np.dot(reclat, gadrs))) - print(tp, "[", bztp[0], bztp[1], bztp[2], "]", multis, - bztp.sum(axis=0), d) + print(tp, "[", bztp[0], bztp[1], bztp[2], "]", multis, bztp.sum(axis=0), d) diff --git a/test/sscha/test_sscha.py b/test/sscha/test_sscha.py index b0739ced..f9c1e060 100644 --- a/test/sscha/test_sscha.py +++ b/test/sscha/test_sscha.py @@ -1,9 +1,12 @@ -import sys +"""Tests for SSCHA routines.""" import pytest import numpy as np from phono3py.sscha.sscha import ( - DispCorrMatrix, DispCorrMatrixMesh, - SupercellPhonon, ThirdOrderFC) + DispCorrMatrix, + DispCorrMatrixMesh, + SupercellPhonon, + ThirdOrderFC, +) from phonopy.phonon.qpoints import QpointsPhonon from phonopy.phonon.random_displacements import RandomDisplacements @@ -12,20 +15,42 @@ try: except NameError: ModuleNotFoundError = ImportError -si_pbesol_upsilon0_0 = [[3.849187e+02, 0, 0], - [0, 3.849187e+02, 0], - [0, 0, 3.849187e+02]] -si_pbesol_upsilon1_34 = [[1.886404, -1.549705, -1.126055], - [-1.549705, 1.886404, -1.126055], - [-1.126055, -1.126055, -0.006187]] +si_pbesol_upsilon0_0 = [[3.849187e02, 0, 0], [0, 3.849187e02, 0], [0, 0, 3.849187e02]] +si_pbesol_upsilon1_34 = [ + [1.886404, -1.549705, -1.126055], + [-1.549705, 1.886404, -1.126055], + [-1.126055, -1.126055, -0.006187], +] si_pbesol_111_freqs = [ - 0.00000, 0.00000, 0.00000, 4.02839, 4.02839, 4.02839, - 4.02839, 4.02839, 4.02839, 12.13724, 12.13724, 12.13724, - 12.13724, 12.13724, 12.13724, 13.71746, 13.71746, 13.71746, - 13.71746, 13.71746, 13.71746, 15.24974, 15.24974, 15.24974] + 0.00000, + 0.00000, + 0.00000, + 4.02839, + 4.02839, + 4.02839, + 4.02839, + 4.02839, + 4.02839, + 12.13724, + 12.13724, + 12.13724, + 12.13724, + 12.13724, + 12.13724, + 13.71746, + 13.71746, + 13.71746, + 13.71746, + 13.71746, + 13.71746, + 15.24974, + 15.24974, + 15.24974, +] def get_supercell_phonon(ph3): + """Return SupercellPhonon class instance.""" ph3.mesh_numbers = [1, 1, 1] ph3.init_phph_interaction() fc2 = ph3.dynamical_matrix.force_constants @@ -35,37 +60,43 @@ def get_supercell_phonon(ph3): def mass_sand(matrix, mass): + """Calculate mass sandwich.""" return ((matrix * mass).T * mass).T def mass_inv(matrix, mass): + """Calculate inverse mass sandwich.""" bare = mass_sand(matrix, mass) inv_bare = np.linalg.pinv(bare) return mass_sand(inv_bare, mass) def test_SupercellPhonon(si_pbesol_111): + """Test of SupercellPhonon class.""" sph = get_supercell_phonon(si_pbesol_111) - np.testing.assert_allclose( - si_pbesol_111_freqs, sph.frequencies, atol=1e-4) + np.testing.assert_allclose(si_pbesol_111_freqs, sph.frequencies, atol=1e-4) def test_disp_corr_matrix_mesh(si_pbesol): + """Test of DispCorrMatrixMesh class.""" si_pbesol.mesh_numbers = [9, 9, 9] si_pbesol.init_phph_interaction() dynmat = si_pbesol.dynamical_matrix uu = DispCorrMatrixMesh(dynmat.primitive, dynmat.supercell) - qpoints_phonon = QpointsPhonon(uu.commensurate_points, - dynmat, - with_eigenvectors=True) + qpoints_phonon = QpointsPhonon( + uu.commensurate_points, dynmat, with_eigenvectors=True + ) freqs = qpoints_phonon.frequencies eigvecs = qpoints_phonon.eigenvectors uu.run(freqs, eigvecs, 300.0) np.testing.assert_allclose( - si_pbesol_upsilon0_0, uu.upsilon_matrix[0:3, 0:3], atol=1e-4) + si_pbesol_upsilon0_0, uu.upsilon_matrix[0:3, 0:3], atol=1e-4 + ) np.testing.assert_allclose( - si_pbesol_upsilon1_34, uu.upsilon_matrix[1 * 3: 2 * 3, 34 * 3: 35 * 3], - atol=1e-4) + si_pbesol_upsilon1_34, + uu.upsilon_matrix[1 * 3 : 2 * 3, 34 * 3 : 35 * 3], + atol=1e-4, + ) sqrt_masses = np.repeat(np.sqrt(si_pbesol.supercell.masses), 3) uu_inv = mass_inv(uu.psi_matrix, sqrt_masses) @@ -73,22 +104,27 @@ def test_disp_corr_matrix_mesh(si_pbesol): def test_disp_corr_matrix(si_pbesol): + """Test of DispCorrMatrix class.""" supercell_phonon = get_supercell_phonon(si_pbesol) uu = DispCorrMatrix(supercell_phonon) uu.run(300.0) np.testing.assert_allclose( - si_pbesol_upsilon0_0, uu.upsilon_matrix[0:3, 0:3], atol=1e-4) + si_pbesol_upsilon0_0, uu.upsilon_matrix[0:3, 0:3], atol=1e-4 + ) np.testing.assert_allclose( si_pbesol_upsilon1_34, - uu.upsilon_matrix[1 * 3: 2 * 3, 34 * 3: 35 * 3], - atol=1e-4) + uu.upsilon_matrix[1 * 3 : 2 * 3, 34 * 3 : 35 * 3], + atol=1e-4, + ) def test_disp_corr_matrix_si(si_pbesol): + """Test of DispCorrMatrix class with Si.""" _test_disp_corr_matrix(si_pbesol) def test_disp_corr_matrix_nacl(nacl_pbe): + """Test of DispCorrMatrix class with NaCl.""" _test_disp_corr_matrix(nacl_pbe) @@ -99,30 +135,27 @@ def _test_disp_corr_matrix(ph3): sqrt_masses = np.repeat(np.sqrt(ph3.supercell.masses), 3) uu_inv = mass_inv(uu.psi_matrix, sqrt_masses) - np.testing.assert_allclose( - uu.upsilon_matrix, uu_inv, atol=1e-8, rtol=0) + np.testing.assert_allclose(uu.upsilon_matrix, uu_inv, atol=1e-8, rtol=0) - rd = RandomDisplacements(ph3.supercell, - ph3.primitive, - ph3.fc2) + rd = RandomDisplacements(ph3.supercell, ph3.primitive, ph3.fc2) rd.run_correlation_matrix(300) - rd_uu_inv = np.transpose(rd.uu_inv, - axes=[0, 2, 1, 3]).reshape(uu_inv.shape) - np.testing.assert_allclose( - uu.upsilon_matrix, rd_uu_inv, atol=1e-8, rtol=0) + rd_uu_inv = np.transpose(rd.uu_inv, axes=[0, 2, 1, 3]).reshape(uu_inv.shape) + np.testing.assert_allclose(uu.upsilon_matrix, rd_uu_inv, atol=1e-8, rtol=0) def test_fc3(si_pbesol_iterha_111): + """Test of ThirdOrderFC class.""" try: - import alm + import alm # noqa F401 except ModuleNotFoundError: pytest.skip("Skip this test because ALM module was not found.") ph = si_pbesol_iterha_111 - ph.produce_force_constants(calculate_full_force_constants=True, - fc_calculator='alm') + ph.produce_force_constants(calculate_full_force_constants=True, fc_calculator="alm") supercell_phonon = SupercellPhonon( - ph.supercell, ph.force_constants, - frequency_factor_to_THz=ph.unit_conversion_factor) + ph.supercell, + ph.force_constants, + frequency_factor_to_THz=ph.unit_conversion_factor, + ) fc3 = ThirdOrderFC(ph.displacements, ph.forces, supercell_phonon) fc3.run(T=300)