ColwynGulliford / lume-gpt

Apache License 2.0
3 stars 4 forks source link

Unable to identify particle species #22

Closed BenDickensheets closed 4 months ago

BenDickensheets commented 4 months ago

Creating a beam with setparticles command and the builtin gpt me constant fails during conversion to ParticleGroup. The gpt builtin me and mp constants (9.10953e-31 and 1.67265e-27) differ from scipy's physical constants (9.1093837015e-31 and 1.67262192369e-27) by a relative error of 1.6e-5. The relative error in the qe constant is about 0.8e-5.

This can be fixed by increasing the relative tolerance in np.isclose calls to 1e-4. (The default rtol is 1e-5.)

Minimal demonstration attached.

lume_gpt_particle_ident_test.zip