PlasmaPy / hack-week

2022 Hack Week material...slides,notebooks, and more
BSD 2-Clause "Simplified" License
9 stars 41 forks source link

Implement an X-Ray Thomson Scattering (XRTS) module #24

Open lemmatum opened 2 years ago

lemmatum commented 2 years ago

We already have some optical Thomson Scattering features in PlasmaPy, but it would be good to extend these into the XRTS and warm dense matter regimes, where Compton scattering features, and electron degeneracy, and chemical potentials become important.

pmk-LANL commented 2 years ago

I think the easiest simulation to get up and running (which still has some depth to it) would be to simulate the free electron component of the XRTS in the random phase approximation (RPA) regime.

Scattered spectrum power is related to the dynamic structure factor S(k,w) as well as the incident and scattered wavevectors: image

Here is the Dynamic Structure Factor equation for the free electron component: image The leading term is just detailed balance, which can be implemented as its own function.

Probably the most complicated part of it is doing the complex-valued triple integral for the dielectric function (in the RPA regime), but if it is done in a general enough way, you can use this function with various input distribution functions: image This requires two real-valued integrals to be done (most likely in Gaussian quadrature), followed by a Cauchy Principal Value integral to deal with the asymptote

We want to use the Fermi-Dirac distribution specifically to describe degenerate electrons in the warm dense matter regime: image

The chemical potential in the above distribution function can be described by an interpolation between classical and quantum theories, given by: image

where the coefficients are A = 0.25945, B = 0.072, and b = 0.858

Note that as temperature T goes large, the above distribution function reduces to the Maxwell-Boltzmann function, so it's still valid for classical plasmas. This interpolated chemical potential is already implemented in PlasmaPy here.

pmk-LANL commented 2 years ago

The integral can be done by splitting into a double integral and a Cauchy integral. For the double integral, I think we can use scipy.dblquad. For the Cauchy integral we can use scipy.integrate.quad with weight = 'cauchy' to get the principal value. This is just a wrapper around the QAWC method from QUADPACK.

And since these integrals are being dong at every value of photon energy in the simulation space, we might be able to further optimize this by using scipy.integrate.quad_vec.

lemmatum commented 2 years ago

I should've added that the theta in the equation for the chemical potential is the degeneracy parameter given by: image

Where the Fermi energy is: image

I already implemented the Fermi Energy in plasmapy here and theta here.