A prolog application of basic interactions between elementary particles.
The main idea behind this project is to create a system that will tell you when an interaction
of the form A + B --> C + D + E + ...
or a decay of the form A --> B + C + D + ...
, where A, B, C, D, E are elementary particles, is possible or not.
For the time being, you can consult the knowledge base, do basic simple (or filtered) queries, and check if an interaction or decay is possible at a higher level. When I say a higher level, I mean that I'm not taking into account the quarks, nor the quantum numbers such as strangeness, topness, botomness and charm.
You can check here the interactions and decays that pass or don't pass the tests with this library, and here the queries.
For future ideas and goals check the CONTRIBUTING page.
You're expected to have GnuProlog or SWI-Prolog installed.
On Ubuntu:
sudo apt install gprolog
or
sudo apt install swi-prolog
Go inside the particleslogic folder from a terminal and get a Prolog REPL running.
From inside the prolog REPL (gprolog
or swipl
):
?- consult('src/particles.pl').
Now, let's say that you want to find out the mass of the electron. You'll type:
?- mass(electron, M).
And you'll get:
M = 0.511.
Let's say that you want to find the lifetime of all the particles.
You'll type:
?- lifetime(Particle, Lifetime).
And you'll get (it will stop when the base runs out of particles, or when you press "." or enter instead of ";"):
Particle = electron,
Lifetime = 'Stable' ;
Particle = positron,
Lifetime = 'Stable' ;
Particle = electron_neutrino,
Lifetime = 'Stable' ;
Particle = anti_electron_neutrino,
Lifetime = 'Stable' ;
Particle = muon,
Lifetime = 2.19e-6 ;
Particle = anti_muon,
Lifetime = 2.19e-6 ;
Particle = muon_neutrino,
Lifetime = 'Stable' ;
Particle = tau,
Lifetime = 3.3e-13 .
Querying and filtering the database:
Let's say that you want to find all the particles with mass greater than 30 MeV/c^2 and less than 200 MeV/c^2:
?- mass(Particle, Mass), Mass > 30, Mass < 200.
Then we get:
Particle = muon,
Mass = 105.7 ;
Particle = anti_muon,
Mass = 105.7 ;
Particle = pion,
Mass = 139.6 ;
Particle = anti_pion,
Mass = 139.6 ;
Particle = pion0,
Mass = 135.0 ;
Particle = strange,
Mass = 95 ;
Particle = anti_strange,
Mass = 95 ;
false.
First you'll have to load the laws.pl
library:
?- consult('src/laws.pl').
Then, to check say the interaction electron + positron --> photon + photon
you type in the REPL:
?- possible_interaction_first_level([electron, positron], [photon,photon]).
true.
Once you have loaded the laws.pl
library you can check if a decay is possible:
For example, let's check the muon
decay: muon --> electron + muon_neutrino + anti_electron_neutrino
if it is possible:
?- possible_interaction_first_level([muon], [electron, muon_neutrino, anti_electron_neutrino]).
true.
Particle name (symbol)
Kindly do see CONTRIBUTING and CODE OF CONDUCT for more information.