Laurent series, Rational Functions in sqrt(q)?

I need to construct the ring of formal Laurent series in q**(1/2) over the rational numbers. How would I do that in sage?

I realize that there's a perfectly good workaround, but I'd be nonetheless very happy if I didn't have to use it. I could just use Laurent series in another variable, like t,

R.<t> = LaurentSeriesRing(QQ)


I could then define q to be t**2, and use t as a formal square root of q. But then I still can't raise q to a non-integer power - sage complains that there's a non-integer in the exponent. I'd make about 500 mistakes just typing in formulas and it would be hard to read the output.

Another workaround which I'm not keen on is to just say

var('q')


and just use symbolic expressions instead. I don't really want to do that either: I like having all the Laurent series methods available and I gather that working in an explicit ring is a lot faster? If I'm misinformed there, then please let me know.

Lastly, I'd also like to construct the rational functions in sqrt(q) - same basic problem, as far as I can see. Any help appreciated.

edit retag close merge delete

Sort by ยป oldest newest most voted

Hearing nothing, I just used the first workaround, made 500 mistakes typing in formulas as predicted, fixed them, and I was done. However, the surprise was that it was less painful than I expected, and it did have the advantage that I solved the problem with the tools I already knew, which I regard as virtuous in some sense.

So I'm going to sheepishly call this an answer to my own question. Probably there's a badge for that or something. But I'd still be curious to hear if there's a better way.

more