本文整理汇总了Python中molecule.Molecule.bohr_to_ang方法的典型用法代码示例。如果您正苦于以下问题:Python Molecule.bohr_to_ang方法的具体用法?Python Molecule.bohr_to_ang怎么用?Python Molecule.bohr_to_ang使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类molecule.Molecule
的用法示例。
在下文中一共展示了Molecule.bohr_to_ang方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Molecule
# 需要导入模块: from molecule import Molecule [as 别名]
# 或者: from molecule.Molecule import bohr_to_ang [as 别名]
import sys
sys.path.insert(0, '../extra-files')
sys.path.insert(0, '../../0/adabbott')
from molecule import Molecule
mol = Molecule(open("../extra-files/molecule.xyz").read())
mol = mol.bohr_to_ang()
#read Hessian Values
hessian_values = open('../extra-files/hessian.dat').readlines()
print (hessian_values)
#collect hessain values into matrix
for row in hessian_values:
row.split()
示例2: Molecule
# 需要导入模块: from molecule import Molecule [as 别名]
# 或者: from molecule.Molecule import bohr_to_ang [as 别名]
import sys
sys.path.insert(0, '../extra-files')
sys.path.insert(0, '../../0/winky94')
from molecule import Molecule
from masses import get_mass
import numpy as np
mol = Molecule(open('../extra-files/molecule.xyz').read(), 'Bohr')
mol.bohr_to_ang()
lines = open('../extra-files/hessian.dat').readlines()
H = []
for line in lines:
H.append(list(map(float, line.split())))
H = np.matrix(H)
M = []
for atom in mol.atoms:
M.append(1/np.sqrt(get_mass(atom)))
M.append(1/np.sqrt(get_mass(atom)))
M.append(1/np.sqrt(get_mass(atom)))
M = np.diag(M)
mwH = M * H * M
E = np.linalg.eigh(mwH)