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.Mon, 10 Dec 2018 17:22:04 +0100Norm in UniversalCyclotomicFieldhttps://ask.sagemath.org/question/44623/norm-in-universalcyclotomicfield/ Hi,
I'm trying to work with vectors in the `UniversalCyclotomicField`, But I can't find a way to make the norm work. I'm writing the following code :
sage: a = vector([E(8)])
sage: a.norm()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-5b5ddb3f4c99> in <module>()
----> 1 a.norm()
/home/[name]/SageMath/local/lib/python2.7/site-packages/sage/modules/free_module_element.pyx in sage.modules.free_module_element.FreeModuleElement.norm (build/cythonized/sage/modules/free_module_element.c:12840)()
1671 sqrt(5)
1672 """
-> 1673 abs_self = [abs(x) for x in self]
1674 if p == Infinity:
1675 return max(abs_self)
TypeError: bad operand type for abs(): 'UniversalCyclotomicField_with_category.element_class'
And having no luck with it. Does any of you know a workaround allowing me to stay in exact calculations ?
Thanks in advanceAssombranceMon, 10 Dec 2018 17:22:04 +0100https://ask.sagemath.org/question/44623/Simultaneously diagonalizing matrices exactlyhttps://ask.sagemath.org/question/40737/simultaneously-diagonalizing-matrices-exactly/I have a bunch of matrices with integer coefficients that simultaneously commute. I know that there is a basis that simultaneously diagonalizes all of them, and I want to find it exactly so that I can recover all the corresponding eigenvalues as algebraic numbers.
I've tried casting to QQbar and using eigenvectors, but this occasionally tries to divide by zero for no reason I can discern. Any ideas?watson_laddMon, 22 Jan 2018 18:43:40 +0100https://ask.sagemath.org/question/40737/Memory error mixing exact numbers and decimal oneshttps://ask.sagemath.org/question/36618/memory-error-mixing-exact-numbers-and-decimal-ones/ Hi,
I wonder why this code gives an error in Sage 7.5.1:
f(x)=3*sin(2*pi*(1.75-2*x))
if abs(f(0.7)) < 1e-12:
print 1
MemoryError: Not enough memory to calculate cyclotomic polynomial of 428914250225777franpenaTue, 14 Feb 2017 18:42:39 +0100https://ask.sagemath.org/question/36618/exact factortinghttps://ask.sagemath.org/question/10638/exact-factorting/How do you get sage to factor into exact values. For instance, I want it to factor x^2-2 and return (x-sqrt(2))*(x+sqrt(2))
However, when I input
realpoly.<x> = PolynomialRing(CC)
factor(x^2-2,x)
Sage returns
(x - 1.41421356237310) * (x + 1.41421356237310)
Any ideas? ClemFanJC07Sun, 20 Oct 2013 19:43:06 +0200https://ask.sagemath.org/question/10638/Why does jordan_form not work over inexact rings?https://ask.sagemath.org/question/10488/why-does-jordan_form-not-work-over-inexact-rings/Hi,
Given a matrix M with entries (variables) in SR, I needed to compute the transformation matrix to a jordan form of M.
I ended up copying the code in "jordan_form" and "_jordan_form_vector_in_difference" from "matrix2.pyx",
deleting the "if (base_ring is None and not self.base_ring().is_exact()) ..."
and replacing "evals = A.charpoly().roots()" by
eigenvects=A.eigenvectors_right()
evals=[(eigenvect[0],eigenvect[2]) for eigenvect in eigenvects]
So far it seems to work. Can this go wrong? Or could one just change the original code in matrix2.pyx, and allow inexact rings?
Thanks for your help!LolinaThu, 29 Aug 2013 06:43:36 +0200https://ask.sagemath.org/question/10488/Exact factorial/gamma values for half-integershttps://ask.sagemath.org/question/8877/exact-factorialgamma-values-for-half-integers/is it possible to return exact values of (n+1/2)! and ?(n+1/2) for *n* is an integer?
[Particular Values of the Gamma Function](http://en.wikipedia.org/wiki/Particular_values_of_the_Gamma_function)daniel.e2718Thu, 10 May 2012 20:43:01 +0200https://ask.sagemath.org/question/8877/out of core exact linear algebrahttps://ask.sagemath.org/question/8810/out-of-core-exact-linear-algebra/I'm trying to solve a large (17000x250000) sparse (density=0.01) system over the rationals. Are there any routines in Sage (or out) that could give the reduced row echelon form, or the null space?
Everything I've looked into either runs out of memory or isn't exact.tagitagiWed, 21 Mar 2012 17:21:05 +0100https://ask.sagemath.org/question/8810/