20210126 02:17:42 0600  edited answer  Solving the Schrodinger equation using sage (Well) Hello, @Grim! I am not quite sure about Schrödinger's Equation, but I know how to obtain $k=\frac{n\pi}{a}$. I believe this will result a helpful version of your code: The first line defines the symbolic variables Now, things get a little complicated. If you write At this point, there are many ways in which you can obtain the values of $A$, $B$ and $k$. The first method is manually solving equations $$A=0$$ and $$A\cos(ak)+B\sin(ak)=0$$ If you replace the first equation in the second, you obtain $B\sin(ax)=0$. Now, since $B>0$ (according to your code), you must have that $\sin(ak)=0$, which implies that $k=\frac{n\pi}{a}$. Finally, in this case, $B$ can be any positive number (regardless of its value, your ODE and boundary conditions are satisfied.) The second way to solve this is using Sage itself. You have two equations, namely just after the previous code. You will get something like $$\left[\left[A = 0, k = \frac{\pi + 2\pi z_{1879}}{a}\right], \left[A = 0, k = \frac{2 \pi z_{1900}}{a}\right]\right]$$ The variables You can also use the Sympy package to solve these equations: You will get $$\left[\left\{A : 0, k : 0\right\}, \left\{A : 0, k : \frac{\pi}{a}\right\}\right]$$ These are just two particular solutions that you can easily generalize using reduction formulas and properties of the trigonometric functions. What happens if you use I would like to point out a few interesting teachings derived from your question:

20210126 02:10:30 0600  commented answer  Solving the Schrodinger equation using sage (Well) @dsejas  this might be due to a bug in the way LaTeX is processed on Ask Sage. It seems some of the backslashes need escaping, ie we need In my experience, not all backslashes need this, but if you do them all you're safe. It seems to depend on the following character, and seems
and one could of course prepare a more complete list. The preview when composing a question or answer behaves differently, making this all the more puzzling. 
20210125 13:53:24 0600  edited question  Solving the Schrodinger equation using sage (Well) I'm trying to solve the Schrödinger equation through Sage, for the potential well. I wrote: How can i find the constants A and B through boundary conditions? My conditions are: Psi(0)=0 and Psi(a)=0. If i put it in desolve function it return me zero. So i tried to work with the equations separated but i cannot figure out
how to get 
20210125 13:50:19 0600  commented question  Trying to solve the Schrodinger equation using sage (well) Duplicate of Ask Sage question 55455. 
20210125 13:31:55 0600  answered a question  Arithmetic operation is not working in finite field GF(4091^2)? The difference comes from different methods being available depending on the underlying finite field implementation. The Below we illustrate this and propose a Illustration Define Then use it as follows: Making all finite fields provide 
20210124 16:44:38 0600  edited answer  Generating only the ranks of elliptic curves that can be found provably correctly Here is a piece of code trying to compute the rank of all elliptic curves $E(a,b)$ of the shape $y^2=x^3+ax+b$ for $a,b\in[2010, 2021]$. Sometimes, there it will be "harder" to compute the rank, so the code will not deliver a computed rank. We fill in a dictionary with keys $(a,b)$ and values the corresponding rank for the key when it could be computed, and To see which cases could not be computed... ... and get an empty list, so in this case there was no 
20210122 11:37:49 0600  commented answer  How to do low degree computation in a Free Algebra ? I see you added an answer. You can accept that answer to mark the question solved. 
20210122 11:30:42 0600  edited answer  How to do low degree computation in a Free Algebra ? Another way (less complete than @slelievre's answer but more efficient for just a quick computation) is to compute directly in the free algebra, using the following instead of the product: 
20210121 18:36:25 0600  edited answer  Generating only the ranks of elliptic curves that can be found provably correctly I assume that you mean elliptic curves over ℚ. I would do two or three things. First, wrap your call to In the second example, the rank really is I hope this helps. 
20210121 16:46:14 0600  edited answer  How do I understand the result of symbolic integrals Maxima 5.21.1 gives for which is correct from what I can tell (agrees numerically with the original expression and has the same derivative). The result isn't as simple as it could be because the integration algorithm is phrased in more general terms, such that the integrand you specified is a special case of some general form. Often that's the most effective way to calculate integrals, since you can cover a lot of special cases with one general form. 
20210121 11:33:57 0600  answered a question  Mysterious "must have a value" error The command you want requires the GAP package HAPprime, no longer being developed: its repository at GitHub is archived, and some of the code has been migrated to HAP. That said, you can still install it by downloading the package's
compressed tarball and unpacking it in your To do that on CoCalc, open a CoCalc terminal and run
the following commands (skip the initial Then you can use the desired GAP command, either directly in GAP
or in Sage (via In Sage: 
20210121 05:01:59 0600  commented answer  Issues with ReedSolomon encoder Note about zero and one:
So one can use One could name the polynomials and then use e.g. 
20210120 12:18:55 0600  commented question  Solve returns bad results Welcome to Ask Sage! Thank you for your question! 
20210120 12:17:13 0600  commented question  Transforming a list of list Please provide selfcontained code that can be copied and pasted. Currently, we get name errors, as neither Calling 
20210120 12:03:42 0600  commented question  Tensor product of elements of nonfree algebras Thanks for reporting. This appears to reveal a bug. Fixing it is now tracked at 
20210120 12:02:23 0600  answered a question  Tensor product of elements of nonfree algebras Thanks for reporting. This appears to be a bug. Fixing it is now tracked at Note that the code works fine in Sage 8.8 but fails in Sage 8.9. This change might have to do with the changes in Sage Trac ticket 25603. 
20210120 07:47:12 0600  commented question  Extracting coefficients Indentation is fixed now. 
20210120 07:46:44 0600  edited question  Extracting coefficients I have defined and generated a system like below: I would like to know if it is possible to extract the matrix coefficients of the equations in 'e'. The difficulty comes from the definition of the variables 'p()'. For example: in 'e', I have 8 expressions as below: So, my question is if it is possible to extract the coefficients of all the variables p_ _ and p_ _ _ _ considering the lexicography order and taking the p's with 2 entrees as the firsts variables, i.e., with the order: p_1_1, p_1_2, p_2_1, p_2_2, p_1_1_1_1, p_1_1_1_2, ... and so on. It means, that I have a system with 4 variables with 2 entrees p_ _ and more 16 with 4 entrees p_ _ _ _. I would like to write these coefficients using matrices in this case with 20 variables and 8 equations given in e. Precisely, I want to know the degrees of freedom of the system. 
20210120 07:30:28 0600  answered a question  Transforming a list of list The function One can use it to build a matrix for all the duel scores. The function: Define the players: The duel winners and the scores (called Individual scores: Extract the players from the scores: Some scores: The scores as a matrix: 
20210119 14:52:16 0600  commented question  Tensor product of elements of nonfree algebras The code works fine in Sage 8.8 but fails in Sage 8.9. This might have to do with the changes in Sage Trac ticket 25603. 
20210119 14:14:50 0600  commented answer  How to do low degree computation in a Free Algebra ? To format code blocks in questions, answers, or comments, separate them by a blank line above and below, and indent them by four spaces. Cay you edit your comment to do that? Or you could turn your comment into an answer, since it actually answers the question. 
20210119 14:11:58 0600  answered a question  Ranging the Z axis Setting zmin and zmax to get a chosen zrangeMissing functionalityInspecting the Searching Ask Sage and sagesupport, we find that many 3d plotting functions similarly lack the ability to limit the zrange. Providing this missing functionality is now tracked at WorkaroundSome of the questions on this theme were answered with a suggestion to use implicit_plot3d. For hyperplanes, this works very well. We can therefore mimic the Here is such a function: Usage is as follows. One can provide only an xrange and a yrange: and get the exact same picture as in the question. Or one can additionally provide a zrange: Optional extra arguments are passed to This for instance allows to set the opacity: The function could be improved to accept a choice of colours. Currently
it uses the same default as the 
20210119 08:58:54 0600  edited question  Ranging the Z axis I am plotting arrangements of hyperplanes. Like this one: The problem is I need the z axis to range from 1 to 1 rather than from 4 to 4. Is there a way to change that? 
20210119 08:55:04 0600  commented question  Is there a way to range the z axis? Duplicate of Ask Sage question 55355. 
20210119 05:09:54 0600  edited question  Random polynomial of degree 1 Having defined
one can ask for a random element using the The random polynomial I obtained that way was of degree two: If I only want a random linear polynomial from this ring, how can I get one? 
20210119 04:53:16 0600  edited question  Multiply polynomials from different rings Suppose I take a polynomial from $K[x]$, say $x^2 + 5x$, and another polynomial from $K[y]$, say $y^3$. I want to formally multiply them and get $x^2y^3 + 5xy^3$ as the output. How can I do that? Note: My efforts: When I do 
20210118 14:57:47 0600  commented question  "Affine diagonalization algorithm" in ndimensions? The 
20210118 14:54:25 0600  edited question  "Affine diagonalization algorithm" in ndimensions? Does Sage have a general implementation of the "affine diagonalization algorithm" for ndimensional vector spaces? I found some pseudocode, see page 15 (in section 3 "affine diagonalization" which begins on page 12) of Searching online led me also to this answer from 2008 where someone does it with Maple: but unfortunately, I cannot open the Thank you very much for the help. 
20210118 12:17:20 0600  edited answer  Centering the cells of a table and the use of tiny size Regarding the " Regarding the table, it needs a list of lists, not just a list, so use extra brackets; and you want headers for the columns, so they form a row of headers or "header row". 
20210118 12:08:18 0600  edited question  Centering the cells of a table and the use of tiny size I change my question to clarify.
In the following code (I have integrated the solution for First define a function: Then use it: everything works fine apart from the 
20210118 10:25:27 0600  commented question  I should store binary values in an array Why not open a new question:
The new question can say "this is a follow up to Ask Sage question 55323" and you can add a comment here saying "See a followup question at Ask Sage question 55xxx". 
20210118 09:45:29 0600  edited question  How can I compute a fixed field over the padics I have problems to implement the following set up: I want to have a field $K = \mathbb{Q}_3$ and an extension $L = \mathbb{Q}_3(\alpha)$ over $K$ where $f:=\min_K(\alpha) = x^4  3x^2 + 18$. This extension has degree $4$ and ramification index $2$. Furthermore, let $F/K$ be the unique unramified extension of $K$ of degree $4$ which is generated by a primitive $5$th root of unity $\zeta_5$. Then one can show that $\varphi: \alpha \mapsto \frac{(2 \alpha^2  3)\sqrt{\frac{2}{7}}}{\alpha},$ $\zeta_5 \mapsto \zeta_5^3$ is an element of the Galois group of $LF/K$. Now let $L' = (LF)^{\langle \varphi \rangle}$. This must be a quadratic and totally ramified extension of $K$. There are only two possibilities for that: $K(\sqrt{3})$ or $K(\sqrt{3})$. Question: How to determine whether $L' = K(\sqrt{3})$ or $L' = K(\sqrt{3})$ (or equivalently, $\varphi(\sqrt{3}) = \sqrt{3}$ or $\varphi(\sqrt{3}) = \sqrt{3}$)? Since I only have only superficial knowledge about Sage, I was not even able to set up the easy things like the field $L$ properly. When I use I get an error that my polynomial $f$ must be either unramified or Eisenstein (which of course does not exist since $L/K$ is neither unramified nor totally ramified). Furthermore, I have no idea how to approach with my problem with Sage otherwise. And since computation by hand is pretty hard in this case (I already tried!), it would be nice to solve with problem here, so I can use it for similar computations in the future. Could you please help me with this problem? 
20210118 09:43:21 0600  commented question  How can I compute a fixed field over the padics Welcome to Ask Sage! Thank you for your question! 
20210118 08:58:25 0600  commented answer  How to do low degree computation in a Free Algebra ? Edited answer to partially address multicharacter generator names. Sadly they are still not latexing properly. 