示例#1
0
constraint = FixAtoms(mask=[a.symbol == 'Al' for a in slab])
slab.set_constraint(constraint)

slab.set_calculator(EMT())

dyn = QuasiNewton(slab)
dyn.run(fmax=0.05)

# Running vibrational analysis
vib = Vibrations(slab, indices=[8, 9, 10, 11])
vib.run()
vib.summary()

print('\n >> Anharmonics <<\n')

AM = AnharmonicModes(vibrations_object=vib, settings={'plot_mode': True})

rot_mode = AM.define_rotation(basepos=[0., 0., -1.],
                              branch=[9, 10, 11],
                              symnumber=3)
AM.clean()
AM.run()
AM.inspect_anmodes()
AM.pre_summary()
AM.summary()
AM.write_h_spacemodes()

# self.reduced_h_modes
# Inspect the vib modes afterwards
# View post anharmonic modes
slab = fcc111('Au', size=(2, 2, 2), vacuum=4.0)
H = molecule('H')
add_adsorbate(slab, H, 3.0, 'ontop')

constraint = FixAtoms(mask=[a.symbol == 'Au' for a in slab])
slab.set_constraint(constraint)
slab.set_calculator(EMT())

dyn = QuasiNewton(slab, logfile='/dev/null')
dyn.run(fmax=0.05)

vib = Vibrations(slab, indices=[8])
vib.run()
vib.summary(log='/dev/null')
vib.clean()

AM = AnharmonicModes(vibrations_object=vib)

translational_mode = AM.define_translation(
    from_atom_to_atom=[4, 6]  # move from top position on 4 to 6
)
AM.run()
AM.summary(log='/dev/null')
AM.clean()

# print(AM.get_ZPE(), AM.get_entropic_energy())
assert abs(AM.get_ZPE() - 0.168) < 1e-3, AM.get_ZPE()
assert abs(AM.get_entropic_energy() - (0.0293)) < 1e-3, (
    AM.get_entropic_energy())
vib = Vibrations(slab, indices=[8])
vib.run()
vib.summary()

# Here the number of initial sampling points are increased such
# that the potential energy surface of the translation comes
# out looking good.
# The result with the default value of 5 (not setting n_initial),
# will be a potential energy surface that is well fitted,
# but the thermodynamical properties are converged.
# This is therefore only for illustration.

AM = AnharmonicModes(
    vibrations_object=vib,
    pre_names='an_mode_relax_',
    settings={
        'plot_mode': True,
        'n_initial': 10,
    })

# Translation by moving from top position on 4 to 6
AM.define_translation(
    from_atom_to_atom=[4, 6],
    relax_axis=[0, 0, 1])
AM.clean()
AM.inspect_anmodes()  # creates trajectory file
AM.run()
AM.pre_summary()
AM.summary()

# Delete all the generated files
示例#4
0
H2 = molecule('H2')
H2.set_calculator(EMT())
dyn = QuasiNewton(H2)
dyn.run(fmax=0.05)

vib = Vibrations(H2, indices=[0, 1])

vib.run()

vib.summary()

print('\n >> Anharmonics 1000k sampling up to 0.25 kT<<\n')

AM = AnharmonicModes(vib,
                     settings={
                         'temperature': 1000,
                         'plot_mode': True
                     })

vib_mode = AM.define_vibration(mode_number=-1)

AM.run()
AM.inspect_anmodes()
AM.summary()

print('\n >> Anharmonics 1000k with initial estimated out to 1.0 kT<<\n')

AM = AnharmonicModes(vib,
                     pre_names='an_mode_1000K_',
                     settings={
                         'temperature': 1000,
slab.set_calculator(EMT())

dyn = QuasiNewton(slab)
dyn.run(fmax=0.05)

# Running vibrational analysis
vib = Vibrations(slab, indices=[8, 9, 10, 11])
vib.run()
vib.summary()

print('\n >> Anharmonics <<\n')

AM = AnharmonicModes(
    vibrations_object=vib,
    settings={
        'plot_mode': True,
        'overlap_print': 1})

rot_mode = AM.define_rotation(
    basepos=[0., 0., -1.],
    branch=[9, 10, 11],
    symnumber=3)
AM.clean()
AM.run()
AM.inspect_anmodes()
AM.pre_summary()
AM.summary()
AM.write_h_spacemodes()

# self.reduced_h_modes
示例#6
0
add_adsorbate(slab, H, 3.0, 'ontop')

constraint = FixAtoms(mask=[a.symbol == 'Au' for a in slab])
slab.set_constraint(constraint)

slab.set_calculator(EMT())

QuasiNewton(slab).run(fmax=0.001)

vib = Vibrations(slab, indices=[8])
vib.run()
vib.summary()
vib.clean()

AM = AnharmonicModes(vibrations_object=vib, settings={
    'plot_mode': True,
})

for i in range(len(vib.hnu)):
    AM.define_vibration(mode_number=-1)

AM.inspect_anmodes()
AM.run()
AM.summary()
AM.clean()

print(AM.get_ZPE(), AM.get_entropic_energy())
# assert abs(AM.get_ZPE() - 0.243) < 1e-3, AM.get_ZPE()
# assert abs(AM.get_entropic_energy() - (-0.000)) < 1e-3, (
#     AM.get_entropic_energy())
constraint = FixAtoms(mask=[a.symbol == 'Au' for a in slab])
slab.set_constraint(constraint)

slab.set_calculator(EMT())

dyn = QuasiNewton(slab)
dyn.run(fmax=0.05)

# Running vibrational analysis

vib = Vibrations(slab, indices=[8])
vib.run()
vib.summary()

AM = AnharmonicModes(vibrations_object=vib,
                     settings={
                         'plot_mode': True,
                         'use_force_consistent': True
                     })

# Translation by moving from top position on 4 to 6
AM.define_translation(from_atom_to_atom=[4, 6])
AM.inspect_anmodes()  # creates trajectory file
AM.run()
AM.pre_summary()
AM.summary()

# Delete all the generated files
# vib.clean()
# AM.clean()
示例#8
0
from __init__ import AnharmonicModes

slab = fcc111('Al', size=(2, 2, 2), vacuum=3.0)
CH3 = molecule('CH3')
add_adsorbate(slab, CH3, 2.5, 'ontop')

constraint = FixAtoms(mask=[a.symbol == 'Al' for a in slab])
slab.set_constraint(constraint)

slab.set_calculator(EMT())

dyn = QuasiNewton(slab)
dyn.run(fmax=0.05)

# Running vibrational analysis
vib = Vibrations(slab, indices=[8, 9, 10, 11])
vib.run()
vib.summary()

AM = AnharmonicModes(vibrations_object=vib)
vib_mode = AM.define_vibration(mode_number=-1)

AM.inspect_anmodes()  # creates trajectory file
AM.run()
AM.pre_summary()
AM.summary()

# Delete all the generated files
# vib.clean()
# AM.clean()
H = molecule('H')
add_adsorbate(slab, H, 3.0, 'ontop')

constraint = FixAtoms(mask=[a.symbol == 'Au' for a in slab])
slab.set_constraint(constraint)

slab.set_calculator(EMT())

QuasiNewton(slab).run(fmax=0.001)

vib = Vibrations(slab, indices=[8])
vib.run()
vib.summary()
vib.clean()

AM = AnharmonicModes(vibrations_object=vib, settings={
    'plot_mode': True,
})

for i in range(len(vib.hnu)):
    AM.define_vibration(mode_number=-1)

AM.inspect_anmodes()
AM.run()
AM.summary()
AM.clean()

assert abs(AM.get_ZPE() - 0.601) < 1e-3, AM.get_ZPE()
assert abs(AM.get_entropic_energy() -
           (-0.000)) < 1e-3, (AM.get_entropic_energy())
示例#10
0
vib = Vibrations(slab, indices=[8])
vib.run()
vib.summary()

# Here the number of initial sampling points are increased such
# that the potential energy surface of the translation comes
# out looking good.
# The result with the default value of 5 (not setting n_initial),
# will be a potential energy surface that is well fitted,
# but the thermodynamical properties are converged.
# This is therefore only for illustration.

AM = AnharmonicModes(vibrations_object=vib,
                     pre_names='an_mode_relax_',
                     settings={
                         'plot_mode': True,
                         'n_initial': 10,
                     })

# Translation by moving from top position on 4 to 6
AM.define_translation(from_atom_to_atom=[4, 6], relax_axis=[0, 0, 1])
AM.clean()
AM.inspect_anmodes()  # creates trajectory file
AM.run()
AM.pre_summary()
AM.summary()

# Delete all the generated files
# vib.clean()
# AM.clean()
示例#11
0
vib.summary()
vib.write_mode()

print('\n >> Anharmonics <<\n')

AM = AnharmonicModes(
    vibrations_object=vib,
    pre_names='an_mode_',
    settings={
        'use_forces': True,
        # 'plot_mode': True,
        'temperature': 298.15,
        # 'rot_nsamples': 15,
        # 'max_step_iterations': 1,
        # 'min_step_iterations': 1,
        'plot_mode_each_iteration': True,
        # 'rot_nsamples': 9,
        # 'fit_verbose': True,
        'fit_plot_regu_curve_iterations': True,
        'fit_plot_regu_curve': True,
        'fit_forces': False,
        'verbosity': 2,
        'conv_tol': 2e-4,
        # 'fit_max_order': 5,
        # 'fit_pdiff': 2,
    })

# rot_mode = AM.define_rotation(
#     basepos=[0., 0., -1.],
#     branch=[9, 10, 11],
#     symnumber=3)
示例#12
0
slab = fcc111('Au', size=(2, 2, 2), vacuum=4.0)
H = molecule('H')
add_adsorbate(slab, H, 3.0, 'ontop')

constraint = FixAtoms(mask=[a.symbol == 'Au' for a in slab])
slab.set_constraint(constraint)

slab.set_calculator(EMT())

QuasiNewton(slab, logfile='/dev/null').run(fmax=0.05)

vib = Vibrations(slab, indices=[8])
vib.run()
vib.summary(log='/dev/null')
vib.clean()

AM = AnharmonicModes(vibrations_object=vib)

AM.define_vibration(mode_number=-1)
AM.define_translation(from_atom_to_atom=[4, 6])

# AM.inspect_anmodes()  # creates trajectory file
AM.run()
AM.summary(log='/dev/null')
AM.clean()

assert abs(AM.get_ZPE() - 0.356) < 1e-3, AM.get_ZPE()
assert abs(AM.get_entropic_energy() -
           (-0.0217)) < 1e-3, (AM.get_entropic_energy())
示例#13
0
from __init__ import AnharmonicModes

slab = fcc111('Al', size=(2, 2, 2), vacuum=3.0)
CH3 = molecule('CH3')
add_adsorbate(slab, CH3, 2.5, 'ontop')

constraint = FixAtoms(mask=[a.symbol == 'Al' for a in slab])
slab.set_constraint(constraint)
slab.set_calculator(EMT())

dyn = QuasiNewton(slab, logfile='/dev/null')
dyn.run(fmax=0.05)

vib = Vibrations(slab, indices=[8, 9, 10, 11])
vib.run()
vib.summary(log='/dev/null')
vib.clean()

AM = AnharmonicModes(vibrations_object=vib)
rot_mode = AM.define_rotation(basepos=[0., 0., -1.],
                              branch=[9, 10, 11],
                              symnumber=3)

AM.run()
AM.summary(log='/dev/null')
AM.clean()

assert abs(AM.get_ZPE() - 0.405) < 1e-3, AM.get_ZPE()
assert abs(AM.get_entropic_energy() -
           (-0.068)) < 1e-3, (AM.get_entropic_energy())
from ase.vibrations import Vibrations

from __init__ import AnharmonicModes

H2 = molecule('H2')
H2.set_calculator(EMT())
dyn = QuasiNewton(H2, logfile='/dev/null')
dyn.run(fmax=0.05)

vib = Vibrations(H2, indices=[0, 1])
vib.run()
vib.summary(log='/dev/null')
vib.clean()

AM = AnharmonicModes(vib,
                     settings={
                         'temperature': 1000,
                     })
vib_mode = AM.define_vibration(mode_number=-1)
AM.run()
AM.summary(log='/dev/null')
AM.clean()

assert abs(AM.get_ZPE() - 0.313) < 1e-3, AM.get_ZPE()
assert abs(AM.get_entropic_energy()) < 1e-3, AM.get_entropic_energy()

AM = AnharmonicModes(vib,
                     settings={
                         'temperature': 1000,
                         'step_multi_kT_disp': 1.0,
                     })
constraint = FixAtoms(mask=[a.symbol == 'Au' for a in slab])
slab.set_constraint(constraint)

slab.set_calculator(EMT())

QuasiNewton(slab).run(fmax=0.001)

vib = Vibrations(slab, indices=[8])
vib.run()
vib.summary()
vib.clean()

AM = AnharmonicModes(
    vibrations_object=vib,
    settings={
        'plot_mode': True,
    })

for i in range(len(vib.hnu)):
    AM.define_vibration(mode_number=-1)

AM.inspect_anmodes()
AM.run()
AM.summary()
AM.clean()

print(AM.get_ZPE(), AM.get_entropic_energy())
# assert abs(AM.get_ZPE() - 0.243) < 1e-3, AM.get_ZPE()
# assert abs(AM.get_entropic_energy() - (-0.000)) < 1e-3, (
#     AM.get_entropic_energy())
slab = fcc111('Au', size=(2, 2, 2), vacuum=4.0)
H = molecule('H')
add_adsorbate(slab, H, 3.0, 'ontop')

constraint = FixAtoms(mask=[a.symbol == 'Au' for a in slab])
slab.set_constraint(constraint)

slab.set_calculator(EMT())

QuasiNewton(slab).run(fmax=0.05)

vib = Vibrations(slab, indices=[8])
vib.run()
vib.summary()
vib.clean()

AM = AnharmonicModes(
    vibrations_object=vib,
    settings={
        'plot_mode': True,
        # 'defined_modes_overlap_tol': 1e-9
    })

AM.define_vibration(mode_number=-1)
AM.define_translation(from_atom_to_atom=[4, 6])

AM.inspect_anmodes()
AM.run()
AM.summary()
# AM.clean()
示例#17
0
from ase.vibrations import Vibrations

from __init__ import AnharmonicModes

H2 = molecule('H2')
H2.set_calculator(EMT())
dyn = QuasiNewton(H2, logfile='/dev/null')
dyn.run(fmax=0.05)

vib = Vibrations(H2, indices=[0, 1])
vib.run()
vib.summary(log='/dev/null')
vib.clean()

AM = AnharmonicModes(vib, settings={
    'temperature': 1000,
})
vib_mode = AM.define_vibration(mode_number=-1)
AM.run()
AM.summary(log='/dev/null')
AM.clean()

assert abs(AM.get_ZPE() - 0.497) < 1e-3, AM.get_ZPE()
assert abs(AM.get_entropic_energy()) < 1e-3, AM.get_entropic_energy()

AM = AnharmonicModes(vib,
                     settings={
                         'temperature': 1000,
                         'step_multi_kT_disp': 1.0,
                     })
示例#18
0
from __init__ import AnharmonicModes

slab = fcc111('Au', size=(2, 2, 2), vacuum=4.0)
H = molecule('H')
add_adsorbate(slab, H, 3.0, 'ontop')

constraint = FixAtoms(mask=[a.symbol == 'Au' for a in slab])
slab.set_constraint(constraint)
slab.set_calculator(EMT())

dyn = QuasiNewton(slab, logfile='/dev/null')
dyn.run(fmax=0.05)

vib = Vibrations(slab, indices=[8])
vib.run()
vib.summary(log='/dev/null')
vib.clean()

AM = AnharmonicModes(vibrations_object=vib)

translational_mode = AM.define_translation(
    from_atom_to_atom=[4, 6]  # move from top position on 4 to 6
)
AM.run()
AM.summary(log='/dev/null')
AM.clean()

assert abs(AM.get_ZPE() - 0.1678) < 1e-3, AM.get_ZPE()
assert abs(AM.get_entropic_energy() -
           (-0.0217)) < 1e-3, (AM.get_entropic_energy())
slab = fcc111('Al', size=(2, 2, 2), vacuum=3.0)
CH3 = molecule('CH3')
add_adsorbate(slab, CH3, 2.5, 'ontop')

constraint = FixAtoms(mask=[a.symbol == 'Al' for a in slab])
slab.set_constraint(constraint)
slab.set_calculator(EMT())

dyn = QuasiNewton(slab, logfile='/dev/null')
dyn.run(fmax=0.05)

vib = Vibrations(slab, indices=[8, 9, 10, 11])
vib.run()
vib.summary(log='/dev/null')
vib.clean()

AM = AnharmonicModes(vibrations_object=vib)
rot_mode = AM.define_rotation(
    basepos=[0., 0., -1.],
    branch=[9, 10, 11],
    symnumber=3)

AM.run()
AM.summary(log='/dev/null')
AM.clean()

# print(AM.get_ZPE(), AM.get_entropic_energy())
assert abs(AM.get_ZPE() - 0.388) < 1e-3, AM.get_ZPE()
assert abs(AM.get_entropic_energy() - (0.091)) < 1e-3, (
    AM.get_entropic_energy())
slab.set_constraint(constraint)

slab.set_calculator(EMT())

dyn = QuasiNewton(slab)
dyn.run(fmax=0.05)

# Running vibrational analysis

vib = Vibrations(slab, indices=[8])
vib.run()
vib.summary()

AM = AnharmonicModes(
    vibrations_object=vib,
    settings={
        'plot_mode': True,
        'use_force_consistent': True
    })

# Translation by moving from top position on 4 to 6
AM.define_translation(from_atom_to_atom=[4, 6])
AM.inspect_anmodes()  # creates trajectory file
AM.run()
AM.pre_summary()
AM.summary()

# Delete all the generated files
# vib.clean()
# AM.clean()