-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatom.xml
516 lines (249 loc) · 89.4 KB
/
atom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Hexo</title>
<link href="http://raolixiang-up.github.io/atom.xml" rel="self"/>
<link href="http://raolixiang-up.github.io/"/>
<updated>2023-01-10T15:09:15.443Z</updated>
<id>http://raolixiang-up.github.io/</id>
<author>
<name>raolixiang</name>
</author>
<generator uri="https://hexo.io/">Hexo</generator>
<entry>
<title>文献001-预印本网站</title>
<link href="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/"/>
<id>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/</id>
<published>2023-01-10T14:49:29.000Z</published>
<updated>2023-01-10T15:09:15.443Z</updated>
<content type="html"><![CDATA[<p>这里总结一下预印本和各种免费资源的网站吧,方便以后搜索最新文献。<br>[1] <a href="https://arxiv.org/">arXiv.org e-Print archive</a>: 数学、物理学、计算机等。<br>[2] <a href="http://www.chinaxiv.org/home.htm">ChinaXiv.org 中国科学院科技论文预发布平台</a>: 国产网站,接收中英文文章,比较综合。<br>[3] <a href="https://www.biorxiv.org/">bioRxiv.org - the preprint server for Biology</a>: 仅针对生物学领域。<br>[4] <a href="https://f1000.com/">Open Research Publishing - Advancing Knowledge - F1000</a>:涵盖所有生命科学领域的。<br>[5] <a href="https://figshare.com/">figshare - credit for all your research</a>: 图表、多媒体、海报、论文(包括预印本)和多文件、数据集等。<br>[6] <a href="https://peerj.com/preprints/">PeerJ - Search</a>: 涵盖了生物科学、医学和健康科学的领域。<br>[7] <a href="https://zenodo.org/">Zenodo - Research. Shared.</a>: 刊物、演示文稿、论文集、项目、图像、软件(包括与 GitHub 的集成)以及所有语言的数据。<br>[8] <a href="https://www.ssrn.com/index.cfm/en/">Home :: SSRN</a>:偏社会科学领域。</p>]]></content>
<summary type="html"><p>这里总结一下预印本和各种免费资源的网站吧,方便以后搜索最新文献。<br>[1] <a href="https://arxiv.org/">arXiv.org e-Print archive</a>: 数学、物理学、计算机等。<br>[2] <a href="http://w</summary>
<category term="文献" scheme="http://raolixiang-up.github.io/categories/%E6%96%87%E7%8C%AE/"/>
<category term="预印本" scheme="http://raolixiang-up.github.io/tags/%E9%A2%84%E5%8D%B0%E6%9C%AC/"/>
</entry>
<entry>
<title>ABINIT001-初步学习</title>
<link href="http://raolixiang-up.github.io/2023/01/01/ABINIT001-%E5%88%9D%E6%AD%A5%E5%AD%A6%E4%B9%A0/"/>
<id>http://raolixiang-up.github.io/2023/01/01/ABINIT001-%E5%88%9D%E6%AD%A5%E5%AD%A6%E4%B9%A0/</id>
<published>2023-01-01T13:55:47.000Z</published>
<updated>2023-01-01T14:58:59.482Z</updated>
<content type="html"><![CDATA[<p>因为要计算体系的非线性光学,因此需要学习ABINIT,这里整理一下学习资料,方便日后复习,主要是ABINIT官网和论坛如下所示:<br>[1] <a href="https://www.abinit.org/">Home | ABINIT</a><br>[2] <a href="https://discourse.abinit.org/">ABINIT</a><br>其他的学习资料推荐微信公众号:学术之友,作者有ABINIT开发组的经历,教程质量很高。ABINIT目前学习资源很少,官网感觉很乱相比于vasp官网,这可能就是开源的弊端吧。下面基本操作分享一个b站视频吧,如下:<br><a href="https://www.bilibili.com/video/BV1f34y1j7kQ/?spm_id_from=333.999.0.0&vd_source=a3d30bedf09a03ccbaa078f26da9bdf4">abinit 入门金刚石总能量的计算_哔哩哔哩_bilibili</a></p>]]></content>
<summary type="html"><p>因为要计算体系的非线性光学,因此需要学习ABINIT,这里整理一下学习资料,方便日后复习,主要是ABINIT官网和论坛如下所示:<br>[1] <a href="https://www.abinit.org/">Home | ABINIT</a><br>[2] <a hre</summary>
<category term="DFT" scheme="http://raolixiang-up.github.io/categories/DFT/"/>
<category term="ABINIT" scheme="http://raolixiang-up.github.io/tags/ABINIT/"/>
</entry>
<entry>
<title>机器学习002-决定系数等指标</title>
<link href="http://raolixiang-up.github.io/2022/12/31/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0002/"/>
<id>http://raolixiang-up.github.io/2022/12/31/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0002/</id>
<published>2022-12-31T14:53:34.000Z</published>
<updated>2022-12-31T15:15:34.687Z</updated>
<content type="html"><![CDATA[<p>机器学习中MSE(均方误差)、 RMSE(均方根误差)、 MAE(平均绝对误差)、R2(决定系数)是评判机器学习获得的模型优劣非常重要的指标,这些指标的定义可以百度或者谷歌,这里不赘述了。<br>这里使用python脚本,需要一个具有两列数据的csv文件,一列为真实值,一列为机器学习预测值。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#导入相应的函数库</span></span><br><span class="line">from sklearn import datasets</span><br><span class="line">from sklearn.model_selection import train_test_split</span><br><span class="line">from sklearn.ensemble import RandomForestRegressor</span><br><span class="line">import numpy as np</span><br><span class="line">import pandas as pd</span><br><span class="line">from math import sqrt</span><br><span class="line">from sklearn.metrics import mean_absolute_error</span><br><span class="line">from sklearn.metrics import mean_squared_error</span><br><span class="line">from sklearn.metrics import r2_score</span><br><span class="line"><span class="comment">#加载数据</span></span><br><span class="line">file_y = pd.read_csv(<span class="string">'y-c44-3-q2-no.csv'</span>) <span class="comment"># csv文件,文件中有两列数,一列是真实值,一列是机器学习预测值</span></span><br><span class="line"><span class="comment"># print(file_y)</span></span><br><span class="line">data1 = file_y[<span class="string">'y_true'</span>] <span class="comment"># 真实值那列的抬头</span></span><br><span class="line">y_true = data1.values.tolist()</span><br><span class="line">data2 = file_y[<span class="string">'y_pred'</span>] <span class="comment"># 机器学习预测值那列的抬头</span></span><br><span class="line">y_pred = data2.values.tolist()</span><br><span class="line"><span class="comment"># print(y_true)</span></span><br><span class="line"><span class="comment"># print(y_pred)</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 使用sklearn调用衡量线性回归的MSE 、 RMSE、 MAE、r2</span></span><br><span class="line"><span class="built_in">print</span>(<span class="string">"mean_absolute_error:"</span>, mean_absolute_error(y_true, y_pred))</span><br><span class="line"><span class="built_in">print</span>(<span class="string">"mean_squared_error:"</span>, mean_squared_error(y_true, y_pred))</span><br><span class="line"><span class="built_in">print</span>(<span class="string">"rmse:"</span>, sqrt(mean_squared_error(y_true, y_pred)))</span><br><span class="line"><span class="built_in">print</span>(<span class="string">"r2 score:"</span>, r2_score(y_true, y_pred))</span><br></pre></td></tr></table></figure><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1] <a href="https://blog.csdn.net/z15818264727/article/details/122638802">Python计算统计分析MSE 、 RMSE、 MAE、r2_zNULLT的博客-CSDN博客_python rmse</a><br>[2] <a href="https://blog.csdn.net/weixin_43245453/article/details/90144226">从csv文件读取列数据保存在列表中_春风若是你的博客-CSDN博客</a></p>]]></content>
<summary type="html"><p>机器学习中MSE(均方误差)、 RMSE(均方根误差)、 MAE(平均绝对误差)、R2(决定系数)是评判机器学习获得的模型优劣非常重要的指标,这些指标的定义可以百度或者谷歌,这里不赘述了。<br>这里使用python脚本,需要一个具有两列数据的csv文件,一列为真实值,一列</summary>
<category term="机器学习" scheme="http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"/>
<category term="ML" scheme="http://raolixiang-up.github.io/tags/ML/"/>
</entry>
<entry>
<title>科研代码005-lobsterpy</title>
<link href="http://raolixiang-up.github.io/2022/10/14/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81005-lobsterpy/"/>
<id>http://raolixiang-up.github.io/2022/10/14/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81005-lobsterpy/</id>
<published>2022-10-14T15:53:52.000Z</published>
<updated>2022-10-14T16:09:57.326Z</updated>
<content type="html"><![CDATA[<p>lobsterpy为辅助计算COHP的工具,非常简便好用,网址为:<a href="https://github.com/JaGeo/LobsterPy">JaGeo/LobsterPy: Package to automatically analyze Lobster runs</a><br>对于COHP的计算分析相关的帖子已经很多在这里整理一下:</p><ol><li><a href="https://www.bilibili.com/video/BV1Q4411s7AL/?spm_id_from=333.999.0.0&vd_source=a3d30bedf09a03ccbaa078f26da9bdf4">固体与表面第一性原理计算教学14,电子结构分析(六)COOP, COHP_哔哩哔哩_bilibili</a></li><li><a href="http://blog.wangruixing.cn/2019/04/22/cohp/">COOP和COHP简单原理 | 世事如棋</a></li><li><a href="http://www.cohp.de/">COHP Homepage</a><br>以上三个网址可以帮我们掌握COHP基础知识和基本的计算,浪里个浪~~~~~~~~完结</li></ol>]]></content>
<summary type="html"><p>lobsterpy为辅助计算COHP的工具,非常简便好用,网址为:<a href="https://github.com/JaGeo/LobsterPy">JaGeo/LobsterPy: Package to automatically analyze Lobster r</summary>
<category term="科研代码" scheme="http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81/"/>
<category term="python" scheme="http://raolixiang-up.github.io/tags/python/"/>
</entry>
<entry>
<title>vasp003-能带计算</title>
<link href="http://raolixiang-up.github.io/2022/07/15/vasp003-%E8%83%BD%E5%B8%A6%E8%AE%A1%E7%AE%97/"/>
<id>http://raolixiang-up.github.io/2022/07/15/vasp003-%E8%83%BD%E5%B8%A6%E8%AE%A1%E7%AE%97/</id>
<published>2022-07-15T02:39:04.000Z</published>
<updated>2022-07-15T04:04:42.274Z</updated>
<content type="html"><![CDATA[<p>能带计算走了很多弯路,主要介绍两种能带计算:PBE能带和HSE能带</p><h2 id="PBE能带"><a href="#PBE能带" class="headerlink" title="PBE能带"></a>PBE能带</h2><p>计算流程分为如下:</p><h3 id="PBE-SCF计算"><a href="#PBE-SCF计算" class="headerlink" title="PBE-SCF计算"></a>PBE-SCF计算</h3><p>这一步生成需要读取的WAVECAR,参考INCAR如下:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">ISTART=0</span><br><span class="line">ICHARG=2</span><br><span class="line">PREC=Accurate</span><br><span class="line">GGA = PE</span><br><span class="line">ADDGRID =.TRUE.</span><br><span class="line"></span><br><span class="line"><span class="comment"># Electronic relaxation</span></span><br><span class="line">ENCUT=500</span><br><span class="line">EDIFF=1E-8</span><br><span class="line">EDIFFG=-0.001</span><br><span class="line"></span><br><span class="line">ISMEAR=0</span><br><span class="line">SIGMA = 0.05</span><br><span class="line">POTIM=0.20</span><br><span class="line">NELM=90</span><br><span class="line">NELMIN=5</span><br><span class="line">NSW=0</span><br><span class="line"></span><br><span class="line"><span class="comment"># Write flags</span></span><br><span class="line">LWAVE=.TRUE.</span><br><span class="line">LCHARG=.TRUE.</span><br></pre></td></tr></table></figure><p>按照自己的需求增添参数</p><h3 id="PBE能带计算"><a href="#PBE能带计算" class="headerlink" title="PBE能带计算"></a>PBE能带计算</h3><p>运行vaspkit -task 303(3D材料)或者302(二维材料)<br>生成KPATH.in 和 HIGH_SYMMETRY_POINTS,可以自行修改,主要修改KPATH.in设置K点路径,更换KPOINTS文件:cp KPATH.in KPOINTS<br>将PBE-SCF计算中的INCAR中ISTART改为1即可,这里不设置ICHARG=11,不读取生成的CHARGCAR,提交任务即可。<br>处理数据如下:<br>vaspkit -task n #根据下面说明自行选择<br>211) Band-Structure<br>212) Projected Band-Structure for Selected Atom<br>213) Projected Band-Structure for Each Element<br>214) The Sum of Projected Band-Structure for Selected Atoms<br>215) Projected Band-Structure by Element Weight</p><h2 id="HSE能带计算"><a href="#HSE能带计算" class="headerlink" title="HSE能带计算"></a>HSE能带计算</h2><p>HSE计算分为两步:</p><h3 id="采用标准的KPOINTS进行HSE的SCF计算"><a href="#采用标准的KPOINTS进行HSE的SCF计算" class="headerlink" title="采用标准的KPOINTS进行HSE的SCF计算"></a>采用标准的KPOINTS进行HSE的SCF计算</h3><p>参考的INCAR如下所示:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br></pre></td><td class="code"><pre><span class="line">ISTART=0</span><br><span class="line">ICHARG=2</span><br><span class="line">PREC=Accurate</span><br><span class="line">ADDGRID =.TRUE.</span><br><span class="line"></span><br><span class="line"><span class="comment"># Electronic relaxation</span></span><br><span class="line">ENCUT=500</span><br><span class="line">EDIFF=1E-8</span><br><span class="line">EDIFFG=-0.001</span><br><span class="line"></span><br><span class="line">ISMEAR=0</span><br><span class="line">SIGMA = 0.05</span><br><span class="line">POTIM=0.20</span><br><span class="line">NELM=90</span><br><span class="line">NELMIN=5</span><br><span class="line">NSW=0</span><br><span class="line"></span><br><span class="line"><span class="comment"># HSE</span></span><br><span class="line">LHFCALC = TRUE</span><br><span class="line">HFSCREEN = 0.2</span><br><span class="line">GGA = PE</span><br><span class="line">AEXX = 0.14</span><br><span class="line">AGGAX = 0.86</span><br><span class="line">ALGO = Normal</span><br><span class="line">TIME = 0.4</span><br><span class="line"></span><br><span class="line"><span class="comment"># SOC (可选择是否具有自旋轨道耦合,NBANDS要为正常计算的二倍)</span></span><br><span class="line"><span class="comment"># LSORBIT = .TRUE.</span></span><br><span class="line"><span class="comment"># LMAXMIX=4</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Write flags</span></span><br><span class="line">LWAVE=.TRUE.</span><br><span class="line">LCHARG=.TRUE.</span><br></pre></td></tr></table></figure><p>需要注意的事项,<br>(1)AEXX越大带隙一般越大,AGGAX=1-AEXX;<br>(2)ALGO选择Normal<br>(3)用标准的KPOINTS</p><h3 id="HSE能带计算-1"><a href="#HSE能带计算-1" class="headerlink" title="HSE能带计算"></a>HSE能带计算</h3><p>运行vaspkit -task 303(3D材料)或者302(二维材料)<br>生成KPATH.in 和 HIGH_SYMMETRY_POINTS,可以自行修改,主要修改KPATH.in设置K点路径,然后运行vaspkit -task 251,一步一步输入,生成HSE计算使用的KPOINTS<br>将HSE-SCF计算中的INCAR中ISTART改为1即可,这里不设置ICHARG=11,不读取生成的CHARGCAR,提交任务即可。<br>任务处理命令:<br>vaspkit -task 252</p><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1] <a href="http://blog.wangruixing.cn/2019/05/22/vaspkit-hse-band/">Vaspkit做杂化泛函能带计算方法 | 世事如棋</a><br>[2] <a href="http://blog.wangruixing.cn/2019/05/20/hse/">VASP中杂化泛函计算参数设置 | 世事如棋</a></p>]]></content>
<summary type="html"><p>能带计算走了很多弯路,主要介绍两种能带计算:PBE能带和HSE能带</p>
<h2 id="PBE能带"><a href="#PBE能带" class="headerlink" title="PBE能带"></a>PBE能带</h2><p>计算流程分为如下:</p>
<h3</summary>
<category term="vasp" scheme="http://raolixiang-up.github.io/categories/vasp/"/>
<category term="vasp" scheme="http://raolixiang-up.github.io/tags/vasp/"/>
</entry>
<entry>
<title>vasp002-DOS计算</title>
<link href="http://raolixiang-up.github.io/2022/07/09/vasp002-DOS%E8%AE%A1%E7%AE%97/"/>
<id>http://raolixiang-up.github.io/2022/07/09/vasp002-DOS%E8%AE%A1%E7%AE%97/</id>
<published>2022-07-08T16:18:44.000Z</published>
<updated>2022-07-08T16:23:27.908Z</updated>
<content type="html"><![CDATA[<p>vasp计算DOS,李强博士的帖子叙述的非常详细,具体帖子如下:<br><a href="https://www.bigbrosci.com/2018/02/06/ex37/">Ex-37 DOS 计算(一) | Learn VASP The Hard Way</a><br>顺着这个帖子一直学下去DOS计算不会有什么问题,就不再啰嗦复述了</p><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1]<a href="https://www.bigbrosci.com/2018/02/06/ex37/">Ex-37 DOS 计算(一) | Learn VASP The Hard Way</a></p>]]></content>
<summary type="html"><p>vasp计算DOS,李强博士的帖子叙述的非常详细,具体帖子如下:<br><a href="https://www.bigbrosci.com/2018/02/06/ex37/">Ex-37 DOS 计算(一) | Learn VASP The Hard Way</a><br</summary>
<category term="vasp" scheme="http://raolixiang-up.github.io/categories/vasp/"/>
<category term="vasp" scheme="http://raolixiang-up.github.io/tags/vasp/"/>
</entry>
<entry>
<title>vasp001-固定轴优化</title>
<link href="http://raolixiang-up.github.io/2022/06/03/vasp001-%E5%9B%BA%E5%AE%9A%E8%BD%B4%E4%BC%98%E5%8C%96/"/>
<id>http://raolixiang-up.github.io/2022/06/03/vasp001-%E5%9B%BA%E5%AE%9A%E8%BD%B4%E4%BC%98%E5%8C%96/</id>
<published>2022-06-03T13:28:46.000Z</published>
<updated>2022-06-03T14:20:24.900Z</updated>
<content type="html"><![CDATA[<p>vasp固定轴优化,将网上的资料总结一下。<br>(1)修改constr_cell_relax.F,编译生成对应的vasp执行文件,见<a href="https://chempeng.github.io/post/2018/03/19/vasp-%E5%9B%BA%E5%AE%9A%E5%9F%BA%E7%9F%A2%E4%BC%98%E5%8C%96%E7%BB%93%E6%9E%84/">VASP 固定基矢优化结构 - chempeng</a><br>修改c方向为例,仅对于正交体系和单斜体系,修改代码如下:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br></pre></td><td class="code"><pre><span class="line">!-----------------------------------------------------------------------</span><br><span class="line">!</span><br><span class="line">! At present, VASP does not allow to relax the cellshape selectively</span><br><span class="line">! i.e. <span class="keyword">for</span> instance only cell relaxation <span class="keyword">in</span> x direction.</span><br><span class="line">! To be more precisse, this behaviour can not be achived via the INCAR</span><br><span class="line">! or POSCAR file.</span><br><span class="line">! However, it is possible to <span class="built_in">set</span> selected components of the stress tensor</span><br><span class="line">! to zero.</span><br><span class="line">! The most conveninent position to <span class="keyword">do</span> this is the routines</span><br><span class="line">! CONSTR_CELL_RELAX (constraint cell relaxation).</span><br><span class="line">! FCELL contains the forces on the basis vectors.</span><br><span class="line">! These forces are used to modify the basis vectors according</span><br><span class="line">! to the following equations:</span><br><span class="line">!</span><br><span class="line">! A_OLD(1:3,1:3)=A(1:3,1:3) ! F90 style</span><br><span class="line">! DO J=1,3</span><br><span class="line">! DO I=1,3</span><br><span class="line">! DO K=1,3</span><br><span class="line">! A(I,J)=A(I,J) + FCELL(I,K)*A_OLD(K,J)*STEP_SIZE</span><br><span class="line">! ENDDO</span><br><span class="line">! ENDDO</span><br><span class="line">! ENDDO</span><br><span class="line">! <span class="built_in">where</span> A holds the basis vectors (<span class="keyword">in</span> cartesian coordinates).</span><br><span class="line">!</span><br><span class="line">!-----------------------------------------------------------------------</span><br><span class="line"></span><br><span class="line"> SUBROUTINE CONSTR_CELL_RELAX(FCELL)</span><br><span class="line"> USE prec</span><br><span class="line"> REAL(q) FCELL(3,3)</span><br><span class="line"> DO I=1,3</span><br><span class="line"> FCELL(3,I)=0</span><br><span class="line"> FCELL(I,3)=0</span><br><span class="line"> ENDDO</span><br><span class="line">! just one simple example</span><br><span class="line">! relaxation <span class="keyword">in</span> x directions only</span><br><span class="line">! SAVE=FCELL(1,1)</span><br><span class="line">! FCELL=0 ! F90 style: <span class="built_in">set</span> the whole array to zero</span><br><span class="line">! FCELL(1,1)=SAVE</span><br><span class="line">! relaxation <span class="keyword">in</span> z direction only</span><br><span class="line">! SAVE=FCELL(3,3)</span><br><span class="line">! FCELL=0 ! F90 style: <span class="built_in">set</span> the whole array to zero</span><br><span class="line">! FCELL(3,3)=SAVE</span><br><span class="line"></span><br><span class="line"> RETURN</span><br><span class="line"> END SUBROUTINE</span><br></pre></td></tr></table></figure><p>然后重新编译生成vasp执行文件即可。对于其他方向晶格基矢的修改同理:对于a方向基矢,将 FCELL(3,I) 和 FCELL(I,3) 分别改为 FCELL(1,I) 和 FCELL(I,1) ;对于b方向基矢,则分别改为 FCELL(2,I) 和 FCELL(I,2)<br>(2)一次编译需要配置文件控制,见<a href="https://github.com/Chengcheng-Xiao/VASP_OPT_AXIS">Chengcheng-Xiao/VASP_OPT_AXIS: Fix lattice component(s) during relaxation in VASP</a><br>具体步骤参考链接,我测试了一下肖博士的第一种方法,其中需要注意的是OPTCELL文件数字中间如果有空格则优化有问题,没有空格正常。其次推荐教程中第二种方法,只需要在INCAR中加入IOPTCELL参数即可,不引入其他文件。<br>参考文献<br>[1] <a href="https://chempeng.github.io/post/2018/03/19/vasp-%E5%9B%BA%E5%AE%9A%E5%9F%BA%E7%9F%A2%E4%BC%98%E5%8C%96%E7%BB%93%E6%9E%84/">VASP 固定基矢优化结构 - chempeng</a><br>[2] <a href="https://github.com/Chengcheng-Xiao/VASP_OPT_AXIS">Chengcheng-Xiao/VASP_OPT_AXIS: Fix lattice component(s) during relaxation in VASP</a><br>[3] <a href="https://mp.weixin.qq.com/s/fkoqZisI2mPTha0WfxhcLg">VASP固定基矢优化结构最新方法更新</a><br>[4] <a href="http://blog.wangruixing.cn/2019/05/05/constr/">VASP固定基矢优化结构方法 | 世事如棋</a><br>[5] <a href="http://muchong.com/html/201107/3427823_2.html">VASP并行可执行软件包,可对晶胞参数进行部分优化 - 第 2 页 - 第一原理 - 小木虫 - 学术 科研 互动社区</a></p>]]></content>
<summary type="html"><p>vasp固定轴优化,将网上的资料总结一下。<br>(1)修改constr_cell_relax.F,编译生成对应的vasp执行文件,见<a href="https://chempeng.github.io/post/2018/03/19/vasp-%E5%9B%BA%E5%</summary>
<category term="vasp" scheme="http://raolixiang-up.github.io/categories/vasp/"/>
<category term="vasp" scheme="http://raolixiang-up.github.io/tags/vasp/"/>
</entry>
<entry>
<title>科研代码004-vasp输入文件POTCAR的自动生成</title>
<link href="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/"/>
<id>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/</id>
<published>2022-05-22T12:54:06.000Z</published>
<updated>2022-05-22T13:01:42.654Z</updated>
<content type="html"><![CDATA[<h2 id="代码"><a href="#代码" class="headerlink" title="代码"></a>代码</h2><p>vasp输入文件POTCAR的合并生成,网上很多资料简单整理一下。自己写代码也可以,李强博士已经写好了,如下所示:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/usr/bin/bash</span></span><br><span class="line"><span class="comment"># Create a GGA_PAW POTCAR file</span></span><br><span class="line"><span class="comment"># by BigBro </span></span><br><span class="line"><span class="comment"># To Use it: potcar.sh Cu C H O</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Define local potpaw_GGA pseudopotentialrepository:</span></span><br><span class="line">repo=<span class="string">"/THFS/home/iciq-lq/bin/pot"</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Check if older version of POTCAR ispresent</span></span><br><span class="line"><span class="keyword">if</span> [ -f POTCAR ] ; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">mv</span> -f POTCAR old-POTCAR</span><br><span class="line"><span class="built_in">echo</span> <span class="string">" ** Warning: old POTCAR file found and renamed to 'old-POTCAR'."</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Main loop - concatenate the appropriatePOTCARs (or archives)</span></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> $*</span><br><span class="line"><span class="keyword">do</span></span><br><span class="line"><span class="keyword">if</span> <span class="built_in">test</span> -f <span class="variable">$repo</span>/<span class="variable">$i</span>/POTCAR ; <span class="keyword">then</span></span><br><span class="line"><span class="built_in">cat</span> <span class="variable">$repo</span>/<span class="variable">$i</span>/POTCAR>> POTCAR</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"><span class="built_in">echo</span> <span class="string">" ** Warning: No suitable POTCAR for element '<span class="variable">$i</span>' found!! Skipped thiselement."</span></span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"><span class="keyword">done</span></span><br></pre></td></tr></table></figure><p>简单设置一下POTCAR文件所在的路径即可,具体使用见:<a href="https://www.bigbrosci.com/2017/12/21/A05/">自动生成POTCAR的脚本 | Learn VASP The Hard Way</a><br>因为这是比较简单的操作,很多软件都已经具有这个功能,例如vaspkit,qvasp等软件。</p><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1] <a href="https://www.bigbrosci.com/2017/12/21/A05/">自动生成POTCAR的脚本 | Learn VASP The Hard Way</a><br>[2] <a href="https://vaspkit.com/">Overview — VASPKIT 1.3 documentation</a><br>[3] <a href="https://www.shangyexinzhi.com/article/528678.html">qvasp更新至v2.2版本(卷纳米管等功能)_学术之友-商业新知</a></p>]]></content>
<summary type="html"><h2 id="代码"><a href="#代码" class="headerlink" title="代码"></a>代码</h2><p>vasp输入文件POTCAR的合并生成,网上很多资料简单整理一下。自己写代码也可以,李强博士已经写好了,如下所示:</p>
<figure </summary>
<category term="科研代码" scheme="http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81/"/>
<category term="shell" scheme="http://raolixiang-up.github.io/tags/shell/"/>
</entry>
<entry>
<title>linux-001-slurm和PBS排队调度系统</title>
<link href="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/"/>
<id>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/</id>
<published>2022-05-19T16:27:00.000Z</published>
<updated>2022-05-19T16:28:07.219Z</updated>
<content type="html"><![CDATA[<p>整理一下slurm和PBS简单使用的教程。<br>slurm:</p><ol><li><a href="https://zhuanlan.zhihu.com/p/356415669">Slurm 作业调度系统使用指南 - 知乎</a></li><li><a href="https://slurm.schedmd.com/quickstart.html">Slurm Workload Manager - Quick Start User Guide</a><br>PBS:</li><li><a href="https://kevinzjy.github.io/2018/08/13/180813-Server-PBS/">PBS作业管理系统使用技巧 | Kevinzjy’s Blog</a></li><li><a href="https://www.jianshu.com/p/2f6c799ca147">PBS 作业管理系统 - 简书</a><br>简单的操作,够用即可~~~~~~~~~~~~~~~~~~~~</li></ol>]]></content>
<summary type="html"><p>整理一下slurm和PBS简单使用的教程。<br>slurm:</p>
<ol>
<li><a href="https://zhuanlan.zhihu.com/p/356415669">Slurm 作业调度系统使用指南 - 知乎</a></li>
<li><a href=</summary>
<category term="linux" scheme="http://raolixiang-up.github.io/categories/linux/"/>
<category term="slurm-PBS" scheme="http://raolixiang-up.github.io/tags/slurm-PBS/"/>
</entry>
<entry>
<title>cohp高通量计算005-静态自洽计算是否正常结束的统计</title>
<link href="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/"/>
<id>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/</id>
<published>2022-05-14T13:24:23.000Z</published>
<updated>2022-05-14T13:51:02.799Z</updated>
<content type="html"><![CDATA[<p>总是要写很多稀奇古怪的脚本,因为计算cohp需要一步静态自洽计算,因此判定静态自洽是否正常结束非常重要。因为任务数目过多,所以需要写一个批量判定脚本。</p><h2 id="编写思路"><a href="#编写思路" class="headerlink" title="编写思路"></a>编写思路</h2><p>对静态自洽的步数和INCAR中设置的步数进行比较如果不等,表明静态自洽计算正常结束。如果相等,静态自洽有可能没有正常结束,此时要比较OSZICAR中的dE和INCAR中的EDIFF。如果dE小于EDIFF则正常结束,反之,则未收敛。</p><h2 id="脚本代码"><a href="#脚本代码" class="headerlink" title="脚本代码"></a>脚本代码</h2><p>脚本ls-st-convergence.sh要和批量任务放在一个文件夹内,静态自洽的INCAR中等号=两边有空格,代码如下:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/usr/bin/bash</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> A*</span><br><span class="line"><span class="keyword">do</span></span><br><span class="line"></span><br><span class="line">N=$(<span class="built_in">tail</span> -n 2 <span class="variable">${i}</span>/static/OSZICAR | awk <span class="string">'NR==1 {print $2}'</span>)</span><br><span class="line">dE=$(<span class="built_in">tail</span> -n 2 <span class="variable">${i}</span>/static/OSZICAR | awk <span class="string">'NR==1 {print $4}'</span>) </span><br><span class="line">NELM=$(<span class="built_in">cat</span> <span class="variable">${i}</span>/static/INCAR | awk <span class="string">'NR==13 {print $3}'</span>) <span class="comment"># 参考自己的INCAR提取</span></span><br><span class="line">EDIFF=$(<span class="built_in">cat</span> <span class="variable">${i}</span>/static/INCAR | awk <span class="string">'NR==1 {print $3}'</span>) <span class="comment"># 参考自己的INCAR提取</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">"<span class="variable">${N}</span>"</span> = <span class="string">"<span class="variable">${NELM}</span>"</span> ];<span class="keyword">then</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">${i}</span> <span class="variable">${N}</span> <span class="variable">${NELM}</span> <span class="variable">${dE}</span> <span class="variable">${EDIFF}</span> >> no-st-convergence_result.dat</span><br><span class="line"><span class="keyword">else</span></span><br><span class="line">convergence_result=<span class="string">"No"</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">${i}</span> <span class="variable">${N}</span> <span class="variable">${NELM}</span> <span class="variable">${dE}</span> <span class="variable">${EDIFF}</span> >> yes-st-convergence_result.dat</span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">done</span></span><br><span class="line">sed -i <span class="string">'1i system N NEM dE EDIFF'</span> no-convergence_result.dat</span><br><span class="line">sed -i <span class="string">'1i system N NEM dE EDIFF'</span> yes-convergence_result.dat</span><br></pre></td></tr></table></figure><p>这里不收敛的结构在no-st-convergence_result.dat中,收敛的结果在yes-convergence_result.dat。如果执行脚本时出现下列语句:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sed:无法读取 no-st-convergence_result.dat:没有那个文件或目录</span><br></pre></td></tr></table></figure><p>那么恭喜你,你的所有静态自洽计算都是收敛的。如有错误,欢迎指正~~~~~~~~~~</p><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1] <a href="https://www.cnblogs.com/kaishirenshi/p/9729800.html">shell中的if语句 - 开始认识 - 博客园</a><br>[2] <a href="https://www.runoob.com/linux/linux-comm-awk.html">Linux awk 命令 | 菜鸟教程</a><br>[3] <a href="https://blog.csdn.net/fengfeifengfei/article/details/40371935">(5条消息) awk妙用(如何取出某行某列的某个元素)_god_is_my的博客-CSDN博客</a></p>]]></content>
<summary type="html"><p>总是要写很多稀奇古怪的脚本,因为计算cohp需要一步静态自洽计算,因此判定静态自洽是否正常结束非常重要。因为任务数目过多,所以需要写一个批量判定脚本。</p>
<h2 id="编写思路"><a href="#编写思路" class="headerlink" title="编</summary>
<category term="机器学习" scheme="http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"/>
<category term="ML" scheme="http://raolixiang-up.github.io/tags/ML/"/>
</entry>
<entry>
<title>科研代码003-收敛性测试</title>
<link href="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/"/>
<id>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/</id>
<published>2022-05-12T15:41:17.000Z</published>
<updated>2022-05-13T09:32:53.438Z</updated>
<content type="html"><![CDATA[<p>收敛性测试,可以自己编写代码,也可以使用现成的代码,这里分享一个脚本vaspup。</p><h2 id="vaspup程序"><a href="#vaspup程序" class="headerlink" title="vaspup程序"></a>vaspup程序</h2><p>vaspup下载安装见:<a href="https://github.com/kavanase/vaspup2.0">kavanase/vaspup2.0: VASP Convergence Testing for Energy & Dielectric Constants</a><br>使用教程见程序给的例子和上述链接。<br>##注意事项<br>INCAR中等号=两边有一个空格。仅仅测试的关键词满足即可。KPOINTS也一样</p><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1] <a href="https://github.com/kavanase/vaspup2.0">kavanase/vaspup2.0: VASP Convergence Testing for Energy & Dielectric Constants</a></p>]]></content>
<summary type="html"><p>收敛性测试,可以自己编写代码,也可以使用现成的代码,这里分享一个脚本vaspup。</p>
<h2 id="vaspup程序"><a href="#vaspup程序" class="headerlink" title="vaspup程序"></a>vaspup程序</h2></summary>
<category term="科研代码" scheme="http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81/"/>
<category term="github" scheme="http://raolixiang-up.github.io/tags/github/"/>
</entry>
<entry>
<title>cohp高通量计算004-结构优化是否收敛的统计</title>
<link href="http://raolixiang-up.github.io/2022/05/12/cohp%E9%AB%98%E9%80%9A%E9%87%8F%E8%AE%A1%E7%AE%97/"/>
<id>http://raolixiang-up.github.io/2022/05/12/cohp%E9%AB%98%E9%80%9A%E9%87%8F%E8%AE%A1%E7%AE%97/</id>
<published>2022-05-11T19:53:27.000Z</published>
<updated>2022-05-13T09:18:53.679Z</updated>
<content type="html"><![CDATA[<h2 id="问题描述"><a href="#问题描述" class="headerlink" title="问题描述"></a>问题描述</h2><p>搞了很久,仍然卡在一个很奇葩的点上,我清楚的知道问题,但是没找到教程,弱爆了。问题如下所示:<br>result1=$(grep “reached” ${i}/GO/OUTCAR | tail -1)输出的字符串与”reached required accuracy - stopping structural energy minimisation”字符串不等价,目前还没找到解决方案。<br>这绝不是一个很难问题,只是我还没找到解决问题的路径。</p><h2 id="脚本代码"><a href="#脚本代码" class="headerlink" title="脚本代码"></a>脚本代码</h2><p>我采用另一种方式解决了这个问题,代码如下:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/usr/bin/bash</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> A*</span><br><span class="line"><span class="keyword">do</span></span><br><span class="line"><span class="built_in">cd</span> <span class="variable">${i}</span>/GO/</span><br><span class="line">result1=$(grep <span class="string">"reached"</span> <span class="variable">${i}</span>/GO/OUTCAR | <span class="built_in">tail</span> -1)</span><br><span class="line">result2=$(grep <span class="string">"reached"</span> A001*/GO/OUTCAR | <span class="built_in">tail</span> -1) <span class="comment">##找个确定收敛的OUTCAR</span></span><br><span class="line"><span class="comment"># final=`tail -1 out.vasp | awk '{print $1,$2}'`</span></span><br><span class="line"><span class="comment"># if [ "$final"x == "1 F="x ];then</span></span><br><span class="line"><span class="keyword">if</span> [ <span class="string">"<span class="variable">${result1}</span>"</span>x == <span class="string">"<span class="variable">${result2}</span>"</span>x ];<span class="keyword">then</span></span><br><span class="line">convergence_result=<span class="string">"Yes"</span></span><br><span class="line"><span class="keyword">else</span></span><br><span class="line">convergence_result=<span class="string">"No"</span></span><br><span class="line"><span class="built_in">echo</span> <span class="variable">${i}</span> <span class="variable">${convergence_result}</span> >> convergence_result.dat</span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">done</span></span><br><span class="line">sed -i <span class="string">'1i system convergence_result'</span> convergence_result.dat </span><br></pre></td></tr></table></figure><p>结构达到收敛的就不再统计,只统计结构优化未收敛的结果。找一个确定收敛的OUTCAR,提取关键语句,赋值在result2,然后其他的提取结果都与result2比较,顺利解决问题.<br>如有错误,欢迎指正~~~~~~~</p><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1] <a href="https://www.runoob.com/linux/linux-shell-variable.html">Shell 变量 | 菜鸟教程</a><br>[2] <a href="https://www.cnblogs.com/kaishirenshi/p/9729800.html">shell中的if语句 - 开始认识 - 博客园</a><br>[3] <a href="https://blog.csdn.net/Mr_LeeHY/article/details/76383091">(5条消息) Shell字符串比较相等、不相等方法小结_Howie Lee的博客-CSDN博客_shell 字符串不相等</a><br>[4] <a href="https://blog.csdn.net/kobejayandy/article/details/13291525">(5条消息) Linux下的文本dos格式转Unix格式,去除^M符号_kobejayandy的博客-CSDN博客_dos格式和unix格式</a></p>]]></content>
<summary type="html"><h2 id="问题描述"><a href="#问题描述" class="headerlink" title="问题描述"></a>问题描述</h2><p>搞了很久,仍然卡在一个很奇葩的点上,我清楚的知道问题,但是没找到教程,弱爆了。问题如下所示:<br>result1=$(gr</summary>
<category term="机器学习" scheme="http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"/>
<category term="ML" scheme="http://raolixiang-up.github.io/tags/ML/"/>
</entry>
<entry>
<title>科研代码002-任务收敛情况监控脚本</title>
<link href="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/"/>
<id>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/</id>
<published>2022-05-11T16:04:07.000Z</published>
<updated>2022-05-11T16:36:02.905Z</updated>
<content type="html"><![CDATA[<p>在任务运行过程中监测任务的收敛情况,有两个脚本。</p><h2 id="rsgrad"><a href="#rsgrad" class="headerlink" title="rsgrad"></a>rsgrad</h2><p>vasp计算监控程序,使用rust语言编写,具体详情见主页:<a href="https://github.com/Ionizing/rsgrad">Ionizing/rsgrad: A VASP calculation monitor. Written in Rust</a><br>安装包下载地址:<a href="https://github.com/Ionizing/rsgrad/releases/tag/0.3.6">Release 0.3.6 · Ionizing/rsgrad</a>,直接使用预编译二进制文件即可。<br>运行指令如下:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">rsgrad rlx <span class="comment"># 监控结构弛豫过程</span></span><br></pre></td></tr></table></figure><p>具体详细信息见主页。</p><h2 id="extforce-sh和screenfore-py脚本监控"><a href="#extforce-sh和screenfore-py脚本监控" class="headerlink" title="extforce.sh和screenfore.py脚本监控"></a>extforce.sh和screenfore.py脚本监控</h2><p>extforce.sh脚本的思路:<br>1)从OUTCAR中提取所有的TOTAL-FORCE部分信息(每个原子上的force vectors);<br>2)用for循环调用screenforce.py筛选出每一个离子步受力大于EDIFFG的原子,及对应的原子序号,存储在lt_ediffg_${i}.dat,i为相应的离子步数。然后可以用p4vasp软件查看 具体是哪些原子没有达到力收敛标准。<br>预设的参数:<br>1)在extforce.sh里设置体系的原子数(N_atoms);<br>2)在screenforce.py里设置一下EDIFFG(ediffg)。<br>需用python3,如果只有python2的话可以把screenforce.py的print那几行改成py2的格式即可,使用时将extforce.sh, screenforce.py, OUTCAR放在同一目录下,执行./extforce.sh即可。<br>相关介绍见:<a href="http://bbs.keinsci.com/thread-19985-1-1.html">分享从OUTCAR查看原子受力的小脚本 - 第一性原理 (First Principle) - 计算化学公社</a><br>对extforce.sh进行了简单的修改,直接从POSCAR获得原子总数,代码如下:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="comment"># Written by qmlearner at Homestay Uni.</span></span><br><span class="line"></span><br><span class="line"><span class="comment">######################################################</span></span><br><span class="line"><span class="comment">#Define the number of atoms (N_atoms) of your system.#</span></span><br><span class="line"><span class="comment">######################################################</span></span><br><span class="line">N_atoms=`<span class="built_in">cat</span> POSCAR | sed -n <span class="string">'7p'</span> | awk <span class="string">'{ for(i=1;i<=NF;i++) sum+=$i; print sum}'</span>`</span><br><span class="line">N_Lines_1=$(<span class="built_in">echo</span> <span class="string">"<span class="variable">${N_atoms}</span>+1"</span> | bc)</span><br><span class="line">N_Lines_2=$(<span class="built_in">echo</span> <span class="string">"<span class="variable">${N_atoms}</span>+2"</span> | bc)</span><br><span class="line"></span><br><span class="line"><span class="comment">########################################</span></span><br><span class="line"><span class="comment">#Extract the force vectors of each atom# </span></span><br><span class="line"><span class="comment">#for each ionic step. #</span></span><br><span class="line"><span class="comment">########################################</span></span><br><span class="line"><span class="keyword">if</span> [ ! -f <span class="string">"OUTCAR"</span> ]; <span class="keyword">then</span></span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"Does not find OUTCAR."</span></span><br><span class="line"><span class="keyword">else</span></span><br><span class="line"> sed -n <span class="string">"/TOTAL-FORCE/,+<span class="variable">${N_Lines_1}</span>p"</span> OUTCAR > forcevectors.dat</span><br><span class="line"><span class="keyword">fi</span></span><br><span class="line"></span><br><span class="line">N_ionic_steps=$(grep -o <span class="string">'TOTAL-FORCE'</span> forcevectors.dat | <span class="built_in">wc</span> -l)</span><br><span class="line"></span><br><span class="line"><span class="built_in">cp</span> forcevectors.dat forcevectors-back.dat</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> ((i=1;i<=<span class="variable">${N_ionic_steps}</span>;i++));</span><br><span class="line"><span class="keyword">do</span></span><br><span class="line"> sed -n <span class="string">"3,<span class="variable">${N_Lines_2}</span>p"</span> forcevectors.dat | awk <span class="string">'{printf "%10s %10s %10s \n",$4,$5,$6}'</span> > sep_forcevectors.dat</span><br><span class="line"> sed <span class="string">"1,<span class="variable">${N_Lines_2}</span>d"</span> forcevectors.dat > forcevectors_del.dat</span><br><span class="line"> <span class="built_in">mv</span> forcevectors_del.dat forcevectors.dat</span><br><span class="line"> python screenforce.py</span><br><span class="line"> <span class="built_in">mv</span> lt_ediffg.dat lt_ediffg_<span class="variable">${i}</span>.dat</span><br><span class="line"><span class="keyword">done</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">rm</span> forcevectors.dat sep_forcevectors.dat atomicforce.dat</span><br></pre></td></tr></table></figure><p>screenforce.py的代码如下:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/usr/bin/python -u </span></span><br><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="comment"># Calculate the force of each atom. Screen the force not fullfil convergence criteria and the </span></span><br><span class="line"><span class="comment"># corresponding atom number.</span></span><br><span class="line"><span class="comment"># Written by qmlearner at Homestay Uni. </span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">#import math </span></span><br><span class="line"><span class="comment">#import numpy as np</span></span><br><span class="line"><span class="comment">#import re</span></span><br><span class="line">import os</span><br><span class="line"></span><br><span class="line">a=open(<span class="string">'sep_forcevectors.dat'</span>,<span class="string">'r+'</span>)</span><br><span class="line"></span><br><span class="line">af=<span class="string">'atomicforce.dat'</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> os.path.exists(af):</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"---------------------------------------------"</span>)</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"%s file already exists. It will be deleted."</span> %(af)) </span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"---------------------------------------------"</span>)</span><br><span class="line"> os.remove(af)</span><br><span class="line"></span><br><span class="line">b=open(af,<span class="string">'a'</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">la=a.readlines()</span><br><span class="line"></span><br><span class="line"><span class="comment">###############################################</span></span><br><span class="line"><span class="comment">#Calculate the force performing on each atom###</span></span><br><span class="line"><span class="comment">###############################################</span></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> range(len(la)):</span><br><span class="line"> x=<span class="built_in">float</span>(la[i].strip().<span class="built_in">split</span>()[0])</span><br><span class="line"> y=<span class="built_in">float</span>(la[i].strip().<span class="built_in">split</span>()[1])</span><br><span class="line"> z=<span class="built_in">float</span>(la[i].strip().<span class="built_in">split</span>()[2])</span><br><span class="line"> </span><br><span class="line"> F=(x**2 + y**2 + z**2)**0.5</span><br><span class="line"> b.write(str(F))</span><br><span class="line"> b.write(<span class="string">'\n'</span>)</span><br><span class="line"></span><br><span class="line">a.close()</span><br><span class="line">b.close()</span><br><span class="line"></span><br><span class="line"><span class="comment">################################################</span></span><br><span class="line"><span class="comment">#Output the force that does not fulfill #</span></span><br><span class="line"><span class="comment">#convergence criteria. #</span></span><br><span class="line"><span class="comment">################################################</span></span><br><span class="line"></span><br><span class="line">c=open(<span class="string">'atomicforce.dat'</span>,<span class="string">'r'</span>)</span><br><span class="line"></span><br><span class="line">ce=<span class="string">'lt_ediffg.dat'</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> os.path.exists(ce):</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"------------------------------------------"</span>)</span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"%s file already exists. It will be deleted."</span> %(ce)) </span><br><span class="line"> <span class="built_in">print</span>(<span class="string">"------------------------------------------"</span>)</span><br><span class="line"> os.remove(ce)</span><br><span class="line"></span><br><span class="line">d=open(ce,<span class="string">'a'</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">lc=c.readlines()</span><br><span class="line"></span><br><span class="line"><span class="comment">##################################################</span></span><br><span class="line"><span class="comment">#Change the ediffg according to your own settings#</span></span><br><span class="line"><span class="comment">##################################################</span></span><br><span class="line">ediffg=0.01</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> range(len(lc)):</span><br><span class="line"> F=<span class="built_in">float</span>(lc[i].strip()) </span><br><span class="line"> <span class="keyword">if</span> F >= ediffg:</span><br><span class="line"> d.write(str(i+1))</span><br><span class="line"> d.write(<span class="string">'\t'</span>)</span><br><span class="line"> d.write(str(F))</span><br><span class="line"> d.write(<span class="string">'\n'</span>)</span><br><span class="line"></span><br><span class="line">c.close()</span><br><span class="line">d.close()</span><br></pre></td></tr></table></figure><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1] <a href="https://github.com/Ionizing/rsgrad">Ionizing/rsgrad: A VASP calculation monitor. Written in Rust</a><br>[2] <a href="http://bbs.keinsci.com/thread-19985-1-1.html">分享从OUTCAR查看原子受力的小脚本 - 第一性原理 (First Principle) - 计算化学公社</a><br>[3] <a href="https://blog.csdn.net/chenxieyy/article/details/53786313">(5条消息) linux 一行数值累加求和_yychenxie21的博客-CSDN博客_linux 累加</a></p>]]></content>
<summary type="html"><p>在任务运行过程中监测任务的收敛情况,有两个脚本。</p>
<h2 id="rsgrad"><a href="#rsgrad" class="headerlink" title="rsgrad"></a>rsgrad</h2><p>vasp计算监控程序,使用rust语言编写,</summary>
<category term="科研代码" scheme="http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81/"/>
<category term="github" scheme="http://raolixiang-up.github.io/tags/github/"/>
</entry>
<entry>
<title>cohp高通量计算003-批量重命名</title>
<link href="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/"/>
<id>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/</id>
<published>2022-05-06T01:59:08.000Z</published>
<updated>2022-05-06T02:12:46.557Z</updated>
<content type="html"><![CDATA[<p>爬取完数据,因为mpid需要按顺序排列,方便以后数据爬取,因此需要给下载的结构文件重命名。python使用很不熟练,命令代码也不熟悉,任务还比较着急。因此,直接搜索“文件批量重命名”,顺利找到解决方案。</p><h2 id="使用工具"><a href="#使用工具" class="headerlink" title="使用工具"></a>使用工具</h2><p>软件名称:Renamer Lite (免安装解压即用)<br>下载地址:<br><a href="https://www.den4b.com/products/renamer">ReNamer « Products « den4b.com</a><br><a href="https://m.majorgeeks.com/files/details/renamer.html">Download ReNamer Lite - MajorGeeks</a><br>使用这个工具顺利解决我的问题</p><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1] <a href="https://www.den4b.com/products/renamer">ReNamer « Products « den4b.com</a><br>[2] <a href="https://m.majorgeeks.com/files/details/renamer.html">Download ReNamer Lite - MajorGeeks</a><br>[3] <a href="https://zhuanlan.zhihu.com/p/100779917">ReNamer批量重命名文件教程 - 知乎</a></p>]]></content>
<summary type="html"><p>爬取完数据,因为mpid需要按顺序排列,方便以后数据爬取,因此需要给下载的结构文件重命名。python使用很不熟练,命令代码也不熟悉,任务还比较着急。因此,直接搜索“文件批量重命名”,顺利找到解决方案。</p>
<h2 id="使用工具"><a href="#使用工具" c</summary>
<category term="机器学习" scheme="http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"/>
<category term="ML" scheme="http://raolixiang-up.github.io/tags/ML/"/>
</entry>
<entry>
<title>科研代码001-sumo</title>
<link href="http://raolixiang-up.github.io/2022/05/05/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81001/"/>
<id>http://raolixiang-up.github.io/2022/05/05/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81001/</id>
<published>2022-05-05T13:10:46.000Z</published>
<updated>2022-05-05T13:23:11.982Z</updated>
<content type="html"><![CDATA[<p>sumo程序可以简化vasp计算数据的后处理,这里收集一下大佬分享的使用代码吧。</p><h2 id="程序安装"><a href="#程序安装" class="headerlink" title="程序安装"></a>程序安装</h2><p>sumo简介和安装见:SMTG-UCL/sumo: <a href="https://github.com/SMTG-UCL/sumo">Heavyweight plotting tools for ab initio calculations</a><br>安装命令如下:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ pip install --user sumo</span><br></pre></td></tr></table></figure><h2 id="程序使用"><a href="#程序使用" class="headerlink" title="程序使用"></a>程序使用</h2><p>a) 声子谱(DFPT方法)</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ sumo-phonon-bandplot -f FORCE_CONSTANTS --primitive-auto --pymatgen --format tiff --dim 2 2 2</span><br></pre></td></tr></table></figure><p>b) 声子谱(冷冻声子法)</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ sumo-phonon-bandplot --primitive-auto --pymatgen --format tiff --dim 2 2 2</span><br></pre></td></tr></table></figure><p>c) 一键画态密度图</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ sumo-dosplot --orbitals Os.d --elements Os.d --atoms Os.1 --no-total</span><br></pre></td></tr></table></figure><p>d) 一键画能带图</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ sumo-bandplot --project Os.d,O.p,Os.s --mode stacked --circle-size 90</span><br></pre></td></tr></table></figure><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1] <a href="https://github.com/SMTG-UCL/sumo">Heavyweight plotting tools for ab initio calculations</a><br>[2] <a href="https://smtg-ucl.github.io/sumo/index.html">Sumo — sumo 2.3.0 documentation</a></p>]]></content>
<summary type="html"><p>sumo程序可以简化vasp计算数据的后处理,这里收集一下大佬分享的使用代码吧。</p>
<h2 id="程序安装"><a href="#程序安装" class="headerlink" title="程序安装"></a>程序安装</h2><p>sumo简介和安装见:SMT</summary>
<category term="科研代码" scheme="http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E4%BB%A3%E7%A0%81/"/>
<category term="github" scheme="http://raolixiang-up.github.io/tags/github/"/>
</entry>
<entry>
<title>shell001-反向删除</title>
<link href="http://raolixiang-up.github.io/2022/05/05/shell001/"/>
<id>http://raolixiang-up.github.io/2022/05/05/shell001/</id>
<published>2022-05-04T17:39:45.000Z</published>
<updated>2022-05-04T18:03:44.668Z</updated>
<content type="html"><![CDATA[<p>我咋特别喜欢揪着不常用的命令花费大量时间死磕呢,不是一个好习惯。</p><h2 id="shell反向删除"><a href="#shell反向删除" class="headerlink" title="shell反向删除"></a>shell反向删除</h2><h3 id="方法1"><a href="#方法1" class="headerlink" title="方法1"></a>方法1</h3><p>花了很长时间终于找到解决方案。<br> <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">shopt</span> -s extglob <span class="comment">#(打开extglob模式)</span></span><br><span class="line">$ <span class="built_in">rm</span> -rf !(file1) 或者 <span class="built_in">rm</span> -rf !(file1|file2|...) -删除多个文件</span><br></pre></td></tr></table></figure><br>顺利反向删除</p><h3 id="方法2"><a href="#方法2" class="headerlink" title="方法2"></a>方法2</h3><p>当前文件夹中结合使用grep和xargs来处理文件名:ls | grep -v keep | xargs rm #删除keep文件之外的所有文件<br>说明:ls先得到当前的所有文件和文件夹的名字,grep -v keep,进行grep正则匹配查找keep,-v参数决定了结果为匹配之外的结果,也就是的到了keep之外的所有文件名,然后 xargs用于从 标准输入获得参数 并且传递给后面的命令,这里使用的命令是 rm,然后由rm删除前面选择的文件。<br>好处:使用了grep来正则表达式来匹配文件名字,可以一次保留多个文件,从而进行更加准确的处理。</p><h3 id="方法3"><a href="#方法3" class="headerlink" title="方法3"></a>方法3</h3><p>使用find命令代替ls,改进方法3从而能够处理制定文件夹的文件:<br>find ./test/ | grep -v keep | xargs rm #删除当前test文件夹中keep文件之外的所有文件<br>说明,用grep而不用find -name选取名字,因为find选取名字时比较麻烦,对正则表达式支持不够,无法排除指定文件名。</p><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1] <a href="https://blog.csdn.net/taiyang1987912/article/details/41488395">linux shell下除了某个文件外的其他文件全部删除的命令_乌托邦2号的博客-CSDN博客_linux删除除了某个文件的其他文件</a><br>[2] <a href="https://blog.csdn.net/youcijibi/article/details/103674402">rm -rf 排除指定文件夹或文件_youcijibi的博客-CSDN博客_rm 排除目录</a><br>[3] <a href="https://cloud.tencent.com/developer/article/1849817">Linux下使用rm删除文件,并排除指定文件 - 云+社区 - 腾讯云</a></p>]]></content>
<summary type="html"><p>我咋特别喜欢揪着不常用的命令花费大量时间死磕呢,不是一个好习惯。</p>
<h2 id="shell反向删除"><a href="#shell反向删除" class="headerlink" title="shell反向删除"></a>shell反向删除</h2><h3 i</summary>
<category term="shell" scheme="http://raolixiang-up.github.io/categories/shell/"/>
<category term="bash" scheme="http://raolixiang-up.github.io/tags/bash/"/>
</entry>
<entry>
<title>科研追踪001</title>
<link href="http://raolixiang-up.github.io/2022/05/04/%E7%A7%91%E7%A0%94%E8%BF%BD%E8%B8%AA001/"/>
<id>http://raolixiang-up.github.io/2022/05/04/%E7%A7%91%E7%A0%94%E8%BF%BD%E8%B8%AA001/</id>
<published>2022-05-04T08:28:59.000Z</published>
<updated>2022-10-15T06:06:21.400Z</updated>
<content type="html"><![CDATA[<p>搜集一下需要关注的课题组主页吧,会更新。</p><h2 id="研究类"><a href="#研究类" class="headerlink" title="研究类"></a>研究类</h2><ol><li><a href="http://www.jiawanghong.org/index.html">Jiawang Hong Research Group</a>—-自己所属课题组,必须关注</li><li><a href="https://ombe.nju.edu.cn/main.htm">氧化物分子束外延及电子结构表征实验室</a>—聂越峰老师课题组</li><li><a href="https://sites.google.com/site/zrfbuaa/home">Website of Dr. Ruifeng Zhang</a>—张瑞丰老师课题组</li><li><a href="https://crystal.nju.edu.cn/zh/">功能晶体材料实验室</a>—陈彦彬老师课题组</li><li><a href="http://www.comates.group/">Computational Materials Science Group : Wan-Jian Yin (尹万健) Group</a></li><li><a href="https://pld.nju.edu.cn/">PLD Lab</a>—刘俊明老师课题组</li><li><a href="https://physics.seu.edu.cn/sdong/">东南大学量子材料物理研究组-Welcome to the PQM Group</a>—董帅老师课题组</li><li><a href="https://www.labxing.com/lucheng">卢成课题组 | 中国地质大学(武汉) | LabXing</a></li><li><a href="https://stokes.byu.edu/stokes/stokes.html">Harold T. Stokes</a></li><li><a href="https://fenniegroup.org/">Fennie Group Materials Physics</a></li><li><a href="http://thermoelectrics.matsci.northwestern.edu/">Thermoelectrics at Northwestern</a></li><li><a href="https://www.x-mol.com/groups/ROuyang">欧阳润海课题组</a></li><li><a href="http://enlaigao.whu.edu.cn/">Home | Enlai Gao’s Webpage</a>—高恩来老师课题组</li><li><a href="https://zhangruanlab.com/people/">People – Zhang & Ruan Lab</a>—张远波和阮威课题组</li><li><a href="http://www.shuaigroup.net/">Home - shuaigroup</a>—帅志刚老师课题组</li><li><a href="https://people.sissa.it/~dalcorso/">Home page of Andrea Dal Corso</a>—Andrea Dal Corso课题组QE软件</li></ol><h2 id="工具类"><a href="#工具类" class="headerlink" title="工具类"></a>工具类</h2><ol><li><a href="https://harzing.com/home">Harzing.com</a>—文献情报搜索类,很多软件</li></ol>]]></content>
<summary type="html"><p>搜集一下需要关注的课题组主页吧,会更新。</p>
<h2 id="研究类"><a href="#研究类" class="headerlink" title="研究类"></a>研究类</h2><ol>
<li><a href="http://www.jiawanghong.</summary>
<category term="科研追踪" scheme="http://raolixiang-up.github.io/categories/%E7%A7%91%E7%A0%94%E8%BF%BD%E8%B8%AA/"/>
<category term="课题组" scheme="http://raolixiang-up.github.io/tags/%E8%AF%BE%E9%A2%98%E7%BB%84/"/>
</entry>
<entry>
<title>cohp的高通量计算002-爬取POSCAR</title>
<link href="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/"/>
<id>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/</id>
<published>2022-05-02T14:47:33.000Z</published>
<updated>2022-05-11T19:57:11.869Z</updated>
<content type="html"><![CDATA[<p>作了个大死,越是任务紧急越是东瞅西瞅,效率低到姥姥家。同时,在一些小点上竟然花费那么长时间了,一直卡bug。最后的成果就是能够通过mpid批量爬取数据。</p><h2 id="成果(通过mpid批量爬取数据)"><a href="#成果(通过mpid批量爬取数据)" class="headerlink" title="成果(通过mpid批量爬取数据)"></a>成果(通过mpid批量爬取数据)</h2><p>代码如下:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">import pymatgen.core as mg</span><br><span class="line">from pymatgen.io.vasp import Poscar</span><br><span class="line">from pymatgen.ext.matproj import MPRester</span><br><span class="line">import csv</span><br><span class="line"></span><br><span class="line">with open(<span class="string">'structureid.csv'</span>,<span class="string">'r'</span>,encoding=<span class="string">'UTF-8-sig'</span>) as csv_file:</span><br><span class="line"> content = csv.reader(csv_file)</span><br><span class="line"> structure_id = list(content)[0]</span><br><span class="line"> <span class="built_in">print</span>(structure_id)</span><br><span class="line"> <span class="keyword">for</span> mpid <span class="keyword">in</span> structure_id:</span><br><span class="line"> mpr = MPRester(<span class="string">"API-MP"</span>)</span><br><span class="line"> strctr = mpr.get_structure_by_material_id(mpid)</span><br><span class="line"> poscar = Poscar(strctr)</span><br><span class="line"> poscar.write_file(<span class="string">'POSCAR_{0}'</span>.format(mpid))</span><br></pre></td></tr></table></figure><p>写了一点代码,因为已经知道所有mpid,因此就通过mpid来爬取POSCAR结构,但是有483个结构。因此,采用for循环遍历483个mpid。总不能一个一个输,因此采用读取csv文件的方式生成一个列表。这里,用到csv库的reader命令,然后我就在这里卡bug,走不动了。reader把每行都搞成一个列表,每行的元素直接逗号隔开,最终生成的列表中的元素都是行所组成的列表,for… in…无法遍历。<br>搜了很多资料,一开始都放弃csv文件转投text文件,折腾很久的原因就是自己对概念理解不清,一些关键的功能根本不知道 。最后采用以下步骤解决:<br>(1)csv中的mpid排列转为行排列(excel复制粘贴就可以,注意复制的区域和粘贴的区域大小一致);<br>(2)采用structure_id = list(content)[0],只提取第一行形成的数组;<br>(3)一个小细节就是encoding=’UTF-8-sig’,一定要加-sig,不然输出列表的第一个元素会有\ufeff特殊字符;<br>(4)盲目相信教程,列表中的单双引号都可以,我竟然作死去折腾把列表中的单引号转为双引号,当然以失败告终。<br>(5)从materials project爬取数据,把VPN关掉,使用conda或者pip安装一些包的时候也一样。血泪教训,目前搞不清为啥要关闭。<br>这样就完成了爬取数据,现在搞清楚了感觉很简单,但我搞了好久。分析一下原因:<br>(1)基本是参考别人的脚本,对python基础概念理解不清,关键细节更是只能通过搜索看到关键信息点才会有突破,本质就是解题思路不清晰;<br>(2)很要命的一点,就是反复死磕一个点,耗费太多精力发现是死胡同,还得另寻他路,不过也是在拼命搜索过程中找到岔路口;<br>(3)还有一点就是思路不清晰,搞多线程,同时尝试去解决很多个点,精力分散,结果就是按下葫芦浮起瓢。</p><h2 id="后续工作安排"><a href="#后续工作安排" class="headerlink" title="后续工作安排"></a>后续工作安排</h2><p>按照LobsterAutomation教程接下来就是atomate和FireWorks两个高通量软件的调用了,他们可以监控和检查计算结果。如果搞明白应该可以加快脚本书写进度。下面工作流程如下:<br>(1)解读调用的atomate的包<br>(2)解读调用的FireWorks包</p><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1] <a href="https://atomate.org/index.html">atomate (Materials Science Workflows) — atomate 1.0.3 documentation</a><br>[2] <a href="https://materialsproject.github.io/fireworks/">Introduction to FireWorks (workflow software) — FireWorks 2.0.3 documentation</a><br>[3] <a href="https://pymatgen.org/">Introduction — pymatgen 2022.4.26 documentation</a><br>[4] <a href="https://www.cnblogs.com/zqifa/p/python-9.html">python去除\ufeff、\xa0、\u3000 - zqifa - 博客园</a></p>]]></content>
<summary type="html"><p>作了个大死,越是任务紧急越是东瞅西瞅,效率低到姥姥家。同时,在一些小点上竟然花费那么长时间了,一直卡bug。最后的成果就是能够通过mpid批量爬取数据。</p>
<h2 id="成果(通过mpid批量爬取数据)"><a href="#成果(通过mpid批量爬取数据)" cl</summary>
<category term="机器学习" scheme="http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"/>
<category term="ML" scheme="http://raolixiang-up.github.io/tags/ML/"/>
</entry>
<entry>
<title>cohp的高通量计算001-基本工具</title>
<link href="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/"/>
<id>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/</id>
<published>2022-05-01T15:58:43.000Z</published>
<updated>2022-05-11T19:57:09.576Z</updated>
<content type="html"><![CDATA[<p>最近学习机器学习,第一个任务是关于数据挖掘和高通量计算,为机器学习准备素材,没有编程基础很难受,这一天浏览了python的基本操作,进行简单的算例模仿,工作还是没啥进展,先把用到的资料总结一下吧</p><h2 id="使用的工具"><a href="#使用的工具" class="headerlink" title="使用的工具"></a>使用的工具</h2><p>(1)jupyter notebook或者jupyter lab,jupyter lab我用的很不稳定,因此大量测试学习采用jupyter notebook;<br>(2)文本编辑器:BowPad,挺好用,可以替代notepad++。</p><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>自己搜寻资料的能力太弱了,真的有待加强,基本都是大佬提供的</p><ol><li><a href="https://github.com/MasterLegend/PyML/tree/main/%E7%AC%AC06%E6%9C%9F%202022.04.25-04.29">PyML/第06期 2022.04.25-04.29 at main · MasterLegend/PyML</a></li><li><a href="https://hackingmaterials.lbl.gov/matminer/index.html">matminer (Materials Data Mining) — matminer 0.7.6 documentation</a></li><li><a href="https://materialsproject.org/dashboard">Materials Project</a></li><li><a href="https://github.com/JaGeo/LobsterAutomation">JaGeo/LobsterAutomation: This is a package to reproduce the publication on Lobster automation</a></li><li><a href="https://github.com/JaGeo/LobsterPy">JaGeo/LobsterPy: Package to automatically analyze Lobster runs</a></li><li><a href="https://pymatgen.org/">Introduction — pymatgen 2022.4.26 documentation</a></li><li><a href="https://wiki.fysik.dtu.dk/ase/index.html">Atomic Simulation Environment — ASE documentation</a></li><li><a href="https://zhuanlan.zhihu.com/p/470592188">ASE-LOBSTER联用进行批量COHP成键分析 - 知乎</a></li><li><a href="http://blog.wangruixing.cn/2019/06/12/pymatgen-api/">pymatgen API的使用-高通量计算初探 | 世事如棋</a></li></ol>]]></content>
<summary type="html"><p>最近学习机器学习,第一个任务是关于数据挖掘和高通量计算,为机器学习准备素材,没有编程基础很难受,这一天浏览了python的基本操作,进行简单的算例模仿,工作还是没啥进展,先把用到的资料总结一下吧</p>
<h2 id="使用的工具"><a href="#使用的工具" cla</summary>
<category term="机器学习" scheme="http://raolixiang-up.github.io/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"/>
<category term="ML" scheme="http://raolixiang-up.github.io/tags/ML/"/>
</entry>
<entry>
<title>Hexo个人博客(006)-评论系统设置</title>
<link href="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/"/>
<id>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/</id>
<published>2022-04-29T07:40:46.000Z</published>
<updated>2022-04-30T07:48:22.660Z</updated>
<content type="html"><![CDATA[<p>搭建完博客,希望能及时跟同行一起交流,所以鼓捣一下评论系统。</p><h2 id="问题检索"><a href="#问题检索" class="headerlink" title="问题检索"></a>问题检索</h2><p>搜索关键词“hexo pure 评论系统”,“hexo pure valine”</p><p>希望评论系统好用<br>希望评论系统好用+1<br>希望评论系统好用+2<br>希望评论系统好用+3<br>希望评论系统好用+4<br>希望评论系统好用+5<br>希望评论系统好用+6<br>希望评论系统好用+7<br>希望评论系统好用+8<br>希望评论系统好用+9<br>希望评论系统好用+10<br>希望评论系统好用+11<br>希望评论系统好用+12<br>希望评论系统好用+13<br>希望评论系统好用+14<br>希望评论系统好用+15<br>希望评论系统好用+16<br>希望评论系统好用+17<br>希望评论系统好用+18<br>希望评论系统好用+19<br>希望评论系统好用+20</p><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p>[1] <a href="https://hwame.top/20200520/hello-hexo-optimization.html">Hexo博客搭建(3)——优化评论系统 | 鴻塵</a><br>[2] <a href="https://hwame.top/20200520/hello-hexo-configuration.html">Hexo博客搭建(2)——主题配置 | 鴻塵</a><br>[3] <a href="https://zhuanlan.zhihu.com/p/149540221">Hexo博客使用valine评论系统无效果及终极解决方案 - 知乎</a><br>[4] <a href="https://valine.js.org/">介绍 | Valine 一款快速、简洁且高效的无后端评论系统</a></p>]]></content>
<summary type="html"><p>搭建完博客,希望能及时跟同行一起交流,所以鼓捣一下评论系统。</p>
<h2 id="问题检索"><a href="#问题检索" class="headerlink" title="问题检索"></a>问题检索</h2><p>搜索关键词“hexo pure 评论系统”,“h</summary>
<category term="hexo博客" scheme="http://raolixiang-up.github.io/categories/hexo%E5%8D%9A%E5%AE%A2/"/>
<category term="hexo" scheme="http://raolixiang-up.github.io/tags/hexo/"/>
</entry>
</feed>