raman-sc / VASP

Python program to evaluate off-resonance Raman activity using VASP code as the backend.
MIT License
164 stars 79 forks source link

Incorrect unit cell generated by parse_poscar_header() #5

Open akashjn opened 6 years ago

akashjn commented 6 years ago

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])

raulf2012 commented 6 years ago

What is the implication of previously calculated spectra? This seems like it might be a big issue.

akashjn commented 6 years ago

For a unit-cell whose all angles (alpha, beta and gamma) are not equal to 90 degrees, taking a transpose of the unit-cell matrix will change the relative position of the atoms in the displaced POSCAR, and depending on the angles, atoms might come too close or move farther from each other. So, the structure that we want to simulate will be lost (or distorted) and we will not get correct calculated RAMAN spectra.

However, if all angles (alpha, beta and gamma) are equal to 90 degrees, 'vasp_raman.py, version [0.5.1]' will work fine. Because, in the unit-cell matrix only diagonal elements will be non-zero and on taking a transpose of such a matrix, matrix remain unchanged. Therefore, the unit-cell in displaced POSCARs will be same as the POSCAR.phon and script will work fine.