
SageMath
1,000 FOLLOWERS
Discuss everything about maths at the SageMath forum with other mathematics enthusiasts.
SageMath
13h ago
I am trying to install the Kohel database but running into an error I don't understand. From what I gathered online I should run `sage -i database_kohel` in my Linux terminal, but this is giving me the following error : `make: *** No rule to make target 'all-toolchain'. Stop.` I am running Sage 9.5 in WSL using an Ubuntu terminal. Any help would be appreciated ..read more
SageMath
22h ago
Inspired by [this question](https://ask.sagemath.org/question/67158/how-to-get-selective-outputs-printed/), I stumbled in an unexpected difficulty when trying to compare two `Set`s : sage: L[:2] [[ [ 2 -2] [0 1] [ 0 1] [-2 1], [0 1], [ 0 -1/2] ], [ [ 2 -2] [ 0 1] [0 1] [-2 1], [ 0 -1/2], [0 1] ]] sage: Set(L[0][1:])==Set(L[1][1:]) False Quite unexpected... However : sage: all([u in Set(L[1][1:]) for u in Set(L[0][1:])]) True sage: all([u in Set(L[0][1:]) for u in Set(L[1][1:])]) True as expected. The `Sets` [reference](https://doc.sagemath.org/html/en/reference/sets/sage/sets/set.html) doesn't ..read more
SageMath
1d ago
After running my code > ------------------- ------------------- if................ show((x,y,z)) The output is a collection of list of triplets of square matrices of same order. I want only those output to be printed which contain same set of three matrices, keeping the first matrix fixed. That is, for example, suppose I am getting the following outputs: 1.[A1,P,Q] 2.[A1,Q,P] 3.[P,Q,A1] 4.[A2,L,M] 5.[A2,M,L] 6.[A2,X,Y] 7.[Q,L,A1] Now consider the first three outputs . The first two outputs are to be considered same. But the third output is to be considered different, though all three output ..read more
SageMath
3d ago
how can i get (n) linearly independent vector for a given space ? for example ; v=VectorSpace(GF(11),8) can i get 6 "RANDOM" linearly independent vector ..read more
SageMath
4d ago
Why the following code does not work with SageMath version9, though it works with SageMath version8? f(x,y)=sin(x+2*y) numerical_integral(f,0,pi,params=[5]) SageMath version8.6 gives (-1.6781430581529053, 2.2206773047754592e-14). SageMath version9.7 gives (0.0, 0.0). Execution of numerical_integral(f(x,5), 0, pi) in SageMath version9.7 also gives (-1.6781430581529053, 2.2206773047754592e-14 ..read more
SageMath
4d ago
I am wondering if there's sample code that allows javascript to interact with the sagecell where it can display an output from the sagecell after evaluation. I want javascript to be able to send code to the sagecell and ask the sagecell to evaluate the code. Then I want javascript to be able to alert the evaluated code ..read more
SageMath
4d ago
As the title suggests, whenever I try to render anything in 3D (a polygon, for example) in a Jupyter notebook in VSCode using the Sagemath kernal with WSL, the output is just a blank space that is approximately the size of what the output graph is suppose to look like. If I try to switch from the text/html to text/plain, the original render would change to one line of "Graphics3d Object." Is there a fix to this? Thanks ..read more
SageMath
4d ago
def undamped(x, t): return [x[1], x[0]-x[0]^3] from scipy.integrate import odeint from scipy import linspace coordinates=0 nbpts = 1000 # number of points endtime = 20 # end of time span tspan = linspace(0.0, endtime, nbpts) ics1 = [0.09, 0.0] # first initial conditions sol1 = odeint(undamped, ics1, tspan) solx1 = [(tspan[k], sol[m]) for k in range(nbpts)] xplot1 = list_plot(sol, axes_labels=['t','x'], size=1) coordinates1 = [(s[0], s[1]) for s in sol1] phaseportrait1 = list_plot(coordinates,axes_labels=['x','y'], size=1) a = graphics_array([xplot1, phaseportrait1]) a.show ..read more
SageMath
4d ago
As title. If p and k are integers, and k is positive, then p^k should be an integer. Why is Sage telling me otherwise, and how can I convince it of the truth? ---------- `sage: var('p,k')` `(p, k)` `sage: assume(p,'integer')` `sage: assume(k,'integer')` `sage: assume(k>0)` `sage: alpha = p^k` `sage: alpha.is_integer()` `False ..read more
SageMath
4d ago
Given a certain matrix, how do you remove scientific notation on the entries? For example, for 10000000000.0 show the full number instead of 1e10 ..read more