Code Monkey home page Code Monkey logo

seekpath's Introduction

SeeK-path

Test status for default branch: continuousintegration

SeeK-path is a python module to obtain band paths in the Brillouin zone of crystal structures.

The definition of k-point labels follows crystallographic convention, as defined and discussed in the HPKOT paper. Moreover, the Bravais lattice is detected properly using the spacegroup symmetry. Also the suggested band path provided in the HPKOT paper is returned. Systems without time-reversal and inversion-symmetry are also properly taken into account.

If you use this tool, please cite the following work:

  • Y. Hinuma, G. Pizzi, Y. Kumagai, F. Oba, I. Tanaka, Band structure diagram paths based on crystallography, Comp. Mat. Sci. 128, 140 (2017) (JOURNAL LINK, arXiv link).
  • You should also cite spglib that is an essential library used in the implementation: A. Togo, I. Tanaka, "Spglib: a software library for crystal symmetry search", arXiv:1808.01590 (2018) (spglib arXiv link).

Please check the SeeK-path user guide on ReadTheDocs.

  • Jae-Mo Lihm: k-point paths for the original unit cell (i.e., the one provided in input by the user) without standardization or symmetrization

The code is open-source (licensed with a MIT license, see LICENSE.txt).

In the tools-seekpath repository we also provide the code to deploy a online service for the visualization of the band paths and primitive cells of the crystal structures. A live version is hosted on the Materials Cloud web portal.

The following is a screenshot of the selection window:

SeeK-path web service selection window

And the following is a screenshot of the main output window, showing the Brillouin zone, the primitive crystal structure, the coordinates of the k-points and the suggested band path.

SeeK-path web service main output

seekpath's People

Contributors

dependabot[bot] avatar dev-zero avatar giovannipizzi avatar jaemolihm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seekpath's Issues

Push build docker to docker hub from travis

See for instance here
https://sebest.github.io/post/using-travis-ci-to-build-docker-images/
but read also the comment on checking on pull requests (probably we should skip if it is a pull request).

This would also allow to move the docker file in a subfolder, with a README.md only for it, and put this readme also on docker hub (currently, with automated builds, the README.md is rewritten with the one sitting in the same folder of the Dockerfile, that is less than ideal - the Dockerfile cannot be easily moved to a subfolder, because then we need to find a different way to get the proper code version into the image, e.g. getting in some way with build hooks the version we are building from, and then getting that from github, but it seems a bit tricky to me).

Also, check if there is a better way to check if the nginx+wsgi service is up, rather than waiting an arbitrary number of seconds (15 currently).

Usage 3.1 is problematic

Honestly speaking, Usage 3.1 is very problematic,
It is convenient if you can add the rotation matrix connecting the user-provided cell
and the conventional cell, as an output of get_path.

Fix the CASTEP importer

The ASE importer used now fails with most input files.
See e.g. Si2-bs.cell.txt
that returns

    Generating castep_keywords.py ... hang on.
    The castep_keywords.py contains abstractions for CASTEP input
    parameters (for both .cell and .param input files), including some
    format checks and descriptions. The latter are extracted from the
    internal online help facility of a CASTEP binary, thus allowing to
    easily keep the calculator synchronized with (different versions of)
    the CASTEP code. Consequently, avoiding licensing issues (CASTEP is
    distributed commercially by accelrys), we consider it wise not to
    provide castep_keywords.py in the first place.

read_cell: Warning - Was not able to initialize CASTEP calculator.
           This may be due to a non-existing "castep.keywords.py"
           file or a non-existing CASTEP installation.
           Original error message appears below:

           Could not determine the version of your CASTEP binary 
           This usually means one of the following 
              * you do not have CASTEP installed 
              * you have not set the CASTEP_COMMAND to call it 
              * you have provided a wrong CASTEP_COMMAND. 
                Make sure it is in your PATH
           
           

           Fallback-mode will be applied to provide at least the
           geometric information contained in the *.cell file.
Warning: the keyword BS_KPOINT_LIST is not
         interpreted in cell files
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-4323c05a7564> in <module>()
----> 1 get_structure_tuple(open('/home/pizzi/Desktop/Si2-bs.cell'), 'castep')

/home/pizzi/git/seekpath/webservice/structure_importers/__init__.pyc in get_structure_tuple(fileobject, fileformat)
     55     elif fileformat == 'castep':
     56         import ase.io.castep
---> 57         asestructure = ase.io.castep.read_castep_cell(fileobject)
     58         return tuple_from_ase(asestructure)
     59     elif fileformat == 'qe-inp':

/home/pizzi/.local/lib/python2.7/site-packages/ase/io/castep.pyc in read_castep_cell(fd, index)
    599                     else:
    600                         block_lines.append(lines[l-1].strip())
--> 601                 calc.__setattr__(block_name, block_lines)
    602                 # raise UserWarning
    603         else:

AttributeError: 'NoneType' object has no attribute 'BS_KPOINT_LIST'

Action: reimplement a simple parser just for the cell and the atomic positions.

Strange behavior for oA.

Dear developers,

The returned structure of oA shows strange behavior.
Here is my orthorhombic BaTiO3.

Ba1 Ti1 O3 (call STRUCTURE A HERE)
1.0
0.000000 2.859776 -2.876106
0.000000 2.859776 2.876106
3.964208 0.000000 0.000000
Ba Ti O
1 1 3 
direct
-0.004309 1.004309 0.000000 Ba
0.480552 0.519448 0.500000 Ti
0.022641 0.491446 0.500000 O
0.508554 0.977359 0.500000 O
-0.487338 1.487338 0.000000 O

If the A structure is input, seekpath returns

Ba1 Ti1 O3 (call STRUCTURE B HERE)
1.0
0.000000 2.859776 -2.876106
0.000000 2.859776 2.876106
3.964208 0.000000 0.000000
Ba Ti O
1 1 3 
direct
0.0043090000    0.9956910000    0.0000000000
-0.4805520000   1.4805520000    0.5000000000
-0.5085540000   1.0226410000    0.5000000000
-0.0226410000   1.5085540000    0.5000000000
0.4873380000    0.5126620000    0.0000000000

A strange to me is when A is input, B is returned, and when B is input, A is returned.
That means the seekpath shows cyclic behavior.
Of course, these two shows the same result, so this is not a true bug in principle.
However, if possible, I would like to have a unique structure.

What do you think?

brillouine zone is on going?

I like you will include variety of samples in the package.
Anyway I can not yet plot my own BZone.

Please, not set ax.axis('off').
And I hope you use ax.set_aspect('equal') to keep the same aspect ratio.

Fix the QE importer

When the CELL_PARAMETER line has the units using (at least one character in) upper case, it crashes (while it shouldn't).
The regex needs to be fixed.

Also, see how to deal cases with e.g. 'Mn1' and 'Mn2' properly.

any plan for jupyter/jupyterlab plugin?

It seems that the python package can only generate he K path, and the visualization functions is outside the python package?

seekpath must be the best k-path visualization tool I have ever met, and the rotatable can add into jupyter/jupyterlab, it will be more helpful.

Thanks in advance.

Add link to docs of input file formats

In the seek path results, at the bottom, a number of formats is generated (QE, CP2K, and a few more (VASP, Crystal) are being contributed in #68).

With so many formats (and some of them being not intuitive) it would be good to have a link to the docs (e.g. with a link [Format specification], in small font, in the blue header).

Here are some possible links:

Failed to pass the run_tests.py.

Hi,

I install the git master version of seekpath will pip's editable mode with the following steps:

# Doing this within pyenv using python 3.8.1:
$ pyenv shell 3.8.1
# Create a virtualenv named as hpc for this test:
$ pyenv virtualenv hpc
$ pyenv shell hpc 
$ git clone https://github.com/giovannipizzi/seekpath.git seekpath.git
$ cd seekpath.git
$ pip install -e .

And I also installed the all of the packages listed in the *requirements.txt files.
Then I do the following testing:

$ python run_tests.py 
ssF.ssss..................................................................
======================================================================
FAIL: test_2 (seekpath.brillouinzone.test_brillouinzone.TestBZ)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/werner/Public/hpc/tools/seekpath.git/seekpath/brillouinzone/test_brillouinzone.py", line 254, in test_2
    self.assertTrue(is_same,
AssertionError: False is not true : The two sets of faces are different: The following item in the first list was not found in the second one: [[-0.5, 0.5, -0.3400000000000001], [0.30000000000000004, 0.5, -0.4999999999999999], [0.3, 0.3, -0.6599999999999999], [-0.5, 0.3, -0.4999999999999999]]

----------------------------------------------------------------------
Ran 74 tests in 0.340s

FAILED (failures=1, skipped=6)

Any hints for this issue?

Regards

Problem creating primitive cell

Hi,

I'm using seekpath python library 2.0.1, and I found the following error occurs for this attached specific geometry file.

ValueError: Problem creating primitive cell, I found the following group of atoms with len != 2: (2, 6, 12, 16), (3, 7, 13, 17), (4, 8, 14, 18), (5, 9, 15, 19)

I found the structure can be normalized or primitivized using spglib 1.16.3.

I also checked this geometry doesn't work in https://www.materialscloud.org/work/tools/seekpath

Thank you.

PdSe1.23Te0.77.vasp.txt

Obtaining High symmetrical points in the Corner of FBZ

I was wondering if there is a possibility to obtain the high-symmetrical points when they are located in an edge of the FBZ, but due to loss of symmetry (during optimization) these ones are not shown in the seekpath,
For example,

image

this system is mP1 symmetry , but it gets loss in the optimization due to the different degrees of freedom of the system,
like in this example

image

yet I would like to obtain the corner points (in my case) that are interesting for the bandstructure ,

Is there a way to get these corner points ?

highlight suggested path more

this is a suggestion by andrea ferretti - he mentions that when using seekpath in class, (some) students end up using the "high symmetry points" as the path and don't read to the very bottom where it provides the actual suggested path.

One could even think of putting the suggested path before the coordinates of the corresponding labels.

No standardization

I think standardization should be one of an option.
Because people use supercells and so on. Its depends on problems.

takao kotani

symmetry info is not right for some structure

Dear developers,
I have a structure which is monoclinic and spacegroup C2/m (No.12). The cif file can be downloaded here
But when I feed this structure into seekpath.get_path, no matter what threshold I set, it always shows the spacegroup is P1(No.1) and bravais lattice is aP.
On the other hand, the spglib.get_symmetry_dataset do return P1 with the default symprec=1e-5. But it will return C2/m with symprec=5e-4.
So, I am wondering if there is something wrong with threshold in seekpath.get_path ?

best regards

Issue creating primitive cell for F-centred cubic cells

I've got a set of structures for which SeeK Path cannot generate primitive cells. They're all face centred cubic cells of space group F m -3 m. The website also failed to yield an outcome with a warning message of "Unable to process the structure"

The error message is listed below:

File "/home/uccazxi/.python2local/lib/python2.7/site-packages/matools/prim.py", line 44, in main
  seek_data = seekpath.get_path(std)
File "/home/uccazxi/.python2local/lib/python2.7/site-packages/seekpath/getpaths.py", line 95, in get_path
  res = hpkot.get_path(structure, with_time_reversal, threshold)
File "/home/uccazxi/.python2local/lib/python2.7/site-packages/seekpath/hpkot/__init__.py", line 423, in get_path
  bravais_lattice=bravais_lattice)
File "/home/uccazxi/.python2local/lib/python2.7/site-packages/seekpath/hpkot/spg_mapping.py", line 312, in get_primitive
  volume_ratio, ", ".join(str(_) for _ in wrong_count)))
ValueError: Problem creating primitive cell, I found the following group of atoms with len != 4: (0, 1, 3, 4, 6, 7, 9, 10)

And one of the POSCAR looks like this:

Bi1 Na1 Se2
1.0
5.9879999161 0.0000000000 0.0000000000
0.0000000000 5.9879999161 0.0000000000
0.0000000000 0.0000000000 5.9879999161
Bi Na Se
4 4 4
Direct
0.000000000 0.000000000 0.000000000
0.000000000 0.500000000 0.500000000
0.500000000 0.000000000 0.500000000
0.500000000 0.500000000 0.000000000
0.000000000 0.000000000 0.000000000
0.000000000 0.500000000 0.500000000
0.500000000 0.000000000 0.500000000
0.500000000 0.500000000 0.000000000
0.500000000 0.500000000 0.500000000
0.500000000 0.000000000 0.000000000
0.000000000 0.500000000 0.000000000
0.000000000 0.000000000 0.500000000

Thank you.

Sorry I just realized that when VESTA was generating the unit cell it makes the occupancy from 0.5 to 1, making two cations on the same site. That's why it got wrong.

Test failure with spglib 1.12.2.post0

Hi, we're trying to maintain seekpath packages for Nix/NixOS. When we upgraded spglib from 1.10.4.11 to 1.12.2.post0 we noticed that a single test in seekpath 1.8.4, test_oI2Y started failing. The error being:

======================================================================
FAIL: test_oI2Y (seekpath.test_paths_hpkot.TestPaths3D_HPKOT)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/seekpath-1.8.4/seekpath/test_paths_hpkot.py", line 706, in test_oI2Y
    self.base_test(ext_bravais="oI2", with_inv=True)
  File "/build/seekpath-1.8.4/seekpath/test_paths_hpkot.py", line 366, in base_test
    self.assertEqual(res['bravais_lattice_extended'], ext_bravais)
AssertionError: 'oI3' != 'oI2'
- oI3
?   ^
+ oI2
?   ^

Same error on python 2.7 & 3.7, on macos & linux.

link orientation of reciprocal and real space

While real and reciprocal lattices are, of course, different, orientation in real and reciprocal space has the same meaning.

Finding a way to indicate the correspondence between real-space and reciprocal-space directions can be very helpful for linking properties like dispersion of bands, etc. to the crystal structure.

In the seekpath output you show both real and reciprocal space side by side, and you could couple the two orientations together (so that, if you rotate one, the other rotates accordingly).

Increase the number of threads in the web app

Now it's 4, but in general it can be higher (e.g. 10 - a default Ubuntu configuration for a server has 25 ThreadsPerChild with a MPM-event in my experience).
Also this reduces risks of downtime if a requests become extremely slow (see e.g. #50)

double precision as default

Dear author,
It is a great application.
I really appreciate your efforts.

Here is my sample for NiO.

import seekpath
cell = [[0.5, 0.5, 1.0],[0.5, 1.0, 0.5],[1.0, 0.5, 0.5]]
positions = [[0, 0, 0],[.25,.25,.25],[.5,.5,.5],[.75,.75,.75]]
numbers = [1,2,3,3]
structure = (cell, positions, numbers)
with_time_reversal=False
a=seekpath.get_path(structure,with_time_reversal) for i in a.keys():
print i, a[i]

I think all numbers should be double precision, or exact values.
(I saw numbers such as 0.66666667 in its console output. It is problematic in my case).

takao kotani

re-order lattice vectors after importing.

I notice that seekpath will re-order the lattice vectors.
For example, if my QE input file has

CELL_PARAMETERS (angstrom)
5.511004561 0.0000000 -0.522914292
0.00000000 3.203286540 0.00000000
-0.833975125 0.00000000 9.033641976

Then after QE parsing:
v | x | y | z
v1 | -3.2032865400 | 0.0000000000 | 0.0000000000
v2 | 0.0000000000 | -1.6835747027 | 8.9144701514
v3 | 0.0000000000 | 5.5357574575 | 0.0000000000

Is there any reason to enforce such re-ordering?
Sometimes, I find such ordering quite inconvenient.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.