mirror of https://github.com/phonopy/phono3py.git
Preparing GridMatrix test
This commit is contained in:
parent
06914266c0
commit
d5b004ea97
|
@ -181,28 +181,28 @@ def load(
|
||||||
'dielectric': Dielectric constant matrix
|
'dielectric': Dielectric constant matrix
|
||||||
(array_like, shape=(3, 3), dtype=float),
|
(array_like, shape=(3, 3), dtype=float),
|
||||||
'factor': unit conversion facotr (float)}
|
'factor': unit conversion facotr (float)}
|
||||||
unitcell_filename : str, optional
|
unitcell_filename : os.PathLike, optional
|
||||||
Input unit cell filename. Default is None.
|
Input unit cell filename. Default is None.
|
||||||
supercell_filename : str, optional
|
supercell_filename : os.PathLike, optional
|
||||||
Input supercell filename. When this is specified, supercell_matrix is
|
Input supercell filename. When this is specified, supercell_matrix is
|
||||||
ignored. Default is None.
|
ignored. Default is None.
|
||||||
born_filename : str, optional
|
born_filename : os.PathLike, optional
|
||||||
Filename corresponding to 'BORN', a file contains non-analytical term
|
Filename corresponding to 'BORN', a file contains non-analytical term
|
||||||
correction parameters.
|
correction parameters.
|
||||||
forces_fc3_filename : sequence or str, optional
|
forces_fc3_filename : sequence or os.PathLike, optional
|
||||||
A two-elemental sequence of filenames corresponding to
|
A two-elemental sequence of filenames corresponding to
|
||||||
('FORCES_FC3', 'disp_fc3.yaml') in the type-1 format or a filename
|
('FORCES_FC3', 'disp_fc3.yaml') in the type-1 format or a filename
|
||||||
(str) corresponding to 'FORCES_FC3' in the type-2 format.
|
(os.PathLike) corresponding to 'FORCES_FC3' in the type-2 format.
|
||||||
Default is None.
|
Default is None.
|
||||||
forces_fc2_filename : str or tuple, optional
|
forces_fc2_filename : os.PathLike or sequence, optional
|
||||||
A two-elemental sequence of filenames corresponding to
|
A two-elemental sequence of filenames corresponding to
|
||||||
('FORCES_FC2', 'disp_fc2.yaml') in the type-1 format or a filename
|
('FORCES_FC2', 'disp_fc2.yaml') in the type-1 format or a filename
|
||||||
(str) corresponding to 'FORCES_FC2' in the type-2 format.
|
(os.PathLike) corresponding to 'FORCES_FC2' in the type-2 format.
|
||||||
Default is None.
|
Default is None.
|
||||||
fc3_filename : str, optional
|
fc3_filename : os.PathLike, optional
|
||||||
Filename of a file corresponding to 'fc3.hdf5', a file contains
|
Filename of a file corresponding to 'fc3.hdf5', a file contains
|
||||||
third-order force constants. Default is None.
|
third-order force constants. Default is None.
|
||||||
fc2_filename : str, optional
|
fc2_filename : os.PathLike, optional
|
||||||
Filename of a file corresponding to 'fc2.hdf5', a file contains
|
Filename of a file corresponding to 'fc2.hdf5', a file contains
|
||||||
second-order force constants. Default is None.
|
second-order force constants. Default is None.
|
||||||
fc_calculator : str, optional
|
fc_calculator : str, optional
|
||||||
|
@ -378,7 +378,7 @@ def set_dataset_and_force_constants(
|
||||||
if log_level:
|
if log_level:
|
||||||
print('fc3 was read from "%s".' % fc3_filename)
|
print('fc3 was read from "%s".' % fc3_filename)
|
||||||
elif forces_fc3_filename is not None:
|
elif forces_fc3_filename is not None:
|
||||||
if type(forces_fc3_filename) is str:
|
if isinstance(forces_fc3_filename, os.PathLike):
|
||||||
force_filename = forces_fc3_filename
|
force_filename = forces_fc3_filename
|
||||||
disp_filename = None
|
disp_filename = None
|
||||||
else:
|
else:
|
||||||
|
@ -456,7 +456,7 @@ def set_dataset_and_force_constants(
|
||||||
if log_level:
|
if log_level:
|
||||||
print('fc2 was read from "%s".' % fc2_filename)
|
print('fc2 was read from "%s".' % fc2_filename)
|
||||||
elif forces_fc2_filename is not None:
|
elif forces_fc2_filename is not None:
|
||||||
if type(forces_fc2_filename) is str:
|
if isinstance(forces_fc2_filename, os.PathLike):
|
||||||
force_filename = forces_fc2_filename
|
force_filename = forces_fc2_filename
|
||||||
disp_filename = None
|
disp_filename = None
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -549,7 +549,7 @@ class GridMatrix:
|
||||||
Symmetry dataset of spglib (Symmetry.dataset) of primitive cell that
|
Symmetry dataset of spglib (Symmetry.dataset) of primitive cell that
|
||||||
has `lattice`. Default is None.
|
has `lattice`. Default is None.
|
||||||
transformation_matrix : array_like, optional
|
transformation_matrix : array_like, optional
|
||||||
Transformation matrix equivalent to ``transformation_matrix`` or
|
Transformation matrix equivalent to ``transformation_matrix`` in
|
||||||
spglib-dataset. This is only used when ``use_grg=True``. Default is
|
spglib-dataset. This is only used when ``use_grg=True``. Default is
|
||||||
None.
|
None.
|
||||||
use_grg : bool, optional
|
use_grg : bool, optional
|
||||||
|
@ -714,7 +714,12 @@ class GridMatrix:
|
||||||
RuntimeWarning,
|
RuntimeWarning,
|
||||||
)
|
)
|
||||||
if fall_back:
|
if fall_back:
|
||||||
self._D_diag = length2mesh(length, self._lattice)
|
if symmetry_dataset is None:
|
||||||
|
self._D_diag = length2mesh(length, self._lattice)
|
||||||
|
else:
|
||||||
|
self._D_diag = length2mesh(
|
||||||
|
length, self._lattice, rotations=symmetry_dataset["rotations"]
|
||||||
|
)
|
||||||
elif num_values == 3:
|
elif num_values == 3:
|
||||||
self._D_diag = np.array(mesh, dtype="int_")
|
self._D_diag = np.array(mesh, dtype="int_")
|
||||||
|
|
||||||
|
|
109
test/conftest.py
109
test/conftest.py
|
@ -1,5 +1,5 @@
|
||||||
"""Pytest conftest.py."""
|
"""Pytest conftest.py."""
|
||||||
import os
|
from pathlib import Path
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import phonopy
|
import phonopy
|
||||||
|
@ -9,8 +9,9 @@ from phonopy.interface.phonopy_yaml import read_cell_yaml
|
||||||
from phonopy.structure.atoms import PhonopyAtoms
|
from phonopy.structure.atoms import PhonopyAtoms
|
||||||
|
|
||||||
import phono3py
|
import phono3py
|
||||||
|
from phono3py import Phono3py
|
||||||
|
|
||||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
cwd = Path(__file__).parent
|
||||||
store_dense_gp_map = True
|
store_dense_gp_map = True
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +28,7 @@ def pytest_addoption(parser):
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def agno2_cell() -> PhonopyAtoms:
|
def agno2_cell() -> PhonopyAtoms:
|
||||||
"""Return AgNO2 cell (Imm2)."""
|
"""Return AgNO2 cell (Imm2)."""
|
||||||
cell = read_cell_yaml(os.path.join(current_dir, "AgNO2_cell.yaml"))
|
cell = read_cell_yaml(cwd / "AgNO2_cell.yaml")
|
||||||
return cell
|
return cell
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,15 +50,15 @@ def aln_cell() -> PhonopyAtoms:
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol(request):
|
def si_pbesol(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 2x2x2.
|
"""Return Phono3py instance of Si 2x2x2.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
* full fc
|
* full fc
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_si_pbesol.yaml")
|
yaml_filename = cwd / "phono3py_si_pbesol.yaml"
|
||||||
forces_fc3_filename = os.path.join(current_dir, "FORCES_FC3_si_pbesol")
|
forces_fc3_filename = cwd / "FORCES_FC3_si_pbesol"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -69,7 +70,7 @@ def si_pbesol(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_grg(request):
|
def si_pbesol_grg(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 2x2x2.
|
"""Return Phono3py instance of Si 2x2x2.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
|
@ -77,8 +78,8 @@ def si_pbesol_grg(request):
|
||||||
* GR-grid
|
* GR-grid
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_si_pbesol.yaml")
|
yaml_filename = cwd / "phono3py_si_pbesol.yaml"
|
||||||
forces_fc3_filename = os.path.join(current_dir, "FORCES_FC3_si_pbesol")
|
forces_fc3_filename = cwd / "FORCES_FC3_si_pbesol"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -91,15 +92,15 @@ def si_pbesol_grg(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_nosym(request):
|
def si_pbesol_nosym(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 2x2x2.
|
"""Return Phono3py instance of Si 2x2x2.
|
||||||
|
|
||||||
* without symmetry
|
* without symmetry
|
||||||
* no fc
|
* no fc
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_si_pbesol.yaml")
|
yaml_filename = cwd / "phono3py_si_pbesol.yaml"
|
||||||
forces_fc3_filename = os.path.join(current_dir, "FORCES_FC3_si_pbesol")
|
forces_fc3_filename = cwd / "FORCES_FC3_si_pbesol"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -113,15 +114,15 @@ def si_pbesol_nosym(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_nomeshsym(request):
|
def si_pbesol_nomeshsym(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 2x2x2.
|
"""Return Phono3py instance of Si 2x2x2.
|
||||||
|
|
||||||
* without mesh-symmetry
|
* without mesh-symmetry
|
||||||
* no fc
|
* no fc
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_si_pbesol.yaml")
|
yaml_filename = cwd / "phono3py_si_pbesol.yaml"
|
||||||
forces_fc3_filename = os.path.join(current_dir, "FORCES_FC3_si_pbesol")
|
forces_fc3_filename = cwd / "FORCES_FC3_si_pbesol"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -135,15 +136,15 @@ def si_pbesol_nomeshsym(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_compact_fc(request):
|
def si_pbesol_compact_fc(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 2x2x2.
|
"""Return Phono3py instance of Si 2x2x2.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
* compact fc
|
* compact fc
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_si_pbesol.yaml")
|
yaml_filename = cwd / "phono3py_si_pbesol.yaml"
|
||||||
forces_fc3_filename = os.path.join(current_dir, "FORCES_FC3_si_pbesol")
|
forces_fc3_filename = cwd / "FORCES_FC3_si_pbesol"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -156,14 +157,14 @@ def si_pbesol_compact_fc(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_111(request):
|
def si_pbesol_111(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 1x1x1.
|
"""Return Phono3py instance of Si 1x1x1.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
* full fc
|
* full fc
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_Si111.yaml")
|
yaml_filename = cwd / "phono3py_params_Si111.yaml"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -174,7 +175,7 @@ def si_pbesol_111(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_111_alm(request):
|
def si_pbesol_111_alm(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 1x1x1.
|
"""Return Phono3py instance of Si 1x1x1.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
|
@ -184,7 +185,7 @@ def si_pbesol_111_alm(request):
|
||||||
"""
|
"""
|
||||||
pytest.importorskip("alm")
|
pytest.importorskip("alm")
|
||||||
|
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_Si111.yaml")
|
yaml_filename = cwd / "phono3py_params_Si111.yaml"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -196,19 +197,19 @@ def si_pbesol_111_alm(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_iterha_111():
|
def si_pbesol_iterha_111() -> Phonopy:
|
||||||
"""Return Phono3py instance of Si 1x1x1.
|
"""Return Phono3py instance of Si 1x1x1.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
* no fc
|
* no fc
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phonopy_params-Si111-iterha.yaml.gz")
|
yaml_filename = cwd / "phonopy_params-Si111-iterha.yaml.gz"
|
||||||
return phonopy.load(yaml_filename, log_level=1, produce_fc=False)
|
return phonopy.load(yaml_filename, log_level=1, produce_fc=False)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_111_222_fd(request):
|
def si_pbesol_111_222_fd(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 1x1x1.
|
"""Return Phono3py instance of Si 1x1x1.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
|
@ -216,7 +217,7 @@ def si_pbesol_111_222_fd(request):
|
||||||
* use alm if available on test side
|
* use alm if available on test side
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_Si-111-222.yaml")
|
yaml_filename = cwd / "phono3py_params_Si-111-222.yaml"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -227,7 +228,7 @@ def si_pbesol_111_222_fd(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_111_222_alm(request):
|
def si_pbesol_111_222_alm(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 1x1x1.
|
"""Return Phono3py instance of Si 1x1x1.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
|
@ -237,7 +238,7 @@ def si_pbesol_111_222_alm(request):
|
||||||
"""
|
"""
|
||||||
pytest.importorskip("alm")
|
pytest.importorskip("alm")
|
||||||
|
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_Si-111-222.yaml")
|
yaml_filename = cwd / "phono3py_params_Si-111-222.yaml"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -249,7 +250,7 @@ def si_pbesol_111_222_alm(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_111_222_alm_fd(request):
|
def si_pbesol_111_222_alm_fd(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 1x1x1.
|
"""Return Phono3py instance of Si 1x1x1.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
|
@ -259,7 +260,7 @@ def si_pbesol_111_222_alm_fd(request):
|
||||||
"""
|
"""
|
||||||
pytest.importorskip("alm")
|
pytest.importorskip("alm")
|
||||||
|
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_Si-111-222.yaml")
|
yaml_filename = cwd / "phono3py_params_Si-111-222.yaml"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -271,7 +272,7 @@ def si_pbesol_111_222_alm_fd(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_111_222_fd_alm(request):
|
def si_pbesol_111_222_fd_alm(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 1x1x1.
|
"""Return Phono3py instance of Si 1x1x1.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
|
@ -281,7 +282,7 @@ def si_pbesol_111_222_fd_alm(request):
|
||||||
"""
|
"""
|
||||||
pytest.importorskip("alm")
|
pytest.importorskip("alm")
|
||||||
|
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_Si-111-222.yaml")
|
yaml_filename = cwd / "phono3py_params_Si-111-222.yaml"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -293,7 +294,7 @@ def si_pbesol_111_222_fd_alm(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_111_222_alm_cutoff(request):
|
def si_pbesol_111_222_alm_cutoff(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 1x1x1.
|
"""Return Phono3py instance of Si 1x1x1.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
|
@ -304,7 +305,7 @@ def si_pbesol_111_222_alm_cutoff(request):
|
||||||
"""
|
"""
|
||||||
pytest.importorskip("alm")
|
pytest.importorskip("alm")
|
||||||
|
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_Si-111-222.yaml")
|
yaml_filename = cwd / "phono3py_params_Si-111-222.yaml"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -317,7 +318,7 @@ def si_pbesol_111_222_alm_cutoff(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_111_222_alm_cutoff_fc2(request):
|
def si_pbesol_111_222_alm_cutoff_fc2(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 1x1x1.
|
"""Return Phono3py instance of Si 1x1x1.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
|
@ -328,7 +329,7 @@ def si_pbesol_111_222_alm_cutoff_fc2(request):
|
||||||
"""
|
"""
|
||||||
pytest.importorskip("alm")
|
pytest.importorskip("alm")
|
||||||
|
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_Si-111-222.yaml")
|
yaml_filename = cwd / "phono3py_params_Si-111-222.yaml"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -341,7 +342,7 @@ def si_pbesol_111_222_alm_cutoff_fc2(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def si_pbesol_111_222_alm_cutoff_fc3(request):
|
def si_pbesol_111_222_alm_cutoff_fc3(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of Si 1x1x1.
|
"""Return Phono3py instance of Si 1x1x1.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
|
@ -352,7 +353,7 @@ def si_pbesol_111_222_alm_cutoff_fc3(request):
|
||||||
"""
|
"""
|
||||||
pytest.importorskip("alm")
|
pytest.importorskip("alm")
|
||||||
|
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_Si-111-222.yaml")
|
yaml_filename = cwd / "phono3py_params_Si-111-222.yaml"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -365,14 +366,14 @@ def si_pbesol_111_222_alm_cutoff_fc3(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def nacl_pbe(request):
|
def nacl_pbe(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of NaCl 2x2x2.
|
"""Return Phono3py instance of NaCl 2x2x2.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
* full fc
|
* full fc
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_NaCl222.yaml.xz")
|
yaml_filename = cwd / "phono3py_params_NaCl222.yaml.xz"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -383,14 +384,14 @@ def nacl_pbe(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def nacl_pbe_compact_fc(request):
|
def nacl_pbe_compact_fc(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of NaCl 2x2x2.
|
"""Return Phono3py instance of NaCl 2x2x2.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
* compact fc
|
* compact fc
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_NaCl222.yaml.xz")
|
yaml_filename = cwd / "phono3py_params_NaCl222.yaml.xz"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -402,13 +403,13 @@ def nacl_pbe_compact_fc(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def nacl_pbe_cutoff_fc3(request):
|
def nacl_pbe_cutoff_fc3(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of NaCl 2x2x2 with cutoff-pair-distance.
|
"""Return Phono3py instance of NaCl 2x2x2 with cutoff-pair-distance.
|
||||||
|
|
||||||
* cutoff pair with 5
|
* cutoff pair with 5
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_NaCl222.yaml.xz")
|
yaml_filename = cwd / "phono3py_params_NaCl222.yaml.xz"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
ph3 = phono3py.load(
|
ph3 = phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -435,14 +436,14 @@ def nacl_pbe_cutoff_fc3(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def nacl_pbe_cutoff_fc3_all_forces(request):
|
def nacl_pbe_cutoff_fc3_all_forces(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of NaCl 2x2x2 with cutoff-pair-distance.
|
"""Return Phono3py instance of NaCl 2x2x2 with cutoff-pair-distance.
|
||||||
|
|
||||||
* cutoff pair with 5
|
* cutoff pair with 5
|
||||||
* All forces are set.
|
* All forces are set.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_NaCl222.yaml.xz")
|
yaml_filename = cwd / "phono3py_params_NaCl222.yaml.xz"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
ph3 = phono3py.load(
|
ph3 = phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -459,7 +460,7 @@ def nacl_pbe_cutoff_fc3_all_forces(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def nacl_pbe_cutoff_fc3_compact_fc(request):
|
def nacl_pbe_cutoff_fc3_compact_fc(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of NaCl 2x2x2 with cutoff-pair-distance.
|
"""Return Phono3py instance of NaCl 2x2x2 with cutoff-pair-distance.
|
||||||
|
|
||||||
* cutoff pair with 5
|
* cutoff pair with 5
|
||||||
|
@ -467,7 +468,7 @@ def nacl_pbe_cutoff_fc3_compact_fc(request):
|
||||||
* Compact FC
|
* Compact FC
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_NaCl222.yaml.xz")
|
yaml_filename = cwd / "phono3py_params_NaCl222.yaml.xz"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
ph3 = phono3py.load(
|
ph3 = phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -484,14 +485,14 @@ def nacl_pbe_cutoff_fc3_compact_fc(request):
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def aln_lda(request):
|
def aln_lda(request) -> Phono3py:
|
||||||
"""Return Phono3py instance of AlN 3x3x2.
|
"""Return Phono3py instance of AlN 3x3x2.
|
||||||
|
|
||||||
* with symmetry
|
* with symmetry
|
||||||
* full fc.
|
* full fc.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
yaml_filename = os.path.join(current_dir, "phono3py_params_AlN332.yaml.xz")
|
yaml_filename = cwd / "phono3py_params_AlN332.yaml.xz"
|
||||||
enable_v2 = request.config.getoption("--v1")
|
enable_v2 = request.config.getoption("--v1")
|
||||||
return phono3py.load(
|
return phono3py.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
|
@ -504,9 +505,9 @@ def aln_lda(request):
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def ph_nacl() -> Phonopy:
|
def ph_nacl() -> Phonopy:
|
||||||
"""Return Phonopy class instance of NaCl 2x2x2."""
|
"""Return Phonopy class instance of NaCl 2x2x2."""
|
||||||
yaml_filename = os.path.join(current_dir, "phonopy_disp_NaCl.yaml")
|
yaml_filename = cwd / "phonopy_disp_NaCl.yaml"
|
||||||
force_sets_filename = os.path.join(current_dir, "FORCE_SETS_NaCl")
|
force_sets_filename = cwd / "FORCE_SETS_NaCl"
|
||||||
born_filename = os.path.join(current_dir, "BORN_NaCl")
|
born_filename = cwd / "BORN_NaCl"
|
||||||
return phonopy.load(
|
return phonopy.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
force_sets_filename=force_sets_filename,
|
force_sets_filename=force_sets_filename,
|
||||||
|
@ -520,7 +521,7 @@ def ph_nacl() -> Phonopy:
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def ph_si() -> Phonopy:
|
def ph_si() -> Phonopy:
|
||||||
"""Return Phonopy class instance of Si-prim 2x2x2."""
|
"""Return Phonopy class instance of Si-prim 2x2x2."""
|
||||||
yaml_filename = os.path.join(current_dir, "phonopy_params_Si.yaml")
|
yaml_filename = cwd / "phonopy_params_Si.yaml"
|
||||||
return phonopy.load(
|
return phonopy.load(
|
||||||
yaml_filename,
|
yaml_filename,
|
||||||
is_compact_fc=False,
|
is_compact_fc=False,
|
||||||
|
|
|
@ -11,6 +11,7 @@ from phono3py import Phono3py
|
||||||
from phono3py.other.tetrahedron_method import get_tetrahedra_relative_grid_address
|
from phono3py.other.tetrahedron_method import get_tetrahedra_relative_grid_address
|
||||||
from phono3py.phonon.grid import (
|
from phono3py.phonon.grid import (
|
||||||
BZGrid,
|
BZGrid,
|
||||||
|
GridMatrix,
|
||||||
_get_grid_points_by_bz_rotations_c,
|
_get_grid_points_by_bz_rotations_c,
|
||||||
_get_grid_points_by_bz_rotations_py,
|
_get_grid_points_by_bz_rotations_py,
|
||||||
_get_grid_points_by_rotations,
|
_get_grid_points_by_rotations,
|
||||||
|
@ -2384,3 +2385,8 @@ def test_relocate_BZ_grid_address_aln_compare():
|
||||||
# print(np.dot(bzgrid.P, shifts.T).T)
|
# print(np.dot(bzgrid.P, shifts.T).T)
|
||||||
|
|
||||||
# return bzgrid
|
# return bzgrid
|
||||||
|
|
||||||
|
|
||||||
|
def test_GridMatrix_without_symmetry():
|
||||||
|
"""Test of GridMatrix."""
|
||||||
|
GridMatrix(50, np.eye(3) * 5)
|
||||||
|
|
Loading…
Reference in New Issue