Giter Site home page Giter Site logo

vasp's Introduction

vasp_raman.py

Raman off-resonant activity calculator using VASP as a back-end.

TOC

Theory
Installation
Global variables
Examples
Changelog
How to cite
Contributors

Theory

In order to calculate off-resonance Raman activity of a mode, one needs to compute the derivative of the polarizability (or macroscopic dielectric tensor) with respect to that normal mode coordinate: dP/dQ (or de/dQ).
Thus, two ingredients are required:

  1. Phonons at Γ-point
  2. Macroscopic dielectric tensor

Phonons at Γ-point

In VASP, phonons at Γ-point can be computed using either:

  • finite displacements: IBRION=5 or IBRION=6; or
  • density functional perturbation theory (DFPT): IBRION=7 or IBRION=8.

Only finite displacements are available when hybrid functional is employed.

Macroscopic dielectric tensor

In VASP, macroscopic dielectric tensor can be computed using either:

  • DFPT: LEPSILON=.TRUE.
  • or from frequency dependent dielectric matrix calculation: LOPTICS=.TRUE..

In the latter case, hybrids functionals could be employed.
For a more formal description of the method see D. Porezag, M.R. Pederson, PRB, 54, 7830 (1996).

Installation

Python >= 2.6 is required. Just copy vasp_raman.py in the $PATH and run! No external dependencies.

Global variables

vasp_raman.py requires two environmental variables to be set:

  • VASP_RAMAN_PARAMS is defined as FIRST-MODE_LAST-MODE_NDERIV_STEPSIZE where:

    • FIRST_MODE - integer, first mode for which derivative of the polarizability is computed
    • LAST-MODE - integer, last mode for which derivative of the polarizability is computed
    • NDERIV - integer, scheme for finite difference, currently only value 2 is supported
    • STEPSIZE - float, step-size for finite difference, in Angstroms

    Example: VASP_RAMAN_PARAMS=01_10_2_0.01

  • VASP_RAMAN_RUN the command to execute VASP (can contain MPI call):
    Example: VASP_RAMAN_RUN='aprun -B /u/afonari/vasp.5.3.2/vasp.5.3/vasp &> job.out'

Both variables should be exported (in Bash language) before running vasp_raman.py.

An example of PBS script:

#!/bin/bash
#PBS -l select=1:ncpus=32:mpiprocs=32
#PBS -l walltime=01:00:00
#PBS -q debug
#PBS -j oe
#PBS -N Example
#PBS -V

cd $PBS_O_WORKDIR

ulimit -s unlimited  # remove limit on stack size

export VASP_RAMAN_RUN='aprun -B /u/afonari/vasp.5.3.2/vasp.5.3/vasp &> job.out'
export VASP_RAMAN_PARAMS='01_10_2_0.01'

python27 vasp_raman.py > vasp_raman.out

An example of bash script (in case no scheduler is installed):

#!/bin/bash

# suggested by Ricardo Faccio, Universidad de la República, Montevideo, Uruguay

# OpenMP variables
#export OMP_NUM_THREADS=1
#export MKL_NUM_THREADS=1

# vasp_raman.py variables
export VASP_RAMAN_RUN='mpirun -np 4 vasp5.3.5_par'
export VASP_RAMAN_PARAMS='01_06_2_0.01'

python /home/user/bin/vasp_raman.py > vasp_raman.out

Examples

Changelog

0.6 (will be released soon)

  • ADDED: ability to use phonons obtained from the vtst tools
  • FIX: cleaned POSCAR parsing code
  • FIX: contributors and version are now in the output
  • FIX: Cyclopentadiene example is now fully consistent with the version
  • Basic working functionality

How to cite

Use Bibtext or RIS file for citation.

Contributors

Alexandr Fonari (Georgia Tech, PIs: J.-L. Bredas/V. Coropceanu): Email
Shannon Stauffer (UT Austin, PI: G. Henkelman): Email.

vasp's People

Contributors

afonari 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  avatar  avatar  avatar  avatar  avatar  avatar

vasp's Issues

error from OUTCAR

Raman off-resonant activity calculator,
using VASP as a back-end.

Contributors: Alexandr Fonari  (Georgia Tech)
              Shannon Stauffer (UT Austin)
MIT License, 2013
URL: http://raman-sc.github.io
Started at: 2019-10-22 13:46

[main]: VASP_RAMAN_RUN='mpirun -np $NP -machinefile $PBS_NODEFILE --mca btl self,sm,openib --bind-to-core $EXEC >> test.out'
[main]: VASP_RAMAN_PARAMS='01_21_2_0.01'
[[4.7828934262654972, 4.7828934262654972, 4.7828934262654972], [4.7828934262654972, 2.0498114683994988, 2.0498114683994988], [2.0498114683994988, 4.7828934262654972, 2.0498114683994988], [2.0498114683994988, 2.0498114683994988, 4.7828934262654972], [0.6832704894664996, 0.6832704894664996, 0.6832704894664996], [0.6832704894664996, 3.416352447332498, 3.416352447332498], [3.416352447332498, 0.6832704894664996, 3.416352447332498], [3.416352447332498, 3.416352447332498, 0.6832704894664996]]

[main]: Mode #1: frequency 504.5795270 cm-1; norm: 0.1886973
[main]: File OUTCAR.0001.-1.out not found, preparing displaced POSCAR
[main]: Running VASP...
[main]: File OUTCAR.0001.+1.out not found, preparing displaced POSCAR
[main]: Running VASP...
[main]: ERROR Couldn't find OUTCAR file, exiting...
the above error is shown. The sript is
#!/bin/bash

#PBS -l nodes=1:ppn=16
#PBS -l walltime=300:00:00
#PBS -N USPEXvariation
#PBS -q blade_x
#PBS -j oe
#PBS -V
source /public/software/profile.d/compiler_intel-composer_xe_2016.3.210.sh
source /public/software/profile.d/mpi_openmpi-1.6.5-intel.sh
#The program we want to execute (modify to suit your setup)
EXEC=/public/software/vasp/5.2.12/openmpi/intel/vasp
#setup hostfile
echo "host: "
#cat $PBS_JOBID-$PBS_JOBCOOKIE.hosts
echo "--------Begin-------------------------------------------"
#This jobs working directory
echo Working directory is $PBS_O_WORKDIR
#go to work dir
cd $PBS_O_WORKDIR
echo "Beginning time is: "
echo Time is date
echo Directory is pwd
NP=cat $PBS_NODEFILE|wc -l
echo "Numbers of Processors: $NP"
echo "---------------------------------------------------"
#running
ulimit -s unlimited # remove limit on stack size

#export VASP_RAMAN_RUN='time mpirun -np $NP -machinefile $PBS_NODEFILE --mca btl self,sm,openib --bind-to-core $EXEC >> test.out'
export VASP_RAMAN_RUN='mpirun -np $NP -machinefile $PBS_NODEFILE --mca btl self,sm,openib --bind-to-core $EXEC >> test.out'
export VASP_RAMAN_PARAMS='01_21_2_0.01'

python vasp_raman.py > vasp_raman.out
#time mpirun -np $NP -machinefile $PBS_NODEFILE --mca btl self,sm,openib --bind-to-core $EXEC >> test.out

#clean
echo "--------Finish-------------------------------------------"
echo "Finishing time is: "
echo Time is date
echo "--------Finish-------------------------------------------"
Is this problem solve?

Error when running raman-vasp.py

Thank you very much for developing the raman-sc program for our convenience,I am having a problem running vasp_raman, an error occurred after running for a few minutes,
“Traceback (most recent call last)
File "vasp_raman.py",line 291, in
eigval = eigvals [i]
IndexError: list index out of range"
the program running in CentOS 7.5
I am not familiar with the python language, so I hope you guys will be able to answer this question.
Looking forward to your reply

Eigenvectors after division by SQRT(mass)' in OUTCAR. Use 'NWRITE=3' in INCAR. Exiting…

I am learnt some knowledge by VASP_raman.py. Some questions were happened, and I hope I can ask for you.

When I do this app, it was showed this type, [get_modes_from_OUTCAR]: ERROR Couldn't find 'Eigenvectors after division by SQRT(mass)' in OUTCAR. Use 'NWRITE=3' in INCAR. Exiting…, while my INCAR has typed it. It made me confused. I hope get some hand. THANKS!

Sincerely,
Kyle
China University of Geoisence, Beijing, China

INCAR

SYSTEM=Al_garnet
ISTART=0
EDIFFG = -0.01
EDIFF=1E-7
IBRION=6
NSW=300 # change
ISMEAR=0
SIGMA=0.05
PREC=ACCURATE
ISIF=2
LREAL=A
NFREE = 2
NWRITE =3
LEPSILON=T

Incorrect unit cell generated by parse_poscar_header()

In vasp_raman.py script version [0.5.1], within parse_poscar_header() :

poscar_header += "%15.12f %15.12f %15.12f\n" % (b[0][0], b[0][1], b[0][2])
poscar_header += "%15.12f %15.12f %15.12f\n" % (b[1][0], b[1][1], b[1][2])
poscar_header += "%15.12f %15.12f %15.12f\n" % (b[2][0], b[2][1], b[2][2])

generates a wrong unit-cell for displaced POSCAR from the given POSCAR.phon. Actually above code writes the transpose of the unitcell matrix given in POSCAR.phon. To get correct unit-cell (same as in POSCAR.phon) use,
poscar_header += "%15.12f %15.12f %15.12f\n" % (b[0][0], b[1][0], b[2][0])
poscar_header += "%15.12f %15.12f %15.12f\n" % (b[0][1], b[1][1], b[2][1])
poscar_header += "%15.12f %15.12f %15.12f\n" % (b[0][2], b[1][2], b[2][2])

Finite Difference Formula Error

I think your finite difference formula that's implemented here may have an error in it (line 351):

ra[m][n] += eps[m][n] * coeffs[j]/step_size * norm * vol/(4.0*pi)

When you're displace coordinates, the displacement is by a normalized, not mass-weighted eigenvector (line 314). You shouldn't need the norm of the vector in this equation, as the total displacement in either direction should simply be "step_size" (you already normalized the displacement effectively). Therefore, that line should be changed to:

ra[m][n] += eps[m][n] * coeffs[j]/step_size * vol/(4.0*pi)

A problem reading the DIELECTRIC TENSOR

Hi

I came a cross a problem with vasp and the dielectric tensor, sometimes when the valuesof the tensor are very big the numbers in the OUTCAR are mixedup and so the python script doesn't read them correctly. For example see the following sinnpet

MACROSCOPIC STATIC DIELECTRIC TENSOR (including local field effects in DFT)
  ------------------------------------------------------
       13738.431079-16959.202530     2.426989
        -7663.060793 23943.531628    -3.049640
            2.471794    -5.009690  1175.736030
  ------------------------------------------------------

In vasprun.xml the data is printed correctly, so I suggest to try and read the OUTCAR, and if it doesn't succeed then read the data from the xml with the following commands:

from lxml import etree
doc = etree.parse('vasprun.xml')
values = [c.text for c in doc.xpath("/modeling/calculation/varray")[3].getchildren()]

dymmatrix.py problem

I am trying to calculate a Raman spectra and am following the example of Bulk Silicon using the VTST tools. I am getting this feedback after submitting the dymmatrix.py script after the vibrational calculations step:

Reading DISPLACECAR
Traceback (most recent call last):
  File "/home/sdix/scripts/dymmatrix.py", line 135, in <module>
    dymmatrix(displacecars, outcars)
  File "/home/sdix/scripts/dymmatrix.py", line 29, in dymmatrix
    ndisp = numpy.count_nonzero(displacements)
AttributeError: 'module' object has no attribute 'count_nonzero'

I have tried a few different DISPLACECARS but I can not resolve this issue.

POSCAR heading

I am trying to calculate the Raman intensities and am running into this problem in the raman directory where the vasp_raman.py script seems to overwrite the POSCAR with
OUTCAR.0001.-1.out 1.0e-02
and in the OUTCAR and job.out there is an error that says
OUTCAR:
POSCAR: OUTCAR.0001.-1.out 1.0e-02 positions in cartesian coordinates
job.out:
No initial positions read in

This is my submission script:

#!/bin/bash
#SBATCH -J Pt100-phonon
#SBATCH --time=1000:00:00
#SBATCH -N 1
#SBATCH --ntasks-per-node 20
#SBATCH --export=ALL
#SBATCH --mail-type=ALL
#SBATCH --mail-user=[email protected]

cd $SLURM_SUBMIT_DIR

ulimit -s unlimited

ssh lumos /home/mmorabito/scripts/mail.sh pwd $SLURM_JOB_ID $SLURM_JOB_NAME

export VASP_RAMAN_RUN='mpirun -np 20 vasp_std &> job.out'
export VASP_RAMAN_PARAMS='01_114_2_0.01'

python /home/sdix/scripts/vasp_raman.py > vasp_raman.out

#rm job_nodefile

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.