The BrillEu class

Define a class BrillEu to act as the interface between brille and Euphonic. Thus enabling efficient interpolation of CASTEP-derived phonons at arbitrary Q points.

class brilleu.BrillEu(FCData, Grid, crystal, scattering_lengths=None, parallel=False, log=None, emit=None, **kwds)

Efficient interpolation of phonon intensity at arbitrary Q points.

The Euphonic data classes can be used to, e.g., interpolate dynamical force matrices at arbitary Q points. It can then use that information to determine eigen values (squared excitation energy) and eigen vectors (atom displacements) for the 3×[number of atoms] phonon branches. Finally Q and the eigen vectors can be used to determine the structure factors of the phonon branches, which are proportional to the doubly-differential cross section measured by neutron scattering.

brille provides classes to hold arbitrarily-shaped data at the points of a grid filling the first irreducible Brillouin zone of the primitive lattice reciprocal unit cell. The classes can then use linear interpolation to estimate their held-data at points between grid-points, the translational and rotational symmetry of the lattice to find an equivalent first-irreducible-Brillouin-zone point, q, for any arbitrary reciprocal space point, Q.

The BrillEu object must be constructed with the symmetry information of its lattice. The symmetry operators can be read from a CASTEP file or a Hall symbol can be read from a Phonopy summary file. In either case the symmetry information is used to construc a first irreducible Brillouin zone which is used to define the boundary of a brille grid object. The gridded-points are then used by the Euphonic object to calculate ωᵢ(q) and ϵᵢⱼ(q), which are placed in the brille object at their respective grid points. When an external request is made to the BrillEu object to calculate Sᵢ(Q) it first uses the filled brille object to interpolate ωᵢ(Q) and ϵᵢⱼ(Q) and then converts Q and ϵᵢⱼ(Q) into Sᵢ(Q). The more-likely use for BrillEu, however, will be in calculating S(Q,ω) in which case ωᵢ(Q) and Sᵢ(Q) are calculated as above and then a simple distribution (selected by the caller) is used to broaden each of the i phonon branches before combining their intensities.

dw(q_hkl, temperature=0)

Calculates the Debye-Waller factor using the Brillouin zone grid.

classmethod from_castep(filename, **kwds)

Wrapper for euphonic.force_constants.ForceConstants.from_castep()

Pulls euphonic.force_constants.ForceConstants from the binary CASTEP file provided then uses custom reader to extract symmetry operations as well.

classmethod from_forceconstants(fc, irreducible=True, hall=None, symmetry=None, mesh=None, nest=None, **kwds)

Common constructor which builds brille grid

Parameters
  • fc (euphonic.force_constants.ForceConstants) – The force constants obtained from Euphonic

  • hall (str or int, optional) – A valid Hall symbol or (deprecated) Spglib Hall number encoding the symmetry operations of the spacegroup

  • symmetry (brille.Symmetry, optional) – The spacegroup symmetry operations or their generators

  • mesh (logical, optional) – Construct a brille.BZMeshQdc grid

  • nest (logical , optional) – Construct a brille.BZNestQdc grid

  • **kwds – passed to constructor of grid object and class constructor brilleu.brilleu.BrillEu

Returns

Return type

brilleu.brilleu.BrillEu

Note

If both mesh and nest are not True a brille.BZTrellisQdc will be created. This is the default behaviour.

classmethod from_phonopy(path='.', summary_name='phonopy.yaml', **kwds)

Wrapper for euphonic.force_constants.ForceConstants.from_phonopy()

Pulls euphonic.force_constants.ForceConstants from the Phonopy file(s) provided then pulls Hall symbol from the summary file.

s_q(q_hkl, interpolate=True, **kwargs)

Calculate Sᵢ(Q) where Q = (q_h,q_k,q_l).

s_qw(q_hkl, energy, p_dict)

Calculate \(S(\mathbf{Q},E)\) including an energy linewidth.

Parameters
  • q_hkl (\(N\times 3\) numpy.ndarray) – The positions in reciprocal lattice units where the phonon spectral weight should be determined

  • energy (\(N\) numpy.ndarray) – The energies at which the phonon spectral weight should be determined

  • calc_bose (logical, optional) – Whether a Bose-factor correction should be applied

  • temperature (float, optional, default = 5 K) – The temperature used in the Bose and Debye-Waller calculation

  • unique_q (logical, optional, default False) – If True the input q_hkl are reduced to only unique vectors before calling brilleu.brilleu.BrillEu.s_q()

  • resfun (str, optional, default δ(ω-ωᵢ)) – (energy) resolution function used in broadening modes. See below.

  • param (float array-like (required if resfun provided)) – parameters for the broading resolution function

Note

Selecting the energy linewidth function:

Linewidth function

resfun (one of)

param

Simple Harmonic Oscillator

‘sho’, ‘s’

fwhm

Gaussian

‘gauss’, ‘g’

fwhm

Lorentzian

‘lorentz’, ‘lor’, ‘l’

fwhm

Voigt

‘voi’, ‘v’

[g_fwhm, l_fwhm]

For each linewidth function, the full name is also a valid value for resfun, e.g., ‘resfun’: ‘Simple Harmonic Oscillator’. Functions taking a single param value will use the first element in any non-scalar value. The Simple Harmonic Oscillator function also uses the temperature key in p_dict to optionally include the temperature.

Returns

A vector with \(S(\mathbf{Q},E)\)

Return type

\(N\) numpy.ndarray

w_q(q_pt, **kwds)

Variant of brilleu.brilleu.BrillEu.QPointPhononModes()

See brilleu.brilleu.BrillEu.QPointPhononModes() for possible input.

Returns

Only the determined eigenvalues

Return type

numpy.ndarray

class brilleu.brilleu.BrQωε(Q, ω, ε, Wd=None, T=None)

Similar to a euphonic.qpoint_phonon_modes.QpointPhononModes

This object holds the results of the brille.brille.BrillEu.QpointPhononModes() calculation in such a way that the phonon structure factor can be easily calculated.

calculate_structure_factor(crystal, scattering_lengths, **kwargs)

Calculate the one phonon inelastic neutron scattering dynamic structure factor

Adapted from the euphonic.structure_factor.StructureFactor constructor.

Parameters
  • crystal (euphonic.Crystal) – A valid Crystal object to provide atoms, masses, and positions, needed to produce output object

  • scattering_lengths (dictionary of str : float) – Dictionary of spin and isotope averaged coherent scattering lengths for each element in the structure, with lengths in fm.

Returns

Return type

euphonic.structure_factor.StructureFactor

class brilleu.brilleu.BrillEu(FCData, Grid, crystal, scattering_lengths=None, parallel=False, log=None, emit=None, **kwds)

Efficient interpolation of phonon intensity at arbitrary Q points.

The Euphonic data classes can be used to, e.g., interpolate dynamical force matrices at arbitary Q points. It can then use that information to determine eigen values (squared excitation energy) and eigen vectors (atom displacements) for the 3×[number of atoms] phonon branches. Finally Q and the eigen vectors can be used to determine the structure factors of the phonon branches, which are proportional to the doubly-differential cross section measured by neutron scattering.

brille provides classes to hold arbitrarily-shaped data at the points of a grid filling the first irreducible Brillouin zone of the primitive lattice reciprocal unit cell. The classes can then use linear interpolation to estimate their held-data at points between grid-points, the translational and rotational symmetry of the lattice to find an equivalent first-irreducible-Brillouin-zone point, q, for any arbitrary reciprocal space point, Q.

The BrillEu object must be constructed with the symmetry information of its lattice. The symmetry operators can be read from a CASTEP file or a Hall symbol can be read from a Phonopy summary file. In either case the symmetry information is used to construc a first irreducible Brillouin zone which is used to define the boundary of a brille grid object. The gridded-points are then used by the Euphonic object to calculate ωᵢ(q) and ϵᵢⱼ(q), which are placed in the brille object at their respective grid points. When an external request is made to the BrillEu object to calculate Sᵢ(Q) it first uses the filled brille object to interpolate ωᵢ(Q) and ϵᵢⱼ(Q) and then converts Q and ϵᵢⱼ(Q) into Sᵢ(Q). The more-likely use for BrillEu, however, will be in calculating S(Q,ω) in which case ωᵢ(Q) and Sᵢ(Q) are calculated as above and then a simple distribution (selected by the caller) is used to broaden each of the i phonon branches before combining their intensities.

dw(q_hkl, temperature=0)

Calculates the Debye-Waller factor using the Brillouin zone grid.

classmethod from_castep(filename, **kwds)

Wrapper for euphonic.force_constants.ForceConstants.from_castep()

Pulls euphonic.force_constants.ForceConstants from the binary CASTEP file provided then uses custom reader to extract symmetry operations as well.

classmethod from_forceconstants(fc, irreducible=True, hall=None, symmetry=None, mesh=None, nest=None, **kwds)

Common constructor which builds brille grid

Parameters
  • fc (euphonic.force_constants.ForceConstants) – The force constants obtained from Euphonic

  • hall (str or int, optional) – A valid Hall symbol or (deprecated) Spglib Hall number encoding the symmetry operations of the spacegroup

  • symmetry (brille.Symmetry, optional) – The spacegroup symmetry operations or their generators

  • mesh (logical, optional) – Construct a brille.BZMeshQdc grid

  • nest (logical , optional) – Construct a brille.BZNestQdc grid

  • **kwds – passed to constructor of grid object and class constructor brilleu.brilleu.BrillEu

Returns

Return type

brilleu.brilleu.BrillEu

Note

If both mesh and nest are not True a brille.BZTrellisQdc will be created. This is the default behaviour.

classmethod from_phonopy(path='.', summary_name='phonopy.yaml', **kwds)

Wrapper for euphonic.force_constants.ForceConstants.from_phonopy()

Pulls euphonic.force_constants.ForceConstants from the Phonopy file(s) provided then pulls Hall symbol from the summary file.

s_q(q_hkl, interpolate=True, **kwargs)

Calculate Sᵢ(Q) where Q = (q_h,q_k,q_l).

s_qw(q_hkl, energy, p_dict)

Calculate \(S(\mathbf{Q},E)\) including an energy linewidth.

Parameters
  • q_hkl (\(N\times 3\) numpy.ndarray) – The positions in reciprocal lattice units where the phonon spectral weight should be determined

  • energy (\(N\) numpy.ndarray) – The energies at which the phonon spectral weight should be determined

  • calc_bose (logical, optional) – Whether a Bose-factor correction should be applied

  • temperature (float, optional, default = 5 K) – The temperature used in the Bose and Debye-Waller calculation

  • unique_q (logical, optional, default False) – If True the input q_hkl are reduced to only unique vectors before calling brilleu.brilleu.BrillEu.s_q()

  • resfun (str, optional, default δ(ω-ωᵢ)) – (energy) resolution function used in broadening modes. See below.

  • param (float array-like (required if resfun provided)) – parameters for the broading resolution function

Note

Selecting the energy linewidth function:

Linewidth function

resfun (one of)

param

Simple Harmonic Oscillator

‘sho’, ‘s’

fwhm

Gaussian

‘gauss’, ‘g’

fwhm

Lorentzian

‘lorentz’, ‘lor’, ‘l’

fwhm

Voigt

‘voi’, ‘v’

[g_fwhm, l_fwhm]

For each linewidth function, the full name is also a valid value for resfun, e.g., ‘resfun’: ‘Simple Harmonic Oscillator’. Functions taking a single param value will use the first element in any non-scalar value. The Simple Harmonic Oscillator function also uses the temperature key in p_dict to optionally include the temperature.

Returns

A vector with \(S(\mathbf{Q},E)\)

Return type

\(N\) numpy.ndarray

w_q(q_pt, **kwds)

Variant of brilleu.brilleu.BrillEu.QPointPhononModes()

See brilleu.brilleu.BrillEu.QPointPhononModes() for possible input.

Returns

Only the determined eigenvalues

Return type

numpy.ndarray

brilleu.brilleu.getBrillEuObj(*args, **kwds)

For loading local directory or fetching from remote repository into a BrillEu object

See brilleu.utilities.getObjType() for details.