Skip to content

Instantly share code, notes, and snippets.

View lan496's full-sized avatar

Kohei Shinohara lan496

View GitHub Profile
@lan496
lan496 / LICENSE
Created February 9, 2021 01:26
This license applies to all my public gists: https://gist.github.com/lan496
This license applies to all public Gists in my accout, unless otherwise noted in the Gist:
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
@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 / nglview_pymatgen.ipynb
Last active December 8, 2020 16:32
Visualize pymatgen's structure with NGLView
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lan496
lan496 / numba_special.ipynb
Last active October 3, 2020 06:01
scipy.special function with numba
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lan496
lan496 / hopping_integral.ipynb
Created September 8, 2020 05:03
Table of interatomic matrix elements
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / ionic_radii.ipynb
Created August 29, 2020 08:01
plot Shannon effective ionic radius
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lan496
lan496 / makefig.sh
Created October 29, 2019 05:30
convert dot file with latex symbol into pdf
#!/bin/bash -eu
if [ $# -ne 1 ]; then
echo "specify dot file"
exit 1
fi
dotfile=$1
tmpfile=$(mktemp)
texfile="${1}.tex"