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, 04 Nov 2024 07:29:56 +01003d plot theme default? (Threejs viewer)https://ask.sagemath.org/question/79995/3d-plot-theme-default-threejs-viewer/The following command produces an interactive 3d plot viewer with the default white background.
plot3d(x^2 + y^2, (x, -1, 1), (y, -1, 1))
But I want a black background. This functionality is available with the following command.
plot3d(x^2 + y^2, (x, -1, 1), (y, -1, 1)).show(theme="dark")
But it is cumbersome to type out `.show(theme="dark")` each time I wish to plot something.
**Can I set the _default_ 3d plot theme? How?**
I did my best to search the official docs and general web for an answer. I tried searching through the source code to find any potential answers, but I am not skilled enough.
I am using SageMath version 10.4, interactively through Linux CLI. The 3D viewer my installation defaults to is the Threejs viewer, offline version.
This is my first post. If I have done something wrong, sorry! I will do my best to rectify any mistakes I make.
Thanks in advance to anyone who can answer, even if the true answer is just "no".eMon, 04 Nov 2024 07:29:56 +0100https://ask.sagemath.org/question/79995/Running Sage as a Command and Importing as a Python Library in Kali Linuxhttps://ask.sagemath.org/question/79923/running-sage-as-a-command-and-importing-as-a-python-library-in-kali-linux/I've successfully managed to install SageMath on Kali Linux by following this guide : pastebin.com/6m6ypB2N. While I can run SageMath using the following command: ./sage However, this is different from other people's Sage, where they can run it using the sage command like Python. Also, I want to import Sage as a library in Python using: from sage.all import * since many prewritten algorithms and libraries are written in Python. I have no idea why my Sage installation behaves differently and not like other people's installations, and I can't find any related guides anywhere.rocfusFri, 01 Nov 2024 19:30:06 +0100https://ask.sagemath.org/question/79923/[Solved] Build problem with giac Sagemath10.4 on Linux Mint 22https://ask.sagemath.org/question/79813/solved-build-problem-with-giac-sagemath104-on-linux-mint-22/ I am installing Sagemath 10.4 on Linux MInt 22. make fails on build of giac-1.9.0.15po. The following are error messages extracted from the giac-1.9.0.15po.log. Iam not sure how to make sense of this as I can't seem to locate the Makefile referred to.
>
[spkg-install] collect2: error: ld returned 1 exit status
[spkg-install] make[7]: *** [Makefile:792: icas] Error 1
[spkg-install] make[6]: *** [Makefile:507: all-recursive] Error 1
[spkg-install] make[5]: *** [Makefile:437: all] Error 2
[spkg-install] **********************************************************************************************************************************************************************************************************************************************
[spkg-install] Error building giac-1.9.0.15p0
[spkg-install] **********************************************************************************************************************************************************************************************************************************************
************************************************************************
Error installing package giac-1.9.0.15p0David CousensSat, 26 Oct 2024 04:03:28 +0200https://ask.sagemath.org/question/79813/Elimination didn't find the correct idealhttps://ask.sagemath.org/question/79889/elimination-didnt-find-the-correct-ideal/Hi! I'm trying to compute the polynomial relations among matrix entries:
Here is the setup:
<pre>
# the following codes are from python with sagemath
a, b, c, d, e, f, g = var('a b c d e f g')
N = Matrix(SR,
[[a, e, f, g],
[e, b, 0, 0],
[f, 0, c, 0],
[g, 0, 0, d]]
)
M = N.inverse()
</pre>
For the symmetric matrix N with the above zero patterns, we notice that the following relations should hold in its inverse, and indeed we verified them:
<pre>
# below all passed
assert M[0, 0] * M[1, 2] * M[1, 3] - M[0, 1] ** 2 * M[2, 3] == 0
assert M[0, 1] * M[0, 2] - M[0, 0] * M[1, 2] == 0
assert M[0, 1] * M[0, 3] - M[0, 0] * M[1, 3] == 0
assert M[0, 2] * M[0, 3] - M[0, 0] * M[2, 3] == 0
assert M[0, 3] * M[1, 2] - M[0, 1] * M[2, 3] == 0
assert M[0, 2] * M[1, 3] - M[0, 1] * M[2, 3] == 0
</pre>
Then, I tried to see if these relations can be found automatically by elimination:
<pre>
tag_variable_names = [f'M_{i}_{j}' for i in range(4) for j in range(i, 4)]
R = PolynomialRing(QQ, tag_variable_names + ['a', 'b', 'c', 'd', 'e', 'f', 'g'])
R_gens = R.gens_dict()
param_symbolic_to_ring = {v: R_gens[str(v)] for v in [a, b, c, d, e, f, g]}
equations = []
for i in range(4):
for j in range(i, 4):
true_expr = M[i, j].subs(param_symbolic_to_ring)
# this true expression is fraction of polynomials w.r.t. parameters a, b, c, ..., and can be very complicated
# we clear the denominator as follows:
numerator, denominator = true_expr.numerator(), true_expr.denominator()
equations.append(R_gens[f'M_{i}_{j}'] * denominator - R(numerator))
I = R.ideal(equations)
# to get the relations among tag variables (entries of M), we eliminate the parameters
J = I.elimination_ideal(list(param_symbolic_to_ring.values()))
Ideal_M = J.change_ring(PolynomialRing(QQ, tag_variable_names))
</pre>
I expect that the elimination ideal should contain the above relations. However, nothing was found:
<pre>
> Ideal_M.gens()
[0]
</pre>
Why does this happen? Could it be related to handling fractions during the elimination? Any insights would be appreciated!cgr71Wed, 30 Oct 2024 14:21:48 +0100https://ask.sagemath.org/question/79889/Not recognizing infinite sum as zeta function?https://ask.sagemath.org/question/79876/not-recognizing-infinite-sum-as-zeta-function/ Hi,
Is there a reason why Sage can recognize an infinite series as the zeta function for integers but not fractions (rationals)? For example:
sum(1/t^(2), t, 1, oo), sum(1/t^(3), t, 1, oo), sum(1/t^(11), t, 1, oo)
returns `(1/6*pi^2, zeta(3), zeta(11))`
But, this:
sum(1/t^(3/2), t, 1, oo), sum(1/t^(5.2), t, 1, oo)
returns just `(sum(t^(-3/2), t, 1, +Infinity), sum(t^(-5.2), t, 1, +Infinity))`spiritheap51Tue, 29 Oct 2024 11:28:25 +0100https://ask.sagemath.org/question/79876/import sage.all; ImportError: libgsl.so.25: cannot open shared object file: No such file or directoryhttps://ask.sagemath.org/question/79789/import-sageall-importerror-libgslso25-cannot-open-shared-object-file-no-such-file-or-directory/Hello:
How Can I import sage.all?
Thanks a lot
{bash}
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 10.4, Release Date: 2024-07-19 │
│ Using Python 3.11.10. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: sage.all is not available; this is a limited REPL. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage: import sage.all
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import sage.all
File ~/miniconda3/envs/sage/lib/python3.11/site-packages/sage/all.py:84
81 from sage.data_structures.all import *
83 from sage.structure.all import *
---> 84 from sage.rings.all import *
85 from sage.arith.all import *
86 from sage.matrix.all import *
File ~/miniconda3/envs/sage/lib/python3.11/site-packages/sage/rings/all.py:57
54 from sage.rings.finite_rings.all import *
56 # Number field
---> 57 from sage.rings.number_field.all import *
59 # Function field
60 from sage.rings.function_field.all import *
File ~/miniconda3/envs/sage/lib/python3.11/site-packages/sage/rings/number_field/all.py:2
----> 2 from sage.rings.number_field.number_field import (NumberField, NumberFieldTower, CyclotomicField, QuadraticField,
3 is_fundamental_discriminant, is_real_place)
4 from sage.rings.number_field.number_field_element import NumberFieldElement
6 from sage.rings.number_field.order import EquationOrder, GaussianIntegers, EisensteinIntegers
File ~/miniconda3/envs/sage/lib/python3.11/site-packages/sage/rings/number_field/number_field.py:84
82 import sage.libs.ntl.all as ntl
83 import sage.rings.abc
---> 84 import sage.rings.complex_mpfr
85 from sage.rings.polynomial.polynomial_element import Polynomial
86 import sage.rings.real_mpfr
File ~/miniconda3/envs/sage/lib/python3.11/site-packages/sage/rings/complex_mpfr.pyx:1, in init sage.rings.complex_mpfr (build/cythonized/sage/rings/complex_mpfr.c:44581)()
----> 1 """
2 Arbitrary precision floating point complex numbers using GNU MPFR
3
ImportError: libgsl.so.25: cannot open shared object file: No such file or directorydanliSat, 26 Oct 2024 00:06:02 +0200https://ask.sagemath.org/question/79789/Low order Taylor expansionhttps://ask.sagemath.org/question/79842/low-order-taylor-expansion/When I try to Taylor expand the following expression
f(x) = sin(x)^6 / ( 8 - 15*cos(x) + 10*cos(x)^3 - 3*cos(x)^5)
up to a low order like 4, sage returns 0, but for higher orders like 6 and up,
it correctly Taylor expands the function but it suddenly also finds lower order terms.
the following code shows the issue
[taylor(f(x), x, 0, i) for i in range(8) ]
the first 5 expansions give 0, from order 6 on, sage finds also lower order terms.davySun, 27 Oct 2024 17:03:42 +0100https://ask.sagemath.org/question/79842/Solving a system by resultant computationshttps://ask.sagemath.org/question/79839/solving-a-system-by-resultant-computations/I want to solve the following system f(x,y,z)=g(x,y,z)=h(x,y,z)=0 in Sage using resultant computations, where f(x,y,z)=x^2 + y + z -1 and g(x,y,z)=x + y^2 + z-1 and h(x,y,z)=x^2 + y + z^2 -1. So what are sufficient commands to do this, and thank you.hamoudaSun, 27 Oct 2024 14:43:37 +0100https://ask.sagemath.org/question/79839/colored jones polynomial function does not returnhttps://ask.sagemath.org/question/79833/colored-jones-polynomial-function-does-not-return/Hi, and excume me to disturbe.
I'm using sage 10.4 (with python3.12.7) for topology knot invariant calculation.
My program is as follows:
from sage.all import *
ans = Knot([[1, 5, 2, 4], [3, 7, 4, 6], [5, 3, 6, 2], [7, 13, 8, 12], [9, 18, 10, 19], [11, 15, 12, 14], [13, 9, 14, 8], [15, 22, 16, 1], [17, 20, 18, 21], [19, 10, 20, 11], [21, 16, 22, 17]]).colored_jones_polynomial(2)
In this program `[[1, 5, 2, 4], [3, 7, 4, 6], [5, 3, 6, 2], [7, 13, 8, 12], [9, 18, 10, 19], [11, 15, 12, 14], [13, 9, 14, 8], [15, 22, 16, 1], [17, 20, 18, 21], [19, 10, 20, 11], [21, 16, 22, 17]]` is a pd_code of knot `K3a1#K8a8`.
But the program never seems to return.
When I tried to calculate the same invariant in mathematica, it return at once and i get the polynomial:
1/q^13 - 2/q^12 - 1/q^11 + 7/q^10 - 6/q^9 - 8/q^8 + 21/q^7 - 10/q^6 - 25/q^5 + 43/q^4 - 10/q^3 - 52/q^2 + 68/q - 82 q + 83 q^2 + 14 q^3 - 101 q^4 + 80 q^5 + 25 q^6 - 98 q^7 + 65 q^8 + 25 q^9 - 74 q^10 + 42 q^11 + 17 q^12 - 40 q^13 + 20 q^14 + 7 q^15 - 14 q^16 + 7 q^17 + q^18 - 3 q^19 + q^20
Which means that maybe something is wrong with the implementation in sage.
Besides, I used Ctrl+C to interrupt this program and I found that, according to the stack trace, the program seems to stop in a function called `hash` all the time.
If anyone has knowledge of this issue and is willing to help, I would greatly appreciate it.
I tried all prime/non-prime knots no more than 11-crossing that I know (1782 knots are tested) for 2-colored and 3-colored jones polynomial, and only 32% of the function call can return in one minute.
A usual stack trace is lised as follows:
---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
Cell In[2], line 1
----> 1 ans = Knot([[Integer(1), Integer(5), Integer(2), Integer(4)], [Integer(3), Integer(7), Integer(4), Integer(6)], [Integer(5), Integer(3), Integer(6), Integer(2)], [Integer(7), Integer(13), Integer(8), Integer(12)], [Integer(9), Integer(18), Integer(10), Integer(19)], [Integer(11), Integer(15), Integer(12), Integer(14)], [Integer(13), Integer(9), Integer(14), Integer(8)], [Integer(15), Integer(22), Integer(16), Integer(1)], [Integer(17), Integer(20), Integer(18), Integer(21)], [Integer(19), Integer(10), Integer(20), Integer(11)], [Integer(21), Integer(16), Integer(22), Integer(17)]]).colored_jones_polynomial(Integer(2))
File ~/.local/mambaforge/envs/sage_env/lib/python3.12/site-packages/sage/knots/knot.py:388, in Knot.colored_jones_polynomial(self, N, variab, try_inverse)
353 def colored_jones_polynomial(self, N, variab=None, try_inverse=True):
354 r"""
355 Return the colored Jones polynomial of the trace closure of the braid.
356
(...)
386 (t^3 + 3*t^2 + 4*t + 1)/(t^4 + 4*t^3 + 6*t^2 + 4*t + 1)
387 """
--> 388 return self.braid().colored_jones_polynomial(N=N, variab=variab,
389 try_inverse=try_inverse)
File ~/.local/mambaforge/envs/sage_env/lib/python3.12/site-packages/sage/groups/braid.py:2242, in Braid.colored_jones_polynomial(self, N, variab, try_inverse)
2239 shorter_qword = qword_inv if use_inverse else qword
2240 knot = Knot(self.inverse()) if use_inverse else Knot(self)
2241 cj = (q**((N - 1) * (knot.writhe() - self.strands() + 1) / 2)
-> 2242 * self._colored_jones_sum(N, shorter_qword))
2243 self._cj_with_q[N] = cj.subs({q: 1/q}) if use_inverse else cj
2244 return self.colored_jones_polynomial(N, variab, try_inverse)
File ~/.local/mambaforge/envs/sage_env/lib/python3.12/site-packages/sage/groups/braid.py:2163, in Braid._colored_jones_sum(self, N, qword)
2159 # This seemingly infinite sum is always finite if the qword comes
2160 # from a sum of quantum determinants; because at some point
2161 # the break condition will become true.
2162 while continue_summing:
-> 2163 current_word *= rqword
2164 new_rqw = RightQuantumWord(alg(current_word))
2165 current_word = new_rqw.reduced_word()
File ~/.local/mambaforge/envs/sage_env/lib/python3.12/site-packages/sage/structure/element.pyx:1510, in sage.structure.element.Element.__mul__ (build/cythonized/sage/structure/element.c:20246)()
1508 cdef int cl = classify_elements(left, right)
1509 if HAVE_SAME_PARENT(cl):
-> 1510 return (<Element>left)._mul_(right)
1511 if BOTH_ARE_ELEMENT(cl):
1512 return coercion_model.bin_op(left, right, mul)
File ~/.local/mambaforge/envs/sage_env/lib/python3.12/site-packages/sage/structure/element.pyx:1556, in sage.structure.element.Element._mul_ (build/cythonized/sage/structure/element.c:20605)()
1554 raise bin_op_exception('*', self, other)
1555 else:
-> 1556 return python_op(other)
1557
1558 cdef _mul_long(self, long n):
File ~/.local/mambaforge/envs/sage_env/lib/python3.12/site-packages/sage/algebras/free_algebra_element.py:201, in FreeAlgebraElement._mul_(self, y)
199 z_elt[key] += cx*cy
200 else:
--> 201 z_elt[key] = cx*cy
202 if not z_elt[key]:
203 del z_elt[key]
File ~/.local/mambaforge/envs/sage_env/lib/python3.12/site-packages/sage/monoids/free_monoid_element.py:102, in FreeMonoidElement.__hash__(self)
90 def __hash__(self):
91 r"""
92 TESTS::
93
(...)
100 True
101 """
--> 102 return hash(tuple(self._element_list))
File src/cysignals/signals.pyx:310, in cysignals.signals.python_check_interrupt()
KeyboardInterrupt:GGN_2015Sun, 27 Oct 2024 02:53:57 +0100https://ask.sagemath.org/question/79833/Unable to locate package Sagemathhttps://ask.sagemath.org/question/79766/unable-to-locate-package-sagemath/ Newbie question:
I have been trying to get Sagemath installed on a Win10 PC. Have installed WSL and Ubuntu 24.04. I have tried $ sudo apt install sagemath however, it returns the message "Unable to locate package Sagemath". Earlier, it came back with a more verbose comment "Package sagemath is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source".
Would much appreciate any workable advise to get me started on SageMath / Win10 / WSL / Ubuntu24.04.
Towards the working end to complete the SageMath install, I find that much of the information available on the web is vague and imprecise.
Many Thanks... Shahid / Shaussie.Shaussie01Thu, 24 Oct 2024 13:06:40 +0200https://ask.sagemath.org/question/79766/A limit trivial in polar coordinates cannot be computed in Cartesian coordinates. Why ?https://ask.sagemath.org/question/79602/a-limit-trivial-in-polar-coordinates-cannot-be-computed-in-cartesian-coordinates-why/Consider :
sage: var("x, y, rho, theta, k")
(x, y, rho, theta, k)
sage: g(rho, theta)=cos(theta)*exp(-rho^2)
sage: parametric_plot3d([rho*cos(theta), rho*sin(theta), g(rho, theta)], (rho, 0, 2), (theta, -pi, pi), aspect_ratio=[1, 1, 2], title="g").show(viewer="tachyon")
Launched png viewer for Graphics3d Object
![image description](/upfiles/17284898204876548.png)
This function isn't even defined at the origin, nor it does have a limit *stricto sensu*. It has, however, a well defined *directional* limit, trivially computed :
sage: limit(g(rho, theta), rho=0)
cos(theta)
In Cartesian coordinates, the function can be expressed as :
sage: f(x, y)=g(rho, theta).subs({rho^2:x^2+y^2, theta:atan2(y, x)}) ; f
(x, y) |--> x*e^(-x^2 - y^2)/sqrt(x^2 + y^2)
We can visually check that this function is the same as $ g $ :
sage: plot3d(f(x, y), (x, -2, 2), (y, -2, 2), aspect_ratio=[1, 1, 2], title="f").show(viewer="tachyon")
Launched png viewer for Graphics3d Object
![image description](/upfiles/17284892663136875.png)
However, the very same directional limit is irretrievable when expressed in Cartesian coordinates. Using $ k=\tan\theta $ :
sage: f(x, y).subs({y:k*x}).limit(x=0)
ind
There are (at least) two ways to get *a* result :
sage: f(x, y).subs({y:k*x}).limit(x=0, taylor=True)
1/sqrt(k^2 + 1)
sage: f(x, y).subs({y:k*x}).limit(x=0, algorithm="sympy")
1/sqrt(k^2 + 1)
which is erroneous :
sage: f(x, y).subs({y:x*tan(theta)}).limit(x=0, algorithm="sympy")
sqrt(cos(theta)^2)
In fact, we expect $\cos\theta$ but we get $|\cos\theta|$. In other words, while the function is correctly computed, its directional limit loses its sign.
What am I doing wrong ?
BTW, I have checked that Mathematica stumbles on the same block...Emmanuel CharpentierWed, 09 Oct 2024 18:06:59 +0200https://ask.sagemath.org/question/79602/complicated algebra test: infinite loophttps://ask.sagemath.org/question/79751/complicated-algebra-test-infinite-loop/ Hi
W11,WSL,UBUNTU 22.04 ,SAGEMATH 10.2
test if zero of complicated algebra value gives infinite loop (if second t value uncommented)
t=-1/6*(1/4)^(1/3)*(3*sqrt(35)*sqrt(3) + 31)^(1/3)*(I*sqrt(3) + 1) - 2/3*(1/4)^(2/3)*(-I*sqrt(3) + 1)/(3*sqrt(35)*sqrt(3) + 31)^(1/3) + 1/3
#t= -1/12*sqrt((36*(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(2/3) + 21*(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(1/3) + 91)/(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(1/3)) - 1/2*sqrt(-(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(1/3) - 91/36/(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(1/3) - 27/2/sqrt((36*(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(2/3) + 21*(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(1/3) + 91)/(1/24*I*sqrt(827)*sqrt(6) + 593/216)^(1/3)) + 7/6) - 1/4
show(t)
if t == 0 :
print('zero')ortolljWed, 23 Oct 2024 07:31:21 +0200https://ask.sagemath.org/question/79751/How to simplify Bessel functions ?https://ask.sagemath.org/question/79676/how-to-simplify-bessel-functions/Hello,
I'm studying Helmholtz equation in cylindrical coordinates.
I'm using a solution of the scalar Helmholtz equation to build a vector field that could be a solution of the vector Helmholtz equation.
Here is my code with an orthonormal basis in a 3D manifold with cylindrical coordinates.
Normally, SVH should be equal to 0 (actually, it is), but Sage doesn't simplify.
I've used the simplify function, but it doesn't work.
Can someone help me?
%display latex
from sage.manifolds.operators import *
E = Manifold(3,coordinates='cylindrical', name='E') # 3D Manifold in cylindrical coord
Ecyl.<r,ph,z> = E.chart(r'r:(0,+oo) ph:(0,2*pi):\phi z')
k = var('k')
assume(k>=0)
to_orthonormal = E.automorphism_field() # Orthonormal basis q
to_orthonormal[0,0] = 1
to_orthonormal[1,1] = 1/r
to_orthonormal[2,2] = 1
q = Ecyl.frame().new_frame(to_orthonormal, 'q')
E.set_default_frame(q)
eta = E.metric(name='eta', latex_name=r'\eta') #Minkowski metric
eta[0,0] = 1
eta[1,1] = 1
eta[2,2] = 1
h = E.scalar_field(bessel_J(0,sqrt(k^2)*r)*cos(0*z)*cos(0*ph), name='h') #Helmholtz equation solution in cylindrical coord
k2 = -h.laplacian(eta)*h^(-1) # Determination of k^2
H = h*(r*q[0]+z*q[2]) #Definition of a vector field H such that O is a vectorial Helmholtz equation solution
O = H.curl(metric=eta)
SHV = O.laplacian(eta) + k2*O
SHV.display()
Sage solution :
-1/4*((2*bessel_J(2, k*r)*bessel_J(1, k*r) - bessel_J(3, k*r)*bessel_J(0, k*r) + bessel_J(1, k*r)*bessel_J(0, k*r))*k^3*r^2 - 2*(2*bessel_J(1, k*r)^2 - bessel_J(2, k*r)*bessel_J(0, k*r) + bessel_J(0, k*r)^2)*k^2*r + 4*k*bessel_J(1, k*r)*bessel_J(0, k*r))*z/(r^2*bessel_J(0, k*r))CModeraWed, 16 Oct 2024 10:53:18 +0200https://ask.sagemath.org/question/79676/How to use splines in substitutionshttps://ask.sagemath.org/question/79678/how-to-use-splines-in-substitutions/Hello. I'm working on geodesics on a manifold for which the metric functions are only given in terms of numerical functions. I obtained the approximations of the functions using splines, which work very well. When it comes time to substitute for the metric functions, however, I run into a problem.
Here's a minimal example that reproduces the problem:
Make straight line spline:
`spltest=spline([(0,0), (1,1), (2,2)])`
Create expression:
`eq(r) = 2 * function('nu')(r)`
Substitute:
`eq.subs({nu(r): spltest(r)})`
which throws out errors:
```
TypeError: cannot evaluate symbolic expression to a numeric value
TypeError: unable to simplify to float approximation
```
When spline is replaced with a PolynomialRing.lagrange_polynomial, the substitution works fine, but Lagrange polynomials do not behave well with the form of the function I need, and therefore cannot be used in general.
Any advice for making numeric data work with equations?dexWed, 16 Oct 2024 12:11:43 +0200https://ask.sagemath.org/question/79678/Run live tutorials and documentation in local notebook 9.6?https://ask.sagemath.org/question/79682/run-live-tutorials-and-documentation-in-local-notebook-96/ Can we and how do we do this? tutorial() doesn't work and the items under the help menu just display static tutorials.chaikensWed, 16 Oct 2024 14:55:33 +0200https://ask.sagemath.org/question/79682/Automate run in Windows 10 using conda (2024)https://ask.sagemath.org/question/79658/automate-run-in-windows-10-using-conda-2024/Hello everyone!
I've installed Sagemath on two Windows 10 machines following the guide https://doc.sagemath.org/html/en/installation/index.html
with different results.
In one of them (the one with the issue), to run Sagemath I have to open Ubuntu and run
$ conda activate sage
every time I want to use sagemath. This prevents me from being able to use a shortcut to launch sagemath: when following the instructions in
https://doc.sagemath.org/html/en/installation/launching.html#create-a-notebook-launch-script
and
https://doc.sagemath.org/html/en/installation/launching.html#create-a-shortcut
it doesn't work, it shows:`./sage_nb.sh: line 3: sage: command not found`
Q1: currently my script reads
#!/bin/bash
cd /mnt/c
sage -n jupyter
Can I modify it also to do the "$ conda activate sage" command first? I've tried in several ways but failed miserably, for instance changing it to
#!/bin/bash
conda init
conda activate sage
cd /mnt/c
sage -n jupyter
I get
CondaError: Run 'conda init' before 'conda activate'
./sage_nb.sh: line 5: sage: command not found
which, by the way, is exactly the same message I get when NOT entering the line 2 with `conda init`.
Q2: Is there a way of permanently avoiding the need to enter the command `$ conda activate sage` every time?tidessonMon, 14 Oct 2024 16:09:15 +0200https://ask.sagemath.org/question/79658/Cannot transpose the matrix with x.transpose()https://ask.sagemath.org/question/79649/cannot-transpose-the-matrix-with-xtranspose/ Helllo,
im having a probles with matrixes that i do during my studies, i try to transpose the matrixes but it gives me the error
```
AttributeError Traceback (most recent call last)
Cell In[17], line 1
----> 1 A.transpose()
AttributeError: 'NoneType' object has no attribute 'transpose'
```
an the said matrix looks like that
A = matrix(2,3,[8,-2,3,5,1,-4])zizzelziSun, 13 Oct 2024 17:01:12 +0200https://ask.sagemath.org/question/79649/How to specify dashed edges in SageMath?https://ask.sagemath.org/question/76558/how-to-specify-dashed-edges-in-sagemath/I would like to present some subgraphs of a graph. Considering that the printed version is in black and white, I would like the highlighted subgraphs to appear as red dashed lines. However, I have only seen settings for color. I am not sure how to set the dashed lines.
g=Graph([(0, 1), (0, 3), (0, 4), (0, 5), (0, 6), (0, 7), (0, 8), (1, 3), (1, 5), (1, 7), (1, 8), (1, 9), (1, 10),
(3, 4), (3, 5), (3, 10), (4, 5), (5, 6), (5, 7), (5, 9), (5, 10), (6, 7), (7, 8), (7, 9)])
g.plot(layout="planar",save_pos=True)
s=g.hamiltonian_cycle()
s1=s.edges(labels=False)
#print(s1)
def plot_with_highlight(G, highlight_edges):
highlight_vertices = list(set().union(*highlight_edges))
G.plot(edge_colors={'red': highlight_edges}, vertex_colors={'red': highlight_vertices}).show()
plot_with_highlight(g,s1)
![image description](/upfiles/17107541498930897.png)lichengMon, 18 Mar 2024 10:29:23 +0100https://ask.sagemath.org/question/76558/Install of Sage 10.4 freezes my computerhttps://ask.sagemath.org/question/78518/install-of-sage-104-freezes-my-computer/Please note that my Linux build froze while building Sage 10.4
My machine is reasonably powerful, and shows 12 CPU.
During the build it occasionally showing 100% on all CPUs and SENSORS would register some heat issues, but usually continued.
The final error I got was from:
from /mnt/extra_data/Sage/Sage_10_4_failed/sage/logs/pkgs/scipy-1.12.0.log
#
#[spkg-install] [1033/1610] Compiling C++ object scipy/spatial/_ckdtree.cpython-310-x86_64-linux-gnu.so.p/ckdtree_src_build.cxx.o
#[spkg-install] [1034/1610] Generating 'scipy/spatial/_ckdtree.cpython-310-x86_64-linux-gnu.so.p/_ckdtree.cpp'
#[spkg-install] warning: /mnt/extra_data/Sage/Sage_10_4/sage/local/var/lib/sage/venv-python3.10/var/tmp/sage/build/scipy-1.12.0/src/scipy/spatial/_ckdtree.pyx:1627:5: Only extern functions can throw C++ exceptions.kyourenMon, 29 Jul 2024 08:04:57 +0200https://ask.sagemath.org/question/78518/Find a perfect bisimplicial ordering in a faster algorithmhttps://ask.sagemath.org/question/79627/find-a-perfect-bisimplicial-ordering-in-a-faster-algorithm/A bipartite graph is chordal bipartite if each cycle of length at least 6 has
a chord. My question as shown in https://github.com/sagemath/sage/issues/38792
I write a brute-force search for finding perfect bisimplicial ordering on chordal bipartite graphs.lichengFri, 11 Oct 2024 14:36:34 +0200https://ask.sagemath.org/question/79627/Expansion cos(3x)https://ask.sagemath.org/question/79625/expansion-cos3x/ Is there a way in the Sagemath language to expand expression like cos(n*x) in terms of sin(x) and cos(x)?antrock1999Fri, 11 Oct 2024 13:15:20 +0200https://ask.sagemath.org/question/79625/values of variables from points in the polyhedron defined by a linear programhttps://ask.sagemath.org/question/55520/values-of-variables-from-points-in-the-polyhedron-defined-by-a-linear-program/SageMath provides a [function](https://doc.sagemath.org/html/en/reference/numerical/sage/numerical/mip.html#sage.numerical.mip.MixedIntegerLinearProgram.polyhedron) for constructing the polyhedron defined by a linear program. Given a point in such a polyhedron, how can I tell which coordinate of the point corresponds to which variable of the linear program?
**ADDED:** The documentation suggests that "the polyhedron is built from the variables stored by the LP solver" and that "they usually match the ones created explicitly when defining the LP", except possibly for Gurobi solver. So, the question seems to reduce to finding the order number of each variable in LP (or an accurate bookkeeping of their creations). Things are even more fuzzy for Gurobi, which one of the best solvers out there.Max AlekseyevSun, 31 Jan 2021 19:51:48 +0100https://ask.sagemath.org/question/55520/Labelling vertices in a displayed polytopehttps://ask.sagemath.org/question/79610/labelling-vertices-in-a-displayed-polytope/I am working with the following code:
def make_polytope(v,d):
n = len(v)
I = identity_matrix(n)
zeros_column = matrix(ZZ, n, 1, [0]*n)
matrix_with_zeros = zeros_column.augment(I)
vector1 = vector([-d] + v.list())
vector2 = vector([d] + (-v).list())
M = matrix_with_zeros.stack(matrix([vector1, vector2]))
P1 = Polyhedron(ieqs = M)
P = Polyhedron(vertices = P1.integral_points())
return P
a = vector([5,19,27,31])
d = 81
P = make_polytope(a,d)
i=0
for f in P.vertices():
print(i,": ", f)
i=i+1
plot = P.plot(line='red', polygon=False, point={'size':30,'color':'green'}, vertex_labels=True)
plot.show()
If you run it, you get a polytope in 3D space printed out (changing a and d gives you different polytopes, but this is both simple and complicated enough for this purpose).
Note that with the above data, P is a 3D polytope in 4-space. As I understand it, Sage notices this and projects P to 3D space "orthonormally" via plot(**) and then prints it out with show().
It's all very impressive but I am not able to better study the polytope, as it does not come with labels. Whether I keep or remove the vertex_labels command, it makes no difference.
I have read both this: https://ask.sagemath.org/question/45538/display-vertex-label-a-polytope/ and the comment and link within and it is not helpful (neither it seems to provide a solution, nor I want this done in tikZ for the moment).
**Q: How can I change the above for labels for vertices to be plotted?**Jesus Martinez GarciaThu, 10 Oct 2024 17:22:15 +0200https://ask.sagemath.org/question/79610/How to get the Area of a Dyck pathhttps://ask.sagemath.org/question/79580/how-to-get-the-area-of-a-dyck-path/Given a Dyck path $\pi$, the Area($\pi$) is the set of boxes $(i,j)$ such that $i < j$ and $(i,j)$ is under $\pi$.
How to get the area of a given Dyck path from some given DyckWord pi ?mathstudentTue, 08 Oct 2024 17:25:34 +0200https://ask.sagemath.org/question/79580/Obtaining a finite dimensional algebra associated to Lie algebras in QPAhttps://ask.sagemath.org/question/79595/obtaining-a-finite-dimensional-algebra-associated-to-lie-algebras-in-qpa/Let g be a finite dimensional semisimple Lie algebra over a field K (or even more generally a finite dimensional Lie algebra) with basis $x_1,...,x_n$.
Consider the finite dimensional algebra A(g) (first considered by Smith)
given as the quotient of the free polynomial ring $K<x_1,...,x_n,z>$ in variables $x_1,...,x_n,z$ with the relations:
$x_i z-z x_i$ for all $i$ and $x_i x_j -x_j x_i - [x_i, x_j] z$ for all $i,j$.
>Question: Is there an easy way to obtain this algebra for a given Lie algebra g using Lie algebra methods of Sage (such as getting multiplication tables) that is readable for QPA?
Here QPA is a GAP package, so it is technically avaiable in Sage, but I prefer to use GAP in a seperate terminal usually.
Here is an example how the correct output (so that GAP can read it) should look like for the Lie algebra $sl_2$ with basis $x=e_{12}, y=e_{21}, h$ with Lie brackets $[x,y]=h, [h,x]=2x, [h,y]=-2y$:
Q:=Quiver(1,[[1,1,"x"],[1,1,"y"],[1,1,"h"],[1,1,"z"]]);KQ:=PathAlgebra(GF(31),Q);AssignGeneratorVariables(KQ);rel:=[z*x-x*z,z*y-y*z,z*h-h*z,x*y-y*x-h*z,x*h-h*x+2*x*z,y*h-h*y-2*y*z];A:=KQ/rel;Dimension(A);
So the input should be a semisimple Lie algebra and the output a text that is readable in QPA to input the algebra.
Thanks for any help.klaaaWed, 09 Oct 2024 14:23:03 +0200https://ask.sagemath.org/question/79595/right_kernel of a symbolic matrix has a division by zerohttps://ask.sagemath.org/question/79582/right_kernel-of-a-symbolic-matrix-has-a-division-by-zero/
I have a matrix with a symbolic variable <code>t</code>.
If I first substitute t to 0, then I have a valid (right) kernel: a vector space with basis <code>[1,0]</code>
If I first compute the (right) kernel, I have a vector space with basis <code>[1, - (cos(t) - 1)/sin(t)]</code>.
So, If I evaluate the basis at <code>t=0</code>, I have a divide by zero ValueError.
How could it be? Is there not a way to have <code>right_kernel</code> to return a vector space with basis <code>[sin(t), - (cos(t) - 1)]</code>, so that I would avoid this disagreement?
var('t')
P = matrix([[cos(t) - 1 , sin(t)],[sin(t), -cos(t) - 1]])
P.right_kernel()
# Vectorspace with basis [1,0]
P(t=0).right_kernel()
# Vectorspace with basis [1, - (cos(t) - 1)/sin(t)]
P.right_kernel()
# raise a ValueError: power::eval(): division by zero
P.right_kernel().matrix()[0](t=0)
Also, if I substitute the matrix basis at <code>t=2</code> I obtained correctly <code>P.right_kernel().matrix()(t=2) # --> [1 -(cos(2) - 1)/sin(2)]</code>
But if I substitute at <code>t=0</code> <code>P.right_kernel().matrix()(t=0) # --> [1 -(cos(t) - 1)/sin(t)]</code>
(without any substitution or ValueError "divide by zero" as I would have expected)
Do I miss something obvious?
odewolf@gmail.comTue, 08 Oct 2024 18:25:58 +0200https://ask.sagemath.org/question/79582/Graphs - Gomory Hu tree - Memory blow up and max recursion depthhttps://ask.sagemath.org/question/79577/graphs-gomory-hu-tree-memory-blow-up-and-max-recursion-depth/Hello,
I am using the graphs part of Sage and encounter a problem using the Gomory Hu tree function, using the alogirthm FF. <br/>
Having a graph with more than 1000 vertices triggers the python max depth recursion limit (which I can increase), but being at the max default recursion depth already consumes 17GB of memory. Scaling this linear to the example graph of 30k vertices would require ~500GB of memory, which feels unreasonable, given that Gomory Hu is "just" an iterated min cut algorithm.
Can someone help me? Am I using the function wrong?
from sage.all import *
from datetime import datetime
import psutil
# Initialize graph and get starting memory/time
s3 = graphs.SierpinskiGasketGraph(Integer(10))
start_time = datetime.now()
process = psutil.Process(os.getpid())
mem = process.memory_info()[0] / float(2 ** 20)
print("Mem usage at start:", mem, "MiB")
try:
# Compute
print("Vertices found:", s3.order(), "and edges:", s3.size())
# s3.edge_cut(Integer(1), Integer(1000), value_only=True) # exchange this line for memory comparison
s3.gomory_hu_tree(algorithm="FF")
except Exception as error:
print("Error detected:", error)
finally:
end_time = datetime.now()
print("Runtime =", end_time - start_time)
mem = process.memory_info()[0] / float(2 ** 20)
print("Mem usage at end:", mem, "MiB")
prints:
Mem usage at start: 258.6015625 MiB
Vertices found: 29526 and edges: 59049
Error detected: maximum recursion depth exceeded while calling a Python object
Runtime = 0:05:13.276101
Mem usage at end: 17661.28125 MiB
The max recursion depth error looks like this:
Traceback (most recent call last):
File "/home/telijas/Documents/python/projects/treewidth-playground/main.py", line 22, in <module>
s3.gomory_hu_tree(algorithm="FF")
File "/home/telijas/anaconda3/envs/pythonProject/lib/python3.11/site-packages/sage/graphs/graph.py", line 8592, in gomory_hu_tree
g = self._gomory_hu_tree(frozenset(self.vertex_iterator()), algorithm=algorithm)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/telijas/anaconda3/envs/pythonProject/lib/python3.11/site-packages/sage/graphs/graph.py", line 8493, in _gomory_hu_tree
gV_tree = gV._gomory_hu_tree(vertices & frozenset(gV), algorithm=algorithm)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/telijas/anaconda3/envs/pythonProject/lib/python3.11/site-packages/sage/graphs/graph.py", line 8493, in _gomory_hu_tree
gV_tree = gV._gomory_hu_tree(vertices & frozenset(gV), algorithm=algorithm)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/telijas/anaconda3/envs/pythonProject/lib/python3.11/site-packages/sage/graphs/graph.py", line 8493, in _gomory_hu_tree
gV_tree = gV._gomory_hu_tree(vertices & frozenset(gV), algorithm=algorithm)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OS: Ubuntu 22.04.5 LTS<br/>
Sage: 10.4<br/>
CPU: 3.6 GHz single core
TelijasTue, 08 Oct 2024 16:39:46 +0200https://ask.sagemath.org/question/79577/Sagemath install from source fails with giac in Ubuntu 24.04https://ask.sagemath.org/question/79144/sagemath-install-from-source-fails-with-giac-in-ubuntu-2404/I tried to update Ubuntu from 22.04 to 24.04 first in a virtual machine before doing this on my computer. This was good luck because unfortunately there is no sagemath package for the current Ubuntu version 22.04.
Therefore I tried to install sagemath from source following the instructions in sagemath documentation.
Prerequisites, configure were successful.
However make failed after long time throwing an error that giac installation failed.
I have giac.log and config.log files but do not know how to add these to this post.
During "make" installation giac says the following several times:
class pointer_to_binary_function
In file indcluded from sym2poly.h:27 from giacPCH.h.38 gausspol.h:96:29
Warning 'template class_Arg1, class_Arg2, class_Result class std::pointer_to_binary_function is deprecated'
Because sagemath is essential for me this error prevents me upgrading to Ubuntu 24.04. Can somebody halp?OyanoTue, 10 Sep 2024 10:36:39 +0200https://ask.sagemath.org/question/79144/Class equation of a grouphttps://ask.sagemath.org/question/79540/class-equation-of-a-group/Is there any command for getting the class equation of a permutation group in SAGE?
Note that I am able to write a function for this. I am just wondering if there is any inbuilt function which serves my purpose.sagelearnerSat, 05 Oct 2024 17:29:53 +0200https://ask.sagemath.org/question/79540/Symbolic computation of a series expansion | Cauchy's theoremhttps://ask.sagemath.org/question/79486/symbolic-computation-of-a-series-expansion-cauchys-theorem/Let us assume we do not know the series expansion at $0$ of $$S : z\mapsto\frac{1}{1-(z/2)^2}$$ (consider a more difficult rational fraction if you do not want to make this assumption).
A method to compute the coefficients (*) is to compute a complex integral on a circle: the $k$-th coefficient is given by
$$
a(k)=\frac{1}{2i\pi}\int_{C(0,1)}\frac{S(z)}{z^{k+1}}dz=\int_0^1S\left(\exp\left(2i\pi t\right)\right)\exp\left(-2i\pi kt\right) dt.
$$
But, even in this easy case, I am not able to help Sagemath to do the computation:
kk,k,t,z=var('kk,k,t,z')
assume(k,'integer')
assume(k>0)
S(z)=1/(1-(z/2)^2)
J(kk)=integrate(S(e^(2*I*pi*t))*e^(-2*pi*I*kk*t),t,0,1,hold=True)
Appealing J(k) returns a mistake and requires an assumption on $I$ and $\pi$ :
ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(%i*%pi>0)', see `assume?` for more details)
Is %i*%pi an integer?
1. Any idea to perform the computation of this integral for any integer $k$ (I would like to have a symbolic answer in term of $k$, not a procedure that returns a numerical result for any numeric value of $k$)?
2. Is there another way to get the coefficients (again meaning a general formula depending on k, like 1/k! for exp).
(*) Not the only one, one also could you a general result on the form of a sequence whose generating function is a rational fraction.
NB. A [similar question was asked a few years ago](https://ask.sagemath.org/question/47017/calculating-cauchy-integrals-in-sage/), without positive answer. But situation might have evolved.
The full text Sage message :
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
File /private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/interfaces/maxima_lib.py:817, in MaximaLib.sr_integral(self, *args)
816 try:
--> 817 return max_to_sr(maxima_eval(([max_integrate],
818 [sr_to_max(SR(a)) for a in args])))
819 except RuntimeError as error:
File /private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/libs/ecl.pyx:838, in sage.libs.ecl.EclObject.__call__ (build/cythonized/sage/libs/ecl.c:11700)()
837 lispargs = EclObject(list(args))
--> 838 return ecl_wrap(ecl_safe_apply(self.obj, (<EclObject>lispargs).obj))
839
File /private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/libs/ecl.pyx:358, in sage.libs.ecl.ecl_safe_apply (build/cythonized/sage/libs/ecl.c:9207)()
357 else:
--> 358 raise RuntimeError("ECL says: {}".format(message))
359 else:
RuntimeError: ECL says: Maxima asks: Is %i*%pi an integer?
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
Cell In[4], line 1
----> 1 J(k)
File /private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/symbolic/expression.pyx:6187, in sage.symbolic.expression.Expression.__call__ (build/cythonized/sage/symbolic/expression.cpp:78521)()
6185 z^2 + x^y
6186 """
-> 6187 return self._parent._call_element_(self, *args, **kwds)
6188
6189 def variables(self):
File /private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/symbolic/callable.py:422, in CallableSymbolicExpressionRing_class._call_element_(self, _the_element, *args, **kwds)
420 d = dict(zip([repr(_) for _ in self.arguments()], args))
421 d.update(kwds)
--> 422 return SR(_the_element.substitute(**d))
File /private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/structure/element.pyx:849, in sage.structure.element.Element.substitute (build/cythonized/sage/structure/element.c:15440)()
847 5
848 """
--> 849 return self.subs(*args, **kwds)
850
851
File /private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/symbolic/expression.pyx:5899, in sage.symbolic.expression.Expression.subs (build/cythonized/sage/symbolic/expression.cpp:76733)()
5897 smap.insert(make_pair((<Expression>self.coerce_in(k))._gobj,
5898 (<Expression>self.coerce_in(v))._gobj))
-> 5899 res = self._gobj.subs_map(smap, 0)
5900 return new_Expression_from_GEx(self._parent, res)
5901
File /private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/symbolic/function.pyx:1137, in sage.symbolic.function.BuiltinFunction._evalf_or_eval_ (build/cythonized/sage/symbolic/function.c:16410)()
1135 res = self._evalf_try_(*args)
1136 if res is None:
-> 1137 return self._eval0_(*args)
1138 else:
1139 return res
File /private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/symbolic/integration/integral.py:254, in DefiniteIntegral._eval_(self, f, x, a, b)
252 for integrator in self.integrators:
253 try:
--> 254 A = integrator(*args)
255 except (NotImplementedError, TypeError,
256 AttributeError, RuntimeError):
257 pass
File /private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/symbolic/integration/external.py:46, in maxima_integrator(expression, v, a, b)
44 result = maxima.sr_integral(expression, v)
45 else:
---> 46 result = maxima.sr_integral(expression, v, a, b)
47 return result._sage_()
File /private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/interfaces/maxima_lib.py:827, in MaximaLib.sr_integral(self, *args)
825 raise ValueError("Integral is divergent.")
826 elif "Is" in s: # Maxima asked for a condition
--> 827 self._missing_assumption(s)
828 else:
829 raise
File /private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/sage/interfaces/maxima_lib.py:1074, in MaximaLib._missing_assumption(self, errstr)
1071 outstr = "Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume("\
1072 + errstr[jj + 1:k] + ">0)', see `assume?` for more details)\n" + errstr
1073 outstr = outstr.replace('_SAGE_VAR_', '')
-> 1074 raise ValueError(outstr)
ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(%i*%pi>0)', see `assume?` for more details)
Is %i*%pi an integer?EmmSat, 05 Oct 2024 00:08:39 +0200https://ask.sagemath.org/question/79486/