Skip to content

Species Type: Full Grammar of some Ideas #256

@s9105947

Description

@s9105947

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EXT: SpeciesTypephysical particle species extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions