From a66f59ac47492a16bf91d6ed47d3bedc1eee0fae Mon Sep 17 00:00:00 2001 From: Atsushi Togo Date: Wed, 15 Jan 2025 17:00:53 +0900 Subject: [PATCH] Symfc is used to handle random displacements unless specified in CUI. --- doc/pypolymlp.md | 32 ++++++++++++++++---------------- phono3py/cui/phono3py_script.py | 13 ++++++++++++- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/doc/pypolymlp.md b/doc/pypolymlp.md index f7c52183..86e61f7c 100644 --- a/doc/pypolymlp.md +++ b/doc/pypolymlp.md @@ -269,9 +269,9 @@ Having `phono3py_params.yaml`, phono3py is executed with `--pypolymlp` option, | |_) | | | | (_) | | | | (_) |__) | |_) | |_| | | .__/|_| |_|\___/|_| |_|\___/____/| .__/ \__, | |_| |_| |___/ - 3.5.0 + 3.11.2 --------------------------[time 2024-09-19 15:33:23]------------------------- +-------------------------[time 2025-01-15 16:43:57]------------------------- Compiled with OpenMP support (max 10 threads). Running in phono3py.load mode. Python version 3.12.6 @@ -287,7 +287,6 @@ Primitive matrix: Spacegroup: Fm-3m (225) Use -v option to watch primitive cell, unit cell, and supercell structures. NAC parameters were read from "phono3py_params.yaml". ------------------------------ Force constants ------------------------------ Displacement dataset for fc3 was read from "phono3py_params.yaml". ----------------------------- pypolymlp start ------------------------------ Pypolymlp is a generator of polynomial machine learning potentials. @@ -304,39 +303,40 @@ Clear training X.T @ X Calculate X.T @ X for test data Clear test X.T @ X Regression: model selection ... -- alpha = 1.000e-03 : rmse (train, test) = 9.39542e+14 9.39543e+14 -- alpha = 1.000e-02 : rmse (train, test) = 9.39542e+14 9.39543e+14 -- alpha = 1.000e-01 : rmse (train, test) = 0.03738 0.04961 -- alpha = 1.000e+00 : rmse (train, test) = 0.03900 0.04742 -- alpha = 1.000e+01 : rmse (train, test) = 0.04058 0.04584 +- alpha = 1.000e-03 : rmse (train, test) = 1.12211e+15 1.12211e+15 +- alpha = 1.000e-02 : rmse (train, test) = 1.12211e+15 1.12211e+15 +- alpha = 1.000e-01 : rmse (train, test) = 0.00002 0.00002 +- alpha = 1.000e+00 : rmse (train, test) = 0.00002 0.00002 +- alpha = 1.000e+01 : rmse (train, test) = 0.00002 0.00002 MLPs were written into "phono3py.pmlp" ------------------------------ pypolymlp end ------------------------------- Generate random displacements Twice of number of snapshots will be generated for plus-minus displacements. Displacement distance: 0.001 Evaluate forces in 400 supercells by pypolymlp +----------------------------- Force constants ------------------------------ -------------------------------- Symfc start ------------------------------- -Symfc is a non-trivial force constants calculator. Please cite the paper: -A. Seko and A. Togo, arXiv:2403.03588. +Symfc is a force constants calculator. See the following paper: +A. Seko and A. Togo, Phys. Rev. B, 110, 214302 (2024). Symfc is developed at https://github.com/symfc/symfc. Computing [2, 3] order force constants. Increase log-level to watch detailed symfc log. --------------------------------- Symfc end -------------------------------- -------------------------------- Symfc start ------------------------------- -Symfc is a non-trivial force constants calculator. Please cite the paper: -A. Seko and A. Togo, arXiv:2403.03588. +Symfc is a force constants calculator. See the following paper: +A. Seko and A. Togo, Phys. Rev. B, 110, 214302 (2024). Symfc is developed at https://github.com/symfc/symfc. Computing [2] order force constants. Increase log-level to watch detailed symfc log. --------------------------------- Symfc end -------------------------------- -Max drift of fc3: -0.000000 (xyx) 0.000000 (zyy) -0.000000 (xyx) -Max drift of fc2: 0.000000 (xx) 0.000000 (xx) +Max drift of fc3: -0.000000 (zxz) -0.000000 (xzz) -0.000000 (xzz) +Max drift of fc2: -0.000000 (yy) -0.000000 (yy) fc3 was written into "fc3.hdf5". fc2 was written into "fc2.hdf5". ----------- None of ph-ph interaction calculation was performed. ----------- Dataset generated using MLPs was written in "phono3py_mlp_eval_dataset.yaml". Summary of calculation was written in "phono3py.yaml". --------------------------[time 2024-09-19 15:34:41]------------------------- +-------------------------[time 2025-01-15 16:45:15]------------------------- _ ___ _ __ __| | / _ \ '_ \ / _` | @@ -377,7 +377,7 @@ constants by loading the MLPs from `phono3py.pmlp` as follows: | |_) | | | | (_) | | | | (_) |__) | |_) | |_| | | .__/|_| |_|\___/|_| |_|\___/____/| .__/ \__, | |_| |_| |___/ - 3.11.1-dev14+g5f281b65 + 3.11.2 -------------------------[time 2025-01-12 10:08:31]------------------------- Compiled with OpenMP support (max 10 threads). diff --git a/phono3py/cui/phono3py_script.py b/phono3py/cui/phono3py_script.py index 3ce2cb85..f1188d28 100644 --- a/phono3py/cui/phono3py_script.py +++ b/phono3py/cui/phono3py_script.py @@ -615,7 +615,18 @@ def _store_force_constants(ph3py: Phono3py, settings: Phono3pySettings, log_leve log_level=log_level, ) except ForceCalculatorRequiredError: - _show_fc_calculator_not_found(log_level) + if log_level: + print("Symfc will be used to handle general (or random) displacements.") + + compute_force_constants_from_datasets( + ph3py, + fc_calculator="symfc", + fc_calculator_options=fc_calculator_options, + symmetrize_fc=settings.fc_symmetry, + is_compact_fc=settings.is_compact_fc, + log_level=log_level, + ) + # _show_fc_calculator_not_found(log_level) if log_level: if ph3py.fc3 is None: