More general stuff at the end of mail.
On Thu, 11 Dec 2014, Nathann Cohen wrote:
More difficult is to optimize product() or ordinal_sum() etc.
And impossible, I think, is to optimize mobius_function_matrix, because one
can not know if it has already been calculated or not. Or maybe with
test with definition of mobius_function?
I don't know.... Is it very costly to compute ? The Moebius function
should be quick, shouldn't it ? O_o
It is basically just self.lequal_matrix().inverse().change_ring(ZZ).
lequal_matrix() returns dense integer matrix, and it's .inverse() is of
course of type dense rational matrix but actually integers only. And
lequal_matrix() is upper triangular matrix; we have no support for them as
a basic Matrix type; scipy etc. has support. And to be exact, diagonal
elements are ones. And more, it is of course boolean matrix. So there are
much to optimize for, if someone is interested.
* * *
More general question: should we precalculate things like this? There is
some kind of memory-cpu tradeoff. Should lattices save meet and join
matrices? Or should there be some optional parameter, like
P=Q.product(R, compute=True)
what would compute Möbius function matrix, rank function etc. for all Q, R
and P?
--
Jori Mäntysalo