Opened 7 years ago
Closed 3 years ago
#15291 closed enhancement (wontfix)
The Matroid() function should support rings that don't implement is_field()
Reported by: | Stefan | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | sage-duplicate/invalid/wontfix |
Component: | matroid theory | Keywords: | matroid |
Cc: | Merged in: | ||
Authors: | Reviewers: | Jeroen Demeyer | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Example:
sage: R.<x,y> = ZZ['x','y'] sage: Q = R.quotient([x^2 - y + 1, y^3 + 3 * x - 7]) sage: A = Matrix(Q, [[1,0,1],[0,1,1]]) sage: M = Matroid(A) Traceback (most recent call last) ... NotImplementedError:
Solution:
Catch NotImplementedError? in a try... except block. Probably do the same for the order() test in the same line of code of sage/matroids/constructor.py
Change History (9)
comment:1 Changed 6 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:2 Changed 6 years ago by
comment:3 Changed 6 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:4 Changed 6 years ago by
- Milestone changed from sage-6.3 to sage-6.4
comment:5 Changed 6 years ago by
A similar discussion (try/except around is_field
) took place at #10063.
comment:6 Changed 3 years ago by
- Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
- Reviewers set to Jeroen Demeyer
- Status changed from new to needs_review
The issue from this ticket is fixed by #23382.
However, even then the example does not work because Q
is not a field. Linear matroids (defined using matrices) require linear algebra, which really means that they should be defined over a field. One might get away with integral domains by going to the fraction field (and it's not clear to me that Q
really is an integral domain). In any case, Sage is unable to do non-trivial arithmetic in Q
, so this example does not work.
comment:7 Changed 3 years ago by
- Status changed from needs_review to positive_review
comment:8 Changed 3 years ago by
Not completely accurate. Matroid theory research includes matroids representable over "partial fields", where the entries are from a ring, and the submatrix determinants are all zero or in a multiplicative group of units from that ring. Easiest example: the ring is ZZ and the group is {-1,1}. This gives the regular matroids (they happen to have a custom implementation in Sage using the RegularMatroid? class, but other partial fields don't).
Sage's LinearMatroid? class has support for partial fields, especially through the "fundamentals=" argument to some methods. Internally everything was designed to work with such matrices. Consideration for these lead to tickets like #17692 and #15297 and #15295 .
I assume #23382 fixes the issue reported here (I'll try to review that this weekend), so I will leave this ticket as positive_review.
comment:9 Changed 3 years ago by
- Resolution set to wontfix
- Status changed from positive_review to closed
Closing tickets in the sage-duplicate/invalid/wontfix module with positive_review (i.e. someone has confirmed they should be closed).
I'm not sure what should be written inside the except block.How do we construct a matroid from a ring which is not a field, and which function to use.Please clarify,seeing the code i've pasted!