The beginning of cif2cell

Overview of cif2cell

CIF2Cell download | SourceForge.net Written in python, which outputs the input file (specified part of atomic arrangement) of the first-principles calculation code (abinit, elk, vasp, pwscf, etc.) from cif (crystallographic Information File), which is a crystal structure format. App.

Install with general user privileges

Try to install things as much as you can with general user privileges. As an example, suppose you fetched cif2cell-1.2.10.tar.gz. With $ tar -zxvf cif2cell-1.2.10.tar.gz, move the expanded cif2cell-1.2.10 to / home / user / sources. Change to that directory.

Install PyCiRW with general user privileges

In fact, to install cif2cell, you need an app called PyCiRW, which is included in the cif2cell code. Go to PyCifRW-3.3 which can be expanded with $ tar -zxvf PyCifRW-3.3.tar.gz.

Basically, it is the kind that is installed by so-called python setup.py install. However, this procedure requires some ingenuity because it tries to generate a file in /usr/lib64/python2.7/site-packages, which cannot be added without administrator privileges.

Check the path referenced by python

Run python,

import sys
print(sys.path)

So, let's check the path that can be referenced now. If there is a part that can be edited by a general user, such as home / user / .local / lib / python2.7 / site-packages, you can put it there. However, I'd like to keep the ones that I installed with extreme innocence separately so that I can recognize it, so I will make a clear place to put it.

Create an installation directory and install

The installation destination is / home / user / opt / PyCifRW-3.3. Later, when I try to install by specifying this directory as the installation prefix, I get angry that the proper path is not set. This is because the path that is attached to the directory to be entered is not included in the path examined above. So, I will add the path appropriately. There are several ways to set this path, but here we will solve it by setting the environment variable PYTHONPATH.

export PYTHONPATH=/home/user/opt/PyCifRW-3.3/lib64/python2.7/site-packages:$PYTHONPATH

Then, the environment variable PYTHONPATH is set appropriately. This directory does not exist before the installation, but if you do not look ahead and supplement lib64 / python2.7 / site-packages under the installation destination, it will be moss in the subsequent installation.

python setup.py install --prefix=/home/user/opt/PyCifRW-3.3

It was fine and the installation was completed. In ʻINSTALL` in the directory containing the source,

import CifFile

If you can import with, it means that the installation was successful.

Probably, this seems to be a procedure that can always be used when doing python setup.py install with general user privileges.

Install cif2cell with general user privileges

At this point, it's sunny and you can install cif2cell. Move to the directory where the cif2cell source is located

python setup.py install --prefix=/home/user/opt/cif2cell-1.2.10

Installation is complete.

Naturally, put the path in cif2cell,

export PYTHONPATH=/home/user/opt/cif2cell-1.2.10/lib/python2.7/site-packages:$PYTHONPATH

Is necessary. Without this, it will be moss at from utils import * of cif2cell. The PYTHONPATH specified when installing PyCifRW must continue to be specified when cif2cell is executed.

How to use cif2cell

Basic usage

How to use the basic commands of cif2cell

cif2cell *.cif -p abinit

So, if you want to create an input file with elk or vasp, change the part of ʻabinit to ʻelk or vasp. If you want to name the output file

cif2cell *.cif -p abinit -o hoge.in

Specify the desired file name after -o as in.

The cif example is in cifs or / home / user / opt / cif2cell-1.2.10 / lib / sample_cifs in the directory containing the source code, so you can run it right away.

Specifying options

By specifying the option, you can use it elaborately. For example

cif2cell *.cif -p abinit --no-reduce

And view the input file in a non-primitive cell (probably a Bravais grid).

Other options can be found with $ cif2cell -h, and there is an official manual pdf at / home / user / opt / cif2cell-1.2.10 / lib / docs. It seems that you can make a super cell of an appropriate size from a primitive cell (I have never used it).

trouble shooting

bonus

Output in pwscf format and display in XCryS Den

XCrySDen makes it easy to visualize the crystal structure and easily generate k-space paths in the corresponding Brillouin zone. XCrySDen can read input files in pyscf format, so it is convenient to output with pwscf for this purpose as well.

Where can I get cif?

You can also find it by googled "(substance name or chemical formula) cif". I don't know the source of the cif, so I always look for it in NIMS's Inorganic Materials Database (AtomWork). Since it is basically based on the values reported in the literature, it is good to know the source. For crystals with the structure to be calculated for the first time, check the consistency by putting the cif in VESTA and looking around, or by reading the crystal data directly from the paper and generating the cif via VESTA. It might be a good idea to check it out in Materials Project (I have never used it).

Recommended Posts

The beginning of cif2cell
First Python 3 ~ The beginning of repetition ~
[Understanding in 3 minutes] The beginning of Linux
Learning notes from the beginning of Python 1
Omit BOM from the beginning of the string
Shout Hello, Reiwa! At the beginning of Reiwa
Learning notes from the beginning of Python 2
[Note] Beginning of programming
The meaning of self
the zen of Python
The story of sys.path.append ()
Finding the beginning of Abenomics from NT magnification 2
Finding the beginning of Abenomics from NT magnification 1
Revenge of the Types: Revenge of types
Learn Nim with Python (from the beginning of the year).
[GoLang] Set a space at the beginning of the comment
Study from the beginning of Python Hour1: Hello World
Mathematical understanding of principal component analysis from the beginning
Study from the beginning of Python Hour8: Using packages
Align the version of chromedriver_binary
Scraping the result of "Schedule-kun"
10. Counting the number of lines
The story of building Zabbix 4.4
Towards the retirement of Python2
[Apache] The story of prefork
Compare the fonts of jupyter-themes
About the ease of Python
Get the number of digits
Explain the code of Tensorflow_in_ROS
Reuse the results of clustering
GoPiGo3 of the old man
Calculate the number of changes
Change the theme of Jupyter
The popularity of programming languages
Change the style of matplotlib
Visualize the orbit of Hayabusa2
About the components of Luigi
Connected components of the graph
Filter the output of tracemalloc
About the features of Python
Simulation of the contents of the wallet
The Power of Pandas: Python
DJango Note: From the beginning (simplification and splitting of URLConf)
Get UNIXTIME at the beginning of today with a command
Beginning of Nico Nico Pedia analysis ~ JSON and touch the provided data ~
[Stable at the beginning of the month] Considering the purchase timing of funded investment
The specifications of pytz have changed
Test the version of the argparse module
Find the definition of the value of errno
The day of docker run (note)
Plot the spread of the new coronavirus
The story of Python and the story of NaN
Raise the version of pyenv itself
Get the number of views of Qiita
[Python] The stumbling block of import
Japanese translation of the e2fsprogs manual
The story of participating in AtCoder
Change the background of Ubuntu (GNOME)
Is the probability of precipitation correct?
I investigated the mechanism of flask-login!
Understand the contents of sklearn's pipeline