PaNOSC-ViNYL / SimEx

Start-to-end photon experiment simulation platform
https://simex.readthedocs.io/
GNU General Public License v3.0
26 stars 25 forks source link

Wavefront - Photons conversion: 2nd iteration #84

Open CFGrote opened 7 years ago

CFGrote commented 7 years ago

The conversion from wavefront to photons (or rays) has to be improved: The direction of photons must be calculated from the curvature of the wavefront, i.e. it stands normal to the wavefront. At the moment, we assign the same direction (parallel to z) to all photons.

ax3l commented 7 years ago

@n01r can you please test that in ParaTAXIS?

samoylv commented 7 years ago

@CFGrote

The conversion from wavefront to photons (or rays) has to be improved: The direction of photons must be calculated from the curvature of the wavefront, i.e. it stands normal to the wavefront. At the moment, we assign the same direction (parallel to z) to all photons.

it is true for approx. pure monochromatic beam, short pulses have always finite bandwidth. So, must photons energy / wavelength BW be taken into account for rays?

CFGrote commented 7 years ago

i would say yes, finite bw must also be taken into account. of course, one ray(photon) has a precise energy, so the ensemble of rays must be generated according to the spectrum.

On 01/25/2017 05:18 PM, samoylv wrote:

@CFGrote https://github.com/CFGrote

The conversion from wavefront to photons (or rays) has to be
improved: The direction of photons must be calculated from the
curvature of the wavefront, i.e. it stands normal to the wavefront.
At the moment, we assign the same direction (parallel to z) to all
photons.

it is true for approx. pure monochromatic beam, short pulses have always finite bandwidth. So, must photons energy / wavelength BW be taken into account for rays?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eucall-software/simex_platform/issues/84#issuecomment-275153506, or mute the thread https://github.com/notifications/unsubscribe-auth/AOwoR1L0RyR8LocPN05kMBGpIAhZhS4sks5rV3XrgaJpZM4LSt0w.

-- Dr. Carsten Fortmann-Grote Scientist for Scientific Simulations / Wissenschaftler fuer wissenschaftliche Simulationen European XFEL GmbH Holzkoppel 4 22869 Schenefeld Germany

Phone: +49 (0)40 8998-5603 Fax: +49 (0)40 8998-1905 Email: carsten.grote@xfel.eu Web: www.xfel.eu

Managing Directors: Prof. Dr. Robert Feidenhans'l, Dr. Claudia Burger

Registered as European X-Ray Free-Electron Laser Facility GmbH at Amtsgericht Hamburg, HRB 111165

bussmann commented 7 years ago

There's a lot of stuff to consider. In our case with Parataxis/PIConGPU a single photon will be particle-like and will have the attributes k-vector (gives wavelength and direction of momentum), relative phase (to the EM wave) and (in the future) polarization. You will need to locally set the k-vector direction as a normal on the local wavefront, you encode the spatial and temporal coherence length of your EM wave within the phase distribution over the photons and choose the local polarization of the field as the local polarization of the photn (be aware that elliptic polarization leads again to a distribution of single-photon polarizations.

The key here is that most EM-field parameters must be encoded as distributed over many photons. These photons behave like particles and a huge number of them can be used to encode the EM-field. Quantum-Mechanics-like photons would all know the wavefunction of the EM-wave but we have to basically sample it with Monte-Carlo particle-like photons. Same holds true for rays but without the phase (which you can encode if you use wavelet-rays).

One of the really tricky parts with this is that you need A LOT OF photons, especially if you have multiple scattering in order to not create sampling artifacts. Another is that phase changes due to elastic and inelastic scattering are highly sensitive to numerical errors. Fulfilling both these requirements is tricky. If you increase numerical accuracy each photon will require more memory in your simulation, so you will have a lower total number than with less accuracy.

In the end you might want to add a weighting to your photon ray so that one of your rays/photons can represent more than one real photon in regions of little interest to you. Vice versa you might want to have more than one simulation photon per real photon for good sampling statistics where it is critical. You will then also need to consider techniques such as importance sampling and photon merging/splitting schemes depending on local conditions in your scattering volume.

Hope that helps. tl;tr: Note the differences between sampling photons and real ones. Numerics are a show stopper.