[sage-support] Extended Operations on Symbols

2020-04-26 Thread Jin Guu
I am writing a calculator for various 'q' quantities, and often find that I 
need to manipulate symbols more flexibly. For example, I have to deal with 
the expression

( q + q^(-1) ) ^ (1/2) -- (*)

But currently I could not find any way to achieve this. A naive attempt 
gives a failure:

sage: q = Frac(ZZ['q']).gen()
sage: q ^ (1/2)
---> ValueError: not a 2nd power
sage: power(q, 1/2)
NotImplementedError: non-integral exponents not supported

Leave alone the expression I need! Indeed, one might have to define a 
larger parent for the expression (*) to live in. So this might require 
implementing a new algebraic structure. If that's the case, I'm willing to 
write it. The problem is that implementing a new structure seems a bit 
complicated to me.. I might take some time, and need some guides. Thank you 
so much!

PS. Weirdly enough, exp(sin(q)) is already implemented as in the class 
. Perhaps what I need might 
not be too hard to implement?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/a8d98cd1-03f6-4c86-8248-3733d697ca59%40googlegroups.com.


[sage-support] Re: Extended Operations on Symbols

2020-04-26 Thread Jin Guu
Woah! Thank you so much!

p.s. I said it's naive because I have no better idea.. perhaps there's a 
better wording. Sorry for that.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/cd13518b-5795-4013-9817-f75b76dd40ac%40googlegroups.com.


[sage-support] Is log_html() deprecated?

2020-04-29 Thread Jin Guu
I'd like to log my entire session in sage into a file. The best solution I 
found is to use log_html().
http://doc.sagemath.org/html/en/reference/misc/sage/misc/log.html


But the functions seems deprecated, and the document about it I've found is 
more than a decade.




sage: log_html()
---
NameError Traceback (most recent call last)
 in 
> 1 log_html()

NameError: name 'log_html' is not defined
sage: log_html
---
NameError Traceback (most recent call last)
 in 
> 1 log_html

NameError: name 'log_html' is not defined

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/36adf193-74bb-4c7d-9ec2-7f822bba9625%40googlegroups.com.


[sage-support] Re: Is log_html() deprecated?

2020-04-29 Thread Jin Guu
Apology for more stupid questions. I imported and it loaded, but still 
failed:

sage: from sage.misc.log import log_html
sage: log_html

sage: log_html()
---
AttributeErrorTraceback (most recent call last)
 in 
> 1 log_html()

/usr/lib/python3.8/site-packages/sage/misc/log.py in __init__(self, dir, 
debug, viewer)
 97 self._dir = dir
 98 self._filename = os.path.join(dir, self._filename())
---> 99 self._output = __IPYTHON__.output_hist
100 self._input  = __IPYTHON__.input_hist_raw
101 self._text = ''

AttributeError: 'bool' object has no attribute 'output_hist'
sage:

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/22463a0c-9d82-4d87-8c1d-68ff15ac5f9d%40googlegroups.com.