本文整理汇总了Python中atom.Atom.dipole_element方法的典型用法代码示例。如果您正苦于以下问题:Python Atom.dipole_element方法的具体用法?Python Atom.dipole_element怎么用?Python Atom.dipole_element使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atom.Atom
的用法示例。
在下文中一共展示了Atom.dipole_element方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dipole
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import dipole_element [as 别名]
def dipole(self):
self.parameter['dipole'] = []
for k in range(len(self.parameter['e_amp'])):
if self.d1 == 1:
j2 = 1.0/2.0
else:
j2 = 3.0/2.0
n=self.parameter['n']
tmp = [[0 for i in range(n)] for j in range(n)]
cs = Atom()
for i in range(n):
for j in range(n):
d1 = self.index2lfm(i)
d2 = self.index2lfm(j)
if d1[0] == 0 and d2[0] == 1:
q_arr=self.parameter['e_amp'][k][1]
for q in q_arr:
coef = {'q':q,
'L1':0,
'L2':1,
'F1':d1[1],
'F2':d2[1],
'mf1':d1[2],
'mf2':d2[2]+q,
'J1':1.0/2.0,
'J2':j2,
'I':7.0/2.0}
tmp[i][j] += cs.dipole_element(**coef)
elif d2[0] == 0 and d1[0] == 1:
q_arr=self.parameter['e_amp'][k][1]
for q in q_arr:
coef = {'q':q,
'L1':0,
'L2':1,
'F1':d2[1],
'F2':d1[1],
'mf1':d2[2],
'mf2':d1[2]+q,
'J1':1.0/2.0,
'J2':j2,
'I':7.0/2.0}
tmp[i][j] += cs.dipole_element(**coef)
else:
tmp[i][j] = 0.0
self.parameter['dipole'].append(tmp)
示例2: dipole
# 需要导入模块: from atom import Atom [as 别名]
# 或者: from atom.Atom import dipole_element [as 别名]
def dipole(parameter):
n = parameter["n"]
parameter["dipole"] = [[0 for i in range(n)] for j in range(n)]
cs = Atom()
for i in range(n):
for j in range(n):
d1 = index2lfm(i)
d2 = index2lfm(j)
if d1[0] == 0 and d2[0] == 1:
coef = {
"q": 0,
"L1": 0,
"L2": 1,
"F1": d1[1],
"F2": d2[1],
"mf1": d1[2],
"mf2": d2[2],
"J1": 1.0 / 2.0,
"J2": 1.0 / 2.0,
"I": 7.0 / 2.0,
}
parameter["dipole"][i][j] = cs.dipole_element(**coef)
elif d2[0] == 0 and d1[0] == 1:
coef = {
"q": 0,
"L1": 0,
"L2": 1,
"F1": d2[1],
"F2": d1[1],
"mf1": d2[2],
"mf2": d1[2],
"J1": 1.0 / 2.0,
"J2": 1.0 / 2.0,
"I": 7.0 / 2.0,
}
parameter["dipole"][i][j] = cs.dipole_element(**coef)
else:
parameter["dipole"][i][j] = 0.0
return parameter