Ask Your Question

dispo's profile - activity

2023-05-19 17:53:51 +0100 received badge  Popular Question (source)
2023-02-15 18:41:32 +0100 received badge  Notable Question (source)
2022-10-14 17:49:55 +0100 received badge  Popular Question (source)
2022-02-02 10:28:41 +0100 received badge  Popular Question (source)
2022-01-21 03:01:38 +0100 asked a question Can sage automatically find singular points of a function?

Can sage automatically find singular points of a function? When computing the asymptotics of a series, a common idea is

2021-09-01 02:57:55 +0100 commented answer Change Valuation to do Series Reversion

Thank you! I don't know how the idea of solving for a series in one variable, then reversing that and substituting the o

2021-09-01 02:48:42 +0100 marked best answer Change Valuation to do Series Reversion

I've run into the problem of doing series reversion with symbolic power series a few times now, and while in the past I was able to hack together a solution (by using some inelegant combination of f.taylor(), f.series(), s.truncate(), s.power_series(QQbar), etc.), today I wasn't able to figure out how to get what I want done.

Concretely, let's say you want to compute a power series for those $x$ such that $x \sin(x) + \cos(x) = 0$ (as indeed I do). This can only happen when $\sin(x) \approx 0$, so we want to look near $n \pi$.

Here we can cheat a little bit and use the fact that $\sin$ and $\cos$ are periodic to get a good series expansion for this. If we write $q = n \pi$, we get

q = var('q')
eps = var('eps')
s = (q + eps) * sin(eps).series(eps) + cos(eps).series(eps)
s = s.series(eps) # expand and collect terms

# symbolic power series don't have a .reverse() method
# so let's just work over a field that has a variable called q
R.<q> = PolynomialRing(QQbar)
F = FractionField(R)
S = PowerSeriesRing(F,eps)

s = S(s)

Now we have

$$ s = 1 + q \epsilon + \frac{1}{2} \epsilon^{2} -\frac{1}{6} q \epsilon^{3} -\frac{1}{8} \epsilon^{4} + \frac{1}{120} q \epsilon^{5} + \ldots $$

Since we want to know that $x \sin(x) + \cos(x) = 0$, we should set $s = 0$ and solve for $\epsilon$ (which will depend on $n$). Then our roots will be exactly $q + \epsilon$, that is, $n \pi + \epsilon$. We can do this using lagrange inversion, where if $s^{-1}$ is the inverse of $s$ we'll have $\epsilon = s^{-1}(0)$ and our problem will be solved.

Unfortunately, there's no way (as far as I know) to do lagrange inversion on a symbolic series (and in my experience symbolic power series are probably best avoided anyways. It seems like other people share this belief too). I'm happy to do this trick of working over some other field, but I'm getting an error: s.reverse() is telling me series must have valuation one for reversion. I think this is happening since q.valuation() is returning $0$ for some reason. This is strange, since F(q).valuation() = 1, as expected, but then S(F(q)).valuation() = 0 again.

Is there a way I can force sage to see that q is invertible?

If not, is there another (better) way to handle series reversion with variable coefficients?

Thanks in advance! ^_^

2021-09-01 02:48:42 +0100 received badge  Scholar (source)
2021-08-07 02:14:30 +0100 commented question polynomial multiplication is unexpectedly slow

As an aside, I wasn't able to get this particular implementation working efficiently, but I found an algorithm to more e

2021-07-22 03:46:09 +0100 commented question polynomial multiplication is unexpectedly slow

@mwageringel, @nbruin, @rburing

2021-07-22 03:45:46 +0100 commented question polynomial multiplication is unexpectedly slow

Thank you all for your ideas! I've modified my code to use the S.flattening_morphism().codomain(), and this has helped s

2021-07-17 22:45:40 +0100 commented question polynomial multiplication is unexpectedly slow

@rburing -- that's exactly the next step. We know that the coefficients of f are symmetric polynomials in the roots a[i]

2021-07-17 09:30:59 +0100 edited question polynomial multiplication is unexpectedly slow

polynomial multiplication is unexpectedly slow Hello! I'm writing some code to solve by radicals a polynomial with solv

2021-07-17 09:29:29 +0100 asked a question polynomial multiplication is unexpectedly slow

polynomial multiplication is unexpectedly slow Hello! I'm writing some code to solve by radicals a polynomial with solv

2021-06-23 08:16:18 +0100 edited question Change Valuation to do Series Reversion

Change Valuation to do Series Reversion I've run into the problem of doing series reversion with symbolic power series a

2021-06-23 08:12:21 +0100 edited question Change Valuation to do Series Reversion

Change Valuation to do Series Reversion I've run into the problem of doing series reversion with symbolic power series a

2021-06-23 08:10:02 +0100 asked a question Change Valuation to do Series Reversion

Change Valuation to do Series Reversion I've run into the problem of doing series reversion with symbolic power series a

2021-06-04 22:09:04 +0100 received badge  Good Question (source)
2021-06-04 21:40:53 +0100 received badge  Nice Question (source)
2021-06-04 20:10:25 +0100 edited question Regular Languages in Sage?

Regular Languages in Sage? I see there's a package for automata, but is there a way to work directly with regular langua

2021-06-04 20:10:05 +0100 edited question Regular Languages in Sage?

Regular Languages in Sage? I see there's a package for automata, but is there a way to work directly with regular langua

2021-06-04 20:09:04 +0100 received badge  Editor (source)
2021-06-04 20:09:04 +0100 edited question Regular Languages in Sage?

Regular Languages in Sage? I see there's a package for automata, but is there a way to work directly with regular langua

2021-06-04 20:08:54 +0100 asked a question Regular Languages in Sage?

Regular Languages in Sage? I see there's a package for automata, but is there a way to work directly with regular langua

2021-02-24 09:13:11 +0100 commented answer Can sage draw simplicial complexes?

Thanks for the answer! I'll have to look into writing my own, then... If it's decently robust, maybe I'll look into submitting a pull request (or however sage handles code submission... I'll look into it once I actually have code in hand :P )

2021-02-24 09:11:15 +0100 received badge  Supporter (source)
2021-02-23 01:47:43 +0100 received badge  Student (source)
2021-02-23 00:07:22 +0100 asked a question Can sage draw simplicial complexes?

I understand it's asking a lot to draw complexes in dimensions $>3$, but for (fairly simple) 2 dimensional complexes, it seems reasonable that some plotting algorithm should exist. Even looking at, say, simplicial_complexes.Torus(), it doesn't seem like there's a plot or show method. The docs1 don't seem to have any information either.

Since the things I'm trying to draw are fairly simple, I would be wiling to plot the $1$-skeleton (which sage can do) and then fill in the $2$-cells myself, but I'm not even sure how to go about doing that. Obviously if there is a pre-existing method or library for this, that would be the best possible solution.

Thanks in advance!

1: I don't have the karma to post links, but I'm referencing doc.sagemath.org/html/en/reference/homology/sage/homology/simplicial_complex.html