Open anandijain opened 2 years ago
Hi Anand,
I think these ideas are quite close to what we might be doing with this repo, and in fact they are brilliant. Let me try to address things one-by-one:
We can start implemented your abstractions of Atom. We might not able to fully use it currently and it will take quite some time to reach your current vision with this repo.
Apologies for my not-so-prompt replies, I am currently balancing grad-school applications and hiring process with JC work.
I will try to finalise #10 by this week
Awesome, thanks. Since there is a lot to be done, I wouldn't try to do it in a week. One thing that I found that might be helpful is https://github.com/JuliaPhysics/PeriodicTable.jl There is an issue about supporting isotopes.
I'm really hoping that we can make a nice interface to make public and show to https://github.com/isaacsas (main Catalyst dev).
He will probably have some very good ideas on how to incorporate more chemistry into the simulators. How much we decide to open source is more up to Chris/Viral, but I don't have a problem open sourcing most (if not all) of this repo.
But you will find that the code I've written in that PR is pretty god-awful (seriously its very bad). You will probably do much better to make a new PR and just copy bits and pieces of it.
another thing that would be cool to be able to simulate is reactions involving photons, like this pathway.
https://en.wikipedia.org/wiki/Photoreceptor_cell. also photosynthesis
The problem is, currently the amount of "chemistry" that you can do with SciML/Catalyst/Symbolics is quite limited.
@utkarsh530, I recall you were looking for a reaction rate coefficients database (right?). I think the better way to do this is to actually keep track of each Atom something like:
Look at src/particle.jl for my scratch work
struct Atom protons neutrons electrons end
with the eventual goal being that we can use the formulas in https://en.wikipedia.org/wiki/Reaction_rate_constant and lower the ReactionSystem to a PDE (with temperature as the 2nd IV). I think for now, it is best to stick to the Arrhenius equation for calculating k(T) and avoid having to do statistical mechanics.
This will allow us to be able to make a Catalyst.Reaction constructor that doesn't require putting in a Rate (as it will be auto-determined by Arrhenius + mass action law).
We will need to know how to calculate (or lookup) bond enthalpies in order to calculate the activation energy required for the reaction (which determines the temperature dependence for the reaction rate constant).
One issue that I've run into is deciding the right level of abstraction. It should be obvious we do not want to go as far as to represent protons via quarks, but for anybody doing nuclear chemistry, we would need to know how to calculate the energy released from radioactive decay and other nuclear processes.
For now I think a good starting place is just sticking to the electromagnetic forces (and leaving nuclear things for the future). So we can avoid needing to know which isotope each atom is, but we will still need to know the valence of each atom.
The reason being we need to know which bonds are broken/formed to calculate net energy. The issue here is that PubChem compounds does not provide valence charges (I think). They do provide the compound charge and bond order, but I don't think there is unique mapping to determine valences.
https://github.com/SciML/Catalyst.jl/issues/424 it would be cool to be able to lower rxnsys -> ODE/PDE/Jump in a way that ensures a term for energy that allows conservation of energy.
TLDR; I want to teach a bit of chemistry to Catalyst. this will give users much more peace of mind that the model from literature and the julia code are on the same page.
I'm also not entirely certain about everything here (since it's been a while since I've done any chemistry). Feedback much appreciated
Roadmap and scope
There are a number of things that Catalyst does not support natively that are useful to those modeling chemical reactions.
Particularly, dealing with compounds, elements, and elementary particles is (currently) out of scope for Catalyst.
However, there are many cases when incorporating this extra data (atom-bond graphs, valence charges, masses, etc) is useful for ensuring model correctness and enforcing constraints like conservation of energy and checking that reactions are balanced.
for example, the following reaction in catalyst, there is no way for it to determine that the reaction is unbalanced.
Elementary reactions that I'd want to be able to compute/simulate with a symbolic chemistry tool: (least difficult to most)
https://en.wikipedia.org/wiki/Chemical_reaction
there are a number of decisions to make, like whether energy is implicit or explicit, how much should try to be computed vs just doing a lookup etc.
@utkarsh530 look over my latest commit and mess around wiht stuff, see what you can do