https://github.com/santoshkumarradha/questaal-reader
Prase and read QUESTAAL quantum calculation's output
https://github.com/santoshkumarradha/questaal-reader
ab-initio dft electronic-structure gw python qsgw quantum-codes questaal questaal-reader
Last synced: 5 months ago
JSON representation
Prase and read QUESTAAL quantum calculation's output
- Host: GitHub
- URL: https://github.com/santoshkumarradha/questaal-reader
- Owner: santoshkumarradha
- Created: 2020-05-06T20:51:51.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-21T18:04:45.000Z (over 2 years ago)
- Last Synced: 2024-10-18T23:19:47.689Z (over 1 year ago)
- Topics: ab-initio, dft, electronic-structure, gw, python, qsgw, quantum-codes, questaal, questaal-reader
- Language: Python
- Size: 791 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# QUESTAAL READER
Reader for questaal quantum code output
*NOTE: Soon to be combined with [pyquestaal](https://github.com/santoshkumarradha/pyquestaal)*
### Installation and Examples
place the questaal_reader.py file in the python bin and use after installing requirements.txt as
```console
pip install -U -r requirements.txt
```
example usage shown in [example.ipynb](./example.ipynb)
### example usage
Make sure you use high verbosity and ideally --pr51 and pipe lmf output to a file
```python
from questaal_reader import *
output=reader("out") #out is the output file name
ehf=[i.ehf for i in output.iterations]
ehk=[i.ehk for i in output.iterations]
plt.plot(ehf,marker="o",label="ehf")
plt.plot(ehk,marker="s",label="ehk")
plt.ylabel("Energy (eV)")
plt.xlabel("Iterations")
plt.legend()
plt.show()
```
produces the following plot

Returns pymatgen band plotter for easy plotting with bnds.ctrl
```python
from questaal_reader import get_bands
import matplotlib.pyplot as plt
from pymatgen.electronic_structure.plotter import BSPlotter as bp
p=get_bands("./band-data/bnds.temp")
fig,ax=plt.subplots()
for i in range(len(bp(p).bs_plot_data()['distances'])):
d=bp(p).bs_plot_data()['distances'][i]
e=bp(p).bs_plot_data()['energy'][i]['1']
for k in e:
if k[0]>0:c="#e9c46a"
else:c="#e76f51"
plt.plot(d,k,c=c,lw=2)
for j,i in enumerate(bp(p).bs_plot_data()['ticks']["distance"]):
plt.axvline(i,c="k",ls="--",lw=.5)
ax.set_xticks(bp(p).bs_plot_data()['ticks']["distance"])
ax.set_xticklabels(bp(p).bs_plot_data()['ticks']["label"])
ax.axhline(0,ls="-.",c="k")
plt.ylim(-7,6)
ax.autoscale(enable=True, axis='x', tight=True)
ax.set_ylabel("Energy (eV)")
plt.tight_layout()
plt.savefig("bands.png",dpi=400)
plt.show()
```
produces the following plot
