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
IncidenceStructureFromMatrix bug #16237
Comments
comment:1
Are you working on fixing it ? Nathann |
comment:2
I have a fix but my GIT foo is not sufficient to upload it! :-( There is only one line of change to make: the if testing condition should be
as opposed to the |
comment:3
You can ask on sage-devel if you have problems with GIT. They are writing a tutorial right now, it may give them ideas... |
Branch: u/knsam/16327 |
New commits:
|
Commit: |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:7
Firstly, the bug described is mathematical. And, that it is a bug is evident from following the code. This ticket fixes it and ALL doctests pass. However, the reason I have discovered this bug is itself another bug. So, I think, this ticket can double itself to fix this bug too. So, the new bug is HadamardDesign method assumes that hadamard_matrix returns a Hadamard matrix whose first row and first column is the all-1 vector while hadamard_matrix method does not. This is why the example given in the method works but the example I describe does not:
So, to get the ball rolling, should there be a new method called normalised_hadamard_matrix or should we let the method hadamard_matrix take an optional argument like normalised=True or sth like that? Any suggestions would be welcome. |
comment:8
Yooooooooo !!
Your idea is cool ! I would vote for the optional argument. Though it does not make a lot of sense to set it to "True" by default... So perhaps we can also normalize them automatically before returning them ? Nathann |
comment:9
Replying to @nathanncohen:
May be not, because, this is going to take 2n steps for a Hadamard Matrix of order n. And, for many purposes, this is not necessary. So, may be we can have an optional argument and set it to False instead. Do you agree? |
comment:10
Ahahahah. Okay, as you want. But I do not think these 2n steps will make a difference in any code. Are you sure that creating the matrix takes a linear time ? Or may Python reallocate a partial matrix several times ? Either way is fine ! Nathann |
Changed branch from u/knsam/16327 to u/knsam/16237 |
Author: Kannappan Sampath |
New commits:
|
comment:12
Indeed, the bug that motivated my search is now fixed; with the patch, we have:
|
comment:13
Hello ! Several remarks:
Nathann |
comment:15
Replying to @nathanncohen:
No, I have modified only so much as to remove the edge cases that do not arise. I am not really changing the definition of Paley matrices. There are several floating around in the Literature. I have chosen Horadam's Paley Type I, Type II (I think!). But, this is not standard at all! We could probably have this put explicitly in the documentation. And, this document is not included in the combinat docs! Should we try to add it ? :-)
Good suggestion, I will implement it!
There are several faster ways to do this! I am planning on implementing this in a later ticket! But, for now, it shall be a TODO notice! Kannappan. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:17
Hello Kannappan !!! Okayokayokayokay, so you implement more or less Horadam's construction with a couple of changes of signs. Okay. It would be nice to clean this file a bit in the future, because right now there is a "return 0" in functions who claim to return entries of Hadamard matrices Anyway. I agree with what your branch does, and I added a reviewer's commit in public/16237 to fix a couple of typoes.
Sooooooooo well. If you agree with my changes, you can either :
About the doc : it seems to be included already http://www.sagemath.org/doc/reference/combinat/sage/combinat/matrices/hadamard_matrix.html HMmmmmmm... Okay, nothing else to say. Good work ! Nathann P.S. : The custom is the following : usually, the reviewer sets the ticket to |
Reviewer: Nathann Cohen |
comment:20
Hi Nathann, I have set this ticket to positive review, as we discussed! Kannappan. |
comment:21
Okayyyyyyyyyy... Well, in this context it is better to add a commit rather than rewrite the last one. Because this way the reviewer can easily see what exactly you changed since the previous commit. If I want to do it now, I have to re-read the whole branch again and try to find out if everything is there Nathann |
comment:22
Sorry about it, I will do it from the next time! Kannappan. |
comment:24
Documentation does not build |
Changed branch from u/knsam/16237 to public/16237 |
Work Issues: make doc-pdf |
comment:26
docbuild fails |
comment:28
Fixed. |
Changed work issues from make doc-pdf to none |
Changed branch from public/16237 to |
The method IncidenceStructureFromMatrix has a serious bug, and it leads to serious errors in computations. We should fix it ASAP. For example, one may test with HadamardDesign (which uses the buggy implementation of IncidenceStructureFromMatrix). Consider the following output:
The bug is the indexing used in the if-testing in the method.
CC: @nathanncohen
Component: combinatorics
Author: Kannappan Sampath
Branch/Commit:
e2eab09
Reviewer: Nathann Cohen
Issue created by migration from https://trac.sagemath.org/ticket/16237
The text was updated successfully, but these errors were encountered: