Skip to content

Instantly share code, notes, and snippets.

View Tack-Tau's full-sized avatar

Shuo Tao Tack-Tau

View GitHub Profile
@specter119
specter119 / periodic_table.py
Last active October 30, 2024 14:53
Plot periodic table with Pymatgen and Matplotlib
import re
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.collections import PatchCollection
from pymatgen.core.periodic_table import Element
class PeriodicTablePlotter(object):
@Asif-Iqbal-Bhatti
Asif-Iqbal-Bhatti / extract_energy_VASP.sh
Last active April 18, 2022 17:48
Script to extract energy from each directory for VASP calculation
#!/bin/bash
#
# USAGE: script to extract energy from each folder. This script output energy-vs-volume
# and energy-vs-strain output files. The units are converted from eV to Ha
# and A3 to Bohr3.
#
echo -e "************************************************************************* \e[92m"
echo "*************************************************************************"
echo -e "*************************************************************************\e[0m"
@henriquemiranda
henriquemiranda / pymatgen_symmetrize_poscar.py
Created August 4, 2022 13:50
Read a POSCAR file and write both primitive and conventional symmetrized POSCAR
#read structure from file
from pymatgen.core import Structure
struct = Structure.from_file("POSCAR")
#get symmetrized primitive and conventional cell
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
sga = SpacegroupAnalyzer(struct,symprec=1e-5)
struct_symm_conv = sga.get_refined_structure()
struct_symm_prim = sga.find_primitive()