Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Species Type: Full Grammar of some Ideas #256

Open
s9105947 opened this issue Jan 4, 2022 · 2 comments
Open

Species Type: Full Grammar of some Ideas #256

s9105947 opened this issue Jan 4, 2022 · 2 comments
Labels
EXT: SpeciesType physical particle species extension

Comments

@s9105947
Copy link

s9105947 commented Jan 4, 2022

Dear Maintainers,

I am currently working on a PICMI implementation, which cites the OpenPMD "Convention for Specifying Particle Species".
While reading the extension my internal "hm, maybe this might be {too permissive|not entirely clear}" went of too often for my personal comfort, and I want to share my thoughts.

I don't work with/on openPMD directly, and also tend to be a little over-pedantic: Please take my comments with a grain of salt.
(Also, my background is in computer science, so I'm not too familiar with your typical physics simulation.)

This issue summarizes a group of issues regarding the species type definition into a (well-defined) grammar:
#257 #258 #259 #260 #261

ABNF Grammar

rough sketch of a speciesType syntax definition using ABNF from the top of my head:
(... is an omitted finite list, ELEMENT a one- or two-letter chemical symbol)

A implementation of the species type extension expects an ascii string and must accept at least expressions based on the rule species-type with the following definition:

species-type = species-single / species-list
species-list = species-single *( ";" species-single )
species-single = elementary / hadron-or-jet / atom / ion / molecule / other

other = "other:" *( ALPHA / DIGIT / "+" / "-" / "_" / "." / "#" / "^" )

elementary = quark / leptop / boson
quark = quark-anti / quark-normal
qurak-anti = "anti-" quark-normal
quark-normal = "up" / "down" / "charm" / "strange" / "top" / "bottom"
lepton = lepton-anti / lepton-normal
lepton-anti = "positron" / "anti-electron-neutrino" / "anti-muon" / ...
lepton-normal = "electron" / "electron-neutrino" / "muon" / ...
boson = "photon" / "gluon" / "w-boson" / "z-boson" / "higgs"

hadron-or-jet = hadron-or-jet-normal / hadron-or-jet-anti
hadron-or-jet-anti = "anti-" hadron-or-jet-normal
hadron-or-jet-normal = "proton" / "neutron"

atom = ELEMENT / isotope
isotope = "#" 1*DIGIT ELEMENT

ion = atom charge-postfix
charge-postfix = "^" *DIGIT ("+" / "-")

molecule = 1*(atom *DIGIT) [charge-postfix]

Notes

I have no stake in this discussion (besides my general love for standards),
the implementation I'm working on only accepts a subset of species anyways.

This entire discussion might be obsolete because the title of the extension clearly states that it is (purely) a convention. (I'd still argue that even if purely convention a clear definition should be used, so others -- like PICMI -- can use it as a standard; but that's debatable.)

Once the questions here/in the related issues are discussed I'd be willing to join the results into a PR for incorporation into the existing species extension document.

@DavidSagan
Copy link
Collaborator

@s9105947 I think your points are good ones. Could you form a PR with all this?

@ax3l ax3l added EXT: BeamPhysics proposed accelerator phsyics extension EXT: SpeciesType physical particle species extension and removed EXT: BeamPhysics proposed accelerator phsyics extension labels Jan 5, 2022
@ax3l
Copy link
Member

ax3l commented Jan 6, 2022

ABNF Grammar
A implementation of the species type extension expects an ascii string and must accept at least expressions based on the rule species-type with the following definition:

A few details: we always mean ASCII at the moment for text/string, defined by the base standard.

I like the formal definition, yet I think the standard is currently easy to read since we go by examples.

If you find a compact way to add the grammar to each existing section as a sub-bullet ABNF grammar:, the same way as we have a sub-bullet type, scope, allowed values and examples then this can be added as a PR :)

s9105947 pushed a commit to s9105947/openPMD-standard that referenced this issue Jan 26, 2022
s9105947 added a commit to s9105947/openPMD-standard that referenced this issue Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EXT: SpeciesType physical particle species extension
Projects
None yet
Development

No branches or pull requests

3 participants