Closed davidvoneshen closed 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?
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=
?
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.
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.
@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:
Spectrum1DCollection
seems like the best option, but it needs a small addition, see #123Crystal
object and changing the masses/species individually? For the second option Crystal
's attributes will have to be made mutable (#120). We should probably discuss at the next PACE meeting how much effort we want to put into the isotopes workflow, and whether just tweaking the cross sections is enough for most use cases. calculate_pdos
rather than having the complication of 'if the object doesn't contain eigenvectors, you can only use these arguments, and if you use these arguments you'll get x output, whereas if you use these arguments you'll get y output etc.'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.
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
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.