<commit_before>import sys

from ase.build import molecule, fcc111, add_adsorbate
from ase.optimize import QuasiNewton
from ase.constraints import FixAtoms
from ase.calculators.emt import EMT
from ase.vibrations import Vibrations

sys.path.append("../..")

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()

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<commit_msg>add print<commit_after>import sys

from ase.build import molecule, fcc111, add_adsorbate
from ase.optimize import QuasiNewton
from ase.constraints import FixAtoms
from ase.calculators.emt import EMT
from ase.vibrations import Vibrations

sys.path.append("../..")

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()

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
# Inspect the vib modes afterwards
# View post anharmonic modes
{'fraction_non_alphanumeric': 0.1444797819173103, 'fraction_numerical': 0.03134938664243526, 'mean_word_length': 4.840848806366048, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6535248', 'n_tokens_mistral': 914, 'n_tokens_neox': 849, 'n_words': 197}