Git Product home page Git Product logo

cif2vasp's Introduction

cif2vasp

This script converts a file from the CIF format to VASP's POSCAR format. It does not support fractional occupancies. There may also be other limitations not yet discovered.

Usage

$ cif2vasp [-v] [-f] [-e gulp|ase|cctbx] filename.cif

Backends

The first version of this script was inspired by the procedure found at http://encina.northwestern.edu/index.php/Cif_to_VASP, but I added a better CIF parsing routine using the PyCifRW library. While this version of the script (to be referred to as the GULP backend) still works great, it has very many dependencies. In order to simplify things, I first looked into CCTBX, and later ASE, both powerful Python packages, with ASE being the simplest one to install and use.

ASE

The excellent ASE package, available from https://wiki.fysik.dtu.dk/ase/, almost eliminates the need for this script, since converting a file actually is done with just three lines of code:

from ase import io
atoms = io.read(jobname+'.cif')
atoms.write('POSCAR', format = 'vasp')

Using other backends is recommended if you run into problems with ASE's CIF parsing, or want direct coordinates directly (ASE writes cartesian).

GULP

This backend will give slightly more feedback during the conversion, and will provide a warning if fractional occupancies are found, but the numerical noise is about 1e-10, compared to 1e-16 for ASE because of the intermediate XYZ file with only 10 digits. The GULP process will write direct coordinates.

Requirements:

Process:

  1. prepareGulpInput: Read CIF file using the PyCifRW library and write GULP in file.
  2. runGulp: Run GULP to generate all unit cell coordinates based on the spacegroup symmetry operations.
  3. runConvasp: Write XYZ file from GULP out file, then use ACONVASP to convert the cartesian coordinates in the XYZ file into fractional coordinates.

I also experimented with ATAT (ezvasp) from http://www.its.caltech.edu/~avdw/atat/ . You may try modifying the script to run cif2vaspUsingGULP(jobname, ezvasp = True)

CCTBX

I looked into using the Computational Crystallography Toolbox (CCTBX), which is a powerful Python package available from http://cctbx.sourceforge.net. I did however run into some problems getting CCTBX to play nicely with my current Python installation. The CCTBX support is therefore experimental.

cif2vasp's People

Contributors

danmichaelo avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

cif2vasp's Issues

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.