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.Fri, 28 May 2021 09:55:04 +0200unique elements in complex numbers listhttps://ask.sagemath.org/question/57315/unique-elements-in-complex-numbers-list/I have a list of complex numbers, but even after converting it to a set, there are a lot of repetitions.
here is a minimal example (in my code i have 10^6 polynomials, here only 2)
from sage.rings.polynomial.complex_roots import complex_roots
x = polygen(ZZ)
r1 = complex_roots( x^3+1)
r2 = complex_roots( x^6+2*x^3+1)
s1 = set([r[0] for r in r1])
s2 = set([r[0] for r in r2])
s1 | s2
which results in
{-1,
0.500000000000000? - 0.866025403784439?*I,
0.500000000000000? - 0.866025403784439?*I,
0.500000000000000? + 0.866025403784439?*I,
0.500000000000000? + 0.866025403784439?*I}
as you can see, the roots must be only 3.
Is there an instruction to reduce a set of complex numbers differing less than a delta?alvaroFri, 28 May 2021 09:55:04 +0200https://ask.sagemath.org/question/57315/simplifying a simplicial sethttps://ask.sagemath.org/question/56477/simplifying-a-simplicial-set/The starting point to this question is a simplicial set with a large number of simplices. Sage is still computing exactly how many, but in dimension 4 there are more than 100,000 simplices. Is there a command similar to X.shrink_simplicial_complex(K), but for which the input is already a simplicial set? I am fairly certain this simplicial set description of a cell complex can be described much, much more efficiently. I would like to be able to compute homology and cohomology, but my guess is that this won't be feasible unless I can first simplify.IngridSat, 03 Apr 2021 10:21:48 +0200https://ask.sagemath.org/question/56477/