本文整理匯總了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