sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.43k stars 479 forks source link

Helper functions for polynomial matrices #23619

Closed vneiger closed 6 years ago

vneiger commented 7 years ago

Functions:

CC: @johanrosenkilde @romainlebreton @bgrenet

Component: algebra

Keywords: matrix

Author: Vincent Neiger

Branch/Commit: 5fc5fd6

Reviewer: Johan Rosenkilde, Romain Lebreton, Pascal Giorgi, Bruno Grenet

Issue created by migration from https://trac.sagemath.org/ticket/23619

vneiger commented 7 years ago

Description changed:

--- 
+++ 
@@ -1,5 +1,6 @@
 Functions:
 - row/column degree,
+- pivot (row/column),
 - degree matrix,
 - leading matrix (row/column),
 - is_popov  (row/column),
vneiger commented 7 years ago

Description changed:

--- 
+++ 
@@ -1,4 +1,5 @@
 Functions:
+- degree,
 - row/column degree,
 - pivot (row/column),
 - degree matrix,
vneiger commented 7 years ago

Branch: u/vneiger/23619_polmat_helper

vneiger commented 7 years ago

Commit: ec172a4

vneiger commented 7 years ago
comment:4

Pushed the first function. Not ready for review.


New commits:

ec172a4degree matrix function working
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from ec172a4 to 4aa4338

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

4aa4338improved degree_matrix documentation
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from 4aa4338 to 10be03d

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

10be03dfunction and doc degree of a matrix
vneiger commented 7 years ago
comment:7

Cleaned documentation for the (shifted) degree matrix, and wrote function/doc for degree of a matrix. Not ready for review.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from 10be03d to 68de063

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

0fd8340function and doc for column degree and row degree
68de063function and documentation for leading matrix, row wise and column wise
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

af59287function and doc for is_reduced
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from 68de063 to af59287

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from af59287 to 205e188

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

baab67fsmall correction for degree: case of empty matrix
96c7e5atesting corner cases with <> matrices
205e188is_popov and is_ordered_weak_popov are in good state now; missing examples in the latter
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

c427947class document, and cleaner documentation for methods
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from 205e188 to c427947

johanrosenkilde commented 7 years ago
comment:12

The ticket is coming along very nicely. Some preliminary comments.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from c427947 to fff979b

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

7e0f5e8added examples for is_ordered_weak_popov
fff979bJohan's comments and cleaner doc
vneiger commented 7 years ago
comment:14

Thank you for your numerous comments.

All that is not commented below was taken into account in the last revision.

Replying to @johanrosenkilde:

  • degree: why does the 0x0 matrix have degree None? Such a matrix has e.g. rank 0 and characteristic polynomial 1. Similar question for row-degree.

This is a good question and I have no answer. Another choice would be -1, but so far I see no reason to prefer one or the other. Do you?

  • degree_matrix: I would prefer that you add a parameter check that the shift is a list of the right length.

I was hesitating about such a parameter check. If we put one here, then we should do it for every method involving a shift, right?

One could interpret the doc text as expecting the shift to be a vector of integers - is this a problem?

I don't think this is a problem (if I understand well your question): we can input a vector (1,2,3) or a list [1,2,3], both will work.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from fff979b to 817b81c

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

3d5797dshifts as list/vector: ok now
817b81ctodo
johanrosenkilde commented 7 years ago
comment:16

Hi, looking better and better :-)

Things we discussed face2face:

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

fe37deerow_reduced --> reduced, deprecation warning
91db615check shift length
0545723check shift length
e3064b0pivot index --> leading positions
ee2f999some small fixes
e7d646fpivot index --> leading positions
660ab43degrees and leading positions for empty matrices
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from 817b81c to 660ab43

johanrosenkilde commented 7 years ago

Description changed:

--- 
+++ 
@@ -1,8 +1,8 @@
 Functions:
 - degree,
-- row/column degree,
-- pivot (row/column),
-- degree matrix,
-- leading matrix (row/column),
-- is_popov  (row/column),
-- is_reduced (row/column).
+- `row_degree`, `column_degree`,
+- `row_pivots`, `column_pivots`,
+- `degree_matrix`,
+- `row_leading_matrix`, `column_leading_matrix`,
+- `is_popov`  (row/column),
+- `is_reduced` (row/column).
johanrosenkilde commented 7 years ago
comment:18

Changed some names in the description, as discussed f2f. The code still needs to be updated.

johanrosenkilde commented 7 years ago

Description changed:

--- 
+++ 
@@ -1,6 +1,6 @@
 Functions:
 - degree,
-- `row_degree`, `column_degree`,
+- `row_degrees`, `column_degrees`,
 - `row_pivots`, `column_pivots`,
 - `degree_matrix`,
 - `row_leading_matrix`, `column_leading_matrix`,
johanrosenkilde commented 7 years ago
comment:19

Let's go plural.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Changed commit from 660ab43 to 72fe310

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

c6da217plural for row degree / column degree
72fe310now is_reduced accepts zero rows/columns
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Changed commit from 72fe310 to 7f6e36e

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

b5aa3da is_weak_popov now accepts zero rows / columns
8064d7bis_popov now accepts zero rows + option for up-to-permutation test
489344aremove old code
7f6e36esmall code simplification
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Changed commit from 7f6e36e to 9ed9b40

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

3a336c9working on is_hermite
a266d99now, in ordered weak Popov and in Popov the zero rows must appear at the end (bottom if row-wise, right-hand side if column-wise)
dd920d4is_hermite now works, it simply calls is_popov with the right shift
92356cbis_hermite cleaned, lower_echelon option correct now
de58683add test to support empty matrices in is_{hermite,popov,weak_popov,reduced}
9ed9b40added some SEEALSO blocks
johanrosenkilde commented 6 years ago

Changed branch from u/vneiger/23619_polmat_helper to u/jsrn/23619_polmat_helper

johanrosenkilde commented 6 years ago

Changed commit from 9ed9b40 to 7af4cca

johanrosenkilde commented 6 years ago
comment:24

Author forgot to set needs_review (but said so in private conversation)


Last 10 new commits:

c44832eFixed some doc-tests
5d56351Classical Reed-Solomon codes
19ba6f5Fixed small doc-test failure
37515a0Merge branch 'u/vneiger/23619_polmat_helper' of git://trac.sagemath.org/sage into 23619_polmat_helper
c67c7a3Spaces around operators
805ecd7Plural row/col degrees in various doc text
bb7f3a6Fixed a SEEALSO
03cf1a8Simplified some logic in is_reduced
3a03af4Improved reduced_form doc to conform to the rest of the file. A few other small fixes
7af4ccaImproved doc and examples of weak_popov_form
johanrosenkilde commented 6 years ago
comment:25

Hi Vincent,

I've carefully gone over the entire file now and I like it - we're almost there. I took the liberty to implement directly some smaller fixes, and also to use this ticket to include some improvements to existing docs and examples in that file. Please review these changes.

As to your changes, I'm ready to green light everything except for the following comments:

Also, I like your fix for allowing other row orderings in is_popov!

Best, Johan

johanrosenkilde commented 6 years ago

Reviewer: Johan Rosenkilde

johanrosenkilde commented 6 years ago

Author: Vincent Neiger

johanrosenkilde commented 6 years ago

Dependencies: 24640

johanrosenkilde commented 6 years ago
comment:26

Oh yeah, I also merged in 24640 since I was worried about a conflict. There seems to have been no conflict with 24640 itself, so technically, I should remove that merge, but there was a conflict with some other parts of rebasing this patch to a newer version of Sage.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Changed commit from 7af4cca to 4830af1

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

129aa97Merge commit '9ed9b40' into 23619_polmat_helper_nodep
7b51228Plural row/col degrees in various doc text
b70bb38Fixed a SEEALSO
376759fSimplified some logic in is_reduced
0a14228Improved reduced_form doc to conform to the rest of the file. A few other small fixes
4830af1Improved doc and examples of weak_popov_form
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Changed commit from 4830af1 to 9eaf1f5

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 6 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

9eaf1f5Spaces around operators
johanrosenkilde commented 6 years ago
comment:29

Yay to rewriting history! So I decided to untangle the dependency on #24640 after all, and this was not difficult at all (make new branch off develop, merge in your last commit, cherry-pick my commits). Except that I screwed up and cherry-picked one commit too little (doing git cherry-pick <commitA>..<commitB> does not include <commitA>!) and so ended up adding that after the others. Then git push --force and all is well :-) Now we also know that the patch merges on the latest develop.