The euphonic-brille-convergence
program is useful for determining grid density or number of grid points that should be used in :py:meth:`BrilleInterpolator.from_force_constants <euphonic.brille.BrilleInterpolator.from_force_constants>` to achieve the desired accuracy.
It requires a force constants file as input. By default will create a Brille trellis grid with approximately 5000 grid points, and use this grid to calculate q-point frequencies and eigenvectors at 1000 quasirandom q-points, comparing these to the Euphonic-calculated frequencies and eigenvectors for the same 1000 points.
The comparison is shown in 3 figures:
- A scatter plot showing the difference between Euphonic-interpolated and Brille-interpolated frequencies (the frequency residual)
- A 3D scatter plot showing the difference between the structure factors calculated from the Euphonic-interpolated and Brille-interpolated frequencies and eigenvectors (the structure factor residual)
- A line plot with 2 axes. The top axis is a line plot of the 1D-averaged intensity calculated from the Euphonic-interpolated and Brille-interpolated frequencies and eigenvectors for the 1000 quasirandom q-points. The bottom axis shows the difference between the Euphonic 1D average and the Brille 1D average (the residual).
Additionally, there may some extra figures, depending on the value of the -n
argument (default 0):
- A line plot with 2 axes. The top axis shows a line plot of the intensity for a particular q-point (not 1D-averaged) calculated from the Euphonic-interpolated and Brille-interpolated frequencies and eigenvectors. The bottom axis shows the difference between the Euphonic intensity and the Brille intensity (the residual).
The --brille-npts
or --brille-npts-density
arguments can be used to change the number or number density of Brille grid points respectively.
Note that one or the other should be used, not both.
Multiple values can be used for each of these to see the convergence between Euphonic-interpolated and Brille-interpolated values as the number of Brille grid points changes, so can be used to decide which is sufficient for the required accuracy.
Each provided value will add an extra series to the figures above.
An example for La2Zr2O7 showing 1 extra figure and 3 different Brille grid sizes is shown below:
euphonic-brille-convergence La2Zr2O7.castep_bin -n 1 --brille-npts 500 2500 5000
To see all the command line options, run:
euphonic-brille-convergence -h
You can also see the available command line options below. For more information on how Euphonic and Brille work together, see see :ref:`Brille Interpolator <brille-interpolator>`.
.. argparse::
:module: euphonic.cli.brille_convergence
:func: get_parser
:prog: euphonic-brille-convergence