bandang0 / aamg

Automatic Astrophysical Model Generator
MIT License
0 stars 0 forks source link

Welcome to AAMG #1

Open bandang0 opened 4 years ago

bandang0 commented 4 years ago

Hi, So this is just a crazy idea of having a program generate astrophysical models for you.

For example, we know now that short gamma-ray bursts are produced in the merging of compact objects. However, this wasn't suggested till the 1980's. So imagine someone in the 1970's had a program which randomly output the string "What if short gamma-ray bursts were due to the merging of compact objects?". I reckon just reading that line and looking at the data with a new eye would have saved gamma-ray burst science a couple years.

In this project, we would simply have a list of phenomena (gamma-ray bursts, fast radio bursts, solar flares, etc.), a list of progenitor objects (neutrinos, compact objects, galaxies, clouds, etc.), a list of actions (merging, interacting, decaying, etc.), a list on environments (galaxies, globular clusters, planet atmospheres, etc.). Then the program would generate random models. Like:

$ ./aamg $ What if fast radio bursts were due to the collision of asteroids with the magnetopheres of pulsars?

(Actually that's not a bad idea.)

Also, we could ask to generate models of a given phenomena:

$ ./aamg --phenomena "gamma-ray bursts" $ What if gamma-ray bursts were due to the collapse of massive stars in spiral galaxies? $ ./aamg --phenomena "gamma-ray bursts" $ What if gamma-ray bursts were due to explosions of exoplanets in close orbit with white dwarfs?

Also, we could vary the sentence structure and ask for specific progenitors:

$ ./aamg --progenitor "M-type star" $ M-type stars produce neutrinos from their envelops during Helium shell burning. $ ./aamg --progenitor "M-type star" $ Active galactic nuclei flares are caused by merging of M-type stars with black holes.

I feel like there are some language issues because we want to have correct English outputs every time. Also some actions (like merging) require two progenitors (like a star and a black hole), whereas others (like collapsing) require only one. Certainly there is some rigid structure (like subject-verb-complement) we have to pin down so that everything comes out smoothly!

On the long run, I think we should do the core programming with some elementary bits and then let people populate the possible models by adding objects and actions etc. through PR.

Tell me what you think about the implementation of this! 💫

bandang0 commented 4 years ago

Dear all,

So after a short discussion, we thought about a way of doing this. It uses a formal grammar which allows to generate sentences automatically, sentences which will actually be our astrophysical models. They way these sentences must look at the end defines the grammar we use.

For example, one grammar could be (the terminal symbols are capitalized here):

model := what-if-phrase | affirmative-phrase

what-if-phrase := "What if" (PHENOMENA | PHENOMENON) "were" PASSIVE-TENSE action [place] "?"

affirmative-phrase := (PHENOMENA "are" | PHENOMENON "is") PASSIVE-TENSE action [place] "."

action := (UNARY-VERB "of" PROGENITOR | BINARY-VERB "of" PROGENITOR "and" PROGENITOR)

place := "in" ENVIRONMENT "of" OBJECTS

Starting from the "model" start symbol of the grammar, we randomly follow production rules (the ":=" signs) to end up with a random sentence structure composed of English words and placeholders (terminal symbols) to fill in, like "What if PHENOMENA were PASSIVE-TENSE UNARY-VERB of PROGENITOR."

At this stage, we just choose random words for all the placeholders in lists of possible words, according to the function in the sentence. We could read these in files for example. We could have, e.g.:

# phenomena.txt
gamma-ray bursts
solar flares

#phenomenon.txt
the CMB
the Galactic bulge

# passive-tense.txt
amplified by
caused by
inhibited by
come from

# unary-verb.txt
collapsing
decaying
frame-dragging
radiating

# binary verb.txt
merging
scattering

# environment.txt
the atmospheres
the magnetospheres

# objects.txt
planets
pulsars
galaxies

# progenitor.txt
neutrinos
massive stars
dark matter

Then we end up with sentences like

What if solar flares were caused by collapsing of dark matter?

or (following another path in the grammar)

Gamma-ray bursts are amplified by merging of neutrinos and dark matter in the magnetospheres of pulsars.

In this perspective, we should:

  1. Define a basic grammar and lists of words according to grammatical function,
  2. Write the algorithm which: a. parses the grammar, b. randomly follows a path in the grammar to generate a sentence structure, and c. randomly chooses words to fill in the blanks in the structure.

In the long run, we could let people contribute new pieces to the grammar or new words to fill in through pull requests!

Tell me what you think (I'm boiling right now 🔥).

@zuh0 I don't know more about formal grammars than what I read in the Wikipedia page, so please shout if something's wrong (like vocab) or if there are things to watch out for!