0%

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
from sklearn.metrics import r2_score
from sklearn import linear_model
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from pylab import *

'''
文件用pandas读入命名为df
colume是待分类的一列
label是待分类的列表,如我想分析data.csv文件夹下,的ads_ele下的x和Mg不同情况下的时候吸附能与一些变量的关系
y是想分析的因变量,如吸附能
x是想分析的自变量
'''

def classify_scatter(filename,column,y_goal,x_goal,labels):
plt.figure(figsize=(8.3,6))
label_font = {'family':'Arial','weight':'normal','size':26}
legend_font = {'family':'Arial','weight':'normal','size':15}
plt.rcParams['xtick.direction'] = 'in'#将x周的刻度线方向设置向内
plt.rcParams['ytick.direction'] = 'in'#将y轴的刻度方向设置向内
plt.yticks(fontproperties = 'Arial', size = 24)
plt.xticks(fontproperties = 'Arial', size = 20)
plt.ylabel(y_goal,label_font)
plt.xlabel(x_goal,label_font)
minorticks_on()
tick_params(which='major',width=2,length=6)
tick_params(which='minor',width=2,length=4)
bwith = 2
ax=plt.gca()
ax.spines['bottom'].set_linewidth(bwith)
ax.spines['top'].set_linewidth(bwith)
ax.spines['left'].set_linewidth(bwith)
ax.spines['right'].set_linewidth(bwith)

for label in labels:
df = pd.read_excel(filename)
df = df[df[column] == str(label)]
y = np.array(df[y_goal]).reshape(-1,1)
x = np.array(df[x_goal]).reshape(-1,1)

linear = linear_model.LinearRegression()
linear.fit(x, y)

y_true = y
y_pred = linear.predict(x)
plt.scatter(x, y,label=label+':$R^2$='+str(round(r2_score(y_true,y_pred),3)),s=160,edgecolor='black',alpha=0.8)
x_aixs = np.linspace(np.min(x)-0.1*(np.max(x)-np.min(x)),1.1*np.max(x)+0.3*(np.max(x)-np.min(x)),10, endpoint=True).reshape(-1,1)
plt.plot(x_aixs, linear.predict(x_aixs), ls='dashed')
plt.legend(loc='best',prop ={'family':'Arial','weight':'normal','size':14},fancybox=False,edgecolor='black')
plt.tight_layout()
plt.savefig(y_goal+' VS. '+x_goal+' sorted by '+column+'.pdf',dpi=300)
print(label+'的R2:{}'.format(r2_score(y_true,y_pred)))

filename = 'raw.xlsx'
for c in ['Spacegroup','type','ads_ele']:
column = c
df = pd.read_excel(filename)
# 将这一列的所有行分离出来,并删除数据小于5的点
temp = df[column].value_counts()
labels = temp[temp>4].index.tolist()
# 目标变量和自变量
y_analysis = 'Ads_En'
for i in ['Bader','Workfunction', 'D -0']:
x_analysis = i
classify_scatter(filename,column,y_analysis,x_analysis,labels)

1.买东西并且所要发票

2.下载科研报销单并且按照要求填写,基金号可以先空着

科研报销单.xls

3.去453科研办公室交给进门方向最左边里面的陆静洁老师

综述关系

1
2
3
4
5
6
7
8
9
graph LR
赝势-->模守恒赝势
赝势-->PAW投影缀加平面波
赝势-->USPP超软赝势
PAW投影缀加平面波-->LDA:局域密度泛函
PAW投影缀加平面波-->GGA:广义梯度泛函
PAW投影缀加平面波-->杂化泛函
GGA:广义梯度泛函-->PBE
GGA:广义梯度泛函-->PW91:一般不用

This work is based on the density functional theory (DFT) calculations performed by using the Vienna ab initio Simulation Package (VASP) software. The interaction between ion cores and valence electrons described by the projector augmented wave (PAW) method34. The generalized gradient approximation (GGA)35 in the form of Perdew–Burke–Ernzerhof (PBE) exchange functional36 was used to solve the quantum states of electron. The plane-wave energy cutoff is set to 500 eV. The Monkhorst–Pack method37 with 1 × 1 × 2 k-point mesh is employed for the Brillouin zone sampling of the super lattice. The convergence criteria of energy and force are set to 10−5 eV/atom and 0.01 eV/Å, respectively. The anion charges of lithium compounds were calculated by using the Atoms in Molecules method (Bader charge analysis)38. The energy variations and migration barriers of lithium ion migration in fcc-type anion sublattices with 48 anions (Supplementary Fig. 3) are calculated by the nudged elastic band (NEB) method39,40. The anion charges are changed by the uniform background charge of the sublattice system. Only the one migrating lithium ion is allowed to relax, while the other anions are fixed in their initial positions, and this method can be also found in Ceder’s work8 .

文章中引用的时候需要五篇:DFT,PAW,GGA,PBE,VASP

详细介绍

vasp计算中用到的三种赝势:模守恒赝势,超软赝势,PAW赝势(按产生顺序)。

按方法不同分为USPP(ultrasoft pesudopotential,超软赝势)和PAW(projector augmented wave,投影缀加平面波),两种方法都可以相当程度地减少过渡金属或第一行元素的每个原子所必需的平面波数量。

按交换关联函数不同分为LDA(local density approximation,局域密度近似)和GGA(generalized-gradient approximation,广义梯度近似),GGA又分为PW91(Perdew -Wang 91)和PBE(Perdew-Burke-Ernzerhof)。

求解K-S方程时电子之间的交换关联泛函取局域密度泛函LDA(Rc处电子结构当成是密度相同的均匀电子气体来算)。

广义梯度泛函GGA(考虑了密度的梯度变化),但泛函的不同也会引起贋势的不同。

  • paw文件夹:PAW-LDA
  • paw_gga文件夹:PAW-GGA-PW91
  • paw_pbe文件夹:PAW-GGA-PBE
  • pot文件夹:USPP-LDA
  • pot_GGA文件夹:USPP-GGA

选择某个目录进去,我们还会发现对应每种元素往往还会有多种赝势存在。这是因为根据ENMAX的大小还可以分为 Ga,Ga_s(soft),Ga_h,或者根据处理半芯态的不同还可以分为Ga,Ga_sv(s电子作为半芯态),Ga_pv的不同。

对于化合物(不同原子半径的元素混合)来说,PAW赝势比超软赝势精确度高。

US型赝势所需截至能较小,计算速度快,PAW赝势截至能通常较大,而且考虑的电子数多,计算慢,但精确度高。

在做具体的计算之前,针对需要计算的性质选取不同的贋势做下测试。对于不同贋势得到的结果,关注其最终的能量差,而不是绝对能量。

题目要求

输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字。

1
2
3
4
5
6
7
示例 1
输入:matrix = [[1,2,3],[4,5,6],[7,8,9]]
输出:[1,2,3,6,9,8,7,4,5]

示例 2
输入:matrix = [[1,2,3,4],[5,6,7,8],[9,10,11,12]]
输出:[1,2,3,4,8,12,11,10,9,5,6,7]

源代码

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
class Solution:
# python3定义函数的格式,代表matrix中是一个列表,列表中还有列表,最里层列表中的元素是数字,返回是一个列表,其中也是数字
def spiralOrder(self, matrix:[[int]]) -> [int]:
# 检查是否为空矩阵
if not matrix: return []
# 初始化上下左右四个边界值
l = 0
r = len(matrix[0])-1
t = 0
b = len(matrix) - 1
res = []
# 这是一个永久循环,一直到break执行,如果没有这句只会执行最外面的一层
while True:
for i in range(l, r + 1): res.append(matrix[t][i]) # left to right
t += 1
if t > b: break
for i in range(t, b + 1): res.append(matrix[i][r]) # top to bottom
r -= 1
if l > r: break
for i in range(r, l - 1, -1): res.append(matrix[b][i]) # right to left
b -= 1
if t > b: break
for i in range(b, t - 1, -1): res.append(matrix[i][l]) # bottom to top
l += 1
if l > r: break
return res

知识点

While True的作用
range函数

range函数有三个参数range(start, stop[, step]), 一般来说range函数默认从0开始,第一额参数显示,最后一个参数不显示,若步长为-1则需要start大于stop

类和函数的区别及调用,self的作用
1
2
3
4
5
6
matirix = [[1,2,3,4],[5,6,7,8],[9,10,11,12]]
# 初始化一个类并且调用这个类下的函数
s = Solution()
s.spiralOrder(matirix)
>>>
[1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7]