-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.json
1 lines (1 loc) · 56.5 KB
/
content.json
1
{"meta":{"title":"Hexo","subtitle":"","description":"博观而约取,厚积而薄发","author":"raolixiang","url":"http://raolixiang-up.github.io","root":"/"},"pages":[{"title":"404 Not Found:该页无法显示","date":"2022-04-28T10:29:50.901Z","updated":"2022-04-28T10:29:50.901Z","comments":false,"path":"/404.html","permalink":"http://raolixiang-up.github.io/404.html","excerpt":"","text":""},{"title":"书单","date":"2022-04-28T10:29:50.925Z","updated":"2022-04-28T10:29:50.925Z","comments":false,"path":"books/index.html","permalink":"http://raolixiang-up.github.io/books/index.html","excerpt":"","text":""},{"title":"关于","date":"2022-04-28T10:29:50.919Z","updated":"2022-04-28T10:29:50.919Z","comments":false,"path":"about/index.html","permalink":"http://raolixiang-up.github.io/about/index.html","excerpt":"","text":"个人详细介绍"},{"title":"分类","date":"2022-08-29T12:08:52.193Z","updated":"2022-04-28T10:29:50.933Z","comments":false,"path":"categories/index.html","permalink":"http://raolixiang-up.github.io/categories/index.html","excerpt":"","text":""},{"title":"友情链接","date":"2022-08-29T12:08:52.407Z","updated":"2022-04-28T10:29:50.957Z","comments":true,"path":"links/index.html","permalink":"http://raolixiang-up.github.io/links/index.html","excerpt":"","text":""},{"title":"Repositories","date":"2022-04-28T10:29:50.966Z","updated":"2022-04-28T10:29:50.966Z","comments":false,"path":"repository/index.html","permalink":"http://raolixiang-up.github.io/repository/index.html","excerpt":"","text":""},{"title":"标签","date":"2022-04-28T10:29:50.973Z","updated":"2022-04-28T10:29:50.973Z","comments":false,"path":"tags/index.html","permalink":"http://raolixiang-up.github.io/tags/index.html","excerpt":"","text":""}],"posts":[{"title":"文献001-预印本网站","slug":"文献001-预印本网站","date":"2023-01-10T14:49:29.000Z","updated":"2023-01-10T15:09:15.443Z","comments":true,"path":"2023/01/10/文献001-预印本网站/","link":"","permalink":"http://raolixiang-up.github.io/2023/01/10/%E6%96%87%E7%8C%AE001-%E9%A2%84%E5%8D%B0%E6%9C%AC%E7%BD%91%E7%AB%99/","excerpt":"","text":"这里总结一下预印本和各种免费资源的网站吧,方便以后搜索最新文献。[1] arXiv.org e-Print archive: 数学、物理学、计算机等。[2] ChinaXiv.org 中国科学院科技论文预发布平台: 国产网站,接收中英文文章,比较综合。[3] bioRxiv.org - the preprint server for Biology: 仅针对生物学领域。[4] Open Research Publishing - Advancing Knowledge - F1000:涵盖所有生命科学领域的。[5] figshare - credit for all your research: 图表、多媒体、海报、论文(包括预印本)和多文件、数据集等。[6] PeerJ - Search: 涵盖了生物科学、医学和健康科学的领域。[7] Zenodo - Research. Shared.: 刊物、演示文稿、论文集、项目、图像、软件(包括与 GitHub 的集成)以及所有语言的数据。[8] Home :: SSRN:偏社会科学领域。","categories":[{"name":"文献","slug":"文献","permalink":"http://raolixiang-up.github.io/categories/%E6%96%87%E7%8C%AE/"}],"tags":[{"name":"预印本","slug":"预印本","permalink":"http://raolixiang-up.github.io/tags/%E9%A2%84%E5%8D%B0%E6%9C%AC/"}]},{"title":"ABINIT001-初步学习","slug":"ABINIT001-初步学习","date":"2023-01-01T13:55:47.000Z","updated":"2023-01-01T14:58:59.482Z","comments":true,"path":"2023/01/01/ABINIT001-初步学习/","link":"","permalink":"http://raolixiang-up.github.io/2023/01/01/ABINIT001-%E5%88%9D%E6%AD%A5%E5%AD%A6%E4%B9%A0/","excerpt":"","text":"因为要计算体系的非线性光学,因此需要学习ABINIT,这里整理一下学习资料,方便日后复习,主要是ABINIT官网和论坛如下所示:[1] Home | ABINIT[2] ABINIT其他的学习资料推荐微信公众号:学术之友,作者有ABINIT开发组的经历,教程质量很高。ABINIT目前学习资源很少,官网感觉很乱相比于vasp官网,这可能就是开源的弊端吧。下面基本操作分享一个b站视频吧,如下:abinit 入门金刚石总能量的计算_哔哩哔哩_bilibili","categories":[{"name":"DFT","slug":"DFT","permalink":"http://raolixiang-up.github.io/categories/DFT/"}],"tags":[{"name":"ABINIT","slug":"ABINIT","permalink":"http://raolixiang-up.github.io/tags/ABINIT/"}]},{"title":"机器学习002-决定系数等指标","slug":"机器学习002","date":"2022-12-31T14:53:34.000Z","updated":"2022-12-31T15:15:34.687Z","comments":true,"path":"2022/12/31/机器学习002/","link":"","permalink":"http://raolixiang-up.github.io/2022/12/31/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0002/","excerpt":"","text":"机器学习中MSE(均方误差)、 RMSE(均方根误差)、 MAE(平均绝对误差)、R2(决定系数)是评判机器学习获得的模型优劣非常重要的指标,这些指标的定义可以百度或者谷歌,这里不赘述了。这里使用python脚本,需要一个具有两列数据的csv文件,一列为真实值,一列为机器学习预测值。 12345678910111213141516171819202122232425#导入相应的函数库from sklearn import datasetsfrom sklearn.model_selection import train_test_splitfrom sklearn.ensemble import RandomForestRegressorimport numpy as npimport pandas as pdfrom math import sqrtfrom sklearn.metrics import mean_absolute_errorfrom sklearn.metrics import mean_squared_errorfrom sklearn.metrics import r2_score#加载数据file_y = pd.read_csv('y-c44-3-q2-no.csv') # csv文件,文件中有两列数,一列是真实值,一列是机器学习预测值# print(file_y)data1 = file_y['y_true'] # 真实值那列的抬头y_true = data1.values.tolist()data2 = file_y['y_pred'] # 机器学习预测值那列的抬头y_pred = data2.values.tolist()# print(y_true)# print(y_pred)# 使用sklearn调用衡量线性回归的MSE 、 RMSE、 MAE、r2print("mean_absolute_error:", mean_absolute_error(y_true, y_pred))print("mean_squared_error:", mean_squared_error(y_true, y_pred))print("rmse:", sqrt(mean_squared_error(y_true, y_pred)))print("r2 score:", r2_score(y_true, y_pred)) 参考资料[1] Python计算统计分析MSE 、 RMSE、 MAE、r2_zNULLT的博客-CSDN博客_python rmse[2] 从csv文件读取列数据保存在列表中_春风若是你的博客-CSDN博客","categories":[{"name":"机器学习","slug":"机器学习","permalink":"http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"}],"tags":[{"name":"ML","slug":"ML","permalink":"http://raolixiang-up.github.io/tags/ML/"}]},{"title":"科研代码005-lobsterpy","slug":"科研代码005-lobsterpy","date":"2022-10-14T15:53:52.000Z","updated":"2022-10-14T16:09:57.326Z","comments":true,"path":"2022/10/14/科研代码005-lobsterpy/","link":"","permalink":"http://raolixiang-up.github.io/2022/10/14/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81005-lobsterpy/","excerpt":"","text":"lobsterpy为辅助计算COHP的工具,非常简便好用,网址为:JaGeo/LobsterPy: Package to automatically analyze Lobster runs对于COHP的计算分析相关的帖子已经很多在这里整理一下: 固体与表面第一性原理计算教学14,电子结构分析(六)COOP, COHP_哔哩哔哩_bilibili COOP和COHP简单原理 | 世事如棋 COHP Homepage以上三个网址可以帮我们掌握COHP基础知识和基本的计算,浪里个浪~~~~~~~~完结","categories":[{"name":"科研代码","slug":"科研代码","permalink":"http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81/"}],"tags":[{"name":"python","slug":"python","permalink":"http://raolixiang-up.github.io/tags/python/"}]},{"title":"vasp003-能带计算","slug":"vasp003-能带计算","date":"2022-07-15T02:39:04.000Z","updated":"2022-07-15T04:04:42.274Z","comments":true,"path":"2022/07/15/vasp003-能带计算/","link":"","permalink":"http://raolixiang-up.github.io/2022/07/15/vasp003-%E8%83%BD%E5%B8%A6%E8%AE%A1%E7%AE%97/","excerpt":"","text":"能带计算走了很多弯路,主要介绍两种能带计算:PBE能带和HSE能带 PBE能带计算流程分为如下: PBE-SCF计算这一步生成需要读取的WAVECAR,参考INCAR如下: 123456789101112131415161718192021ISTART=0ICHARG=2PREC=AccurateGGA = PEADDGRID =.TRUE.# Electronic relaxationENCUT=500EDIFF=1E-8EDIFFG=-0.001ISMEAR=0SIGMA = 0.05POTIM=0.20NELM=90NELMIN=5NSW=0# Write flagsLWAVE=.TRUE.LCHARG=.TRUE. 按照自己的需求增添参数 PBE能带计算运行vaspkit -task 303(3D材料)或者302(二维材料)生成KPATH.in 和 HIGH_SYMMETRY_POINTS,可以自行修改,主要修改KPATH.in设置K点路径,更换KPOINTS文件:cp KPATH.in KPOINTS将PBE-SCF计算中的INCAR中ISTART改为1即可,这里不设置ICHARG=11,不读取生成的CHARGCAR,提交任务即可。处理数据如下:vaspkit -task n #根据下面说明自行选择211) Band-Structure212) Projected Band-Structure for Selected Atom213) Projected Band-Structure for Each Element214) The Sum of Projected Band-Structure for Selected Atoms215) Projected Band-Structure by Element Weight HSE能带计算HSE计算分为两步: 采用标准的KPOINTS进行HSE的SCF计算参考的INCAR如下所示: 123456789101112131415161718192021222324252627282930313233ISTART=0ICHARG=2PREC=AccurateADDGRID =.TRUE.# Electronic relaxationENCUT=500EDIFF=1E-8EDIFFG=-0.001ISMEAR=0SIGMA = 0.05POTIM=0.20NELM=90NELMIN=5NSW=0# HSELHFCALC = TRUEHFSCREEN = 0.2GGA = PEAEXX = 0.14AGGAX = 0.86ALGO = NormalTIME = 0.4# SOC (可选择是否具有自旋轨道耦合,NBANDS要为正常计算的二倍)# LSORBIT = .TRUE.# LMAXMIX=4# Write flagsLWAVE=.TRUE.LCHARG=.TRUE. 需要注意的事项,(1)AEXX越大带隙一般越大,AGGAX=1-AEXX;(2)ALGO选择Normal(3)用标准的KPOINTS HSE能带计算运行vaspkit -task 303(3D材料)或者302(二维材料)生成KPATH.in 和 HIGH_SYMMETRY_POINTS,可以自行修改,主要修改KPATH.in设置K点路径,然后运行vaspkit -task 251,一步一步输入,生成HSE计算使用的KPOINTS将HSE-SCF计算中的INCAR中ISTART改为1即可,这里不设置ICHARG=11,不读取生成的CHARGCAR,提交任务即可。任务处理命令:vaspkit -task 252 参考资料[1] Vaspkit做杂化泛函能带计算方法 | 世事如棋[2] VASP中杂化泛函计算参数设置 | 世事如棋","categories":[{"name":"vasp","slug":"vasp","permalink":"http://raolixiang-up.github.io/categories/vasp/"}],"tags":[{"name":"vasp","slug":"vasp","permalink":"http://raolixiang-up.github.io/tags/vasp/"}]},{"title":"vasp002-DOS计算","slug":"vasp002-DOS计算","date":"2022-07-08T16:18:44.000Z","updated":"2022-07-08T16:23:27.908Z","comments":true,"path":"2022/07/09/vasp002-DOS计算/","link":"","permalink":"http://raolixiang-up.github.io/2022/07/09/vasp002-DOS%E8%AE%A1%E7%AE%97/","excerpt":"","text":"vasp计算DOS,李强博士的帖子叙述的非常详细,具体帖子如下:Ex-37 DOS 计算(一) | Learn VASP The Hard Way顺着这个帖子一直学下去DOS计算不会有什么问题,就不再啰嗦复述了 参考资料[1]Ex-37 DOS 计算(一) | Learn VASP The Hard Way","categories":[{"name":"vasp","slug":"vasp","permalink":"http://raolixiang-up.github.io/categories/vasp/"}],"tags":[{"name":"vasp","slug":"vasp","permalink":"http://raolixiang-up.github.io/tags/vasp/"}]},{"title":"vasp001-固定轴优化","slug":"vasp001-固定轴优化","date":"2022-06-03T13:28:46.000Z","updated":"2022-06-03T14:20:24.900Z","comments":true,"path":"2022/06/03/vasp001-固定轴优化/","link":"","permalink":"http://raolixiang-up.github.io/2022/06/03/vasp001-%E5%9B%BA%E5%AE%9A%E8%BD%B4%E4%BC%98%E5%8C%96/","excerpt":"","text":"vasp固定轴优化,将网上的资料总结一下。(1)修改constr_cell_relax.F,编译生成对应的vasp执行文件,见VASP 固定基矢优化结构 - chempeng修改c方向为例,仅对于正交体系和单斜体系,修改代码如下: 123456789101112131415161718192021222324252627282930313233343536373839404142434445!-----------------------------------------------------------------------!! At present, VASP does not allow to relax the cellshape selectively! i.e. for instance only cell relaxation in x direction.! To be more precisse, this behaviour can not be achived via the INCAR! or POSCAR file.! However, it is possible to set selected components of the stress tensor! to zero.! The most conveninent position to do this is the routines! CONSTR_CELL_RELAX (constraint cell relaxation).! FCELL contains the forces on the basis vectors.! These forces are used to modify the basis vectors according! to the following equations:!! A_OLD(1:3,1:3)=A(1:3,1:3) ! F90 style! DO J=1,3! DO I=1,3! DO K=1,3! A(I,J)=A(I,J) + FCELL(I,K)*A_OLD(K,J)*STEP_SIZE! ENDDO! ENDDO! ENDDO! where A holds the basis vectors (in cartesian coordinates).!!----------------------------------------------------------------------- SUBROUTINE CONSTR_CELL_RELAX(FCELL) USE prec REAL(q) FCELL(3,3) DO I=1,3 FCELL(3,I)=0 FCELL(I,3)=0 ENDDO! just one simple example! relaxation in x directions only! SAVE=FCELL(1,1)! FCELL=0 ! F90 style: set the whole array to zero! FCELL(1,1)=SAVE! relaxation in z direction only! SAVE=FCELL(3,3)! FCELL=0 ! F90 style: set the whole array to zero! FCELL(3,3)=SAVE RETURN END SUBROUTINE 然后重新编译生成vasp执行文件即可。对于其他方向晶格基矢的修改同理:对于a方向基矢,将 FCELL(3,I) 和 FCELL(I,3) 分别改为 FCELL(1,I) 和 FCELL(I,1) ;对于b方向基矢,则分别改为 FCELL(2,I) 和 FCELL(I,2)(2)一次编译需要配置文件控制,见Chengcheng-Xiao/VASP_OPT_AXIS: Fix lattice component(s) during relaxation in VASP具体步骤参考链接,我测试了一下肖博士的第一种方法,其中需要注意的是OPTCELL文件数字中间如果有空格则优化有问题,没有空格正常。其次推荐教程中第二种方法,只需要在INCAR中加入IOPTCELL参数即可,不引入其他文件。参考文献[1] VASP 固定基矢优化结构 - chempeng[2] Chengcheng-Xiao/VASP_OPT_AXIS: Fix lattice component(s) during relaxation in VASP[3] VASP固定基矢优化结构最新方法更新[4] VASP固定基矢优化结构方法 | 世事如棋[5] VASP并行可执行软件包,可对晶胞参数进行部分优化 - 第 2 页 - 第一原理 - 小木虫 - 学术 科研 互动社区","categories":[{"name":"vasp","slug":"vasp","permalink":"http://raolixiang-up.github.io/categories/vasp/"}],"tags":[{"name":"vasp","slug":"vasp","permalink":"http://raolixiang-up.github.io/tags/vasp/"}]},{"title":"科研代码004-vasp输入文件POTCAR的自动生成","slug":"科研代码004-vasp输入文件POTCAR的自动生成","date":"2022-05-22T12:54:06.000Z","updated":"2022-05-22T13:01:42.654Z","comments":true,"path":"2022/05/22/科研代码004-vasp输入文件POTCAR的自动生成/","link":"","permalink":"http://raolixiang-up.github.io/2022/05/22/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81004-vasp%E8%BE%93%E5%85%A5%E6%96%87%E4%BB%B6POTCAR%E7%9A%84%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90/","excerpt":"","text":"代码vasp输入文件POTCAR的合并生成,网上很多资料简单整理一下。自己写代码也可以,李强博士已经写好了,如下所示: 1234567891011121314151617181920212223#!/usr/bin/bash# Create a GGA_PAW POTCAR file# by BigBro # To Use it: potcar.sh Cu C H O# Define local potpaw_GGA pseudopotentialrepository:repo="/THFS/home/iciq-lq/bin/pot"# Check if older version of POTCAR ispresentif [ -f POTCAR ] ; thenmv -f POTCAR old-POTCARecho " ** Warning: old POTCAR file found and renamed to 'old-POTCAR'."fi# Main loop - concatenate the appropriatePOTCARs (or archives)for i in $*doif test -f $repo/$i/POTCAR ; thencat $repo/$i/POTCAR>> POTCARelseecho " ** Warning: No suitable POTCAR for element '$i' found!! Skipped thiselement."fidone 简单设置一下POTCAR文件所在的路径即可,具体使用见:自动生成POTCAR的脚本 | Learn VASP The Hard Way因为这是比较简单的操作,很多软件都已经具有这个功能,例如vaspkit,qvasp等软件。 参考资料[1] 自动生成POTCAR的脚本 | Learn VASP The Hard Way[2] Overview — VASPKIT 1.3 documentation[3] qvasp更新至v2.2版本(卷纳米管等功能)_学术之友-商业新知","categories":[{"name":"科研代码","slug":"科研代码","permalink":"http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81/"}],"tags":[{"name":"shell","slug":"shell","permalink":"http://raolixiang-up.github.io/tags/shell/"}]},{"title":"linux-001-slurm和PBS排队调度系统","slug":"linux-slurm排队调度系统","date":"2022-05-19T16:27:00.000Z","updated":"2022-05-19T16:28:07.219Z","comments":true,"path":"2022/05/20/linux-slurm排队调度系统/","link":"","permalink":"http://raolixiang-up.github.io/2022/05/20/linux-slurm%E6%8E%92%E9%98%9F%E8%B0%83%E5%BA%A6%E7%B3%BB%E7%BB%9F/","excerpt":"","text":"整理一下slurm和PBS简单使用的教程。slurm: Slurm 作业调度系统使用指南 - 知乎 Slurm Workload Manager - Quick Start User GuidePBS: PBS作业管理系统使用技巧 | Kevinzjy’s Blog PBS 作业管理系统 - 简书简单的操作,够用即可~~~~~~~~~~~~~~~~~~~~","categories":[{"name":"linux","slug":"linux","permalink":"http://raolixiang-up.github.io/categories/linux/"}],"tags":[{"name":"slurm-PBS","slug":"slurm-PBS","permalink":"http://raolixiang-up.github.io/tags/slurm-PBS/"}]},{"title":"cohp高通量计算005-静态自洽计算是否正常结束的统计","slug":"cohp高通量计算005-静态自洽计算是否正常结束的统计","date":"2022-05-14T13:24:23.000Z","updated":"2022-05-14T13:51:02.799Z","comments":true,"path":"2022/05/14/cohp高通量计算005-静态自洽计算是否正常结束的统计/","link":"","permalink":"http://raolixiang-up.github.io/2022/05/14/cohp%E9%AB%98%E9%80%9A%E9%87%8F%E8%AE%A1%E7%AE%97005-%E9%9D%99%E6%80%81%E8%87%AA%E6%B4%BD%E8%AE%A1%E7%AE%97%E6%98%AF%E5%90%A6%E6%AD%A3%E5%B8%B8%E7%BB%93%E6%9D%9F%E7%9A%84%E7%BB%9F%E8%AE%A1/","excerpt":"","text":"总是要写很多稀奇古怪的脚本,因为计算cohp需要一步静态自洽计算,因此判定静态自洽是否正常结束非常重要。因为任务数目过多,所以需要写一个批量判定脚本。 编写思路对静态自洽的步数和INCAR中设置的步数进行比较如果不等,表明静态自洽计算正常结束。如果相等,静态自洽有可能没有正常结束,此时要比较OSZICAR中的dE和INCAR中的EDIFF。如果dE小于EDIFF则正常结束,反之,则未收敛。 脚本代码脚本ls-st-convergence.sh要和批量任务放在一个文件夹内,静态自洽的INCAR中等号=两边有空格,代码如下: 123456789101112131415161718192021#!/usr/bin/bashfor i in A*doN=$(tail -n 2 ${i}/static/OSZICAR | awk 'NR==1 {print $2}')dE=$(tail -n 2 ${i}/static/OSZICAR | awk 'NR==1 {print $4}') NELM=$(cat ${i}/static/INCAR | awk 'NR==13 {print $3}') # 参考自己的INCAR提取EDIFF=$(cat ${i}/static/INCAR | awk 'NR==1 {print $3}') # 参考自己的INCAR提取if [ "${N}" = "${NELM}" ];then echo ${i} ${N} ${NELM} ${dE} ${EDIFF} >> no-st-convergence_result.datelse convergence_result="No" echo ${i} ${N} ${NELM} ${dE} ${EDIFF} >> yes-st-convergence_result.datfidonesed -i '1i system N NEM dE EDIFF' no-convergence_result.datsed -i '1i system N NEM dE EDIFF' yes-convergence_result.dat 这里不收敛的结构在no-st-convergence_result.dat中,收敛的结果在yes-convergence_result.dat。如果执行脚本时出现下列语句: 1sed:无法读取 no-st-convergence_result.dat:没有那个文件或目录 那么恭喜你,你的所有静态自洽计算都是收敛的。如有错误,欢迎指正~~~~~~~~~~ 参考资料[1] shell中的if语句 - 开始认识 - 博客园[2] Linux awk 命令 | 菜鸟教程[3] (5条消息) awk妙用(如何取出某行某列的某个元素)_god_is_my的博客-CSDN博客","categories":[{"name":"机器学习","slug":"机器学习","permalink":"http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"}],"tags":[{"name":"ML","slug":"ML","permalink":"http://raolixiang-up.github.io/tags/ML/"}]},{"title":"科研代码003-收敛性测试","slug":"科研代码003-收敛性测试","date":"2022-05-12T15:41:17.000Z","updated":"2022-05-13T09:32:53.438Z","comments":true,"path":"2022/05/12/科研代码003-收敛性测试/","link":"","permalink":"http://raolixiang-up.github.io/2022/05/12/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81003-%E6%94%B6%E6%95%9B%E6%80%A7%E6%B5%8B%E8%AF%95/","excerpt":"","text":"收敛性测试,可以自己编写代码,也可以使用现成的代码,这里分享一个脚本vaspup。 vaspup程序vaspup下载安装见:kavanase/vaspup2.0: VASP Convergence Testing for Energy & Dielectric Constants使用教程见程序给的例子和上述链接。##注意事项INCAR中等号=两边有一个空格。仅仅测试的关键词满足即可。KPOINTS也一样 参考资料[1] kavanase/vaspup2.0: VASP Convergence Testing for Energy & Dielectric Constants","categories":[{"name":"科研代码","slug":"科研代码","permalink":"http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81/"}],"tags":[{"name":"github","slug":"github","permalink":"http://raolixiang-up.github.io/tags/github/"}]},{"title":"cohp高通量计算004-结构优化是否收敛的统计","slug":"cohp高通量计算","date":"2022-05-11T19:53:27.000Z","updated":"2022-05-13T09:18:53.679Z","comments":true,"path":"2022/05/12/cohp高通量计算/","link":"","permalink":"http://raolixiang-up.github.io/2022/05/12/cohp%E9%AB%98%E9%80%9A%E9%87%8F%E8%AE%A1%E7%AE%97/","excerpt":"","text":"问题描述搞了很久,仍然卡在一个很奇葩的点上,我清楚的知道问题,但是没找到教程,弱爆了。问题如下所示:result1=$(grep “reached” ${i}/GO/OUTCAR | tail -1)输出的字符串与”reached required accuracy - stopping structural energy minimisation”字符串不等价,目前还没找到解决方案。这绝不是一个很难问题,只是我还没找到解决问题的路径。 脚本代码我采用另一种方式解决了这个问题,代码如下: 123456789101112131415161718#!/usr/bin/bashfor i in A*docd ${i}/GO/result1=$(grep "reached" ${i}/GO/OUTCAR | tail -1)result2=$(grep "reached" A001*/GO/OUTCAR | tail -1) ##找个确定收敛的OUTCAR# final=`tail -1 out.vasp | awk '{print $1,$2}'`# if [ "$final"x == "1 F="x ];thenif [ "${result1}"x == "${result2}"x ];then convergence_result="Yes"else convergence_result="No" echo ${i} ${convergence_result} >> convergence_result.datfidonesed -i '1i system convergence_result' convergence_result.dat 结构达到收敛的就不再统计,只统计结构优化未收敛的结果。找一个确定收敛的OUTCAR,提取关键语句,赋值在result2,然后其他的提取结果都与result2比较,顺利解决问题.如有错误,欢迎指正~~~~~~~ 参考资料[1] Shell 变量 | 菜鸟教程[2] shell中的if语句 - 开始认识 - 博客园[3] (5条消息) Shell字符串比较相等、不相等方法小结_Howie Lee的博客-CSDN博客_shell 字符串不相等[4] (5条消息) Linux下的文本dos格式转Unix格式,去除^M符号_kobejayandy的博客-CSDN博客_dos格式和unix格式","categories":[{"name":"机器学习","slug":"机器学习","permalink":"http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"}],"tags":[{"name":"ML","slug":"ML","permalink":"http://raolixiang-up.github.io/tags/ML/"}]},{"title":"科研代码002-任务收敛情况监控脚本","slug":"查看任务收敛情况","date":"2022-05-11T16:04:07.000Z","updated":"2022-05-11T16:36:02.905Z","comments":true,"path":"2022/05/12/查看任务收敛情况/","link":"","permalink":"http://raolixiang-up.github.io/2022/05/12/%E6%9F%A5%E7%9C%8B%E4%BB%BB%E5%8A%A1%E6%94%B6%E6%95%9B%E6%83%85%E5%86%B5/","excerpt":"","text":"在任务运行过程中监测任务的收敛情况,有两个脚本。 rsgradvasp计算监控程序,使用rust语言编写,具体详情见主页:Ionizing/rsgrad: A VASP calculation monitor. Written in Rust安装包下载地址:Release 0.3.6 · Ionizing/rsgrad,直接使用预编译二进制文件即可。运行指令如下: 1rsgrad rlx # 监控结构弛豫过程 具体详细信息见主页。 extforce.sh和screenfore.py脚本监控extforce.sh脚本的思路:1)从OUTCAR中提取所有的TOTAL-FORCE部分信息(每个原子上的force vectors);2)用for循环调用screenforce.py筛选出每一个离子步受力大于EDIFFG的原子,及对应的原子序号,存储在lt_ediffg_${i}.dat,i为相应的离子步数。然后可以用p4vasp软件查看 具体是哪些原子没有达到力收敛标准。预设的参数:1)在extforce.sh里设置体系的原子数(N_atoms);2)在screenforce.py里设置一下EDIFFG(ediffg)。需用python3,如果只有python2的话可以把screenforce.py的print那几行改成py2的格式即可,使用时将extforce.sh, screenforce.py, OUTCAR放在同一目录下,执行./extforce.sh即可。相关介绍见:分享从OUTCAR查看原子受力的小脚本 - 第一性原理 (First Principle) - 计算化学公社对extforce.sh进行了简单的修改,直接从POSCAR获得原子总数,代码如下: 12345678910111213141516171819202122232425262728293031323334#!/bin/bash# Written by qmlearner at Homestay Uni.#######################################################Define the number of atoms (N_atoms) of your system.#######################################################N_atoms=`cat POSCAR | sed -n '7p' | awk '{ for(i=1;i<=NF;i++) sum+=$i; print sum}'`N_Lines_1=$(echo "${N_atoms}+1" | bc)N_Lines_2=$(echo "${N_atoms}+2" | bc)#########################################Extract the force vectors of each atom# #for each ionic step. #########################################if [ ! -f "OUTCAR" ]; then echo "Does not find OUTCAR."else sed -n "/TOTAL-FORCE/,+${N_Lines_1}p" OUTCAR > forcevectors.datfiN_ionic_steps=$(grep -o 'TOTAL-FORCE' forcevectors.dat | wc -l)cp forcevectors.dat forcevectors-back.datfor ((i=1;i<=${N_ionic_steps};i++));do sed -n "3,${N_Lines_2}p" forcevectors.dat | awk '{printf "%10s %10s %10s \\n",$4,$5,$6}' > sep_forcevectors.dat sed "1,${N_Lines_2}d" forcevectors.dat > forcevectors_del.dat mv forcevectors_del.dat forcevectors.dat python screenforce.py mv lt_ediffg.dat lt_ediffg_${i}.datdonerm forcevectors.dat sep_forcevectors.dat atomicforce.dat screenforce.py的代码如下: 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677#!/usr/bin/python -u # -*- coding: utf-8 -*-# Calculate the force of each atom. Screen the force not fullfil convergence criteria and the # corresponding atom number.# Written by qmlearner at Homestay Uni. #import math #import numpy as np#import reimport osa=open('sep_forcevectors.dat','r+')af='atomicforce.dat'if os.path.exists(af): print("---------------------------------------------") print("%s file already exists. It will be deleted." %(af)) print("---------------------------------------------") os.remove(af)b=open(af,'a')la=a.readlines()################################################Calculate the force performing on each atom##################################################for i in range(len(la)): x=float(la[i].strip().split()[0]) y=float(la[i].strip().split()[1]) z=float(la[i].strip().split()[2]) F=(x**2 + y**2 + z**2)**0.5 b.write(str(F)) b.write('\\n')a.close()b.close()#################################################Output the force that does not fulfill ##convergence criteria. #################################################c=open('atomicforce.dat','r')ce='lt_ediffg.dat'if os.path.exists(ce): print("------------------------------------------") print("%s file already exists. It will be deleted." %(ce)) print("------------------------------------------") os.remove(ce)d=open(ce,'a')lc=c.readlines()###################################################Change the ediffg according to your own settings###################################################ediffg=0.01for i in range(len(lc)): F=float(lc[i].strip()) if F >= ediffg: d.write(str(i+1)) d.write('\\t') d.write(str(F)) d.write('\\n')c.close()d.close() 参考资料[1] Ionizing/rsgrad: A VASP calculation monitor. Written in Rust[2] 分享从OUTCAR查看原子受力的小脚本 - 第一性原理 (First Principle) - 计算化学公社[3] (5条消息) linux 一行数值累加求和_yychenxie21的博客-CSDN博客_linux 累加","categories":[{"name":"科研代码","slug":"科研代码","permalink":"http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81/"}],"tags":[{"name":"github","slug":"github","permalink":"http://raolixiang-up.github.io/tags/github/"}]},{"title":"cohp高通量计算003-批量重命名","slug":"cohp高通量计算003-批量重命名","date":"2022-05-06T01:59:08.000Z","updated":"2022-05-06T02:12:46.557Z","comments":true,"path":"2022/05/06/cohp高通量计算003-批量重命名/","link":"","permalink":"http://raolixiang-up.github.io/2022/05/06/cohp%E9%AB%98%E9%80%9A%E9%87%8F%E8%AE%A1%E7%AE%97003-%E6%89%B9%E9%87%8F%E9%87%8D%E5%91%BD%E5%90%8D/","excerpt":"","text":"爬取完数据,因为mpid需要按顺序排列,方便以后数据爬取,因此需要给下载的结构文件重命名。python使用很不熟练,命令代码也不熟悉,任务还比较着急。因此,直接搜索“文件批量重命名”,顺利找到解决方案。 使用工具软件名称:Renamer Lite (免安装解压即用)下载地址:ReNamer « Products « den4b.comDownload ReNamer Lite - MajorGeeks使用这个工具顺利解决我的问题 参考资料[1] ReNamer « Products « den4b.com[2] Download ReNamer Lite - MajorGeeks[3] ReNamer批量重命名文件教程 - 知乎","categories":[{"name":"机器学习","slug":"机器学习","permalink":"http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"}],"tags":[{"name":"ML","slug":"ML","permalink":"http://raolixiang-up.github.io/tags/ML/"}]},{"title":"科研代码001-sumo","slug":"科研代码001","date":"2022-05-05T13:10:46.000Z","updated":"2022-05-05T13:23:11.982Z","comments":true,"path":"2022/05/05/科研代码001/","link":"","permalink":"http://raolixiang-up.github.io/2022/05/05/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81001/","excerpt":"","text":"sumo程序可以简化vasp计算数据的后处理,这里收集一下大佬分享的使用代码吧。 程序安装sumo简介和安装见:SMTG-UCL/sumo: Heavyweight plotting tools for ab initio calculations安装命令如下: 1$ pip install --user sumo 程序使用a) 声子谱(DFPT方法) 1$ sumo-phonon-bandplot -f FORCE_CONSTANTS --primitive-auto --pymatgen --format tiff --dim 2 2 2 b) 声子谱(冷冻声子法) 1$ sumo-phonon-bandplot --primitive-auto --pymatgen --format tiff --dim 2 2 2 c) 一键画态密度图 1$ sumo-dosplot --orbitals Os.d --elements Os.d --atoms Os.1 --no-total d) 一键画能带图 1$ sumo-bandplot --project Os.d,O.p,Os.s --mode stacked --circle-size 90 参考资料[1] Heavyweight plotting tools for ab initio calculations[2] Sumo — sumo 2.3.0 documentation","categories":[{"name":"科研代码","slug":"科研代码","permalink":"http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81/"}],"tags":[{"name":"github","slug":"github","permalink":"http://raolixiang-up.github.io/tags/github/"}]},{"title":"shell001-反向删除","slug":"shell001","date":"2022-05-04T17:39:45.000Z","updated":"2022-05-04T18:03:44.668Z","comments":true,"path":"2022/05/05/shell001/","link":"","permalink":"http://raolixiang-up.github.io/2022/05/05/shell001/","excerpt":"","text":"我咋特别喜欢揪着不常用的命令花费大量时间死磕呢,不是一个好习惯。 shell反向删除方法1花了很长时间终于找到解决方案。 12$ shopt -s extglob #(打开extglob模式)$ rm -rf !(file1) 或者 rm -rf !(file1|file2|...) -删除多个文件 顺利反向删除 方法2当前文件夹中结合使用grep和xargs来处理文件名:ls | grep -v keep | xargs rm #删除keep文件之外的所有文件说明:ls先得到当前的所有文件和文件夹的名字,grep -v keep,进行grep正则匹配查找keep,-v参数决定了结果为匹配之外的结果,也就是的到了keep之外的所有文件名,然后 xargs用于从 标准输入获得参数 并且传递给后面的命令,这里使用的命令是 rm,然后由rm删除前面选择的文件。好处:使用了grep来正则表达式来匹配文件名字,可以一次保留多个文件,从而进行更加准确的处理。 方法3使用find命令代替ls,改进方法3从而能够处理制定文件夹的文件:find ./test/ | grep -v keep | xargs rm #删除当前test文件夹中keep文件之外的所有文件说明,用grep而不用find -name选取名字,因为find选取名字时比较麻烦,对正则表达式支持不够,无法排除指定文件名。 参考资料[1] linux shell下除了某个文件外的其他文件全部删除的命令_乌托邦2号的博客-CSDN博客_linux删除除了某个文件的其他文件[2] rm -rf 排除指定文件夹或文件_youcijibi的博客-CSDN博客_rm 排除目录[3] Linux下使用rm删除文件,并排除指定文件 - 云+社区 - 腾讯云","categories":[{"name":"shell","slug":"shell","permalink":"http://raolixiang-up.github.io/categories/shell/"}],"tags":[{"name":"bash","slug":"bash","permalink":"http://raolixiang-up.github.io/tags/bash/"}]},{"title":"科研追踪001","slug":"科研追踪001","date":"2022-05-04T08:28:59.000Z","updated":"2022-10-15T06:06:21.400Z","comments":true,"path":"2022/05/04/科研追踪001/","link":"","permalink":"http://raolixiang-up.github.io/2022/05/04/%E7%A7%91%E7%A0%94%E8%BF%BD%E8%B8%AA001/","excerpt":"","text":"搜集一下需要关注的课题组主页吧,会更新。 研究类 Jiawang Hong Research Group—-自己所属课题组,必须关注 氧化物分子束外延及电子结构表征实验室—聂越峰老师课题组 Website of Dr. Ruifeng Zhang—张瑞丰老师课题组 功能晶体材料实验室—陈彦彬老师课题组 Computational Materials Science Group : Wan-Jian Yin (尹万健) Group PLD Lab—刘俊明老师课题组 东南大学量子材料物理研究组-Welcome to the PQM Group—董帅老师课题组 卢成课题组 | 中国地质大学(武汉) | LabXing Harold T. Stokes Fennie Group Materials Physics Thermoelectrics at Northwestern 欧阳润海课题组 Home | Enlai Gao’s Webpage—高恩来老师课题组 People – Zhang & Ruan Lab—张远波和阮威课题组 Home - shuaigroup—帅志刚老师课题组 Home page of Andrea Dal Corso—Andrea Dal Corso课题组QE软件 工具类 Harzing.com—文献情报搜索类,很多软件","categories":[{"name":"科研追踪","slug":"科研追踪","permalink":"http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E8%BF%BD%E8%B8%AA/"}],"tags":[{"name":"课题组","slug":"课题组","permalink":"http://raolixiang-up.github.io/tags/%E8%AF%BE%E9%A2%98%E7%BB%84/"}]},{"title":"cohp的高通量计算002-爬取POSCAR","slug":"cohp的高通量计算002","date":"2022-05-02T14:47:33.000Z","updated":"2022-05-11T19:57:11.869Z","comments":true,"path":"2022/05/02/cohp的高通量计算002/","link":"","permalink":"http://raolixiang-up.github.io/2022/05/02/cohp%E7%9A%84%E9%AB%98%E9%80%9A%E9%87%8F%E8%AE%A1%E7%AE%97002/","excerpt":"","text":"作了个大死,越是任务紧急越是东瞅西瞅,效率低到姥姥家。同时,在一些小点上竟然花费那么长时间了,一直卡bug。最后的成果就是能够通过mpid批量爬取数据。 成果(通过mpid批量爬取数据)代码如下: 1234567891011121314import pymatgen.core as mgfrom pymatgen.io.vasp import Poscarfrom pymatgen.ext.matproj import MPResterimport csvwith open('structureid.csv','r',encoding='UTF-8-sig') as csv_file: content = csv.reader(csv_file) structure_id = list(content)[0] print(structure_id) for mpid in structure_id: mpr = MPRester("API-MP") strctr = mpr.get_structure_by_material_id(mpid) poscar = Poscar(strctr) poscar.write_file('POSCAR_{0}'.format(mpid)) 写了一点代码,因为已经知道所有mpid,因此就通过mpid来爬取POSCAR结构,但是有483个结构。因此,采用for循环遍历483个mpid。总不能一个一个输,因此采用读取csv文件的方式生成一个列表。这里,用到csv库的reader命令,然后我就在这里卡bug,走不动了。reader把每行都搞成一个列表,每行的元素直接逗号隔开,最终生成的列表中的元素都是行所组成的列表,for… in…无法遍历。搜了很多资料,一开始都放弃csv文件转投text文件,折腾很久的原因就是自己对概念理解不清,一些关键的功能根本不知道 。最后采用以下步骤解决:(1)csv中的mpid排列转为行排列(excel复制粘贴就可以,注意复制的区域和粘贴的区域大小一致);(2)采用structure_id = list(content)[0],只提取第一行形成的数组;(3)一个小细节就是encoding=’UTF-8-sig’,一定要加-sig,不然输出列表的第一个元素会有\\ufeff特殊字符;(4)盲目相信教程,列表中的单双引号都可以,我竟然作死去折腾把列表中的单引号转为双引号,当然以失败告终。(5)从materials project爬取数据,把VPN关掉,使用conda或者pip安装一些包的时候也一样。血泪教训,目前搞不清为啥要关闭。这样就完成了爬取数据,现在搞清楚了感觉很简单,但我搞了好久。分析一下原因:(1)基本是参考别人的脚本,对python基础概念理解不清,关键细节更是只能通过搜索看到关键信息点才会有突破,本质就是解题思路不清晰;(2)很要命的一点,就是反复死磕一个点,耗费太多精力发现是死胡同,还得另寻他路,不过也是在拼命搜索过程中找到岔路口;(3)还有一点就是思路不清晰,搞多线程,同时尝试去解决很多个点,精力分散,结果就是按下葫芦浮起瓢。 后续工作安排按照LobsterAutomation教程接下来就是atomate和FireWorks两个高通量软件的调用了,他们可以监控和检查计算结果。如果搞明白应该可以加快脚本书写进度。下面工作流程如下:(1)解读调用的atomate的包(2)解读调用的FireWorks包 参考资料[1] atomate (Materials Science Workflows) — atomate 1.0.3 documentation[2] Introduction to FireWorks (workflow software) — FireWorks 2.0.3 documentation[3] Introduction — pymatgen 2022.4.26 documentation[4] python去除\\ufeff、\\xa0、\\u3000 - zqifa - 博客园","categories":[{"name":"机器学习","slug":"机器学习","permalink":"http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"}],"tags":[{"name":"ML","slug":"ML","permalink":"http://raolixiang-up.github.io/tags/ML/"}]},{"title":"cohp的高通量计算001-基本工具","slug":"cohp的高通量计算001","date":"2022-05-01T15:58:43.000Z","updated":"2022-05-11T19:57:09.576Z","comments":true,"path":"2022/05/01/cohp的高通量计算001/","link":"","permalink":"http://raolixiang-up.github.io/2022/05/01/cohp%E7%9A%84%E9%AB%98%E9%80%9A%E9%87%8F%E8%AE%A1%E7%AE%97001/","excerpt":"","text":"最近学习机器学习,第一个任务是关于数据挖掘和高通量计算,为机器学习准备素材,没有编程基础很难受,这一天浏览了python的基本操作,进行简单的算例模仿,工作还是没啥进展,先把用到的资料总结一下吧 使用的工具(1)jupyter notebook或者jupyter lab,jupyter lab我用的很不稳定,因此大量测试学习采用jupyter notebook;(2)文本编辑器:BowPad,挺好用,可以替代notepad++。 参考资料自己搜寻资料的能力太弱了,真的有待加强,基本都是大佬提供的 PyML/第06期 2022.04.25-04.29 at main · MasterLegend/PyML matminer (Materials Data Mining) — matminer 0.7.6 documentation Materials Project JaGeo/LobsterAutomation: This is a package to reproduce the publication on Lobster automation JaGeo/LobsterPy: Package to automatically analyze Lobster runs Introduction — pymatgen 2022.4.26 documentation Atomic Simulation Environment — ASE documentation ASE-LOBSTER联用进行批量COHP成键分析 - 知乎 pymatgen API的使用-高通量计算初探 | 世事如棋","categories":[{"name":"机器学习","slug":"机器学习","permalink":"http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"}],"tags":[{"name":"ML","slug":"ML","permalink":"http://raolixiang-up.github.io/tags/ML/"}]},{"title":"Hexo个人博客(006)-评论系统设置","slug":"Hexo个人博客006-评论系统设置","date":"2022-04-29T07:40:46.000Z","updated":"2022-04-30T07:48:22.660Z","comments":true,"path":"2022/04/29/Hexo个人博客006-评论系统设置/","link":"","permalink":"http://raolixiang-up.github.io/2022/04/29/Hexo%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2006-%E8%AF%84%E8%AE%BA%E7%B3%BB%E7%BB%9F%E8%AE%BE%E7%BD%AE/","excerpt":"","text":"搭建完博客,希望能及时跟同行一起交流,所以鼓捣一下评论系统。 问题检索搜索关键词“hexo pure 评论系统”,“hexo pure valine” 希望评论系统好用希望评论系统好用+1希望评论系统好用+2希望评论系统好用+3希望评论系统好用+4希望评论系统好用+5希望评论系统好用+6希望评论系统好用+7希望评论系统好用+8希望评论系统好用+9希望评论系统好用+10希望评论系统好用+11希望评论系统好用+12希望评论系统好用+13希望评论系统好用+14希望评论系统好用+15希望评论系统好用+16希望评论系统好用+17希望评论系统好用+18希望评论系统好用+19希望评论系统好用+20 参考资料[1] Hexo博客搭建(3)——优化评论系统 | 鴻塵[2] Hexo博客搭建(2)——主题配置 | 鴻塵[3] Hexo博客使用valine评论系统无效果及终极解决方案 - 知乎[4] 介绍 | Valine 一款快速、简洁且高效的无后端评论系统","categories":[{"name":"hexo博客","slug":"hexo博客","permalink":"http://raolixiang-up.github.io/categories/hexo%E5%8D%9A%E5%AE%A2/"}],"tags":[{"name":"hexo","slug":"hexo","permalink":"http://raolixiang-up.github.io/tags/hexo/"}]},{"title":"机器学习001","slug":"机器学习001","date":"2022-04-28T21:43:56.000Z","updated":"2022-04-29T14:53:23.261Z","comments":true,"path":"2022/04/29/机器学习001/","link":"","permalink":"http://raolixiang-up.github.io/2022/04/29/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0001/","excerpt":"","text":"机器学习的基础数据挖掘","categories":[{"name":"机器学习","slug":"机器学习","permalink":"http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"}],"tags":[{"name":"ML","slug":"ML","permalink":"http://raolixiang-up.github.io/tags/ML/"}]},{"title":"hexo个人博客(005)-标签和分类的产生","slug":"hexo个人博客005-标签和分类的产生","date":"2022-04-28T21:20:49.000Z","updated":"2022-04-28T21:28:47.428Z","comments":true,"path":"2022/04/29/hexo个人博客005-标签和分类的产生/","link":"","permalink":"http://raolixiang-up.github.io/2022/04/29/hexo%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2005-%E6%A0%87%E7%AD%BE%E5%92%8C%E5%88%86%E7%B1%BB%E7%9A%84%E4%BA%A7%E7%94%9F/","excerpt":"","text":"在git中执行hexo n 文件名,在source/_posts下生成相应的 文件名.md 文件,编辑md文件,如下所示: 12345678---title: hexo个人博客005-标签和分类的产生date: 2022-04-29 05:20:49tags: - hexocategories: - hexo博客--- tags和categories即为标签和分类的关键词,如上设置即可。","categories":[{"name":"hexo博客","slug":"hexo博客","permalink":"http://raolixiang-up.github.io/categories/hexo%E5%8D%9A%E5%AE%A2/"}],"tags":[{"name":"hexo","slug":"hexo","permalink":"http://raolixiang-up.github.io/tags/hexo/"}]},{"title":"hexo个人博客(004)-文章图片插入","slug":"hexo个人博客004-文章图片插入","date":"2022-04-28T20:00:46.000Z","updated":"2022-04-29T15:18:57.728Z","comments":true,"path":"2022/04/29/hexo个人博客004-文章图片插入/","link":"","permalink":"http://raolixiang-up.github.io/2022/04/29/hexo%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2004-%E6%96%87%E7%AB%A0%E5%9B%BE%E7%89%87%E6%8F%92%E5%85%A5/","excerpt":"","text":"文章图片插入写博客过程遇到需要图片展示,因此写一个图片插入的教程。 问题检索搜索关键词“hexo 文章 图片” 解决途径根据检索结果,在md文件中插入图片的语法为 1![]() 其中方括号是图片描述,圆括号是图片路径。 绝对路径Hexo项目中将图片统一放在source/images文件夹,通过markdown语法访问,图片在首页内容和文章正文中都可以访问到。 1![](/images/image.jpg) 相对路径图片还可以放在文章自己的目录中。文章的图片目录可以通过配置_config.yml来生成。 1post_asset_folder: true 将_config.yml文件中的配置项post_asset_folder设为true后,执行命令$ hexo new post_name,在source/_posts中会生成文章post_name.md和同名文件夹post_name。将图片放在post_name中,文章就可以使用相对路径引用图片资源了。 1![](image.jpg) 上述是markdown的引用方式,图片只能在文章中显示,但无法在首页中正常显示。如果希望图片在文章和首页中同时显示,可以使用标签插件语法。 1{% asset_img image.jpg This is an image %} 网络路径除了在本地存储图片,还可以将图片上传到一些免费的CDN服务中。比如Cloudinary提供的图片CDN服务,在Cloudinary中上传图片后,会生成对应的url地址,将地址直接拿来引用即可。 1![](url地址) 采用github图床上的图片,展示如下: 参考资料[1] Hexo博客搭建之在文章中插入图片 - yanyinhong的个人博客[2] hexo博客中如何插入图片 - 云+社区 - 腾讯云[3] 在Hexo博客中插入图片的各种方式 | 赵大寳","categories":[{"name":"hexo博客","slug":"hexo博客","permalink":"http://raolixiang-up.github.io/categories/hexo%E5%8D%9A%E5%AE%A2/"}],"tags":[{"name":"hexo","slug":"hexo","permalink":"http://raolixiang-up.github.io/tags/hexo/"}]},{"title":"hexo个人博客(003)-文章目录生成","slug":"hexo个人博客-文章目录生成","date":"2022-04-28T19:35:26.000Z","updated":"2022-10-14T15:51:03.311Z","comments":true,"path":"2022/04/29/hexo个人博客-文章目录生成/","link":"","permalink":"http://raolixiang-up.github.io/2022/04/29/hexo%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2-%E6%96%87%E7%AB%A0%E7%9B%AE%E5%BD%95%E7%94%9F%E6%88%90/","excerpt":"","text":"小白一枚,一直想搭建一个自己保存自己学习工作生活记录的博客。得意于互联网的蓬勃发展,提供各种学习资料,如愿搭建了一个。 文章目录生成已经写了两个关于hexo博客的帖子,使用过程中发现没有文章目录生成。 问题检索检索关键词“hexo pure toc文章目录”,谷歌搜索第一个帖子解决问题 解决问题这个问题是在网址(https://github.com/cofess/hexo-theme-pure/issues/)里的第33和125个问题,在问题33里提供了解决方式,解决问题流程如下所示:(1)把layout/_partial/post/nav.ejs,layout/_partial/sidebar-toc.ejs里的&& post.toc删掉;(2)sidebar-toc.ejs把collapse这个样式去掉可以了,这个样式写了一个display:none!important; 不知道为什么要隐藏Mark。这里只使用了(1)就正常生成了文章目录(TOC,Table of contents)。 参考资料[1] 在内容页面,如何显示文章内容结构 · Issue #33 · cofess/hexo-theme-pure[2] 开启了toc但还是不显示文章目录 · Issue #125 · cofess/hexo-theme-pure[3] Issues · cofess/hexo-theme-pure","categories":[{"name":"hexo博客","slug":"hexo博客","permalink":"http://raolixiang-up.github.io/categories/hexo%E5%8D%9A%E5%AE%A2/"}],"tags":[{"name":"hexo","slug":"hexo","permalink":"http://raolixiang-up.github.io/tags/hexo/"}]},{"title":"hexo个人博客(002)-修改头像","slug":"hexo个人博客-随机头像生成","date":"2022-04-28T17:55:59.000Z","updated":"2022-10-14T15:51:03.311Z","comments":true,"path":"2022/04/29/hexo个人博客-随机头像生成/","link":"","permalink":"http://raolixiang-up.github.io/2022/04/29/hexo%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2-%E9%9A%8F%E6%9C%BA%E5%A4%B4%E5%83%8F%E7%94%9F%E6%88%90/","excerpt":"","text":"更改头像搭建完hexo博客,采用pure主题。配置pure主题只需要在站点配置文件(博客目录下的_config.yml)中把theme项更改为pure(在hexo/themes/下有pure文件夹)即可。其次,在git中进入themes/pure/_source下执行cp -r * ../../../source(将主题下的各种分类标签复制到主目录下的source中,这样就不用自己建了),进入自己的主页还是很激动的,但是马上就很懵了,需要更改的东西太多了。那就先从最简单的开始吧,先更改头像信息。 具体流程这时又要用到万能的搜索了,流程如下:(1)确定更改代码的位置需要更改主题目录下配置文件_config.yml(简称主题配置文件)更改profile的模块就可以了(可以用文本编辑器搜索功能快速定位相应位置);(2)确定具体代码avatar控制头像,头像图片可以提供相对路径或者绝对路径(相关的可以自己搜索)。需要注意的是关键词后的冒号与后面的文本之间必须有空格,提供图片相对路径或者绝对路径的方式不利于以后博客的使用,因此采用图床的方式进行图片上传;(3)使用github和PicGo建立图床这里就不细说了,详细教程见:link(4)上传图像搭建完图床,使用PicGo将图片上传到github的库里,然后复制图片地址粘贴到avatar后,更新即可。通过更改头像,可以发现,基本网站的修改就两个配置文件_config.yml:站点配置文件和主题配置文件,有啥需要更改的就文本编辑器打开配置文件看看吧 头像生成此外,为了得到好看的头像,发现了另一个新大陆,随机生成头像,把搜索到的相关网址总结如下:(1)Multiavatar - Avatar Generator, Profile Picture Creator, Unique Avatars Maker(2)Avataaars Generator - A free online avatar generator for anyone to make their beautiful personal avatar easily!(3)头像生成器 - 在线工具专题 - 一个工具箱 - 好用的在线工具都在这里!(4)Notion 风格头像制作 参考资料[1] Hexo博客搭建(2)——主题配置 | 鴻塵[2] 免费稳定图床最佳实践:PicGo+GitHub+jsDeliver 极简教程 - 云+社区 - 腾讯云","categories":[{"name":"hexo博客","slug":"hexo博客","permalink":"http://raolixiang-up.github.io/categories/hexo%E5%8D%9A%E5%AE%A2/"}],"tags":[{"name":"hexo","slug":"hexo","permalink":"http://raolixiang-up.github.io/tags/hexo/"}]},{"title":"hexo个人博客(001)-建立博客","slug":"hexo个人博客搭建","date":"2022-04-28T15:09:26.000Z","updated":"2022-04-29T15:25:01.663Z","comments":true,"path":"2022/04/28/hexo个人博客搭建/","link":"","permalink":"http://raolixiang-up.github.io/2022/04/28/hexo%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/","excerpt":"","text":"搭建hexo博客流程小白一枚,一直想搭建一个自己保存自己学习工作生活记录的博客。得益于互联网的蓬勃发展,提供各种学习资料,如愿搭建了一个。 搭建思路总结经验总结如下:(1)资料搜索确定目标之后,最重要的是搜集资料,确定关键词,我通过谷歌搜索,搜关键词“个人网站 搭建”、“免费网站 搭建”、“github 免费网站”,很顺利找到很多相关个人网站搭建教程。其中,github的fork别人的主题也尝试过,对于我来说不是很好用,遂放弃。(2)确定工具根据模板主题以及后续修改难易程度,确定hexo+git的组合进行个人博客的搭建。(3)搭建个人网站一开始很难,因为啥也不懂,在很多细小的点上浪费很多时间。回头总结,别太关注细节,不用着急理解各种设置的细节,先把个人网站搭起来再说。关键的代码一定去搜索它起到什么作用这样反而能够加快进度。(4)成功搭建个人博客搭建完个人博客,进行了简单的修改,这是我的第一个帖子。在这里,总结一下经验:善用搜索,理解主干,抓大放小。网上教程很多,我就不重复写了,把教程放到参考资料里。前人栽树,后人乘凉,感谢大佬们的教程分享。 运行小细节修改完配置或者要更新博客流程:在博客目录下(我的是hexo)使用git bash(hexo文件夹右键git bash,也可以先打开git bash使用cd进入),然后执行下面 123$ hexo n 帖子的名称(随意)#会在source/_post/下生成相应的***.md文件,这个文件就是编辑帖子的具体内容$ hexo clean $ hexo g -d更新会延迟一分钟左右~~~~~~ 搭建过程中使用的工具工具总结:(1)git(2)hexo(3)github(搭建图床库以及个人网站)(4)PicGo(向搭建的github图床上传图片)(5)文本编辑器:BowPad(开源免费,超轻便) 参考资料[1] 使用Github Pages与Hexo搭建博客 | jkzhao’s blog[2] Hexo教程:(一)安装及使用初体验 | 中二病也要玩 front end[3] 免费稳定图床最佳实践:PicGo+GitHub+jsDeliver 极简教程 - 云+社区 - 腾讯云[4] 使用Hexo+ Github 建站 时 使用 hexo d 命令异常- 无敌土豆 - 博客园[5] Hexo主题pure使用指南 | 非典型性程序员[6] hexo常用命令笔记 - SegmentFault 思否","categories":[{"name":"hexo博客","slug":"hexo博客","permalink":"http://raolixiang-up.github.io/categories/hexo%E5%8D%9A%E5%AE%A2/"}],"tags":[{"name":"hexo","slug":"hexo","permalink":"http://raolixiang-up.github.io/tags/hexo/"}]},{"title":"模板","slug":"hello-world","date":"2022-04-27T20:38:01.389Z","updated":"2022-04-28T16:29:02.825Z","comments":true,"path":"2022/04/28/hello-world/","link":"","permalink":"http://raolixiang-up.github.io/2022/04/28/hello-world/","excerpt":"","text":"Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub. Quick StartCreate a new post1$ hexo new "My New Post" More info: Writing Run server1$ hexo server More info: Server Generate static files1$ hexo generate More info: Generating Deploy to remote sites1$ hexo deploy More info: Deployment","categories":[],"tags":[]}],"categories":[{"name":"文献","slug":"文献","permalink":"http://raolixiang-up.github.io/categories/%E6%96%87%E7%8C%AE/"},{"name":"DFT","slug":"DFT","permalink":"http://raolixiang-up.github.io/categories/DFT/"},{"name":"机器学习","slug":"机器学习","permalink":"http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"},{"name":"科研代码","slug":"科研代码","permalink":"http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81/"},{"name":"vasp","slug":"vasp","permalink":"http://raolixiang-up.github.io/categories/vasp/"},{"name":"linux","slug":"linux","permalink":"http://raolixiang-up.github.io/categories/linux/"},{"name":"shell","slug":"shell","permalink":"http://raolixiang-up.github.io/categories/shell/"},{"name":"科研追踪","slug":"科研追踪","permalink":"http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E8%BF%BD%E8%B8%AA/"},{"name":"hexo博客","slug":"hexo博客","permalink":"http://raolixiang-up.github.io/categories/hexo%E5%8D%9A%E5%AE%A2/"}],"tags":[{"name":"预印本","slug":"预印本","permalink":"http://raolixiang-up.github.io/tags/%E9%A2%84%E5%8D%B0%E6%9C%AC/"},{"name":"ABINIT","slug":"ABINIT","permalink":"http://raolixiang-up.github.io/tags/ABINIT/"},{"name":"ML","slug":"ML","permalink":"http://raolixiang-up.github.io/tags/ML/"},{"name":"python","slug":"python","permalink":"http://raolixiang-up.github.io/tags/python/"},{"name":"vasp","slug":"vasp","permalink":"http://raolixiang-up.github.io/tags/vasp/"},{"name":"shell","slug":"shell","permalink":"http://raolixiang-up.github.io/tags/shell/"},{"name":"slurm-PBS","slug":"slurm-PBS","permalink":"http://raolixiang-up.github.io/tags/slurm-PBS/"},{"name":"github","slug":"github","permalink":"http://raolixiang-up.github.io/tags/github/"},{"name":"bash","slug":"bash","permalink":"http://raolixiang-up.github.io/tags/bash/"},{"name":"课题组","slug":"课题组","permalink":"http://raolixiang-up.github.io/tags/%E8%AF%BE%E9%A2%98%E7%BB%84/"},{"name":"hexo","slug":"hexo","permalink":"http://raolixiang-up.github.io/tags/hexo/"}]}