Skip to content

Instantly share code, notes, and snippets.

View Asif-Iqbal-Bhatti's full-sized avatar
☢️
Manufacturing consent Noam Chomsky

Asif_em2r Asif-Iqbal-Bhatti

☢️
Manufacturing consent Noam Chomsky
  • Belgium
View GitHub Profile
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / Generate Phonon directories for VASP
Last active January 19, 2020 21:13
This script creates a number of directories based on POSCARS-* generated from phonopy code
#!/usr/bin/env python3.6
#_____________________________________________________________________________
'''
USAGE: python3 script to create directories for POSCAR files generated from
PHONOPY code.
Credit: Asif Iqbal Bhatti
DATED: 19-01-2020
'''
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / Read_hessian_from_vasp.py
Created February 7, 2020 15:17
Read hessian matrix from VASP output file and calculate Eigenvalues and Eigenvectors
#!/usr/bin/env python3
import numpy as np
import os, sys, subprocess
from scipy import linalg as LA
import matplotlib.pyplot as plt
''' The complication that arises by parsing the data from the file is
the trailing empty lines and tabs that need to be deleted before it
can be read. In the case of a simple file format, there is no need for
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / stacking_fault_energy.sh
Last active March 21, 2020 18:08
Stacking fault energy for bcc crystal
#!/bin/bash
#------------------------------------------------------------------------------------------
# |||--> b means burger vector
# |||--> b = a*1/2[111] ;|b| = a*sqrt(3)/2
# |||--> On the (110) plane the slip occur at <1-11>
# |||--> For gamma surface vary b form 0b to 1b
# Some bcc materials (e.g. α-Fe) can contain up to 48 slip systems.
# There are six slip planes of type {110}, each with two <111> directions (12 systems).
# There are 24 {123} and 12 {112} planes each with one <111> direction (36 systems,
# for a total of 48). While the {123} and {112} planes are not exactly identical in
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / get_BayesianERR_from VASP_MLFF.py
Created May 22, 2023 06:13
Bayesian error estimate from VASP.6.4.1 ML FF
#!/usr/bin/env python3
'''
###
# ML error analysis
# AIB_EM for VASP.6.4.1
###
'''
import os, sys
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / get_NequIPData_from_OUTCAR.py
Created May 22, 2023 06:16
NequIP data file from VASP OUTCAR file without ML
#!/usr/bin/env python3.11
'''
# AIB_EM
# Asif Iqbal
'''
import os, sys
import pandas as pd
import numpy as np
from ase.io import read, write
import dpdata
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / get_text_from_screenshot.py
Created November 29, 2024 15:07
get_text_from_screenshot
from PIL import Image
import pytesseract
from fpdf import FPDF
def extract_and_clean_text(image_path):
# Extract text from the image
image = Image.open(image_path)
raw_text = pytesseract.image_to_string(image)
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / invariant_equavariant.py
Created December 5, 2024 12:02
A simple example to understand invariant and equivariant in materials
#!/usr/bin/env python
import numpy as np
def rotate_vector(v, R):
"""Rotates a vector v using a rotation matrix R."""
return np.dot(R, v)
def energy_function(positions):
"""A toy energy function that depends on interatomic distances."""