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, 15 Sep 2022 21:55:07 +0200How to compute the canonical divisor of a smooth varietyhttps://ask.sagemath.org/question/64027/how-to-compute-the-canonical-divisor-of-a-smooth-variety/I cant seem to find any sort of documentation for how to compute the canonical divisor $K_X$ of a variety. My example is quite simpe: I'm just trying to compute the (anti)canonical divisor $-K_X$ of the Segre variety $\mathbb{P}^2 \times \mathbb{P}^2 \subset \mathbb{P}^8$ intersected by a quadric $Q \subset \mathbb{P}^8$ which will be a prime Fano variety so that $-K_X$ is a hyperplane section — I'm able to construct the intersection and save it as a subscheme in SageMath, but cant get much information outside of that.
It seems like the only real way to do this in SageMath is with toric varieties which is a bit frustrating.cdareThu, 15 Sep 2022 21:55:07 +0200https://ask.sagemath.org/question/64027/Elementary divisors of a matrixhttps://ask.sagemath.org/question/42485/elementary-divisors-of-a-matrix/Hi,
I need to compute elementary divisors of a matrix (xI-A), where A is a matrix defined over GF(2). So, i try to define a univariate polynomial ring (R) over GF(2) and compute the elementary divisors of (xI-A) using the elementary_divisors() procedure. But as the size of the matrix increases, the algorithm is too slow. My matrices are of dimension 100.
Can anyone suggest an alternative approach to solve the problem. RamachandranSun, 03 Jun 2018 18:56:18 +0200https://ask.sagemath.org/question/42485/Error when using elementary_divisors()https://ask.sagemath.org/question/10221/error-when-using-elementary_divisors/Can someone please tell me what this error means?
***-macbook:sage faculty1$ ./sage ../H-nqk.sage> ../test5.out
Traceback (most recent call last):
File "../H-nqk.py", line 38, in <module>
print A.elementary_divisors()
File "matrix_integer_dense.pyx", line 2065, in sage.matrix.matrix_integer_dense.Matrix_integer_dense.elementary_divisors (sage/matrix/matrix_integer_dense.c:17905)
File "gen.pyx", line 8525, in sage.libs.pari.gen.gen.matsnf (sage/libs/pari/gen.c:43676)
RuntimeError: Illegal instruction
When I execute the program using the online notebook everything runs fine, so it must be a computer issue. This error occurred when trying to compute the elementary divisors of a 125X125 matrix. Strange thing is, when running the program using a smaller matrix there was no error.
Would really appreciate any help.invariantfactorTue, 11 Jun 2013 14:41:06 +0200https://ask.sagemath.org/question/10221/