## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
Ben
@bhpayne
Today I worked on analyzing which steps in the Physics Derivation Graph are valid and which need additional refinement. I found 30% are good to go, 30% cannot be validated, leaving 40% of the 638 to improve.
Michael Goff
@msgoff
The graphic looks great! What do you think a realistic time frame might be for 50%
Ben
@bhpayne
I don't have a good sense for that. There are issues with both the expressions and the inference rules to address.
Ben
@bhpayne

I'm 1) measuring my current state and 2) sharing my status (to create a sense of accountability). My plan is to 3) revisit this metric and evaluate the rate of change.

I could potentially go back in my commit history and construct this measurement, but I didn't previously have the infrastructure in place to make the measurement easy.

Michael Goff
@msgoff
Do you have a list of the top 5 issues?
That would likely help with coverage by resolving the most frequent first.
Ben
@bhpayne

I'll list the issues below. While you're welcome to contribute by tackling them, your help with the Latex parsing and formal proofs of inference rules are contributions that I don't have as much skill with.

Currently the only way to edit the implementation of an inference rule is to edit the https://github.com/allofphysicsgraph/proofofconcept/blob/gh-pages/v7_pickle_web_interface/flask/validate_steps_sympy.py . I'm not sure if there's a clearer method of verifying the transformation to the input ASTs.

Also, applying the AST transformation to inputs would save the user the work of specifying the output Latex/SymPy representations and improve the correctness. I haven't explored this yet.

Michael Goff
@msgoff
Michael Goff
@msgoff
I don't think it will be an issue to go back and forth between the two sets of ids.
Michael Goff
@msgoff
this file converts latex2unicode in the terminal which may be useful. I worked on this a year or so ago. I need to find the original source that maps latex to unicode.
Ben
@bhpayne

I have a bunch of recorded talks and slides from the CICM 2020 meeting. I realized I could share them by running

python -m SimpleHTTPServer 8000

and coordinating with you regarding specific windows in which to download the content. The CICM materials are a total of 10GB.
-->Let me know if and when you're interested in downloading the materials. Then I'll make sure the content is temporarily accessible via a web server (running on my DigitalOcean droplet).

Ben
@bhpayne

In the process of fixing expressions and steps in the PDG database, I encountered a novel challenge.

I've assumed every step in Latex corresponds to a step that can be checked in SymPy.
https://physicsderivationgraph.blogspot.com/2020/09/evaluating-definite-integrals-for.html

I'm not sure what to do when that isn't the case. In the post I describe a intermediary step commonly included in definite integrals but not supported in SymPy

Moses Paul R
@iammosespaulr
I just saw your write up, can you make use of the Unevaluated integral form ?
but I guess that won't be an exact representation.
lemme look into it
I think the best option would be, to perform an indefinite integral and then substituting the limits back in. a tiny function could accommodate that
Ben
@bhpayne
I think the "unevaluated integral" form would work for a definite integral with bounds; I'm not clear how to specify "integrated result with bounds not yet applied". Thanks for offering to investigate.
Moses Paul R
@iammosespaulr
ofcourse! btw I think you should stick to your own flavour of sympy. here's why I think that
there may be changes that might be really useful to you, but not really useful in the context of the sympy community. also the ability to create short functions and structures that pander to the physics graph shouldn't be hindered by the general approval of the sympy community
I have a fork that I develop and keep up to date, you could try something like that, instead of waiting for improvements to get merged
Moses Paul R
@iammosespaulr
Nice!
Michael Goff
@msgoff
In a quote from "Handbook of Practical Logic and Automated Reasoning"
"Theorem Proving programs bear a strong family resemblance to CAS and overlap in some of the problems the can solve."
https://www.cl.cam.ac.uk/~jrh13/
Something that will likely be relevant in the near future.
Ben
@bhpayne

Idea: apply mathematical operations on the IDs in the PDG.

if I have an ID for some value x and y and +
Then the id of x + y should be some distinct relational mapping applied to the IDs.

I think this can be done with Gödel numbers.

The main benefit is to improve confidence levels by reducing the number of string transformations. My guess is that doing operations on integer IDs will yield a few number of errors in the long term.

To summarize, that would mean each expression has an ID, and each symbol in an expression has an ID, and permutations of symbols have IDs?

On additional aspect to consider is how to handle the case where symbols get replaced by actual numeric values in an expression. Would that substitution also have IDs?
Michael Goff
@msgoff
I am guessing that the number of numerical values that are likely to show up in a derivation are enumerable and fairly small, say less than 10000. With that assumption, I would say yes, every value, operator, and transformation has a distinct Id.
Ben
@bhpayne

To clarify, x+y is distinct from y+x (with separate IDs), or are they the same?

And would a+b get a third ID, or are all three the same ID?

Michael Goff
@msgoff
separate ids
Ben
@bhpayne
If an expression is x + y + z would you plan be to break it into (x+y)+z?
I don't understand where the savings is coming from.
Michael Goff
@msgoff
I am thinking about ids in terms of verifying the correctness of string transformations, and to reduce the number of string transformations in the application.
It’s not well thought out yet, but seems plausible.
Ben
@bhpayne
I'm happy to iterate this idea with you as it becomes clearer.
I suspect there are many simplifying tricks available but I don't have a good way of finding them. My current plan is to use brute-force and manual work with the hope of uncovering recurring patterns.
Ben
@bhpayne

/change of topic/

I encountered a few issues with SymPy today. I'll explain what I found and what I plan to do about it:

I have an expression (1158485859) that, in Latex, is

 \frac{-\hbar^2}{2m} \nabla^2 = {\cal H}

The \nabla^2 is represented in SymPy as Laplacian(), though an argument is required for the operator.

My solution: leave the SymPy representation as Pow(Symbol('nabla'), Integer(2))

Also on the topic of vectors, I encountered the Latex expression

 \vec{p} \cdot \vec{F}(\vec{r}, t) = a

In order to convert that to SymPy, I'd need to specify a basis for \vec{p} (e.g., from sympy.vector import CoordSys3D). I know how to do that; for example,

>>> N = CoordSys3D('N')
>>> p = Symbol('p_x')*N.i + Symbol('p_y')*N.j + Symbol('p_z')*N.k
>>> F = Symbol('F_x')*N.i + Symbol('F_y')*N.j + Symbol('F_z')*N.k
>>> p.dot(F)
F_x*p_x + F_y*p_y + F_z*p_z

However, that doesn't seem to extend to functions:

>>> p.dot(Function(F)(Symbol('r'), Symbol('t')))
Traceback (most recent call last):
...
TypeError: expecting string or Symbol for name

My solution for now: leave the SymPy representation as incorrect, using "multiplication" instead of "dot"

Michael Goff
@msgoff
how much time does it take for you to trouble an expression like this ?
The reason I am asking is because it maybe worthwhile to crowdsource some of the more complicated expressions
To people who know SymPy, LaTeX and the relevant mathematics
Ben
@bhpayne

to trouble an expression

What did you mean?

Michael Goff
@msgoff
Typo troubleshoot
So if it takes 15 min, 30 or an hour to debug something like this it creates some idea of what the value would be if someone could validate complicated expressions as things progress.
Ben
@bhpayne

Regarding the time invested, 2 hours to finally get around to realizing the relevant details.

The good news is that I'm in the process of identifying systemic issues that are design considerations, so once I decide what to do about them they are "fixed" across the project.

For example, nabla^2 shows up 22 times in the current database. The observation about Laplacian applies to all of them at once and is a find-and-replace text-based fix.

On a broader note, I'm reconsidering having a data structure that assumes a 1-to-1 mapping of the Latex-to-SymPy.

I'd like to talk with folks who know SymPy, Latex, and sufficient math in Physics about these issues :)

Ben
@bhpayne

I spent today attempting to place mathematical jargon associated with expressions into a hierarchical class structure.

The questions I encountered that I am unable to solve include,

• What is the superclass above "equation" and "inequality"? These are both examples of what? A "mathematical statement" is the best I can think of
• in the statement "y = x^2 + b where x = {5, 3, 1}" I can identify two equations that are separated by a binary operator "where". Is there a name for this type of operator? Another example is the "for all" operator as in "a + c = 2*g + k for all g \in \Re"
Also, I came to the conclusion that every equation has associated "scope" equations to constrain each variable and that these constraints are almost always implicit. The reader is left to deduce the "for all g \in \Re" from the context of the rest of the paper.
Ben
@bhpayne

Activity log: made a bunch of structural changes to https://derivationmap.net/other_projects and https://derivationmap.net/literature_review like using a sortable table

Also, started migrating content from https://sites.google.com/site/physicsderivationgraph/home to the appropriate pages on https://derivationmap.net/

Next steps in the cleanup process will be to tackle moving content from https://github.com/allofphysicsgraph/proofofconcept/wiki to https://derivationmap.net/