Skip to content

Center molecule within the periodic box and convert XYZ structure into VASP/Quantum Espresso Input files

Notifications You must be signed in to change notification settings

rahulumrao/FormatTransformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FormatTransformer

The package FormatTransformer move molecular structure (single frame or trajectory) within the periodic box and convert XYZ trajectories to VASP (POSCAR) or Quantum Espresso (QE) Input files.

Installation

Clone repository and install package:

git clone git@github.com:rahulumrao/FormatTransformer.git
cd FormatTransformer
pip install .

Usage

xyzcenter - shift molecule at the center of box

❯ xyzcenter -h

usage: xyzcenter [-h] [-i INPUT] [-o OUTPUT] [-b BOX_SIZE]

Center molecular structure within PBC

options:
  -h, --help            Show this help message and exit
  -i INPUT, --input INPUT
                        Input XYZ trajectory file
  -o OUTPUT, --output OUTPUT
                        Output XYZ trajectory file
  -b BOX_SIZE, --box_size BOX_SIZE
                        Box size in Å (default: 15.0)

xyzconverter - Convert XYZ (cartesian) to VASP (POSCAR) or Quantum Espresso input files

❯ xyzconverter -h

usage: xyzconverter [-h] [-i INPUT] [-b BOX_SIZE [BOX_SIZE ...]] -o {VASP,QE} [-pp PSEUDO]

Convert XYZ to VASP POSCAR or Quantum Espresso input files

options:
  -h, --help            Show this help message and exit
  -i INPUT, --input INPUT
                        Input XYZ file containing multiple frames
  -b BOX_SIZE [BOX_SIZE ...], --box_size BOX_SIZE [BOX_SIZE ...]
                        Box size in Å (default: Cubic box of 12.0)
  -o {VASP,QE}, --output_type {VASP,QE}
                        Specify the output format: VASP or QE
  -pp PSEUDO, --pseudo PSEUDO
                        PseudoPotentials directory (required for Quantum Espresso)

Examples

❯ xyzcenter -i trajec.xyz -o centered_trajec.xyz -b 12.0

==============================
Reading... trajec.xyz
==============================
Centered structure saved in centered_trajec.xyz wihtin periodic box 12.0

❯ xyzconverter -i centered_trajec.xyz -o VASP -b 12.0

Converting to VASP POSCAR format...
=============================================================
 Reading file : centered_trajec.xyz
 Box dimensions : A = 12.0, B = 12.0, C = 12.0
=============================================================
100%|███████████████████████████████████████████████████████████████████████| 99/99 [00:00<00:00, 4407.79it/s]
POSCAR files written in directory, poscar_files.

❯ xyzconverter -i centered_trajec.xyz -o VASP -b 12 13 11

Converting to VASP POSCAR format...
=============================================================
 Reading file : centered_trajec.xyz
 Box dimensions : A = 12.0, B = 13.0, C = 11.0
=============================================================
100%|███████████████████████████████████████████████████████████████████████| 99/99 [00:00<00:00, 5886.62it/s]
POSCAR files written in directory, poscar_files.

FormatTransformer Demo

Author:

RAHUL VERMA
Department of Chemical and Biomolecular Engineering
NC State University, Raleigh, USA
Email: rverma7@ncsu.edu

About

Center molecule within the periodic box and convert XYZ structure into VASP/Quantum Espresso Input files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages