pace-neutrons / Euphonic

Euphonic is a Python package for efficient simulation of phonon bandstructures, density of states and inelastic neutron scattering intensities from force constants.
GNU General Public License v3.0
28 stars 11 forks source link

DOS-neutron weighted #116

Closed davidvoneshen closed 3 years ago

davidvoneshen commented 3 years ago

We have a routine to compute the DOS but not the neutron-weighted DOS which, within the incoherent approximation is what we measure.

The neutron weighted DOS is

pdos

where A is some scaling factor, b_j is the neutron scattering length (it is probably best to subsitute b_j^2 for the total scattering cross section) of the element/isotope, m_j is the mass and PDOSj is its contribution to the DOS.

This is most typically what you see in papers comparing powder data to calculation. When we have proper powder averaging with resolution convolution it will be more accurate to compute that and then integrate it but this is quick, easy and surprisingly good most of the time.

rebeccafair commented 3 years ago

Would it make sense to have the option of doing this with both coherent and incoherent cross sections? If so this could be implemented as a keyword argument on calculate_dos e.g. calculate_dos(dos_bins, weighting='coherent'). Is the fact that it's a neutron scattering length sufficiently obvious in Euphonic's context or should it be more specific like weighting='coherent-neutron'? Are there any other types of DOS weighting that we could want to implement in the future?

ajjackson commented 3 years ago

Natural thing would be to have options "coherent", "incoherent", and "total", with the default being None.

If other kinds of weighting are feasible (not unreasonable) then maybe the argument is ins_weighting= or neutron_weighting=?

davidvoneshen commented 3 years ago

People do measure this with x-ray techniques. The thing is that is more complex to model (you need a form factor like the magnetic one which depends on Q and varies from element to element) and I would think you would want to compute the spherical average for the Q you did the measurement at.

Fundamentally though I like it as a keyword for the DOS routine that is already there with the default as None. I don't have strong feelings about how general it should be. It is sometimes nice to be able to edit the scattering lengths to simulate doping and see if anything interesting is happening or if changes are just down to the cross sections. I guess if you manually specified the weighting for each element that would be the most general approach. This would be like it currently is in the horace interface where I need to give the individual weightings. I don't think this is an unreasonable burden on the user and is the most flexible.

ajjackson commented 3 years ago

What we have done for "proper" coherent weighting is include an argument to select the data source. So if the user wants to pull the cross-sections from a customised data file, they can :smile: . I expect we can use the same system here.

rebeccafair commented 3 years ago

@ajjackson and I has a discussion this morning about this and how it should be implemented, and as implementing weighted DOS also involves calculating partial DOS (which Euphonic currently doesn't do) we might as well add PDOS as a feature while we're at it. This leads to some other issues:

So I think the plan is:

Initially we'll add a new calculate_pdos function that will return a Spectrum1DCollection with PDOS decomposed by element by default, as that is probably the most common use case, other options can be added later. Both calculate_dos and calculate_pdos will have weighting='coherent'/'incoherent'/None arguments and accept a cross_sections argument similar to scattering_lengths in QpointPhononModes.calculate_structure_factor which will allow tweaking of the cross-sections.

122, #123 will need to be completed first. We can discuss an isotopes workflow at the next PACE meeting which may feed into #124, #120.