Skip to content

Commit

Permalink
Since "nzero" may be a little confusing, fcs.cpp was modified
Browse files Browse the repository at this point in the history
so that "nzero" is no longer printed.
Support a new function to print (atomic) participation ratio.
Documents are updated accordingly.
  • Loading branch information
ttadano committed Feb 13, 2015
1 parent 3070f14 commit 635a895
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 19 deletions.
5 changes: 3 additions & 2 deletions alm/fcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ void Fcs::init(){

std::cout << std::endl;
for (i = 0; i < maxorder; ++i) {
std::cout << " Number of " << std::setw(9) << interaction->str_order[i] << " FCs (nzero): " << ndup[i].size();
std::cout << " ( " << nzero[i] << " ) " << std::endl;
std::cout << " Number of " << std::setw(9) << interaction->str_order[i] << " FCs : " << ndup[i].size();
std::cout << std::endl;
// std::cout << " ( " << nzero[i] << " ) " << std::endl;
}
std::cout << std::endl;

Expand Down
12 changes: 7 additions & 5 deletions anphon/phonon_dos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ void Dos::calc_scattering_phase_space_with_Bose_mode(const unsigned int nk, cons
unsigned int i, is, js, k1, k2;
unsigned int iT;
unsigned int ns2 = ns * ns;
double omega1, omega2;
double omega0, omega1, omega2;
double temp;
double ret1, ret2;
double n1, n2, f1, f2;
Expand All @@ -665,6 +665,8 @@ void Dos::calc_scattering_phase_space_with_Bose_mode(const unsigned int nk, cons
for (i = 0; i < nk; ++i) kmap_identity[i] = i;


omega0 = writes->in_kayser(omega);

#pragma omp parallel private(i, is, js, k1, k2, omega1, omega2, energy_tmp, weight)
{
memory->allocate(energy_tmp, 2, nk);
Expand All @@ -682,18 +684,18 @@ void Dos::calc_scattering_phase_space_with_Bose_mode(const unsigned int nk, cons
omega1 = eval[k1][is];
omega2 = eval[k2][js];

energy_tmp[0][k1] = omega1 + omega2;
energy_tmp[1][k1] = omega1 - omega2;
energy_tmp[0][k1] = writes->in_kayser(omega1 + omega2);
energy_tmp[1][k1] = writes->in_kayser(omega1 - omega2);
}

if (smearing_method == -1) {
for (i = 0; i < 2; ++i) {
integration->calc_weight_tetrahedron(nk, kmap_identity, weight[i], energy_tmp[i], omega);
integration->calc_weight_tetrahedron(nk, kmap_identity, weight[i], energy_tmp[i], omega0);
}
} else {
for (i = 0; i < 2; ++i) {
integration->calc_weight_smearing(nk, nk, kmap_identity, weight[i],
energy_tmp[i], omega, smearing_method);
energy_tmp[i], omega0, smearing_method);
}
}

Expand Down
8 changes: 2 additions & 6 deletions anphon/write_phonons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,10 +766,6 @@ void Writes::write_scattering_amplitude()
double dT = system->dT;
unsigned int NT = static_cast<unsigned int>((Tmax - Tmin) / dT) + 1;

// static const double factor = std::pow(time_ry, 4) * 1.0e+48;
// static const double factor = 1.0 / std::pow(Ry_to_kayser, 4.0);
static const double factor = 1.0 / Ry_to_kayser;

double omega;

ofs_w.open(file_w.c_str(), std::ios::out);
Expand Down Expand Up @@ -797,8 +793,8 @@ void Writes::write_scattering_amplitude()
for (j = 0; j < NT; ++j) {
ofs_w << std::setw(5) << i + 1 << std::setw(5) << is + 1 << std::setw(15) << omega;
ofs_w << std::setw(8) << Tmin + static_cast<double>(j) * dT;
ofs_w << std::setw(15) << dos->sps3_with_bose[i][is][j][1] * factor;
ofs_w << std::setw(15) << dos->sps3_with_bose[i][is][j][0] * factor;
ofs_w << std::setw(15) << dos->sps3_with_bose[i][is][j][1];
ofs_w << std::setw(15) << dos->sps3_with_bose[i][is][j][0];
ofs_w << std::endl;
}
ofs_w << std::endl;
Expand Down
33 changes: 28 additions & 5 deletions docs/source/formalism/formalism_anphon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,27 @@ In addition, ``TDOS``-tag is available to compute the two-phonon DOS defined by
where :math:`\boldsymbol{G}` is a reciprocal lattice vector. The sign :math:`\pm` correspond to absorption and emission processes, respectively. Please note that the computation of the two-phonon DOS can be expensive
especially when :math:`N_{q}` or :math:`N_{\kappa}` is large.


(Atomic) participation ratio
----------------------------

Participation ratio (PR) and atomic participation ratio (APR) defined in the following may be useful to analyze the localized nature of the phonon mode :math:`\boldsymbol{q}j`.

* Participation ratio (PR)

.. math::
PR_{\boldsymbol{q}j} = \left(\sum_{\kappa}^{N_{\kappa}} \frac{|\boldsymbol{e}(\kappa;\boldsymbol{q}j)|^{2}}{M_{\kappa}}\right)^{2} \Bigg/
N_{\kappa} \sum_{\kappa}^{N_{\kappa}} \frac{|\boldsymbol{e}(\kappa;\boldsymbol{q}j)|^{4}}{M_{\kappa}^{2}}
* Atomic participation ratio (APR)

.. math::
APR_{\boldsymbol{q}j,\kappa} = \frac{|\boldsymbol{e}(\kappa;\boldsymbol{q}j)|^{2}}{M_{\kappa}} \Bigg/ \left( N_{\kappa} \sum_{\kappa}^{N_{\kappa}} \frac{|\boldsymbol{e}(\kappa;\boldsymbol{q}j)|^{4}}{M_{\kappa}^{2}} \right)^{1/2}
For an extended eigenmode, the PR value is of order 1, whereas for a localized eigenmodes PR is of order :math:`1/N_{\kappa}` [3]_. APR is an atomic decomposition of PR that satisfies :math:`PR_{\boldsymbol{q}j} = \sum_{\kappa} (APR_{\boldsymbol{q}j,\kappa})^{2}`. To print the PR and APR, please set ``MODE = phonons`` and ``PRINTPR = 1`` in the ``&analysis`` entry field.

Scattering phase space
-----------------------

Expand Down Expand Up @@ -201,7 +222,7 @@ which is given by
&= \sum_{\ell^{\prime\prime},\kappa^{\prime\prime},\lambda}\Phi_{\mu\nu\lambda}(\ell\kappa;\ell^{\prime}\kappa^{\prime};\ell^{\prime\prime}\kappa^{\prime\prime})r_{\lambda}(\ell^{\prime\prime}\kappa^{\prime\prime}).
\end{align}
Please set ``GRUNEISEN = 1`` and give an appropriate ``FCSXML`` file containing cubic IFCs to print Gr|umulaut_u|neisen parameters.
Please set ``GRUNEISEN = 1`` and give an appropriate ``FCSXML`` file containing cubic IFCs to print Gr\ |umulaut_u|\ neisen parameters.


Anharmonic self-energy
Expand Down Expand Up @@ -251,7 +272,7 @@ To disable the reduction, please set ``TRISYM = 0``.
Isotope scattering
------------------

The effect of isotope scatterings can be considered by the mass perturbation approach proposed by S. Tamura [3]_ by the ``ISOTOPE``-tag.
The effect of isotope scatterings can be considered by the mass perturbation approach proposed by S. Tamura [4]_ by the ``ISOTOPE``-tag.
The corresponding phonon linewidth is given by

.. math::
Expand Down Expand Up @@ -316,7 +337,7 @@ such as phonon DOS or energy conservation surface related to three-phonon proces
enough to avoid unscientific oscillations. Choosing appropriate value for :math:`\epsilon` is not a trivial task
since it may depend on the phonon structure and the density of :math:`\boldsymbol{q}` points.

To avoid such issues, the program *anphon* employs the tetrahedron method [4]_ by default (``ISMEAR = -1``)
To avoid such issues, the program *anphon* employs the tetrahedron method [5]_ by default (``ISMEAR = -1``)
for numerical evaluations of Brillouin zone integration containing :math:`\delta(\omega)`.
When the tetrahedron method is used, the ``EPSILON``-tag is neglected.
We recommend to use the tetrahedron method whenever possible, even though it may slightly increase the computational cost.
Expand All @@ -327,6 +348,8 @@ We recommend to use the tetrahedron method whenever possible, even though it may
.. [2] Y\. Wang *et al.*, J. Phys.: Condens. Matter **22**, 202201 (2010).
.. [3] S\. -I. Tamura, Phys. Rev. B **27**, 858 (1983).
.. [3] J\. Hafner and M. Krajci, J. Phys.: Condens. Matter **5**, 2489 (1993).
.. [4] S\. -I. Tamura, Phys. Rev. B **27**, 858 (1983).
.. [4] P\. E. Bl\ |umulaut_o|\ chl, O. Jepsen, and O. K. Andersen, Phys. Rev. B **49**, 1450555 (1994).
.. [5] P\. E. Bl\ |umulaut_o|\ chl, O. Jepsen, and O. K. Andersen, Phys. Rev. B **49**, 1450555 (1994).
15 changes: 15 additions & 0 deletions docs/source/input/inputanphon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,21 @@ The first entry **KPMODE** specifies the types of calculation which is followed
:Description: This flag is available only when ``KPMODE = phonons`` and *KPMODE* = 2.


````

* PRINTPR-tag = 0 | 1

=== ====================================================================================
0 Do not compute the (atomic) participation ratio
1 Compute participation ratio and atomic participation ratio, which will be
stored in ``PREFIX``.pr and ``PREFIX``.apr respectively.
=== ====================================================================================

:Default: 0
:Type: Integer
:Description: This flag is available when ``KPMODE = phonons``.


````

* ISOTOPE-tag = 0 | 1
Expand Down
12 changes: 11 additions & 1 deletion docs/source/output.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,21 @@ Output files of anphon
Mean-square-displacements of atoms.
Created when ``MODE = phonons`` with **KPMODE** = 2 and ``PRINTMSD = 1``.

* ``PREFIX``.sps
* ``PREFIX``.sps

Total and mode-decomposed scattering phase space.
Created when ``MODE = phonons`` with **KPMODE** = 2 and ``SPS = 1``.

* ``PREFIX``.pr

Participation ratio of every phonon modes.
Created when ``MODE = phonons`` and ``PRINTPR = 1``.

* ``PREFIX``.apr

Atomic participation ratio of every phonon modes.
Created when ``MODE = phonons`` and ``PRINTPR = 1``.

* ``PREFIX``.phvel

Phonon group velocity along given :math:`k` paths.
Expand Down

0 comments on commit 635a895

Please sign in to comment.