Octopus
phonon_modes_oct_m Module Reference

This module provides a class for (classical) phonon modes. More...

Detailed Description

This module provides a class for (classical) phonon modes.

Data Types

type  phonon_modes_t
 This class describes phonon modes, which are specified by their frequencies and eigenvectors. More...
 

Functions/Subroutines

subroutine phonon_modes_init (this, namespace, dim_space, num_atoms, periodic, masses)
 Initialize the phonon modes. More...
 
subroutine phonon_modes_get_displacements (this, imode, Q, P, pos_disp_flat, vel_disp_flat)
 get the displacements for a single mode and the respective generalized coordinates. More...
 
subroutine phonon_modes_sample (this, temperature, seed, pos_displacements, vel_displacements)
 Sample initial ionic displacements and velocities from the Wigner distribution of the modes. More...
 
subroutine next_data_line (iunit, line, filename, namespace, eof)
 Read the next line that is neither blank nor a # comment. More...
 
subroutine phonon_modes_finalize (this)
 

Function/Subroutine Documentation

◆ phonon_modes_init()

subroutine phonon_modes_oct_m::phonon_modes_init ( class(phonon_modes_t), intent(inout)  this,
type(namespace_t), intent(in)  namespace,
integer, intent(in)  dim_space,
integer, intent(in)  num_atoms,
logical, intent(in)  periodic,
real(real64), dimension(:), intent(in)  masses 
)
private

Initialize the phonon modes.

Read information from a file

Parameters
[in]massesatomic masses in AMU, in file atom order

Definition at line 159 of file phonon_modes.F90.

◆ phonon_modes_get_displacements()

subroutine phonon_modes_oct_m::phonon_modes_get_displacements ( class(phonon_modes_t), intent(in)  this,
integer, intent(in)  imode,
real(real64), intent(in)  Q,
real(real64), intent(in)  P,
real(real64), dimension(1:this%dim), intent(out)  pos_disp_flat,
real(real64), dimension(1:this%dim), intent(out)  vel_disp_flat 
)
private

get the displacements for a single mode and the respective generalized coordinates.

Parameters
[out]pos_disp_flatin atomic units
[out]vel_disp_flatin atomic units

Definition at line 394 of file phonon_modes.F90.

◆ phonon_modes_sample()

subroutine phonon_modes_oct_m::phonon_modes_sample ( class(phonon_modes_t), intent(in)  this,
real(real64), intent(in)  temperature,
integer(int64), intent(in)  seed,
real(real64), dimension(:, :), intent(out)  pos_displacements,
real(real64), dimension(:, :), intent(out)  vel_displacements 
)
private

Sample initial ionic displacements and velocities from the Wigner distribution of the modes.

Implements the sampling prescription of the interface notes "Octopus-PhonoPy interface for multi-trajectory runs" (see doc/implementation_notes/):

\[ \delta R = N_p^{-1/2} (M_0/M)^{1/2} \sum_m \alpha_m \tilde{l}_m W_m \tilde{x}_m, \qquad \delta \dot{R} = N_p^{-1/2} (M_0/M)^{1/2} \sum_m \omega_m \alpha_m \tilde{l}_m W_m \tilde{r}_m, \]

with \( \tilde{x}_m, \tilde{r}_m \) sampled as independent Gaussians of variance \( (1 + 2n_m)/2 = \coth(\omega_m / 2 k_B T)/2 \) and \( M_0 \) = 1 AMU. The per-mode factors \( \alpha_m = g_m^{-1/2} \) are carried by the phonon file.

Parameters
[in]temperaturein Kelvin
[in]seedseed for the random sampling; must be non-zero
[out]pos_displacements(1:dim_space, 1:num_atom), atomic units
[out]vel_displacements(1:dim_space, 1:num_atom), atomic units

Definition at line 420 of file phonon_modes.F90.

◆ next_data_line()

subroutine phonon_modes_oct_m::next_data_line ( integer, intent(in)  iunit,
character(len=*), intent(out)  line,
character(len=*), intent(in)  filename,
type(namespace_t), intent(in)  namespace,
logical, intent(out), optional  eof 
)
private

Read the next line that is neither blank nor a # comment.

End of file is fatal, unless eof is present, in which case it is returned there.

Definition at line 493 of file phonon_modes.F90.

◆ phonon_modes_finalize()

subroutine phonon_modes_oct_m::phonon_modes_finalize ( type(phonon_modes_t), intent(inout)  this)
private

Definition at line 526 of file phonon_modes.F90.