当前位置: 首页>>代码示例>>Python>>正文


Python System.run方法代码示例

本文整理汇总了Python中Sire.System.run方法的典型用法代码示例。如果您正苦于以下问题:Python System.run方法的具体用法?Python System.run怎么用?Python System.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sire.System的用法示例。


在下文中一共展示了System.run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: MTSMC

# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import run [as 别名]
# rigid body moves of the solvent using e_fast, then accepts
# or rejects the whole block of moves using e_total
mtsmc = MTSMC(mc, e_fast.function(), 500)

mtsmc.setEnergyComponent(e_total.function())

PDB().write(system.info().groups().molecules(), "test000.pdb")

for i in range(1, 21):
    nmoves = 1000

    print("Block %d: Running %d moves" % (i, nmoves))

    timer.start()

    moves = system.run(mtsmc, nmoves)

    ms = timer.elapsed()

    print("%d moves took %d ms" % (nmoves, ms))

    PDB().write(system.info().groups().molecules(), "test%3.3d.pdb" % i)

mtsmc = moves.moves()[0].clone()

print("%d accepted, %d rejected, ratio == %f %%" % (mtsmc.nAccepted(), mtsmc.nRejected(), mtsmc.acceptanceRatio()))

# check that the QM and MM energies have been conserved...
new_molpro = MolproFF(space, switchfunc)
new_molpro.setMolproExe(qmff.molproExe())
new_molpro.setEnergyOrigin(qmff.energyOrigin())
开发者ID:Alwnikrotikz,项目名称:sire,代码行数:33,代码来源:mtsmc.py

示例2: RigidBodyMC

# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import run [as 别名]
mc = RigidBodyMC( UniformSampler(all_mols) )
mc.setMaximumTranslation( 0.1 * angstrom )

volmc = VolumeMove( MapAsMolecules(all_mols) )
volmc.setVolumeChangingFunction( UniformVolumeChange(50 * angstrom3) )

moves = WeightedMoves()

moves.add(mc, 125)
moves.add(volmc, 1)

for i in range(1,1001):
    print("Running block %d" % i)
    timer.start()
    moves = system.run(moves, 100000)
    
    print("Took %d ms" % timer.elapsed())
    print("Energy = %f | Volume = %f" % (system.forceFields().energy(),    
                                         system.info().space().volume()))
                                         
    print("MC Accept %d Reject %d" % (moves.moves()[0].clone().nAccepted(),
                                      moves.moves()[0].clone().nRejected()))
    
    print("VMC Accept %d Reject %d" % (moves.moves()[1].clone().nAccepted(),
                                       moves.moves()[1].clone().nRejected()))
    
    
    
    PDB().write(system.forceFields().molecules(), "test%0004d.pdb" % i)
开发者ID:Alwnikrotikz,项目名称:sire,代码行数:31,代码来源:volumemove.py

示例3: System

# 需要导入模块: from Sire import System [as 别名]
# 或者: from Sire.System import run [as 别名]
system = System(groups, ffields, monitors)

mc = RigidBodyMC( UniformSampler(solute) )

mc.setTemperature( 25 * celsius )
mc.setMaximumTranslation( 0.3 * angstrom )

#for i in range(0,50):
#    moves = system.run(mc, 10000)
#
#    mc = moves.moves()[0].clone()
#    print "%d accepted, %d rejected, ratio = %f %%" % \
#             (mc.nAccepted(), mc.nRejected(), 100 * mc.acceptanceRatio())
#         
#    print system.monitors().monitor(ffields.total()).average()


mtsmc = MTSMC(mc, e_fast.function(), 500)
mtsmc.setEnergyComponent(e_slow.function())

for i in range(0,5000):
    moves = system.run(mtsmc, 20)

    mtsmc = moves.moves()[0].clone()
    print("%d accepted, %d rejected, ratio = %f %%" % \
             (mtsmc.nAccepted(), mtsmc.nRejected(), 100 * mtsmc.acceptanceRatio()))
         
    print("AVGENERGY: %f" % system.monitors().monitor(ffields.total()).average())
    print("ENERGY: %f" % system.forceFields().energy())
    sys.stdout.flush()
开发者ID:Alwnikrotikz,项目名称:sire,代码行数:32,代码来源:mtsmc_harmonic.py


注:本文中的Sire.System.run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。