本文整理汇总了Python中gpaw.xc.XC.get_setup_name方法的典型用法代码示例。如果您正苦于以下问题:Python XC.get_setup_name方法的具体用法?Python XC.get_setup_name怎么用?Python XC.get_setup_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gpaw.xc.XC
的用法示例。
在下文中一共展示了XC.get_setup_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_setup
# 需要导入模块: from gpaw.xc import XC [as 别名]
# 或者: from gpaw.xc.XC import get_setup_name [as 别名]
def create_setup(symbol, xc='LDA', lmax=0,
type='paw', basis=None, setupdata=None,
filter=None, world=None):
if isinstance(xc, str):
xc = XC(xc)
if isinstance(type, str) and ':' in type:
# Parse DFT+U parameters from type-string:
# Examples: "type:l,U" or "type:l,U,scale"
type, lu = type.split(':')
if type == '':
type = 'paw'
l = 'spdf'.find(lu[0])
assert lu[1] == ','
U = lu[2:]
if ',' in U:
U, scale = U.split(',')
else:
scale = True
U = float(U) / units.Hartree
scale = int(scale)
else:
U = None
if setupdata is None:
if type == 'hgh' or type == 'hgh.sc':
lmax = 0
from gpaw.hgh import HGHSetupData, setups, sc_setups
if type == 'hgh.sc':
table = sc_setups
else:
table = setups
parameters = table[symbol]
setupdata = HGHSetupData(parameters)
elif type == 'ah':
from gpaw.ah import AppelbaumHamann
ah = AppelbaumHamann()
ah.build(basis)
return ah
elif type == 'ae':
from gpaw.ae import HydrogenAllElectronSetup
assert symbol == 'H'
ae = HydrogenAllElectronSetup()
ae.build(basis)
return ae
elif type == 'ghost':
from gpaw.lcao.bsse import GhostSetupData
setupdata = GhostSetupData(symbol)
else:
setupdata = SetupData(symbol, xc.get_setup_name(),
type, True,
world=world)
if hasattr(setupdata, 'build'):
setup = LeanSetup(setupdata.build(xc, lmax, basis, filter))
if U is not None:
setup.set_hubbard_u(U, l, scale)
return setup
else:
return setupdata