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, ) 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] 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] count += 1 ph3.dataset = dataset ph3.produce_fc3(symmetrize_fc3r=True) return ph3
def run_thermal_conductivity(): """Run RTA thermal conductivity calculation from input files.""" 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) # Conductivity_RTA object print(ph3.thermal_conductivity.kappa)
def aln_lda(request): """Return Phono3py instance of AlN 3x3x2. * with symmetry * 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, )
def si_pbesol_111(request): """Return Phono3py instance of Si 1x1x1. * with symmetry * full fc """ 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, )
def nacl_pbe(request): """Return Phono3py instance of NaCl 2x2x2. * with symmetry * 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, )
def si_pbesol(request): """Return Phono3py instance of Si 2x2x2. * with symmetry * full fc """ 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, )
def si_pbesol_111_alm(request): """Return Phono3py instance of Si 1x1x1. * with symmetry * full fc * use alm if available on test side """ pytest.importorskip("alm") 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, fc_calculator="alm", log_level=1, )
def test_duplicates_agno2(agno2_cell): """Test duplicated pairs of displacements.""" 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"])
def si_pbesol(): yaml_filename = os.path.join(current_dir, "phono3py_si_pbesol.yaml") forces_fc3_filename = os.path.join(current_dir, "FORCES_FC3_si_pbesol") return phono3py.load(yaml_filename, forces_fc3_filename=forces_fc3_filename, log_level=1)
def nacl_pbe(): yaml_filename = os.path.join(current_dir, "phono3py_params_NaCl222.yaml.xz") return phono3py.load(yaml_filename, log_level=1)
def si_pbesol_111(): yaml_filename = os.path.join(current_dir, "phono3py_params_Si111.yaml") return phono3py.load(yaml_filename, log_level=1)