diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3136a78..2267661 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,7 +60,7 @@ jobs: publish-pypi: needs: [build] - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && (github.repository == 'SMTG-UCL/easyunfold') + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && (github.repository == 'SMTG-Bham/easyunfold') name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI runs-on: ubuntu-latest steps: diff --git a/.github/workflows/docs-deploy.yaml b/.github/workflows/docs-deploy.yaml index 0d4e949..4c8b28b 100644 --- a/.github/workflows/docs-deploy.yaml +++ b/.github/workflows/docs-deploy.yaml @@ -48,7 +48,7 @@ jobs: - name: Deploy uses: peaceiris/actions-gh-pages@v3 # Deply the documentation built only on the push even - if: ${{ (github.event_name != 'pull_request') && (github.repository == 'SMTG-UCL/easyunfold') }} + if: ${{ (github.event_name != 'pull_request') && (github.repository == 'SMTG-Bham/easyunfold') }} with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs/_build/html diff --git a/README.md b/README.md index 8f70569..30a6ff9 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -![build](https://github.com/SMTG-UCL/easyunfold/actions/workflows/ci.yaml/badge.svg) -[![docs](https://github.com/SMTG-UCL/easyunfold/actions/workflows/docs.yaml/badge.svg)](https://smtg-ucl.github.io/easyunfold/) -[![codecov](https://codecov.io/gh/SMTG-UCL/easyunfold/branch/main/graph/badge.svg?token=XLLWWU5UM2)](https://codecov.io/gh/SMTG-UCL/easyunfold) +![build](https://github.com/SMTG-Bham/easyunfold/actions/workflows/ci.yaml/badge.svg) +[![docs](https://github.com/SMTG-Bham/easyunfold/actions/workflows/docs.yaml/badge.svg)](https://smtg-Bham.github.io/easyunfold/) +[![codecov](https://codecov.io/gh/SMTG-Bham/easyunfold/branch/main/graph/badge.svg?token=XLLWWU5UM2)](https://codecov.io/gh/SMTG-Bham/easyunfold) [![PyPI](https://img.shields.io/pypi/v/easyunfold)](https://pypi.org/project/easyunfold) -[![Downloads](https://img.shields.io/pypi/dm/easyunfold)](https://smtg-ucl.github.io/easyunfold/) +[![Downloads](https://img.shields.io/pypi/dm/easyunfold)](https://smtg-Bham.github.io/easyunfold/) -[![easyunfold](docs/img/logo.svg)](https://smtg-ucl.github.io/easyunfold/) +[![easyunfold](docs/img/logo.svg)](https://smtg-Bham.github.io/easyunfold/) `easyunfold` is intended for obtaining the effective band structure of a supercell for a certain _k_-point path of the primitive cell. It was originally based on diff --git a/docs/conf.py b/docs/conf.py index 8e312a3..3a5df43 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -71,14 +71,14 @@ html_theme = 'sphinx_book_theme' html_theme_options = { 'navigation_depth': 2, - 'repository_url': 'https://github.com/SMTG-UCL/easyunfold', + 'repository_url': 'https://github.com/SMTG-Bham/easyunfold', 'use_repository_button': True, "show_navbar_depth": 2, 'home_page_in_toc': True, "icon_links": [ { "name": "GitHub", - "url": "https://github.com/SMTG-UCL/easyunfold", # required + "url": "https://github.com/SMTG-Bham/easyunfold", # required "icon": "fa-brands fa-github", }, { diff --git a/docs/examples.md b/docs/examples.md index 4f4d3a8..1b7b4e2 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -2,7 +2,7 @@ Worked examples showcasing the capability of the `easyunfold`. Input files for these examples can be found -[here](https://github.com/SMTG-UCL/easyunfold/tree/main/examples). +[here](https://github.com/SMTG-Bham/easyunfold/tree/main/examples). ```{toctree} :maxdepth: 1 diff --git a/docs/examples/example_mgo.md b/docs/examples/example_mgo.md index 10fac88..949812d 100644 --- a/docs/examples/example_mgo.md +++ b/docs/examples/example_mgo.md @@ -2,7 +2,7 @@ :::{note} The files needed for this example are provided in the -[examples/MgO](https://github.com/SMTG-UCL/easyunfold/tree/main/examples/MgO) folder. +[examples/MgO](https://github.com/SMTG-Bham/easyunfold/tree/main/examples/MgO) folder. ::: Often it is useful to know the various contributions of atoms in the structure to the electronic bands @@ -10,7 +10,7 @@ in the band structure, to analyse the chemistry and orbital interactions at play can be computed for unfolded bands as well. For a normal band structure calculation, the contributions can be inferred by colouring the band -according to the elemental contributions, which can be done using [sumo](https://github.com/SMTG-UCL/sumo). +according to the elemental contributions, which can be done using [sumo](https://github.com/SMTG-Bham/sumo). ```{figure} ../../examples/MgO/MgO/band.png :width: 400px @@ -25,7 +25,7 @@ dimension of information (atomic projection) can be tricky to visualise. In this example, we unfold the bands from a MgO 2x1x2 supercell with a Mg atom displaced to break symmetry. The procedure is essentially the same as described in the -[Si supercell example](https://smtg-ucl.github.io/easyunfold/examples/example_si222.html). +[Si supercell example](https://smtg-Bham.github.io/easyunfold/examples/example_si222.html). The only difference here is that we turn on the calculation of orbital projections in `VASP` with `LORBIT = 11` (`12`, `13` and `14` will also work) in the `INCAR` file, and then use the `plot-projections` subcommand diff --git a/docs/examples/example_nabis2.md b/docs/examples/example_nabis2.md index 2993345..41049e8 100644 --- a/docs/examples/example_nabis2.md +++ b/docs/examples/example_nabis2.md @@ -2,7 +2,7 @@ :::{note} The files needed for reproducing this example are provided in the -[examples/NaBiS2](https://github.com/SMTG-UCL/easyunfold/tree/main/examples/NaBiS2) folder. +[examples/NaBiS2](https://github.com/SMTG-Bham/easyunfold/tree/main/examples/NaBiS2) folder. Note that the `PROCAR.gz` file will need to be decompressed with `gzip -d PROCAR.gz` if recalculating and reproducing these example plots. ::: @@ -161,7 +161,7 @@ Atom-projected unfolded band structure of NaBiS2 alongside the electr ``` The orbital contributions of elements in the DOS plot are automatically coloured to match that of the atomic projections in the unfolded band structure plot, and these colours can be changed with the `--colours` option (as shown -in the [MgO example](https://smtg-ucl.github.io/easyunfold/examples/example_mgo.html)). +in the [MgO example](https://smtg-Bham.github.io/easyunfold/examples/example_mgo.html)). ## Unfolded Band Structure with Specific Atom Selection In certain cases, we may want to project the contributions of specific atoms to the unfolded band structure, rather diff --git a/docs/examples/example_si211_castep.md b/docs/examples/example_si211_castep.md index bfaaf64..f1bd7d8 100644 --- a/docs/examples/example_si211_castep.md +++ b/docs/examples/example_si211_castep.md @@ -7,7 +7,7 @@ path using CASTEP. :::{note} The files needed for this example are provided in the -[examples/Si-castep](https://github.com/SMTG-UCL/easyunfold/tree/main/examples/Si-castep) folder. +[examples/Si-castep](https://github.com/SMTG-Bham/easyunfold/tree/main/examples/Si-castep) folder. This guide assumes the current working directory is located at the root of that folder. ::: @@ -19,7 +19,7 @@ easyunfold generate Si_prim.cell Si_211_band/Si_211_band.cell band.cell --code c :::{tip} Here, `band.cell` contains the band structure path and labels of the high symmetry _k_-points for the -primitive cell. The [sumo](https://github.com/SMTG-UCL/sumo) package can be used to generate it with ease. +primitive cell. The [sumo](https://github.com/SMTG-Bham/sumo) package can be used to generate it with ease. ::: The `easyunfold generate` command above also generates an `easyunfold.json` file in the current directory, @@ -112,7 +112,7 @@ Spectral function of the unfolded bands. ``` :::{tip} -See the [NaBiS2 example](https://smtg-ucl.github.io/easyunfold/examples/example_nabis2.html) for tips on +See the [NaBiS2 example](https://smtg-Bham.github.io/easyunfold/examples/example_nabis2.html) for tips on customising and prettifying the unfolded band structure plot. ::: diff --git a/docs/examples/example_si222.md b/docs/examples/example_si222.md index 8a15a87..1e98bbd 100644 --- a/docs/examples/example_si222.md +++ b/docs/examples/example_si222.md @@ -7,7 +7,7 @@ crystalline silicon (Si) which contains a displaced atom, breaking symmetry. :::{note} The files needed for this example are provided in the -[examples/Si222](https://github.com/SMTG-UCL/easyunfold/tree/main/examples/Si222) folder. This +[examples/Si222](https://github.com/SMTG-Bham/easyunfold/tree/main/examples/Si222) folder. This guide assumes the current working directory is located at the root of that folder. ::: @@ -19,7 +19,7 @@ easyunfold generate Si/POSCAR Si_super_deformed/POSCAR Si/KPOINTS_band Here, `KPOINTS_band` is the `KPOINTS` file corresponding to the band structure path for the primitive unit cell, which in this case was generated using `sumo-kgen` (see [Step 1]( -https://smtg-ucl.github.io/easyunfold/guide.html#step-1-generate-the-kpoints-path-of-the-primitive-cell) +https://smtg-Bham.github.io/easyunfold/guide.html#step-1-generate-the-kpoints-path-of-the-primitive-cell) of the tutorial docs page). This generates an `easyunfold.json` file in the current direction containing information about the @@ -88,7 +88,7 @@ mpirun -np 4 vasp_std # run the calculation ``` Alternatively, there is a `run.sh` script in the -[examples/Si222/Si_super_deformed](https://github.com/SMTG-UCL/easyunfold/tree/main/examples/Si222/Si_super_deformed) +[examples/Si222/Si_super_deformed](https://github.com/SMTG-Bham/easyunfold/tree/main/examples/Si222/Si_super_deformed) folder that can be used to perform these two steps above. ## Perform band unfolding @@ -126,7 +126,7 @@ Spectral function of the unfolded bands. ``` :::{tip} -See the [NaBiS2 example](https://smtg-ucl.github.io/easyunfold/examples/example_nabis2.html) for tips on +See the [NaBiS2 example](https://smtg-Bham.github.io/easyunfold/examples/example_nabis2.html) for tips on customising and prettifying the unfolded band structure plot. Here we have also actually used the `--intensity 3.5` option to increase the spectral function intensity. ::: diff --git a/docs/index.md b/docs/index.md index fc5bb67..51af5c1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,10 +1,10 @@ # `easyunfold` Documentation -![build](https://github.com/SMTG-UCL/easyunfold/actions/workflows/ci.yaml/badge.svg) -[![docs](https://github.com/SMTG-UCL/easyunfold/actions/workflows/docs.yaml/badge.svg)](https://smtg-ucl.github.io/easyunfold/) -[![codecov](https://codecov.io/gh/SMTG-UCL/easyunfold/branch/main/graph/badge.svg?token=XLLWWU5UM2)](https://codecov.io/gh/SMTG-UCL/easyunfold) +![build](https://github.com/SMTG-Bham/easyunfold/actions/workflows/ci.yaml/badge.svg) +[![docs](https://github.com/SMTG-Bham/easyunfold/actions/workflows/docs.yaml/badge.svg)](https://smtg-Bham.github.io/easyunfold/) +[![codecov](https://codecov.io/gh/SMTG-Bham/easyunfold/branch/main/graph/badge.svg?token=XLLWWU5UM2)](https://codecov.io/gh/SMTG-Bham/easyunfold) [![PyPI](https://img.shields.io/pypi/v/easyunfold)](https://pypi.org/project/easyunfold) -[![Downloads](https://img.shields.io/pypi/dm/easyunfold)](https://smtg-ucl.github.io/easyunfold/) +[![Downloads](https://img.shields.io/pypi/dm/easyunfold)](https://smtg-Bham.github.io/easyunfold/) @@ -13,7 +13,7 @@ path of the primitive cell. It was originally based on [PyVaspwfc](https://github.com/QijingZheng/VaspBandUnfolding) for reading VASP wavefunction outputs, with a notable improvement being that symmetry-breaking is properly accounted for by sampling necessary additional _k_-points and averaging accordingly. -Typical applications of band structure unfolding are the electronic structure analysis of defects, disorder, alloys, surfaces (and more), as illustrated in the example outputs below and [docs examples](https://smtg-ucl.github.io/easyunfold/examples.html). +Typical applications of band structure unfolding are the electronic structure analysis of defects, disorder, alloys, surfaces (and more), as illustrated in the example outputs below and [docs examples](https://smtg-Bham.github.io/easyunfold/examples.html). Our goal is to implement the band structure unfolding workflow in a robust and user-friendly software package. @@ -49,7 +49,7 @@ In all cases, the supercell symmetry is lowered compared to the pristine primiti Hence, for a given _k_-point path in the primitive cell Brillouin Zone, additional _k_-points are required to be sampled for the supercell, and the extracted spectral weights need to be appropriately averaged to obtain the correct effective band structure (EBS). See the docs -[Theory](https://smtg-ucl.github.io/easyunfold/theory.html) page for more details. +[Theory](https://smtg-Bham.github.io/easyunfold/theory.html) page for more details. @@ -96,7 +96,7 @@ And those who helped in the development: ## Bugs reports and feature requests Bug reports and feature requests are well come. If you found any bug or missing features please report it on the -[Issue Tracker](https://github.com/SMTG-UCL/easyunfold/issues). +[Issue Tracker](https://github.com/SMTG-Bham/easyunfold/issues). ## Seeking support @@ -111,7 +111,7 @@ for external contributions, we prefer the [fork and pull](https://guides.github.com/activities/forking/) workflow while core developers use branches in the main repository: -1. First open an [Issue](https://github.com/SMTG-UCL/easyunfold/issues) to discuss the proposed +1. First open an [Issue](https://github.com/SMTG-Bham/easyunfold/issues) to discuss the proposed contribution. This discussion might include how the changes fit `easyunfold`'s scope and a general technical approach. 2. Make your own project fork and implement the changes diff --git a/docs/tutorial.md b/docs/tutorial.md index 1531de3..eb61cf1 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -23,7 +23,7 @@ In all cases, the supercell symmetry is lowered compared to the pristine primiti Hence, for a given _k_-point path in the primitive cell Brillouin Zone, additional _k_-points are required to be sampled for the supercell, and the extracted spectral weights need to be appropriately averaged to obtain the correct effective band structure (EBS). See the docs -[Theory](https://smtg-ucl.github.io/easyunfold/theory.html) page for more details. +[Theory](https://smtg-Bham.github.io/easyunfold/theory.html) page for more details. At the moment, two plane-wave DFT codes, VASP[^vasp] and CASTEP[^castep], are supported. In principle, support can be easily added for other plane-wave codes if the wavefunction can be read in. @@ -40,10 +40,10 @@ For disordered materials, this primitive cell should be the idealised primitive This can be done by well-established packages such as [seekpath](https://www.materialscloud.org/work/tools/seekpath) or -[sumo](https://github.com/SMTG-UCL/sumo). +[sumo](https://github.com/SMTG-Bham/sumo). Note that the "standardised" primitive cell may be different from your input structure, and the generated path is correct for the standard primitive cell only. -We recommend using [sumo](https://github.com/SMTG-UCL/sumo) for generating the _k_-points, which provides +We recommend using [sumo](https://github.com/SMTG-Bham/sumo) for generating the _k_-points, which provides a nice command line interface, and automatically informs you if your input structure is not the required 'standardised' primitive cell: diff --git a/easyunfold/__init__.py b/easyunfold/__init__.py index caf92c2..b7eb714 100644 --- a/easyunfold/__init__.py +++ b/easyunfold/__init__.py @@ -2,4 +2,4 @@ Collection of code for band unfolding """ -__version__ = '0.3.0' +__version__ = '0.3.2' diff --git a/easyunfold/cli.py b/easyunfold/cli.py index 18095de..841f7c1 100644 --- a/easyunfold/cli.py +++ b/easyunfold/cli.py @@ -48,7 +48,11 @@ def easyunfold(): type=click.Choice(SUPPORTED_DFT_CODES), show_default=True, ) -@click.option('--matrix', '-m', help='Transformation matrix') +@click.option('--matrix', + '-m', + help='Transformation matrix, in the form "x y z" for a diagonal matrix, ' + 'or "x1 y1 z1, x2 y2 z2, x3 y3 z3" for a 3x3 matrix. Automatically guessed if not ' + 'provided.') @click.option('--symprec', help='Tolerance for determining the symmetry', type=float, default=1e-5, show_default=True) @click.option('--out-file', '-o', default='easyunfold.json', help='Name of the output file') @click.option('--no-expand', help='Do not expand the kpoints by symmetry', default=False, is_flag=True) @@ -91,21 +95,26 @@ def generate(pc_file, code, sc_file, matrix, kpoints, time_reversal, out_file, n if matrix: transform_matrix = matrix_from_string(matrix) - if not np.allclose(primitive.cell @ transform_matrix, supercell.cell, rtol=2e-2): # 2% mismatch tolerance - if np.allclose(primitive.cell @ transform_matrix, supercell.cell, rtol=5e-2): # 2-5% mismatch + if not np.allclose(transform_matrix @ primitive.cell, supercell.cell, rtol=2e-2): # 2% mismatch tolerance + if np.allclose(transform_matrix @ primitive.cell, supercell.cell, rtol=5e-2): # 2-5% mismatch click.echo(_quantitative_inaccuracy_warning) else: click.echo(_incommensurate_warning) + click.echo(f'Transform matrix x primitive cell:\n{transform_matrix @ primitive.cell}') + click.echo(f'Supercell cell:\n{supercell.cell}') click.echo('Proceeding with the assumed transformation matrix.') click.echo(f'Transform matrix:\n{transform_matrix.tolist()}') else: tmp = supercell.cell @ np.linalg.inv(primitive.cell) transform_matrix = np.rint(tmp) if not np.allclose(tmp, transform_matrix, rtol=2e-2): # 2% mismatch tolerance - if np.allclose(primitive.cell @ transform_matrix, supercell.cell, rtol=5e-2): # 2-5% mismatch + if np.allclose(transform_matrix @ primitive.cell, supercell.cell, rtol=5e-2): # 2-5% mismatch click.echo(_quantitative_inaccuracy_warning) else: click.echo(_incommensurate_warning) + click.echo(f'(Guessed) Transform matrix:\n{transform_matrix.tolist()}') + click.echo(f'Transform matrix x primitive cell:\n{transform_matrix @ primitive.cell}') + click.echo(f'Supercell cell:\n{supercell.cell}') raise click.Abort() click.echo(f'(Guessed) Transform matrix:\n{transform_matrix.tolist()}') diff --git a/easyunfold/plotting.py b/easyunfold/plotting.py index 352aad3..2822ba0 100644 --- a/easyunfold/plotting.py +++ b/easyunfold/plotting.py @@ -332,7 +332,7 @@ def _plot_spectral_function_rgba( else: fig, axes = plt.subplots(1, 2, figsize=figsize, dpi=dpi) else: - axes = [ax] if not isinstance(ax, list) else ax + axes = ax if isinstance(ax, (list, np.ndarray)) else [ax] fig = axes[0].figure mask = (engs < (ylim[1] + eref)) & (engs > (ylim[0] + eref)) diff --git a/easyunfold/utils.py b/easyunfold/utils.py index 09b25dc..aef159a 100644 --- a/easyunfold/utils.py +++ b/easyunfold/utils.py @@ -209,13 +209,15 @@ def wrap_kpoints(kpoints: Union[list, np.ndarray]): kpoints = np.array(kpoints) + 0.5 kpoints -= np.floor(kpoints) kpoints -= 0.5 + # Giving some numerical tolerance when enforcing the range [-0.5, 0.5) + kpoints[np.abs(kpoints - 0.5) < 1e-7] = -0.5 return kpoints def find_unique(seq: np.ndarray, func=None): """ Find unique slices along the first dimension of an np.array. - This is function is not optimised for high performance and has a O(N^2) scaling. + This function is not optimised for high performance and has a O(N^2) scaling. :return: A tuple of (unique, unique_idx, inv_mapping) """ diff --git a/pyproject.toml b/pyproject.toml index 7f67f15..1d6300b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "easyunfold" -authors = [{name = "Bonan Zhu", email = "zhubonan@outlook.com"}] +authors = [{name = "Bonan Zhu", email = "zhubonan@outlook.com"}, {name = "Seán Kavanagh", email = "s.kavanagh19@imperial.ac.uk"}] readme = "README.md" license = {file = "LICENSE"} classifiers = [ @@ -19,8 +19,8 @@ dependencies = ["scipy~=1.0", "numpy~=1.0", "matplotlib~=3.0", "ase~=3.14", "spg "castepxbin~=0.3.0", "castepinput~=0.1"] [project.urls] -"Homepage" = "https://github.com/SMTG-UCL/easyunfold" -"Documentation" = "https://smtg-ucl.github.io/easyunfold/" +"Homepage" = "https://github.com/SMTG-Bham/easyunfold" +"Documentation" = "https://smtg-Bham.github.io/easyunfold/" [project.scripts] easyunfold = "easyunfold.cli:easyunfold" @@ -28,7 +28,8 @@ easyunfold = "easyunfold.cli:easyunfold" [project.optional-dependencies] doc = [ "sphinx-click>=4,<5", "sphinx-autodoc2>=0.4,<0.5", "sphinx-book-theme>=1,<2", - "sphinx-copybutton>=0.3,<0.4", "myst-parser[linkify]", "sphinx>=6,<7" + "sphinx-copybutton>=0.3,<0.4", "myst-parser[linkify]", "sphinx>=6,<7", "astroid<3" + # astroid needs to be <3 due to: https://github.com/sphinx-extensions2/sphinx-autodoc2/issues/31 ] test = ["pytest", "pytest-cov", "coverage", "sumo"] dos = ["sumo"] diff --git a/tests/conftest.py b/tests/conftest.py index 51a91d3..e1f87cb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -40,6 +40,17 @@ def _inner(tag=''): return _inner +@pytest.fixture +def agsbte2_project_dir(datapath, tmp_path): + """Create a temporary directory containing AgSbTe2 inputs for testing""" + + def _inner(tag=''): + shutil.copytree(datapath('AgSbTe2'), tmp_path / 'AgSbTe2') + return tmp_path / 'AgSbTe2' + + return _inner + + @pytest.fixture def mgo_project_dir(datapath, tmp_path): shutil.copy2(datapath('mgo.json'), tmp_path / 'mgo.json') diff --git a/tests/test_cli.py b/tests/test_cli.py index 16f3038..d106d01 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -20,13 +20,34 @@ def test_generate(si_project_dir): tmp_dir = si_project_dir(None) os.chdir(tmp_dir) - output = runner.invoke(easyunfold, - ['generate', 'Si/POSCAR', 'Si_super_deformed/POSCAR', 'KPOINTS_band_low', '--out-file', 'test', '-y']) + output = runner.invoke( + easyunfold, + [ + 'generate', + 'Si/POSCAR', + 'Si_super_deformed/POSCAR', + 'KPOINTS_band_low', + '--out-file', + 'test', + '-y', + ], + ) assert output.exit_code == 0 output = runner.invoke( easyunfold, - ['generate', 'Si/POSCAR', 'Si_super_deformed/POSCAR', 'KPOINTS_band_low', '--out-file', 'test', '--nk-per-split', '3', '-y']) + [ + 'generate', + 'Si/POSCAR', + 'Si_super_deformed/POSCAR', + 'KPOINTS_band_low', + '--out-file', + 'test', + '--nk-per-split', + '3', + '-y', + ], + ) assert output.exit_code == 0 kpts = read_kpoints('KPOINTS_test')[0] @@ -37,10 +58,20 @@ def test_generate(si_project_dir): # Test with SCF kpoints - output = runner.invoke(easyunfold, [ - 'generate', 'Si/POSCAR', 'Si_super_deformed/POSCAR', 'KPOINTS_band_low', '--out-file', 'test', '--scf-kpoints', - 'Si_super_deformed_soc/IBZKPT', '-y' - ]) + output = runner.invoke( + easyunfold, + [ + 'generate', + 'Si/POSCAR', + 'Si_super_deformed/POSCAR', + 'KPOINTS_band_low', + '--out-file', + 'test', + '--scf-kpoints', + 'Si_super_deformed_soc/IBZKPT', + '-y', + ], + ) assert output.exit_code == 0 kpts, _, _, weights = read_kpoints('KPOINTS_test') assert weights[0] == 1.0 @@ -49,6 +80,88 @@ def test_generate(si_project_dir): assert len(kpts) == 96 + kpts_expected +def test_generate_agsbte2(agsbte2_project_dir): + """ + Test the generate function with SQS AgSbTe2 – in particular the ability to handle slightly-incommensurate cells + """ + runner = CliRunner() + + tmp_dir = agsbte2_project_dir(None) + os.chdir(tmp_dir) + + output = runner.invoke( + easyunfold, # ~2.5% lattice mismatch in this case, print warning but continue fine + ['generate', 'POSCAR_prim', 'SQS_POSCAR', 'KPOINTS_band', '--out-file', 'test'], + ) + assert output.exit_code == 0 + + _kpts = _check_output_info_and_kpoints_agsbte2( + [ + 'Warning: There is a lattice parameter mismatch in the range 2-5% between the primitive (multiplied by the ' + 'transformation matrix) and the supercell. This will lead to some quantitative inaccuracies in the ' + 'Brillouin Zone spacing (and thus effective masses) of the unfolded band structures.', + '(Guessed) Transform matrix:\n[[1.0, -0.0, 0.0], [1.0, -3.0, 1.0], [1.0, 1.0, -3.0]]', + ], + output, + ) + # test with also specifying transformation matrix: + os.remove('KPOINTS_test') + os.remove('test') + output = runner.invoke( + easyunfold, # ~2.5% lattice mismatch in this case, print warning but continue fine + [ + 'generate', + 'POSCAR_prim', + 'SQS_POSCAR', + 'KPOINTS_band', + '--out-file', + 'test', + '-m', + '1 0 0 1 -3 1 1 1 -3', + ], + ) + assert output.exit_code == 0 + + assert ('Warning: There is a lattice parameter mismatch in the range 2-5% between the primitive (multiplied by the ' + 'transformation matrix) and the supercell. This will lead to some quantitative inaccuracies in the ' + 'Brillouin Zone spacing (and thus effective masses) of the unfolded band structures.' in output.output) + _kpts = _check_output_info_and_kpoints_agsbte2( + [ + 'Proceeding with the assumed transformation matrix.', + 'Transform matrix:\n[[1.0, 0.0, 0.0], [1.0, -3.0, 1.0], [1.0, 1.0, -3.0]]', + ], + output, + ) + + +def _check_agsbte2_info_printing(output): + assert '194 kpoints specified along the path' in output.output + for i in [ + 'Supercell cell information:', + 'Space group number: 6', + 'International symbol: Pm', + 'Point group: m', + 'Primitive cell information:', + 'Space group number: 225', + 'International symbol: Fm-3m', + 'Point group: m-3m', + ]: + assert i in output.output + assert 'Supercell kpoints written to KPOINTS_test' in output.output + assert 'Unfolding settings written to test' in output.output + + return read_kpoints('KPOINTS_test')[0] + + +def _check_output_info_and_kpoints_agsbte2(info_messages: list, output: str): + for info_message in info_messages: + assert info_message in output.output + kpts = _check_agsbte2_info_printing(output) + assert len(kpts) == 993 + + return kpts + + @pytest.mark.parametrize('tag', ['', '_spin', '_soc']) def test_unfold(si_project_dir, tag): """ @@ -59,7 +172,17 @@ def test_unfold(si_project_dir, tag): tmp_dir = si_project_dir(tag) os.chdir(tmp_dir) - output = runner.invoke(easyunfold, ['generate', 'Si/POSCAR', 'Si_super_deformed/POSCAR', 'KPOINTS_band_low', '--out-file', 'test.json']) + output = runner.invoke( + easyunfold, + [ + 'generate', + 'Si/POSCAR', + 'Si_super_deformed/POSCAR', + 'KPOINTS_band_low', + '--out-file', + 'test.json', + ], + ) # Status check args_calc = ['unfold', '--data-file', 'test.json', 'status'] @@ -68,7 +191,13 @@ def test_unfold(si_project_dir, tag): assert 'Please run the supercell' in output.stdout # Perform the unfold - args_calc = ['unfold', '--data-file', 'test.json', 'calculate', f'Si_super_deformed{tag}/WAVECAR'] + args_calc = [ + 'unfold', + '--data-file', + 'test.json', + 'calculate', + f'Si_super_deformed{tag}/WAVECAR', + ] if 'soc' in tag: args_calc.append('--ncl') output = runner.invoke(easyunfold, args_calc) @@ -88,12 +217,18 @@ def test_unfold(si_project_dir, tag): if tag == '': output = runner.invoke(easyunfold, ['unfold', '--data-file', 'test.json', 'effective-mass']) assert 'Hole effective masses' in output.stdout - assert r' 0 m_e -0.938459 8 [0.5, 0.0, 0.5] (X) [0.5, 0.25, 0.75] (W)' in output.stdout + assert (r' 0 m_e -0.938459 8 [0.5, 0.0, 0.5] (X) [0.5, 0.25, 0.75] (W)' in output.stdout) # Plot effective mass - output = runner.invoke(easyunfold, ['unfold', '--data-file', 'test.json', 'effective-mass', '--plot']) + output = runner.invoke( + easyunfold, + ['unfold', '--data-file', 'test.json', 'effective-mass', '--plot'], + ) assert Path('unfold-effective-mass.png').is_file() # Plot effective mass fits - output = runner.invoke(easyunfold, ['unfold', '--data-file', 'test.json', 'effective-mass', '--plot-fit']) + output = runner.invoke( + easyunfold, + ['unfold', '--data-file', 'test.json', 'effective-mass', '--plot-fit'], + ) assert Path('unfold-effective-mass.png').is_file() # Do the plotting @@ -103,7 +238,17 @@ def test_unfold(si_project_dir, tag): assert Path('unfold.png').is_file() # matplotlib customisation check - output = runner.invoke(easyunfold, ['unfold', '--data-file', 'test.json', 'plot', '--mpl-style-file', 'my.mplstyle']) + output = runner.invoke( + easyunfold, + [ + 'unfold', + '--data-file', + 'test.json', + 'plot', + '--mpl-style-file', + 'my.mplstyle', + ], + ) assert output.exit_code == 0 print(output.stdout) assert 'Using custom plotting style' in output.stdout @@ -114,39 +259,143 @@ def test_plot_projection(mgo_project_dir): """Test plot projection""" os.chdir(mgo_project_dir) runner = CliRunner() - output = runner.invoke(easyunfold, - ['unfold', '--data-file', 'mgo.json', 'plot-projections', '--atoms-idx', '1,2|3-4', '--procar', 'PROCAR']) + output = runner.invoke( + easyunfold, + [ + 'unfold', + '--data-file', + 'mgo.json', + 'plot-projections', + '--atoms-idx', + '1,2|3-4', + '--procar', + 'PROCAR', + ], + ) _plot_projection_check(output) output = runner.invoke( - easyunfold, ['unfold', '--data-file', 'mgo.json', 'plot-projections', '--atoms-idx', '1,2|3-4', '--procar', 'PROCAR', '--combined']) + easyunfold, + [ + 'unfold', + '--data-file', + 'mgo.json', + 'plot-projections', + '--atoms-idx', + '1,2|3-4', + '--procar', + 'PROCAR', + '--combined', + ], + ) _plot_projection_check(output) - output = runner.invoke(easyunfold, [ - 'unfold', '--data-file', 'mgo.json', 'plot-projections', '--atoms-idx', '1,2|3-4', '--procar', 'PROCAR', '--combined', '--orbitals', - 'px,py|pz' - ]) + output = runner.invoke( + easyunfold, + [ + 'unfold', + '--data-file', + 'mgo.json', + 'plot-projections', + '--atoms-idx', + '1,2|3-4', + '--procar', + 'PROCAR', + '--combined', + '--orbitals', + 'px,py|pz', + ], + ) _plot_projection_check(output) # test --atoms option with --poscar specification - output = runner.invoke(easyunfold, - ['unfold', '--data-file', 'mgo.json', 'plot-projections', '--atoms', 'Mg,O', '--poscar', 'POSCAR.mgo']) + output = runner.invoke( + easyunfold, + [ + 'unfold', + '--data-file', + 'mgo.json', + 'plot-projections', + '--atoms', + 'Mg,O', + '--poscar', + 'POSCAR.mgo', + ], + ) _plot_projection_check(output) # test parsing PROCAR from LORBIT = 14 calculation - output = runner.invoke(easyunfold, [ - 'unfold', '--data-file', 'mgo.json', 'plot-projections', '--atoms', 'Mg,O', '--poscar', 'POSCAR.mgo', '--procar', - 'PROCAR_LORBIT_14.mgo' - ]) + output = runner.invoke( + easyunfold, + [ + 'unfold', + '--data-file', + 'mgo.json', + 'plot-projections', + '--atoms', + 'Mg,O', + '--poscar', + 'POSCAR.mgo', + '--procar', + 'PROCAR_LORBIT_14.mgo', + ], + ) _plot_projection_check(output) # test options - output = runner.invoke(easyunfold, [ - 'unfold', '--data-file', 'mgo.json', 'plot-projections', '--atoms', 'Mg,O', '--poscar', 'POSCAR.mgo', '--eref', '2', - '--no-symm-average', '--cmap', 'PuBu', '--orbitals', 's,p', '--colours', 'r,g', '--orbitals', 's,p', '--colours', 'r,g', - '--colourspace', 'luvlch', '--intensity', '0.5', '--emin', '-2', '--emax', '5', '--dpi', '500', '--vscale', '2.0', '--cmap', 'PuBu', - '--npoints', '200', '--sigma', '0.15', '--title', 'Test', '--no-combined', '--height', '2', '--width', '3', '-o', 'test.png' - ]) + output = runner.invoke( + easyunfold, + [ + 'unfold', + '--data-file', + 'mgo.json', + 'plot-projections', + '--atoms', + 'Mg,O', + '--poscar', + 'POSCAR.mgo', + '--eref', + '2', + '--no-symm-average', + '--cmap', + 'PuBu', + '--orbitals', + 's,p', + '--colours', + 'r,g', + '--orbitals', + 's,p', + '--colours', + 'r,g', + '--colourspace', + 'luvlch', + '--intensity', + '0.5', + '--emin', + '-2', + '--emax', + '5', + '--dpi', + '500', + '--vscale', + '2.0', + '--cmap', + 'PuBu', + '--npoints', + '200', + '--sigma', + '0.15', + '--title', + 'Test', + '--no-combined', + '--height', + '2', + '--width', + '3', + '-o', + 'test.png', + ], + ) assert output.exit_code == 0 assert Path('test.png').is_file() # different file name this time Path('test.png').unlink() @@ -183,97 +432,272 @@ def test_dos_atom_orbital_plots(nabis2_project_dir): """Test various dos/atom/orbital etc plot options with NaBiS2""" os.chdir(nabis2_project_dir) runner = CliRunner() - output = runner.invoke(easyunfold, [ - 'unfold', - 'plot-projections', - '--atoms', - 'Na,Bi,S', - '--orbitals', - 's|px,py,pz|p', - '--vscale', - '0.5', - '--combined', - '--dos', - 'vasprun.xml.gz', - '--zero-line', - '--dos-label', - 'DOS', - '--gaussian', - '0.1', - '--no-total', - '--scale', - '2', - '--dos-elements', - 'Bi.s.p', - ]) + output = runner.invoke( + easyunfold, + [ + 'unfold', + 'plot-projections', + '--atoms', + 'Na,Bi,S', + '--orbitals', + 's|px,py,pz|p', + '--vscale', + '0.5', + '--combined', + '--dos', + 'vasprun.xml.gz', + '--zero-line', + '--dos-label', + 'DOS', + '--gaussian', + '0.1', + '--no-total', + '--scale', + '2', + '--dos-elements', + 'Bi.s.p', + ], + ) _check_dos_atom_orbital_plots(output) - output = runner.invoke(easyunfold, [ - 'unfold', 'plot-projections', '--atoms', 'Na,Bi,S', '--orbitals', 's|px,py,pz|p', '--vscale', '0.5', '--combined', '--dos', - 'vasprun.xml.gz', '--zero-line', '--dos-label', 'DOS', '--gaussian', '0.1', '--no-total', '--scale', '2' - ]) + output = runner.invoke( + easyunfold, + [ + 'unfold', + 'plot-projections', + '--atoms', + 'Na,Bi,S', + '--orbitals', + 's|px,py,pz|p', + '--vscale', + '0.5', + '--combined', + '--dos', + 'vasprun.xml.gz', + '--zero-line', + '--dos-label', + 'DOS', + '--gaussian', + '0.1', + '--no-total', + '--scale', + '2', + ], + ) _check_dos_atom_orbital_plots(output) output = runner.invoke( easyunfold, [ # same but with intensity instead of vscale: - 'unfold', 'plot-projections', '--atoms', 'Na,Bi,S', '--orbitals', 's|px,py,pz|p', '--intensity', '2', '--combined', '--dos', - 'vasprun.xml.gz', '--zero-line', '--dos-label', 'DOS', '--gaussian', '0.1', '--no-total', '--scale', '2' - ]) + 'unfold', + 'plot-projections', + '--atoms', + 'Na,Bi,S', + '--orbitals', + 's|px,py,pz|p', + '--intensity', + '2', + '--combined', + '--dos', + 'vasprun.xml.gz', + '--zero-line', + '--dos-label', + 'DOS', + '--gaussian', + '0.1', + '--no-total', + '--scale', + '2', + ], + ) _check_dos_atom_orbital_plots(output) - output = runner.invoke(easyunfold, [ - 'unfold', 'plot-projections', '--atoms', 'Na,Bi,S', '--vscale', '0.5', '--combined', '--dos', 'vasprun.xml.gz', '--zero-line', - '--dos-label', 'DOS', '--gaussian', '0.1', '--no-total', '--scale', '2' - ]) + output = runner.invoke( + easyunfold, + [ + 'unfold', + 'plot-projections', + '--atoms', + 'Na,Bi,S', + '--vscale', + '0.5', + '--combined', + '--dos', + 'vasprun.xml.gz', + '--zero-line', + '--dos-label', + 'DOS', + '--gaussian', + '0.1', + '--no-total', + '--scale', + '2', + ], + ) _check_dos_atom_orbital_plots(output) - output = runner.invoke(easyunfold, [ - 'unfold', 'plot-projections', '--atoms', 'Na,Bi', '--vscale', '0.5', '--combined', '--dos', 'vasprun.xml.gz', '--zero-line', - '--dos-label', 'DOS', '--gaussian', '0.1', '--no-total', '--scale', '2' - ]) + output = runner.invoke( + easyunfold, + [ + 'unfold', + 'plot-projections', + '--atoms', + 'Na,Bi', + '--vscale', + '0.5', + '--combined', + '--dos', + 'vasprun.xml.gz', + '--zero-line', + '--dos-label', + 'DOS', + '--gaussian', + '0.1', + '--no-total', + '--scale', + '2', + ], + ) _check_dos_atom_orbital_plots(output) - output = runner.invoke(easyunfold, ['unfold', 'plot-projections', '--atoms', 'Na,Bi,S', '--dos', 'vasprun.xml.gz']) + output = runner.invoke( + easyunfold, + ['unfold', 'plot-projections', '--atoms', 'Na,Bi,S', '--dos', 'vasprun.xml.gz'], + ) _check_dos_atom_orbital_plots(output) - output = runner.invoke(easyunfold, ['unfold', 'plot-projections', '--atoms', 'Na,Bi,S', '--combined', '--dos', 'vasprun.xml.gz']) + output = runner.invoke( + easyunfold, + [ + 'unfold', + 'plot-projections', + '--atoms', + 'Na,Bi,S', + '--combined', + '--dos', + 'vasprun.xml.gz', + ], + ) _check_dos_atom_orbital_plots(output) - output = runner.invoke(easyunfold, ['unfold', 'plot', '--atoms-idx', '1-20|21-40', '--orbitals', 's|p', '--dos', 'vasprun.xml.gz']) + output = runner.invoke( + easyunfold, + [ + 'unfold', + 'plot', + '--atoms-idx', + '1-20|21-40', + '--orbitals', + 's|p', + '--dos', + 'vasprun.xml.gz', + ], + ) _check_dos_atom_orbital_plots(output) - output = runner.invoke(easyunfold, ['unfold', 'plot', '--atoms', 'Na,Bi', '--orbitals', 's|p', '--dos', 'vasprun.xml.gz']) + output = runner.invoke( + easyunfold, + [ + 'unfold', + 'plot', + '--atoms', + 'Na,Bi', + '--orbitals', + 's|p', + '--dos', + 'vasprun.xml.gz', + ], + ) _check_dos_atom_orbital_plots(output) - output = runner.invoke(easyunfold, - ['unfold', 'plot-projections', '--atoms', 'Na,Bi', '--combined', '--orbitals', 's', '--dos', 'vasprun.xml.gz']) + output = runner.invoke( + easyunfold, + [ + 'unfold', + 'plot-projections', + '--atoms', + 'Na,Bi', + '--combined', + '--orbitals', + 's', + '--dos', + 'vasprun.xml.gz', + ], + ) _check_dos_atom_orbital_plots(output) - output = runner.invoke(easyunfold, [ - 'unfold', 'plot-projections', '--atoms', 'Na,Bi', '--combined', '--orbitals', 's', '--dos', 'vasprun.xml.gz', '--dos-elements', - 'Bi.s' - ]) + output = runner.invoke( + easyunfold, + [ + 'unfold', + 'plot-projections', + '--atoms', + 'Na,Bi', + '--combined', + '--orbitals', + 's', + '--dos', + 'vasprun.xml.gz', + '--dos-elements', + 'Bi.s', + ], + ) _check_dos_atom_orbital_plots(output) - output = runner.invoke(easyunfold, [ - 'unfold', 'plot-projections', '--atoms-idx', '1-20,21,22,33', '--combined', '--orbitals', 's', '--dos', 'vasprun.xml.gz', - '--dos-elements', 'Bi.s' - ]) + output = runner.invoke( + easyunfold, + [ + 'unfold', + 'plot-projections', + '--atoms-idx', + '1-20,21,22,33', + '--combined', + '--orbitals', + 's', + '--dos', + 'vasprun.xml.gz', + '--dos-elements', + 'Bi.s', + ], + ) _check_dos_atom_orbital_plots(output) output = runner.invoke( easyunfold, - ['unfold', 'plot', '--atoms-idx', '1-20,21,22,33', '--orbitals', 's', '--dos', 'vasprun.xml.gz', '--dos-elements', 'Bi.s']) + [ + 'unfold', + 'plot', + '--atoms-idx', + '1-20,21,22,33', + '--orbitals', + 's', + '--dos', + 'vasprun.xml.gz', + '--dos-elements', + 'Bi.s', + ], + ) _check_dos_atom_orbital_plots(output) output = runner.invoke(easyunfold, ['unfold', 'plot', '--dos', 'vasprun.xml.gz']) _check_dos_atom_orbital_plots(output) - output = runner.invoke(easyunfold, [ - 'unfold', 'plot-projections', '--atoms', 'Na,Bi', '--orbitals', 's', '--combined', '--dos', 'vasprun.xml.gz', '--dos-elements', - 'Bi.s' - ]) + output = runner.invoke( + easyunfold, + [ + 'unfold', + 'plot-projections', + '--atoms', + 'Na,Bi', + '--orbitals', + 's', + '--combined', + '--dos', + 'vasprun.xml.gz', + '--dos-elements', + 'Bi.s', + ], + ) _check_dos_atom_orbital_plots(output) diff --git a/tests/test_data/AgSbTe2/KPOINTS_band b/tests/test_data/AgSbTe2/KPOINTS_band new file mode 100644 index 0000000..0274eb8 --- /dev/null +++ b/tests/test_data/AgSbTe2/KPOINTS_band @@ -0,0 +1,197 @@ +\Gamma -> L -> W -> X -> \Gamma +194 +Reciprocal +0.0 0.0 0.0 1 \Gamma +0.009259259259259257 0.009259259259259259 0.009259259259259259 1 +0.018518518518518514 0.018518518518518517 0.018518518518518517 1 +0.027777777777777773 0.027777777777777773 0.027777777777777773 1 +0.03703703703703703 0.037037037037037035 0.037037037037037035 1 +0.04629629629629629 0.04629629629629629 0.04629629629629629 1 +0.055555555555555546 0.055555555555555546 0.055555555555555546 1 +0.0648148148148148 0.06481481481481481 0.06481481481481481 1 +0.07407407407407406 0.07407407407407407 0.07407407407407407 1 +0.08333333333333331 0.08333333333333331 0.08333333333333331 1 +0.09259259259259257 0.09259259259259257 0.09259259259259257 1 +0.10185185185185183 0.10185185185185183 0.10185185185185183 1 +0.11111111111111109 0.11111111111111109 0.11111111111111109 1 +0.12037037037037035 0.12037037037037035 0.12037037037037035 1 +0.1296296296296296 0.12962962962962962 0.12962962962962962 1 +0.1388888888888889 0.1388888888888889 0.1388888888888889 1 +0.1481481481481481 0.14814814814814814 0.14814814814814814 1 +0.1574074074074074 0.1574074074074074 0.1574074074074074 1 +0.16666666666666663 0.16666666666666663 0.16666666666666663 1 +0.17592592592592593 0.17592592592592593 0.17592592592592593 1 +0.18518518518518515 0.18518518518518515 0.18518518518518515 1 +0.19444444444444445 0.19444444444444445 0.19444444444444445 1 +0.20370370370370366 0.20370370370370366 0.20370370370370366 1 +0.21296296296296297 0.21296296296296297 0.21296296296296297 1 +0.22222222222222218 0.22222222222222218 0.22222222222222218 1 +0.23148148148148145 0.23148148148148148 0.23148148148148148 1 +0.2407407407407407 0.2407407407407407 0.2407407407407407 1 +0.24999999999999997 0.25 0.25 1 +0.2592592592592592 0.25925925925925924 0.25925925925925924 1 +0.26851851851851855 0.26851851851851855 0.26851851851851855 1 +0.2777777777777778 0.2777777777777778 0.2777777777777778 1 +0.28703703703703703 0.28703703703703703 0.28703703703703703 1 +0.2962962962962962 0.2962962962962963 0.2962962962962963 1 +0.3055555555555556 0.3055555555555556 0.3055555555555556 1 +0.3148148148148148 0.3148148148148148 0.3148148148148148 1 +0.32407407407407407 0.32407407407407407 0.32407407407407407 1 +0.33333333333333326 0.33333333333333326 0.33333333333333326 1 +0.3425925925925926 0.3425925925925926 0.3425925925925926 1 +0.35185185185185186 0.35185185185185186 0.35185185185185186 1 +0.36111111111111105 0.3611111111111111 0.3611111111111111 1 +0.3703703703703703 0.3703703703703703 0.3703703703703703 1 +0.37962962962962965 0.37962962962962965 0.37962962962962965 1 +0.3888888888888889 0.3888888888888889 0.3888888888888889 1 +0.3981481481481481 0.39814814814814814 0.39814814814814814 1 +0.40740740740740733 0.40740740740740733 0.40740740740740733 1 +0.4166666666666667 0.4166666666666667 0.4166666666666667 1 +0.42592592592592593 0.42592592592592593 0.42592592592592593 1 +0.4351851851851851 0.4351851851851852 0.4351851851851852 1 +0.44444444444444436 0.44444444444444436 0.44444444444444436 1 +0.4537037037037037 0.4537037037037037 0.4537037037037037 1 +0.4629629629629629 0.46296296296296297 0.46296296296296297 1 +0.47222222222222215 0.47222222222222215 0.47222222222222215 1 +0.4814814814814814 0.4814814814814814 0.4814814814814814 1 +0.49074074074074076 0.49074074074074076 0.49074074074074076 1 +0.49999999999999994 0.5 0.5 1 L +0.5 0.4943181818181818 0.5056818181818181 1 +0.5 0.48863636363636365 0.5113636363636364 1 +0.49999999999999994 0.4829545454545454 0.5170454545454546 1 +0.49999999999999994 0.47727272727272724 0.5227272727272727 1 +0.49999999999999994 0.47159090909090906 0.5284090909090909 1 +0.5 0.46590909090909094 0.5340909090909091 1 +0.5 0.4602272727272727 0.5397727272727273 1 +0.5 0.45454545454545453 0.5454545454545454 1 +0.5 0.44886363636363635 0.5511363636363636 1 +0.5 0.4431818181818182 0.5568181818181819 1 +0.5 0.4375 0.5625 1 +0.49999999999999994 0.4318181818181818 0.5681818181818181 1 +0.5 0.42613636363636365 0.5738636363636364 1 +0.5 0.42045454545454547 0.5795454545454545 1 +0.5 0.4147727272727273 0.5852272727272727 1 +0.5 0.4090909090909091 0.5909090909090908 1 +0.5 0.40340909090909094 0.5965909090909091 1 +0.49999999999999994 0.3977272727272727 0.6022727272727273 1 +0.49999999999999994 0.39204545454545453 0.6079545454545454 1 +0.49999999999999994 0.38636363636363635 0.6136363636363636 1 +0.49999999999999994 0.3806818181818182 0.6193181818181818 1 +0.5 0.375 0.625 1 +0.5 0.3693181818181818 0.6306818181818181 1 +0.49999999999999994 0.36363636363636365 0.6363636363636364 1 +0.5 0.35795454545454547 0.6420454545454546 1 +0.49999999999999994 0.35227272727272724 0.6477272727272727 1 +0.49999999999999994 0.34659090909090906 0.6534090909090909 1 +0.49999999999999994 0.34090909090909094 0.6590909090909091 1 +0.49999999999999994 0.3352272727272727 0.6647727272727272 1 +0.49999999999999994 0.32954545454545453 0.6704545454545454 1 +0.5 0.32386363636363635 0.6761363636363636 1 +0.49999999999999994 0.3181818181818182 0.6818181818181818 1 +0.49999999999999994 0.3125 0.6875 1 +0.49999999999999994 0.3068181818181818 0.6931818181818181 1 +0.49999999999999994 0.30113636363636365 0.6988636363636364 1 +0.49999999999999994 0.29545454545454547 0.7045454545454545 1 +0.49999999999999994 0.28977272727272724 0.7102272727272727 1 +0.49999999999999994 0.28409090909090906 0.7159090909090908 1 +0.5 0.27840909090909094 0.7215909090909091 1 +0.5 0.27272727272727276 0.7272727272727273 1 +0.49999999999999994 0.26704545454545453 0.7329545454545454 1 +0.49999999999999994 0.26136363636363635 0.7386363636363636 1 +0.49999999999999994 0.2556818181818182 0.7443181818181818 1 +0.5 0.25 0.75 1 W +0.5 0.24218749999999997 0.7421875 1 +0.5 0.23437499999999997 0.734375 1 +0.5 0.2265625 0.7265625 1 +0.5 0.21874999999999997 0.71875 1 +0.5 0.2109375 0.7109375 1 +0.5 0.203125 0.703125 1 +0.5 0.19531249999999997 0.6953125 1 +0.5 0.1875 0.6875 1 +0.5 0.1796875 0.6796875 1 +0.5 0.171875 0.671875 1 +0.5 0.1640625 0.6640625 1 +0.5 0.15625 0.65625 1 +0.5 0.1484375 0.6484375 1 +0.5 0.140625 0.640625 1 +0.5 0.1328125 0.6328125 1 +0.5 0.125 0.625 1 +0.5 0.1171875 0.6171875 1 +0.5 0.10937499999999999 0.609375 1 +0.5 0.1015625 0.6015625 1 +0.5 0.09374999999999999 0.59375 1 +0.5 0.0859375 0.5859375 1 +0.5 0.078125 0.578125 1 +0.5 0.07031249999999999 0.5703125 1 +0.5 0.0625 0.5625 1 +0.5 0.05468750000000001 0.5546875 1 +0.5 0.04687499999999999 0.546875 1 +0.5 0.0390625 0.5390625 1 +0.5 0.031250000000000014 0.53125 1 +0.5 0.023437499999999997 0.5234375 1 +0.5 0.015625000000000007 0.515625 1 +0.5 0.007812500000000017 0.5078125 1 +0.5 0.0 0.5 1 X +0.49206349206349204 0.0 0.49206349206349204 1 +0.4841269841269841 0.0 0.4841269841269841 1 +0.47619047619047616 0.0 0.47619047619047616 1 +0.4682539682539682 0.0 0.4682539682539682 1 +0.46031746031746035 0.0 0.46031746031746035 1 +0.4523809523809524 0.0 0.4523809523809524 1 +0.4444444444444444 0.0 0.4444444444444444 1 +0.4365079365079365 0.0 0.4365079365079365 1 +0.42857142857142855 0.0 0.42857142857142855 1 +0.4206349206349206 0.0 0.4206349206349206 1 +0.41269841269841273 0.0 0.41269841269841273 1 +0.40476190476190477 0.0 0.40476190476190477 1 +0.3968253968253968 0.0 0.3968253968253968 1 +0.3888888888888889 0.0 0.3888888888888889 1 +0.38095238095238093 0.0 0.38095238095238093 1 +0.373015873015873 0.0 0.373015873015873 1 +0.36507936507936506 0.0 0.36507936507936506 1 +0.3571428571428571 0.0 0.3571428571428571 1 +0.3492063492063492 0.0 0.3492063492063492 1 +0.3412698412698412 0.0 0.3412698412698412 1 +0.3333333333333333 0.0 0.3333333333333333 1 +0.3253968253968254 0.0 0.3253968253968254 1 +0.31746031746031744 0.0 0.31746031746031744 1 +0.30952380952380953 0.0 0.30952380952380953 1 +0.3015873015873016 0.0 0.3015873015873016 1 +0.29365079365079366 0.0 0.29365079365079366 1 +0.28571428571428575 0.0 0.28571428571428575 1 +0.2777777777777778 0.0 0.2777777777777778 1 +0.2698412698412698 0.0 0.2698412698412698 1 +0.2619047619047619 0.0 0.2619047619047619 1 +0.25396825396825395 0.0 0.25396825396825395 1 +0.24603174603174602 0.0 0.24603174603174602 1 +0.23809523809523808 0.0 0.23809523809523808 1 +0.23015873015873017 0.0 0.23015873015873017 1 +0.22222222222222218 0.0 0.22222222222222218 1 +0.2142857142857143 0.0 0.2142857142857143 1 +0.2063492063492063 0.0 0.2063492063492063 1 +0.1984126984126984 0.0 0.1984126984126984 1 +0.19047619047619047 0.0 0.19047619047619047 1 +0.18253968253968253 0.0 0.18253968253968253 1 +0.1746031746031746 0.0 0.1746031746031746 1 +0.16666666666666669 0.0 0.16666666666666669 1 +0.1587301587301587 0.0 0.1587301587301587 1 +0.1507936507936508 0.0 0.1507936507936508 1 +0.14285714285714288 0.0 0.14285714285714288 1 +0.1349206349206349 0.0 0.1349206349206349 1 +0.12698412698412698 0.0 0.12698412698412698 1 +0.11904761904761904 0.0 0.11904761904761904 1 +0.11111111111111109 0.0 0.11111111111111109 1 +0.10317460317460321 0.0 0.10317460317460321 1 +0.0952380952380952 0.0 0.0952380952380952 1 +0.08730158730158732 0.0 0.08730158730158732 1 +0.07936507936507937 0.0 0.07936507936507937 1 +0.07142857142857144 0.0 0.07142857142857144 1 +0.06349206349206349 0.0 0.06349206349206349 1 +0.0555555555555556 0.0 0.0555555555555556 1 +0.0476190476190476 0.0 0.0476190476190476 1 +0.039682539682539715 0.0 0.039682539682539715 1 +0.031746031746031717 0.0 0.031746031746031717 1 +0.02380952380952383 0.0 0.02380952380952383 1 +0.015873015873015886 0.0 0.015873015873015886 1 +0.007936507936507943 0.0 0.007936507936507943 1 +0.0 0.0 0.0 1 \Gamma diff --git a/tests/test_data/AgSbTe2/POSCAR_prim b/tests/test_data/AgSbTe2/POSCAR_prim new file mode 100644 index 0000000..93254d0 --- /dev/null +++ b/tests/test_data/AgSbTe2/POSCAR_prim @@ -0,0 +1,10 @@ +Ag1 Te1 +1.0 + 0.0000000000000000 3.0399999999999991 3.0399999999999991 + 3.0399999999999991 0.0000000000000000 3.0399999999999991 + 3.0399999999999991 3.0399999999999991 0.0000000000000000 +Ag Te +1 1 +direct + 0.0000000000000000 0.0000000000000000 0.0000000000000000 Ag + -0.5000000000000000 0.5000000000000000 0.5000000000000000 Te diff --git a/tests/test_data/AgSbTe2/SQS_POSCAR b/tests/test_data/AgSbTe2/SQS_POSCAR new file mode 100644 index 0000000..5b8b590 --- /dev/null +++ b/tests/test_data/AgSbTe2/SQS_POSCAR @@ -0,0 +1,41 @@ +Ag4 Sb4 Te8 + 1.0000000000000000 + 0.0000000000000000 3.0153641666817892 3.0153641666817892 + -6.3146236125343318 5.8489685063819117 -5.8489685063819117 + -6.3469556992336607 -5.8654942008784907 5.8654942008784907 + Ag Sb Te + 4 4 8 +Direct + 0.0000000000000000 0.7527020370361285 0.2759265817118562 + -0.0000000000000000 0.4935370195973322 0.5138950873723097 + -0.0000000000000000 0.2587596038798642 0.7615285940182124 + 0.5000000000000000 0.8768400938939700 0.6165996651820500 + -0.0000000000000000 0.9953006355473802 0.0085537967871281 + 0.5000000000000000 0.3842174318681571 0.1227410907740850 + 0.5000000000000000 0.1219783801937458 0.3760017615926263 + 0.5000000000000000 0.6300065004980725 0.8574337035506276 + 0.0000000000000000 0.7715898516865103 0.7457215845430222 + -0.0000000000000000 0.5064226597851310 0.9851925528078957 + 0.0000000000000000 0.2494475112407989 0.2374070649248258 + 0.5000000000000000 0.1226897397507456 0.8663781307658880 + 0.0000000000000000 0.0119377410978760 0.5023102979327116 + 0.5000000000000000 0.8567663249734002 0.1320448189015473 + 0.5000000000000000 0.6033195325030615 0.3724492380933057 + 0.5000000000000000 0.3644849364479630 0.6258160310418472 + + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00 + 0.00000000E+00 0.00000000E+00 0.00000000E+00