本文整理汇总了Python中pymatgen.core.periodic_table.Specie.split方法的典型用法代码示例。如果您正苦于以下问题:Python Specie.split方法的具体用法?Python Specie.split怎么用?Python Specie.split使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.core.periodic_table.Specie
的用法示例。
在下文中一共展示了Specie.split方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: coupling_constant
# 需要导入模块: from pymatgen.core.periodic_table import Specie [as 别名]
# 或者: from pymatgen.core.periodic_table.Specie import split [as 别名]
def coupling_constant(self, specie):
"""
Computes the couplling constant C_q as defined in:
Wasylishen R E, Ashbrook S E, Wimperis S. NMR of quadrupolar nuclei
in solid materials[M]. John Wiley & Sons, 2012. (Chapter 3.2)
C_q for a specific atom type for this electric field tensor:
C_q=e*Q*V_zz/h
h: planck's constant
Q: nuclear electric quadrupole moment in mb (millibarn
e: elementary proton charge
Args:
specie: flexible input to specify the species at this site.
Can take a isotope or element string, Specie object,
or Site object
Return:
the coupling constant as a FloatWithUnit in MHz
"""
planks_constant=FloatWithUnit(6.62607004E-34, "m^2 kg s^-1")
Vzz=FloatWithUnit(self.V_zz, "V ang^-2")
e=FloatWithUnit(-1.60217662E-19, "C")
# Convert from string to Specie object
if isinstance(specie, str):
# isotope was provided in string format
if len(specie.split("-")) > 1:
isotope=str(specie)
specie=Specie(specie.split("-")[0])
Q=specie.get_nmr_quadrupole_moment(isotope)
else:
specie=Specie(specie)
Q=specie.get_nmr_quadrupole_moment()
elif isinstance(specie, Site):
specie=specie.specie
Q=specie.get_nmr_quadrupole_moment()
elif isinstance(specie, Specie):
Q=specie.get_nmr_quadrupole_moment()
else:
raise ValueError("Invalid speciie provided for quadrupolar coupling constant calcuations")
return (e * Q * Vzz / planks_constant).to("MHz")