You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It can be very confusing when two expressions look the same but are actually different. Here are two things we can do to avoid this problem.
When checking to see if a parameter should be relabeled in order to avoid a scoping violation, we could check against the string/latex display of the contained sub-expressions rather than just looking for explicit Variable collisions. An example of this came up recently where there was a "collision" between var_ket_psi and ket_psi. They appear the same but are different types of expressions. This solution would avoid that issue.
More generally we could check expressions as they are generating their formatted display to see if there are any sub-expressions that have the same display but are different. If so, we could generate some kind of warning or raise an exception.
The text was updated successfully, but these errors were encountered:
I like the pro-activeness of (2) (i.e. checking expressions for duplicated display formats). My inclination would be to generate an alert or warning rather than an exception. I also worry a little about the computational overhead of doing such checking.
I think it can be done efficiently, but you have to be careful about it. What I'm thinking is that you store a dictionary that maps latex/strings to expressions, updating this dictionary whenever an expression generates its latex/string representation. But I haven't fully thought this through.
It can be very confusing when two expressions look the same but are actually different. Here are two things we can do to avoid this problem.
The text was updated successfully, but these errors were encountered: