Notes of datastructure
第一章:初识算法算法(algorithm)数据结构(data structure)
生活中的二分法,排序,贪心算法:查字典,整理扑克,找零钱。
数据结构设计是一个充满权衡的过程。如果想在某方面取得提升,往往需要在另一方面作出妥协。
数据结构为算法提供了结构化存储的数据,以及操作数据的方法。数据结构本身仅存储数据信息,结合算法才能解决特定问题。算法通常可以基于不同的数据结构实现,但执行效率可能相差很大,选择合适的数据结构是关键。
在实际讨论时,我们通常会将“数据结构与算法”简称为“算法”。
第二章 复杂度分析渐近复杂度分析(asymptotic complexity analysis)
时间复杂度(time complexity)
重复操作:迭代(iteration)递归(recursion)
for 循环是最常见的迭代形式之一,适合在预先知道迭代次数时使用。while 循环比 for 循环的自由度更高。
每一次嵌套都是一次“升维”,将会使时间复杂度
迭代:“自下而上”地解决问题。从最基础的步骤开始,然后不断重复或累加这些步骤,直到任务完成。
递归:“自上而下”地解决问题。将原问 ...
Notes of ASE
ASE 笔记
得到晶胞参数(方法一:Numpy)通过线性代数运算计算晶胞参数:
12345678910111213141516171819202122# Numpyfrom ase import Atomsimport numpy as npfrom ase.io import readatoms = read('POSCAR')# 基矢cell = atoms.celllatticelength = np.dot(cell, cell.T).diagonal()latticelength = latticelength ** 0.5cos_alpha = np.dot(cell[1], cell[2]) / (latticelength[1] * latticelength[2])cos_beta = np.dot(cell[0], cell[2]) / (latticelength[0] * latticelength[2])cos_gamma = np.dot(cell[0], cell[1]) / (latticelength[0] * latticelen ...
Pearl
9c6161198b65c0c7ed655745c399b5b3c22b49d63312cddb0a2937408d4045fef9e62b4649d6ecf6e9f8073af0e2a97754690bb8adb982f94baeb965b7d732a251cdca5db18dfaeab133b6958a2cd1448143e2f52451725bbc885ea0c90fc3065bdcb22152b47075ef109827b6bac52d7fa64ae61c7957ab85897fc304f8853bc934dea7b7f2c3c8c31a17d3cfdcaa0e1e8bb1071a3925b9d2d0040b32ee60707ebc985cef23122fc53574dd3e37a5255be3fdcec3676cffa2d9af7a8fe932a1292956dc7f14fdc2e078ee0463ed3c199932caf3d1c298e345968ca75ae6f5da76e0b4e120d0e45c38aaf2c039a985fa18de32ef7c2295b29 ...
Theory
Theoryd-band
Numpy Module of Python
一、Numpy-JupyterNumpy-Basis-Operations in Jupyter Notebook
Pandas Module of Python
一、Pandas简介https://inter.joyfulpandas.datawhale.club/Content/ch2.html#
二、Pandas基本操作-JupyterPandas-Basis-Operations in Jupyter Notebookipynb转化为md
12345# 安装 nbconvertpip install nbconvert# 转换 .ipynb 文件为 .md 文件jupyter nbconvert --to markdown notebook.ipynb
数据导入1import pandas as pd
12df = pd.read_csv('./dataset/output.csv')df
数据查看1. 查看数据前五行, 后五行12print(df.head())print(df.tail())
2. 查看数据信息(如数据类型、非空值数量等):1print(df.info())
3. 查看数据描述性统计信息(如均值、标准差等):1print(df.describe())
4. 查看数据列名1print(df ...
Notes of Bash
Shell 笔记
Quick Start of CP2K
Quick Start of CP2K
本教程基于 HPC of zhenggroup 集群环境
一、CP2K介绍关于CP2K
CP2K是一种量子化学和固态物理第一性原理计算软件包,可以执行固态,液态,分子,和生物系统的计算模拟。
CP2K是开源免费程序,使用混合高斯和平面波基组GPW和GAPW的DFT方法比平面波基组计算更快。
CP2K用到好多非常新和前沿的算法OT(Orbital Transformation),ASPC(Always stable predictor corrector),ADMM(Auxiliary Density Matrix Methods),PIMD(pathintegral Molecular Dynamics),adaptive buffered QM/MM
相关文章 https://www.cp2k.org/science
催化:ACS Catal. 2019, 9 (9), 7876-7887
CP2K的应用和局限应用: DFT,AIMD,(QM/MM),NEB,MD https://www.cp2k.org/featu ...
Bader View of VASP
Bader View of VASP
本教程基于 HPC of zhenggroup 集群环境
Bader 计算过程123LAECHG=.TRUE. LCHARG = .TRUE.NSW = 0
得到CHGCAR文件
计算结果分析数值分析
bader.sh分析CHGCAR文件得到ACF.dat其中 ACF.dat 文件包含:原子坐标和每个原子的价层电子数目,通过对比价电子数和 POTCAR 中的 ZVAL 就能得到每个原子的 bader 电荷
grep ZVAL POTCAR得到元素的价电子(vaspkit手册中,刘锦程提到进行 Bader 电荷分析,可采用带 _pv,_sv 的赝势)
可视化分析
python bader2pqr.py得到bader.pqr,get_lattice.exe得到vmdrc.txt
打开vmd,将bader.pqr拖入窗口,vmdrc.txt的命令行逐行输入到终端,可修改颜色范围
参考资料
VASP 官网
Learn VASP The Hard Way
Notes of Linux
Linux 基础
一、Linux 常用命令文件、路径操作12345678910111213141516171819# 获取当前目录current_directory=$(pwd) # Linuxcurrent_directory = os.getcwd() # Python# 创建文件、目录、删除、重命名touch file.txt ; mkdir dirrm file.txt ; rm -r dirmv old_name new_name# 查看文件cat file.txtcat file.txt | grep "keyword"head -n 10 file.txt ; tail -n 10 file.txt# 查找,find+路径+-name+匹配文件名find . -name *.py# 查找,grep+字符+文件路径,显示第一行grep LOOP OUTCAR | head -n 1
批量替换常用关键参数,sed -i ‘s/模式/替换/‘ file12345# sed -i 表示原地编辑不在终端输出,' ...