#16237: IncidenceStructureFromMatrix bug
-------------------------+-------------------------------------------------
Reporter: knsam | Owner:
Type: | Status: new
defect | Milestone: sage-6.2
Priority: major | Resolution:
Component: | Merged in:
PLEASE CHANGE | Reviewers:
Keywords: | Work issues:
Authors: | Commit:
Report Upstream: N/A | bfba495df27bacef7a0bc2632b5000e9f09ebd87
Branch: | Stopgaps:
u/knsam/16327 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by knsam):
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:
{{{
sage: hadamard_matrix(8)
[ 1 1 1 1 1 1 1 1]
[ 1 -1 1 -1 1 -1 1 -1]
[ 1 1 -1 -1 1 1 -1 -1]
[ 1 -1 -1 1 1 -1 -1 1]
[ 1 1 1 1 -1 -1 -1 -1]
[ 1 -1 1 -1 -1 1 -1 1]
[ 1 1 -1 -1 -1 -1 1 1]
[ 1 -1 -1 1 -1 1 1 -1]
sage: hadamard_matrix(12)
[ 1 1 1 1 1 1|-1 1 1 1 1 1]
[ 1 1 1 -1 -1 1| 1 -1 1 -1 -1 1]
[ 1 1 1 1 -1 -1| 1 1 -1 1 -1 -1]
[ 1 -1 1 1 1 -1| 1 -1 1 -1 1 -1]
[ 1 -1 -1 1 1 1| 1 -1 -1 1 -1 1]
[ 1 1 -1 -1 1 1| 1 1 -1 -1 1 -1]
[-----------------+-----------------]
[-1 1 1 1 1 1|-1 -1 -1 -1 -1 -1]
[ 1 -1 1 -1 -1 1|-1 -1 -1 1 1 -1]
[ 1 1 -1 1 -1 -1|-1 -1 -1 -1 1 1]
[ 1 -1 1 -1 1 -1|-1 1 -1 -1 -1 1]
[ 1 -1 -1 1 -1 1|-1 1 1 -1 -1 -1]
[ 1 1 -1 -1 1 -1|-1 -1 1 1 -1 -1]
}}}
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.
--
Ticket URL: <http://trac.sagemath.org/ticket/16237#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.