I have followed the tutorial. But the effect of changed mass is not reflected in the vibrational mode. It is showing the mode of H2 molecule only.
Please help to resolve the issue.
# Molecule Configuration
# -------------------------------------------------------------
# Define elements
elements = [Hydrogen, Hydrogen]
# Define coordinates
cartesian_coordinates = [[ 0. , 0. , 0. ],
[ 0. , 0. , 0.75]]*Angstrom
# Set up configuration
molecule_configuration = MoleculeConfiguration(
elements=elements,
cartesian_coordinates=cartesian_coordinates
)
# Define a new class where the H atom has mass 2.00
class H2(Hydrogen):
@staticmethod
def atomicMass():
return 2.00*Units.atomic_mass_unit
PeriodicTable.ALL_ELEMENTS.append(H2)
# Replace all atoms tagged "H2" with hydrogen-2
for index in molecule_configuration.indicesFromTags("H2"):
molecule_configuration.elements()[index] = H2
# Add tags
molecule_configuration.addTags('H2', [0,1])
# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
numerical_accuracy_parameters = NumericalAccuracyParameters(
density_mesh_cutoff=80.0*Hartree,
)
calculator = LCAOCalculator(
numerical_accuracy_parameters=numerical_accuracy_parameters,
)
molecule_configuration.setCalculator(calculator)
nlprint(molecule_configuration)
molecule_configuration.update()
nlsave('D2-vib.hdf5', molecule_configuration)
# -------------------------------------------------------------
# Optimize Geometry
# -------------------------------------------------------------
molecule_configuration = OptimizeGeometry(
molecule_configuration,
max_forces=0.05*eV/Ang,
max_steps=200,
max_step_length=0.2*Ang,
trajectory_filename='D2-dos-vib.hdf',
disable_stress=True,
optimizer_method=LBFGS(),
)
nlsave('D2.nc.dos-vib.hdf5', molecule_configuration)
nlprint(molecule_configuration)
# -------------------------------------------------------------
# Dynamical Matrix
# -------------------------------------------------------------
dynamical_matrix = DynamicalMatrix(
molecule_configuration,
filename='D2-vib.hdf5',
object_id='dynamical_matrix',
repetitions=Automatic,
atomic_displacement=0.01*Angstrom,
acoustic_sum_rule=True,
finite_difference_method=Central,
force_tolerance=1e-08*Hartree/Bohr**2,
processes_per_displacement=1,
log_filename_prefix='forces_displacement_',
use_wigner_seitz_scheme=False,
)
dynamical_matrix.update()
# -------------------------------------------------------------
# Phonon Density Of States
# -------------------------------------------------------------
qpoint_grid = MonkhorstPackGrid()
phonon_density_of_states = PhononDensityOfStates(
configuration=molecule_configuration,
dynamical_matrix=dynamical_matrix,
qpoints=qpoint_grid,
number_of_bands=None,
)
nlsave('D2.nc.dos-vib.hdf5', phonon_density_of_states)
nlprint(phonon_density_of_states)
# -------------------------------------------------------------
# Vibrational Mode
# -------------------------------------------------------------
vibrational_mode = VibrationalMode(
configuration=molecule_configuration,
dynamical_matrix=dynamical_matrix,
kpoint_fractional=[0, 0, 0],
mode_indices=None,
)
nlsave('D2-vib.hdf5', vibrational_mode)