-
Notifications
You must be signed in to change notification settings - Fork 139
Fix attribute handling in tropical linear spaces #4792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix attribute handling in tropical linear spaces #4792
Conversation
moving declaration of variables where they are needed
This should also fix the root cause of #4790 Halfway in a |
It is not fixing the error from the code snippet in #4790, because that code snippet comes from a mathematically incorrect example (see @benlorenz's comment). It fixes the bug that produced the wrong example which gave rise to #4790. Unfortunately, in matroid theory it is often a major effort to check whether an example is mathematically correct or not (think: checking whether a set is invariant under a group action but you have go enumerate the entire group because checking generators is not enough). Avoiding these mathematically inconsistent scenarios is the best we can do. |
Stupid question: Can you completely exclude a situation where both kinds of attributes (tropical and algebraic) happen to be set or do you just assume that it is highly unlikely that redundant data might be cached sowhere down the road by some method in the future? In presence of both kinds of attributes, precedence should be given to the variant with less computational effort. Is this the case? |
I think there can definitely be sensible situations where both attributes can be set. For example, you construct something using a tropical matrix, but - for efficiency reason - you want to work with an algebraic matrix instead (because it is defined over a field instead of just a semiring so computing things like rank is much easier). So going from But going from a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given your explanation, the changes make perfect sense. Thank you for the PR.
Co-authored-by: Anne Frühbis-Krüger <[email protected]>
Tropical linear spaces can be constructed from many things:
The main difference is that I disabled the construction of attribute
:tropical_matrix
from:algebraic_matrix
, as it makes no sense mathematically: Tropical linear spaces constructed from the minors of a tropical matrix are so-called Stiefel tropical linear spaces, and tropical linear spaces constructed from the minors of an algebraic matrix are realizable tropical linear spaces. The former is a strict subset of the latter.Now, whenever an attribute such as
tropical_pluecker_vector
is requested and not cached, we consistently try to construct it from the algebraic data first, and use the tropical data second.The rest is general code cleanup, such as consistent use of
@attr
, even for attributes were nothing is computed.