ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 22 Oct 2020 15:55:53 +0200Determinant of large sparse symbolic matriceshttps://ask.sagemath.org/question/54004/determinant-of-large-sparse-symbolic-matrices/ I am working on a symbolic circuit simulation program for electronic circuits (SLiCAP). I have a matlab (MuPAD) and a python version available.
The key task of such a program is the calculation of the determinant of sparse matrices with symbolic entries. The MuPAD (MATLAB symbolic toolbox) version calculates the determinant of a sparse matrix (dim = 52x52) with one symbolic variable (the Laplace variable) in about one minute (minor expansion, algorithm unknown). The Python version uses maxima and the newdet method (Gentleman-Johnson algorithm). This method is limited to dim=50x50, but I had to reduce the size to (30x30) because of memory paging errors reported by Lisp.
Now I would like to try SageMath with the "df" algorithm for this purpose, but its running more then 30 minutes ...
I know the Gentleman-Johnson method is included in PyNAC but it doesn't seem to be included in the sage wrapper.
My questions:
1. Can SageMath be forced to use the Gentleman-Johnson algorithm included in PyNAC?
2. If not can a wrapper be build to do this?
3. If so, can someone help we with this?
Thanks in advance for repying!
written so that it can be used?
SLiCAPThu, 22 Oct 2020 15:55:53 +0200https://ask.sagemath.org/question/54004/ChainComplex() runs 24 times slower than homology()https://ask.sagemath.org/question/44101/chaincomplex-runs-24-times-slower-than-homology/I load a list of matrices `bdrs` representing a chain complex, their dimensions are
{1, 21, 210, 1330, 5985, 20349, 54264, 116280, 203490, 293930, 352716, 352716, 293930, 203490, 116280, 54264, 20349, 5985, 1330, 210, 21, 1}, and the largest has density 3.91*10^-6. In total they take up 50MB of disk space. This finishes in 63sec.
When I run `chcx=ChainComplex(bdrs,base_ring=GF(2))`, it takes 7hrs20min, but `chcx.homology()` finishes in only 18min. **Why does it take so long to just store a few matrices?** At first I thought that `ChainComplex()` also does some simplifications/reductions, but `[chcx.free_module_rank(i) for i in range(0,21)]` shows the original dimensions of matrices :/.
**Is there a faster way to compute the homology** of a chain complex (over $\mathbb{Z}$ or $\mathbb{Z}_p$)?LeonSun, 28 Oct 2018 09:55:39 +0100https://ask.sagemath.org/question/44101/