-
Hi, I am wondering whether IMPACTX can run with beam macroparticles with different charges (or weights). From the instruction manual, there is a section 'Initialize a Beam from Arrays', but I cannot find a way to lauch with different charges. May I get some help or insights about this? Thank you very much! Sincerely, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @Xuan0533, Thanks for the question! Yes, internally ImpactX does use particle weights for individual particles, which primarily has an effect on collective effects and diagnostics. The example you mention is a bit rough still and focuses on equal-weight particle beams. The example calls a high-level API, which is implemented here and after partitioning the particles and ensuring we have them well distributed for parallelism (in-node and across compute nodes), we create the weight array in the same function and actually init the particles. We also recently implemented a new Source element that can load openPMD distributions, but in its first quick implementation we use it also to load equal-weight distributions and will generalize this at a later point, among others, because WarpX particle beams are also often weighted with different weights per particle. Can you tell us a bit more about your use case and if you like to try an implementation yourself? We will certainly expose this detail more at some point, but it's not on the top of the priorities just yet for our use cases, but we welcome contributions if you need it earlier. |
Beta Was this translation helpful? Give feedback.
Hi @Xuan0533,
Thanks for the question! Yes, internally ImpactX does use particle weights for individual particles, which primarily has an effect on collective effects and diagnostics.
The example you mention is a bit rough still and focuses on equal-weight particle beams. The example calls a high-level API, which is implemented here and after partitioning the particles and ensuring we have them well distributed for parallelism (in-node and across compute nodes), we create the weight array in the same function and actually init the particles.
This is the part that we could certainly split up further and expose a more low-level function to Python.
We also recently implemented a new Source e…