Hecke.jl
Hecke.jl copied to clipboard
`issquare`/`is_square` vs `issquare_matrix`
There is a helper function issquare_matrix
in Hecke which is only used locally in one place. OTOH in AbstractAlgebra, there is an issquare
(now: is_square
) method for matrices which does exactly the same thing.
I first wanted to replace issquare_matrix
here, but the more I think about it, the more I wonder if we shouldn't do the reverse: after all, for a square matrix, it would also make sense to ask if it is the square of some other matrix, leading to ambiguity.
On the other hand, we also have isdiagonal
(and not isdiagonal_matrix
), is_symmetric
, is_upper_triangular
, etc.
CC @fieker @wbhart @thofma
I don't mind, but I don't actually know an algorithm to check if a matrix is the square of another. I am also not sure of applications.
But that is not what you are asking though. On the naming convention, I have no real opinion.
Well, over fields: one can go to Jordan normal form (may require working in a field extension, of course) and for these square roots can be decided. In general there may be multiple square roots now (depending on the number and types of Jordan blocks).
But yeah, as you correctly pointed out, Bill, it doesn't really matter: the only applications of square roots of matrices I know are for symmetric positive definite matrices in char 0, and in general I then don't care about testing this, but rather for computing the square root.
So in principle I am fine with leaving is_square
for matrices as it is -- I just thought it would be good to (briefly) discuss this explicitly and thus document whatever decision we arrive at.
two functions: is_square
and is_a_square
?
Oh no, this whole CAS business is madness. I guess if we ever need it, we can still use is_square_with_sqrt
. I would keep is_square
.
The CAS is sane. It's only the people who use it without reading every single line of the documentation at 8am every day to see if anything changed who are not sane.
On Fri, May 06, 2022 at 08:12:07AM -0700, wbhart wrote:
I don't mind, but I don't actually know an algorithm to check if a matrix is the square of another. I am also not sure of applications. It happens in numerics/ diff. eqns (at least there). Just evaluate the power series for square-root at the matrix - and do this via jordan form
But that is not what you are asking though. On the naming convention, I have no real opinion.
-- Reply to this email directly or view it on GitHub: https://github.com/thofma/Hecke.jl/issues/685#issuecomment-1119725971 You are receiving this because you were mentioned.
Message ID: @.***>
I will close this for now. I also could not find the issquare_matrix
in the source code anymore (because it was removed in https://github.com/thofma/Hecke.jl/pull/688).