Skip to content

Instantly share code, notes, and snippets.

View lan496's full-sized avatar

Kohei Shinohara lan496

View GitHub Profile
@lan496
lan496 / plot_DOS.ipynb
Created September 1, 2020 06:37
plot DOS, pDOS, and COHP with pymatgen
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lan496
lan496 / zbl.ipynb
Last active February 14, 2024 12:48
Ziegler-Biersack-Littmark (ZBL) potential
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lan496
lan496 / pymatviz_sandbox.ipynb
Last active December 18, 2023 12:12
Plot scalar values for elements by pymatviz
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lan496
lan496 / rref.py
Created December 22, 2020 08:30
Reduced row echelon form
import numpy as np
def reduced_row_echelon_form(matrix: np.ndarray, atol=1e-8):
"""
return reduced row echelon form of a given matrix
Parameters
----------
matrix: (nr, nl)
@lan496
lan496 / kpoint.py
Created December 9, 2022 07:56
Generalized grid with dsenum
from itertools import product, combinations
from typing import List
import numpy as np
from pymatgen.core import Structure
from tqdm import tqdm
from dsenum.permutation_group import DerivativeMultiLatticeHash
from dsenum.superlattice import generate_all_superlattices, reduce_HNF_list_by_parent_lattice_symmetry
from dsenum.utils import get_symmetry_operations
@lan496
lan496 / mp_magnetism.ipynb
Created August 11, 2022 01:57
Example usage of `spglib.get_magnetic_symmetry_dataset`
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lan496
lan496 / rss_mathjax.js
Created September 30, 2019 07:58
User script for Tampermonkey that renders TeX symbols
// ==UserScript==
// @name Enable MathJax
// @namespace http://tampermonkey.net/
// @version 0.1
// @description enable MathJax in inoreader pages
// @author lan496
// @match https://www.inoreader.com/*
// @grant none
// ==/UserScript==