[sage-support] Re: Documentation error https://doc.sagemath.org/html/en/tutorial/programming.html? attach

2021-12-24 Thread Raymond Rogers
Ah well, some text got dropped.  The last entry "attach" errors out in 
Jupyter; even through "attach?" says it takes "*.sage", as does the 
documentation referenced.
Error
UsageError: Invalid GUI request 'sage', valid ones are:dict_keys(['inline', 
'nbagg', 'notebook', 'ipympl', 'widget', None, 'qt4', 'qt', 'qt5', 'wx', 
'tk', 'gtk', 'gtk3', 'osx', 'asyncio'])

On Friday, December 24, 2021 at 10:16:25 AM UTC-5 Raymond Rogers wrote:

> Internal title:  Sage Tutorial v9.4 » Programming
> Loading and Attaching Sage files
> The instruction below fails with the last line "attach" in Jupyter.  
>  Should I report this or just accept that the sage information in 
> doc.sagemath.org doesn't include Jupyter?
> --
>
> 
>
> "
> Next we illustrate how to load programs written in a separate file into 
> Sage. Create a file called example.sage with the following content:
> print("Hello World") print(2^3) 
>
> You can read in and execute example.sage file using the load command.
> sage: load("example.sage") Hello World 8 
>
> You can also attach a Sage file to a running session using 
> the attach command:
> sage: attach("example.sage") Hello World 8 
> "
>
>
>

-- 
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/7098ba0c-1f9f-4576-8f41-a23defb3f9d7n%40googlegroups.com.


[sage-support] Re: documentation for simplify?

2021-02-07 Thread Emmanuel Charpentier
What Sage are you using ?
Le vendredi 5 février 2021 à 21:41:09 UTC+1, fqgo...@colby.edu a écrit :

> I just realized that when faced with 
>
> log(a)-log(b)
>
> Sage does not normally simplify that log(a/b), or vice-versa. I tried 
> using f.simplify_full() and friends with no effect.
>
> Then I tried to enter
>
> ?simplify_full
>
> and got
>
> Object `simplify_full` not found.
>
> I notice that there is a simplify_log(), but that one does not do what I 
> want either. 
>
???
```
sage: var("a,b")
(a, b)
sage: (log(a)-log(b)).log_simplify()
log(a/b)
sage: (log(a)-log(b)).simplify_log()
log(a/b)
```

but, indeed :
```
sage: (log(a)-log(b)).simplify()
log(a) - log(b)
sage: (log(a)-log(b)).simplify_full()
log(a) - log(b)
 ``` 

> 1) Is there a way to do it?
>
See above 

> 2) How can I find out what the various "simplify"s do?
>
The SR objects' methods are probably better documented than wrapper 
functions. 

> Thanks,
>
> Fernando
>
>
> -- 
> =
> Fernando Q. Gouvea http://www.colby.edu/~fqgouvea
> Carter Professor of Mathematics
> Dept. of Mathematics and Statistics
> Colby College  
> 5836 Mayflower Hill
> Waterville, ME 04901   
>
> If all you have is a hammer, everything looks like a nail.
>
>
>

-- 
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/98d000f6-e26e-4053-aaf6-7f4983f1a3den%40googlegroups.com.


[sage-support] Re: Documentation on using sage as a library?

2018-11-19 Thread Kolen Cheung


Here’s the way to translate any Sage program to Python. From 
https://groups.google.com/d/msg/sage-support/ZtlmX3zE0b8/cdecLnbUAwAJ:

The key are these:

from sage.all import *
def sage_parse(expr):
'''exec a sage expression in globals
'''
expr_str = preparse(expr)
# print to show what's run
print(expr_str)
exec(expr_str, globals())

Example (taken from 
https://groups.google.com/d/msg/sage-support/ZtlmX3zE0b8/mqmG5KuiEgAJ):

Sage program:

R. = QQ[]
K = R.fraction_field()
H. = QuaternionAlgebra(K, -1, -1)def Q(a, b, c, d): return H(a + b*i + 
c*j + d*k)@cached_functiondef P(n):
return Q(x+1,1,1,1)*P(n-1) if n > 0 else Q(1,0,0,0)def p(n): return 
P(n)[0].numerator().list()for n in (0..20): print [n], p(n)

Python translation: (grey boxes are the stdouts)

from sage.all import *
def sage_parse(expr):
'''exec a sage expression in globals
'''
expr_str = preparse(expr)
# print to show what's run
print(expr_str)
exec(expr_str, globals())

sage_parse('R. = QQ[]')

R = QQ['x']; (x,) = R._first_ngens(1)

K = R.fraction_field()

sage_parse('H. = QuaternionAlgebra(K, -1, -1)')

H = QuaternionAlgebra(K, -Integer(1), -Integer(1), names=('i', 'j', 'k',)); (i, 
j, k,) = H._first_ngens(3)

def Q(a, b, c, d):
return H(a + b * i + c * j + d * k)

@cached_functiondef P(n):
return Q(x + 1, 1, 1, 1) * P(n - 1) if n > 0 else Q(1, 0, 0, 0)

def p(n):
return P(n)[0].numerator().list()

for n in range(21):
print [n], p(n)

[0] [1]
[1] [1, 1]
[2] [-2, 2, 1]
[3] [-8, -6, 3, 1]
[4] [-8, -32, -12, 4, 1]
[5] [16, -40, -80, -20, 5, 1]
[6] [64, 96, -120, -160, -30, 6, 1]
[7] [64, 448, 336, -280, -280, -42, 7, 1]
[8] [-128, 512, 1792, 896, -560, -448, -56, 8, 1]
[9] [-512, -1152, 2304, 5376, 2016, -1008, -672, -72, 9, 1]
[10] [-512, -5120, -5760, 7680, 13440, 4032, -1680, -960, -90, 10, 1]
[11] [1024, -5632, -28160, -21120, 21120, 29568, 7392, -2640, -1320, -110, 11, 
1]
[12] [4096, 12288, -33792, -112640, -63360, 50688, 59136, 12672, -3960, -1760, 
-132, 12, 1]
[13] [4096, 53248, 79872, -146432, -366080, -164736, 109824, 109824, 20592, 
-5720, -2288, -156, 13, 1]
[14] [-8192, 57344, 372736, 372736, -512512, -1025024, -384384, 219648, 192192, 
32032, -8008, -2912, -182, 14, 1]
[15] [-32768, -122880, 430080, 1863680, 1397760, -1537536, -2562560, -823680, 
411840, 320320, 48048, -10920, -3640, -210, 15, 1]
[16] [-32768, -524288, -983040, 2293760, 7454720, 4472832, -4100096, -5857280, 
-1647360, 732160, 512512, 69888, -14560, -4480, -240, 16, 1]
[17] [65536, -557056, -4456448, -5570560, 9748480, 25346048, 12673024, 
-9957376, -12446720, -3111680, 1244672, 792064, 99008, -19040, -5440, -272, 17, 
1]
[18] [262144, 1179648, -5013504, -26738688, -25067520, 35094528, 76038144, 
32587776, -22404096, -24893440, -5601024, 2036736, 1188096, 137088, -24480, 
-6528, -306, 18, 1]
[19] [262144, 4980736, 11206656, -31752192, -127008768, -95256576, 32672, 
206389248, 77395968, -47297536, -47297536, -9674496, 3224832, 1736448, 186048, 
-31008, -7752, -342, 19, 1]
[20] [-524288, 5242880, 49807360, 74711040, -158760960, -508035072, -317521920, 
317521920, 515973120, 171991040, -94595072, -85995520, -16124160, 4961280, 
2480640, 248064, -38760, -9120, -380, 20, 1]

Interested in adding this to the documentation / FAQ? It just wasn’t very 
clear in the FAQ.
​

-- 
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 post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: documentation?

2018-11-17 Thread slelievre


Le vendredi 16 novembre 2018 21:52:18 UTC+1, Michael Beeson a écrit :
>
> Thank you, that was very instructive to see the "right way"  to start by 
> using an appropriate ring. 
> I guess you can go on to divide out by the other linear factor and get the 
> quadratic equation, 
> and solve it,  but I got that far myself, and then could not work with the 
> solutions of the quadratic equation.
> But you may be able to do that because then they will belong to some 
> algebraic number field which 
> will come equipped with useful algorithms.  
>

Oops, the last command should have been

print("h =  in enumerate(h.list(

instead of

print("h =  in enumerate(g.list(

and, really, writing a last pretty_print function for the whole polynomial,
and applying it to h, would have been a better way to go.

So here is the full thing with a last pretty_print function, and applying
it to `h`, not to `g`.

sage: R. = QQbar[]
sage: S. = R[]
sage: a = QQbar(3).sqrt() / 2
sage: i = QQbar(I)
sage: b = (x - ~x) / (2 * i)
sage: c = (a * (x + ~x) + b) / 2
sage: X = (M / 3) * (a + b + c)
sage: f = 24 * (X^2 - N * b * c) * x^2
sage: f = S(f)
sage: t = QQbar(exp(-pi*I/3))
sage: # pretty_print functions
sage: def pretty_qqbar(z):
: a, b = z.real().radical_expression(), 
z.imag().radical_expression()
: return "{} + {}*i".format(a, b)
:
sage: def pretty_x_coeff(xc):
: return " + ".join("({})*{}".format(pretty_qqbar(xc[m]), m)
:   for m in xc.monomials())
:
sage: def pretty_poly_x_MN(p, name='p'):
: print("\n{} =   ".format(name) +"\n+ "
:   .join("({})*x^{}".format(pretty_x_coeff(xc), k)
: for k, xc in enumerate(h.list())) + "\n")
:
sage: g = f // (x + 1)
sage: h = g // (x - t)
sage: pretty_poly_x_MN(h, name='h')

h =   ((2 + 0*i)*M^2 + (-6 + 0*i)*N)*x^0
+ ((1 + -sqrt(3)*i)*M^2 + (3 + -3*sqrt(3)*i)*N)*x^1
+ ((-1 + -sqrt(3)*i)*M^2 + (3 + 3*sqrt(3)*i)*N)*x^2

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 post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: documentation?

2018-11-16 Thread Michael Beeson
Thank you, that was very instructive to see the "right way"  to start by 
using an appropriate ring. 
I guess you can go on to divide out by the other linear factor and get the 
quadratic equation, 
and solve it,  but I got that far myself, and then could not work with the 
solutions of the quadratic equation.
But you may be able to do that because then they will belong to some 
algebraic number field which 
will come equipped with useful algorithms.  

On Thursday, November 15, 2018 at 9:47:24 AM UTC-8, slelievre wrote:
>
> For the problem at hand here, I would work with polynomials in `x`
> with coefficients in the ring of polynomials in `N` and `M` over
> the field of algebraic numbers, and do something like the following.
>
> Define the ring of polynomials over the field of algebraic numbers.
>
> sage: R. = QQbar[]
>
> Define the ring of polynomials over the above polynomial ring.
>
> sage: S. = R[]
>
> Define `a`, `i`, `b`, `c`, `X`, `f` from the question.
>
> sage: a = QQbar(3).sqrt() / 2
> sage: i = QQbar(I)
> sage: b = (x - ~x) / (2 * i)
> sage: c = (a * (x + ~x) + b) / 2
> sage: X = (M / 3) * (a + b + c)
> sage: f = 24 * (X^2 - N * b * c) * x^2
>
> Note that the definition of `b` involves the inverse of `x` (which can be
> denoted by `~x` or `x^-1`) and therefore lives in the fraction field of 
> `S`,
> rather than in `S` itself. Therefore, so do `c`, `X`, and `f`.
>
> Check if `f` however represents an element in `S` as follows:
>
> sage: f in S
> True
>
> and then construct the corresponding element of `S` (we could call it `f`
> but here we call it `ff`).
>
> sage: ff = S(f)
>
> Check that `ff` vanishes at `-1`, or equivalently is divisible by `x + 1`.
>
> sage: ff(-1)
> 0
> sage: d = x + 1
> sage: d.divides(ff)
> True
>
> Perform exact division (to stay in the polynomial ring `S` rather than move
> to its fraction field).
>
> sage: g = ff // d
>
> Define `t` as an algebraic number.
>
> sage: t = QQbar(exp(-pi*I/3))
>
> Check that `g` vanishes at `t` or equivalently is divisible by `x - t`.
>
> sage: g(t)
> 0
> sage: dd = x - t
> sage: dd.divides(g)
> True
>
> Perform exact division.
>
> sage: h = g // dd
>
> Inspect the result:
>
> sage: h
> ((-1.000? - 1.732050807568878?*I)*M^2
>  + (3.000? + 5.196152422706632?*I)*N)*x^2
>  + ((1.000? - 1.732050807568878?*I)*M^2
>  + (3.000? - 5.196152422706632?*I)*N)*x
>  + 2*M^2 + (-6)*N
>
> Or as a list (the list of coefficients of `x^j`, for `j` from `0` to the 
> degree):
>
> sage: h.list()
> [2*M^2 + (-6)*N,
>  (1.000? - 1.732050807568878?*I)*M^2
>  + (3.000? - 5.196152422706632?*I)*N,
>  (-1.000? - 1.732050807568878?*I)*M^2
>  + (3.000? + 5.196152422706632?*I)*N]
>
> Define somme pretty_print functions to inspect these algebraic numbers:
>
> def pretty_print_qqbar(z):
> a, b = z.real().radical_expression(), z.imag().radical_expression()
> return "{} + {}*i".format(a, b)
>
> def pretty_print_x_coeff(xc):
> return " + ".join("({})*{}".format(pretty_print_qqbar(xc[m]), m)
>   for m in xc.monomials())
>
> and print `h` in a nice form:
>
> print("h =   " +
>   "\n+ ".join("({})*x^{}".format(pretty_print_x_coeff(xc), k)
>  for k, xc in enumerate(g.list(
>
> The result is:
>
> h =   ((-1 + sqrt(3)*i)*M^2 + (3 + -3*sqrt(3)*i)*N)*x^0
> + ((3 + sqrt(3)*i)*M^2 + (-3 + 3*sqrt(3)*i)*N)*x^1
> + ((3 + -sqrt(3)*i)*M^2 + (-3 + -3*sqrt(3)*i)*N)*x^2
> + ((-1 + -sqrt(3)*i)*M^2 + (3 + 3*sqrt(3)*i)*N)*x^3
>
>

-- 
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 post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: documentation?

2018-11-15 Thread slelievre
For the problem at hand here, I would work with polynomials in `x`
with coefficients in the ring of polynomials in `N` and `M` over
the field of algebraic numbers, and do something like the following.

Define the ring of polynomials over the field of algebraic numbers.

sage: R. = QQbar[]

Define the ring of polynomials over the above polynomial ring.

sage: S. = R[]

Define `a`, `i`, `b`, `c`, `X`, `f` from the question.

sage: a = QQbar(3).sqrt() / 2
sage: i = QQbar(I)
sage: b = (x - ~x) / (2 * i)
sage: c = (a * (x + ~x) + b) / 2
sage: X = (M / 3) * (a + b + c)
sage: f = 24 * (X^2 - N * b * c) * x^2

Note that the definition of `b` involves the inverse of `x` (which can be
denoted by `~x` or `x^-1`) and therefore lives in the fraction field of `S`,
rather than in `S` itself. Therefore, so do `c`, `X`, and `f`.

Check if `f` however represents an element in `S` as follows:

sage: f in S
True

and then construct the corresponding element of `S` (we could call it `f`
but here we call it `ff`).

sage: ff = S(f)

Check that `ff` vanishes at `-1`, or equivalently is divisible by `x + 1`.

sage: ff(-1)
0
sage: d = x + 1
sage: d.divides(ff)
True

Perform exact division (to stay in the polynomial ring `S` rather than move
to its fraction field).

sage: g = ff // d

Define `t` as an algebraic number.

sage: t = QQbar(exp(-pi*I/3))

Check that `g` vanishes at `t` or equivalently is divisible by `x - t`.

sage: g(t)
0
sage: dd = x - t
sage: dd.divides(g)
True

Perform exact division.

sage: h = g // dd

Inspect the result:

sage: h
((-1.000? - 1.732050807568878?*I)*M^2
 + (3.000? + 5.196152422706632?*I)*N)*x^2
 + ((1.000? - 1.732050807568878?*I)*M^2
 + (3.000? - 5.196152422706632?*I)*N)*x
 + 2*M^2 + (-6)*N

Or as a list (the list of coefficients of `x^j`, for `j` from `0` to the 
degree):

sage: h.list()
[2*M^2 + (-6)*N,
 (1.000? - 1.732050807568878?*I)*M^2
 + (3.000? - 5.196152422706632?*I)*N,
 (-1.000? - 1.732050807568878?*I)*M^2
 + (3.000? + 5.196152422706632?*I)*N]

Define somme pretty_print functions to inspect these algebraic numbers:

def pretty_print_qqbar(z):
a, b = z.real().radical_expression(), z.imag().radical_expression()
return "{} + {}*i".format(a, b)

def pretty_print_x_coeff(xc):
return " + ".join("({})*{}".format(pretty_print_qqbar(xc[m]), m)
  for m in xc.monomials())

and print `h` in a nice form:

print("h =   " +
  "\n+ ".join("({})*x^{}".format(pretty_print_x_coeff(xc), k)
 for k, xc in enumerate(g.list(

The result is:

h =   ((-1 + sqrt(3)*i)*M^2 + (3 + -3*sqrt(3)*i)*N)*x^0
+ ((3 + sqrt(3)*i)*M^2 + (-3 + 3*sqrt(3)*i)*N)*x^1
+ ((3 + -sqrt(3)*i)*M^2 + (-3 + -3*sqrt(3)*i)*N)*x^2
+ ((-1 + -sqrt(3)*i)*M^2 + (3 + 3*sqrt(3)*i)*N)*x^3

-- 
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 post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: documentation?

2018-11-14 Thread Michael Beeson
Oops,  "243" in my post should have been "k".   I don't know how to edit a 
post after I've posted it.


On Wednesday, November 14, 2018 at 10:31:34 PM UTC-8, Michael Beeson wrote:
>
> After quite some searching I did not succeed to find documentation for 
> sage functions to work with complex numbers as much as I would like. 
> For example  if I have a complicated rational expression,  how can I tell 
> Sage "bring this to the form a + bi".  It seems real() and imag()  only 
> work
> if no pre-processing is needed.   How about "multiply numerator and 
> denominator by denominator.conjugate()" ?  There's probably a chapter in 
> the documentation about this,  could someone please point me to it,  I 
> seem to be incompetent at finding it, sorry.  
>
> Since people want something concrete to look at, not just a general 
> question,  here is some code.   You'll see that it computes a certain 
> complex function (actually two of them)
> with integer parameters N and M,  the solution(s) of a certain equation.   
> I'd like to compute that the absolute value of those expressions must be 1. 
>   The 
> code below computes it numerically  for some more or less random values of 
> N and M,  and it is 1.  for those values, but I can't figure out how to 
> compute it symbolically.   Also,  if there's a better way to do polynomial 
> division than I've used below,  please tell me.
>
> def nov13b():
> var('p,q,r,N,M,x')
> a = sqrt(3)/2
> b = (x-x^(-1))/(2*i)
> c = (sqrt(3)/2)* (x+x^(-1))/2 + (1/2)*(x-x^(-1))/(2*i)
> X = (M/3)*(a+b+c)
> f = 24*(X^2-N*b*c)*x^2
> g = (f.maxima_methods().divide(x+1)[0]).full_simplify()
> print(g.full_simplify())
> print("")
> t = exp(-pi*i/3)
> print(g(x=t).full_simplify())
> print("")
> h = (g.maxima_methods().divide(x-t)[0]).full_simplify()
> print("h = ")
> print(h)
> print("")
> answers = solve(h,x)
> assume(N,'integer')
> assume(M,'integer')
> for u in answers:
> print("")
> ans = u.rhs().simplify()
> for k in range(230,245):
> ans_numerical = abs(ans.substitute(M=11,N=243)).simplify()
> print(n(ans_numerical))
>
>
>
>
>
>

-- 
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 post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Documentation won't compile correctly/ can't rebase git branch

2017-06-02 Thread Zachary Gershkoff
Dima,

I'm not sure why I would make a new local branch. However, I was able to 
successfully rebase and then build the documentation (and then pull, and 
then push) after I followed your earlier advice on upgrading sage. I must 
have broke something before by using the --upgrade option.

Thanks,
Zach

On Thursday, June 1, 2017 at 10:41:20 AM UTC-5, Dima Pasechnik wrote:
>
> I would rather (replace my* with right values)
>
> git checkout -b myrebasedstuff develop
> git pull trac u/myuid/mygreatbranch
>
> # assume it all merged fine, then
>
> make doc-clean
> make
>
>

-- 
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 post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Documentation on defining functions on Sage

2017-04-06 Thread Emmanuel Charpentier
This  should 
enlighten you...

HTH,

--
Emmanuel Charpentier

Le vendredi 31 mars 2017 18:22:24 UTC+2, saad khalid a écrit :
>
> Hey everyone:
>
> I'm just looking for the documentation for properly defining functions on 
> Sage. As far as I can tell, there are several ways to define functions. I 
> think you can define functions as sage objects, and then functions as 
> python functions, and then also lambda functions through python. I don't 
> really understand the difference between the former two options, or the 
> difference in how to create them. I also don't understand if they do things 
> differently. Is there some documentation on properly defining functions. 
> For example, what is the difference between:
>
> var('x')
> f(x) = x^2 #just an eg function
> and 
>
> var('x')
> f = x^2
>
> Moreover, what are the implications or possible problems with:
>
> var('x,y')
> f(x) = x^2*y
>
> Thanks! I tried googling for this but I couldn't find a clear answer 
> anywhere.
>
>
>

-- 
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 post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Documentation for Notebook modifications

2014-12-20 Thread kcrisman
 

 Dear All,

  

 I am searching for a documentation regarding the modification of the view 
 of the sage Notebook. I would like to edit thinks like the headlines, the 
 Buttons to show, the whole layout…

  

 Is there a part in the official documentation that I was missing? Or are 
 there any other good tutorials?


Hi Tobias,

No, there is not really any specific documentation other than the code 
itself, and the now-outdated-but-still-useful 
http://wiki.sagemath.org/devel/SageNotebook.  
https://github.com/sagemath/sagenb/ is where all Sage Notebook stuff 
currently lives.  

There isn't a 100% MVC distinction implemented, but it is not too horrible, 
and see http://math1.skku.ac.kr/ and https://farto.eis.uva.es:8080/ for two 
somewhat customized notebook servers.   A lot of the view stuff essentially 
lives 
in https://github.com/sagemath/sagenb/tree/master/sagenb/data/sage/html so 
I recommend poking around in there first.  Good luck!  You may also be 
interested in the newui branch and the themes pull 
request https://github.com/sagemath/sagenb/pull/136 there.

- kcrisman

-- 
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 post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Documentation and Learning Material for Basic Structures and the CategoryObject class

2013-12-01 Thread JamesHDavenport
Although not SAGE-specific, some of the issues are discussed in our
Davenport,J.H.  Trager,B.M.,
Scratchpad's View of Algebra I: Basic Commutative Algebra.
Proc. DISCO '90 (Springer Lecture Notes in Computer Science Vol.
429, ed. A. Miola) pp. 40-54.
http://opus.bath.ac.uk/32336/.

Davenport,J.H., Gianni,P.  Trager,B.M.,
Scratchpad's View of Algebra II:
A Categorical View of Factorization.
Proc. ISSAC 1991 (ed. S.M. Watt), ACM, New York, pp. 32--38.
http://opus.bath.ac.uk/32335/.
On Saturday, 30 November 2013 23:04:01 UTC, Nehal Patel wrote:

 Hello -- I am interested in learning how one goes about modeling the 
 abstract concepts of modern mathematics such as Groups, Rings, Ideals, 
 Fields, etc.  in an object oriented way (as well as learning a bit about 
 Category Theory along the way).  I seems like a pretty tricky software 
 engineering problem and there must be all sorts of lessons people have 
 learned along the way.  Given the openness of Sage, I figured this was a 
 great place to start.  I'm reading through the Basic Structures section of 
 the Reference Manual and intend to browse through some of the code, but I 
 thought I would ask the lists as well. 

 ++ Is there any documentation that describes how the Sage developers 
 decided to design their class hierarchy?  

 ++ How similar is it to what is used in Magma?  

 ++ Are there good resources that discuss the software design issues 
 (rather than just algorithms) related to CAS

 Ideally there would be something equivalent to the section in William 
 Stein's overview video in which he discusses the history and implementation 
 of the Calculus functionality. 

 thanks!



-- 
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 post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: documentation for implicit_plot

2010-09-14 Thread kcrisman


On Sep 14, 3:00 pm, D.C. Ernst ernst.tr...@gmail.com wrote:
 If I type the following into Sage (which is straight from the
 implicit_plot documentation), I get a black square:

 x,y=var('x,y')
 f(x,y) = x^2 + y^2 - 2
 implicit_plot(f, (-3, 3), (-3, 3),fill=True).show(aspect_ratio=1)

 Of course, if you remove fill=True, then everything works as
 expected.  The documentation should probably remove the fill=True,
 right?

Well, but it's supposed to demonstrate the fill option, which

   * ``fill`` -- boolean (default: ``False``); if ``True``, fill
the
 region f(x,y)  0.

So perhaps there has been a regression - I get the same thing in both
4.5.3 and 4.3 (though in 4.3 I get a ghostly circle in the middle).
Not for the first time, we wish there were a way to do doctesting on
the image files produced...

sage: contour_plot(f, (-3, 3), (-3,
3),fill=True,contours=(0,0)).show(aspect_ratio=1)

doesn't do what we want either. In fact I'm having trouble getting
what I want with

sage: contour_plot(f, (-3, 3), (-3,
3),fill=True,contours=[0,0]).show(aspect_ratio=1)
sage: contour_plot(f, (-3, 3), (-3, 3),fill=True,contours=[-oo,
0]).show(aspect_ratio=1)
sage: contour_plot(f, (-3, 3), (-3,
3),fill=True,contours=[-1000,0]).show(aspect_ratio=1)

I'm not sure what happened here, because

sage: contour_plot(f, (-3, 3), (-3,
3),fill=True,contours=1).show(aspect_ratio=1)

doesn't give just one contour, either.

I can think of several people whose fault this could be, and I'm one
of them, but I'm not sure what's going on yet (albeit won't have time
to check it in detail now).  Can you file a Trac ticket for this
issue, and cc: kcrisman and jason on it?

Thanks,

- kcrisman

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: documentation for implicit_plot

2010-09-14 Thread Jason Grout

On 9/14/10 8:12 PM, kcrisman wrote:



On Sep 14, 3:00 pm, D.C. Ernsternst.tr...@gmail.com  wrote:

If I type the following into Sage (which is straight from the
implicit_plot documentation), I get a black square:

x,y=var('x,y')
f(x,y) = x^2 + y^2 - 2
implicit_plot(f, (-3, 3), (-3, 3),fill=True).show(aspect_ratio=1)

Of course, if you remove fill=True, then everything works as
expected.  The documentation should probably remove the fill=True,
right?


Well, but it's supposed to demonstrate the fill option, which

* ``fill`` -- boolean (default: ``False``); if ``True``, fill
the
  region f(x,y)  0.

So perhaps there has been a regression - I get the same thing in both
4.5.3 and 4.3 (though in 4.3 I get a ghostly circle in the middle).
Not for the first time, we wish there were a way to do doctesting on
the image files produced...

sage: contour_plot(f, (-3, 3), (-3,
3),fill=True,contours=(0,0)).show(aspect_ratio=1)

doesn't do what we want either. In fact I'm having trouble getting
what I want with

sage: contour_plot(f, (-3, 3), (-3,
3),fill=True,contours=[0,0]).show(aspect_ratio=1)
sage: contour_plot(f, (-3, 3), (-3, 3),fill=True,contours=[-oo,
0]).show(aspect_ratio=1)
sage: contour_plot(f, (-3, 3), (-3,
3),fill=True,contours=[-1000,0]).show(aspect_ratio=1)

I'm not sure what happened here, because

sage: contour_plot(f, (-3, 3), (-3,
3),fill=True,contours=1).show(aspect_ratio=1)

doesn't give just one contour, either.

I can think of several people whose fault this could be, and I'm one
of them, but I'm not sure what's going on yet (albeit won't have time
to check it in detail now).  Can you file a Trac ticket for this
issue, and cc: kcrisman and jason on it?



Already done:  http://trac.sagemath.org/sage_trac/ticket/9744

I wrote some rough code fixing it about a month ago.  Volunteers to 
finish it and polish it are welcome!


Jason


--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: Documentation for Sage HTML cells, or what can I do with them?

2009-11-04 Thread ma...@mendelu.cz

On 4 lis, 17:54, Johann \Myrkraverk\ Oskarsson
joh...@myrkraverk.com wrote:
 Hi all,

 I've been trying to google for documentation on what is available in a
 html cell in a sage notebook. And I find nothing. Is there such a doc
 anywhere?

The TinyMCE in Sage is quite recent - (I guess no more than 1 year
old). Perhaps nobody wrote a documentation or tutorial yet. Something
is (if I remember correctly) in one of Sage refcards.


 I do know that I can use latex commands to render mathematics. There
 does not seem to be any list of what kind of latex commands are
 available.

The latex is rendered via jsmath. For more details see the home page
of jsmath (use google to find it).


 Such cells seem to be mysteriously absent from the sage tutorial.

 Can I use sage to calculate something, and then display it in a latex
 rendered math in a html cell? Something akin to
 {sage} latex( f = x^2; f.differentiate( x ) ) {sage}

I think no. But there are some other possibilities, like SageTeX -
LaTeX where you can insert sage comands.

btw: The notation you suggests seems to be close to imaxima in Emacs.
Does something like imaxima work for Emacs and Sage?

I have another related question: Is it possible to use emacs and
Firefox plugin it's all text for editing html cells?

Thanks
Robert Marik


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Documentation for Sage HTML cells, or what can I do with them?

2009-11-04 Thread Dan Drake
On Wed, 04 Nov 2009 at 04:54PM +, Johann Myrkraverk Oskarsson wrote:
 I've been trying to google for documentation on what is available in a
 html cell in a sage notebook. And I find nothing. Is there such a doc
 anywhere?

We use TinyMCE, whose documentation is here:
http://tinymce.moxiecode.com/documentation.php

 Can I use sage to calculate something, and then display it in a latex
 rendered math in a html cell? Something akin to {sage} latex( f = x^2;
 f.differentiate( x ) ) {sage}

I don't think this is possible right now, but it's intriguing.

This sort of thing is possible in a LaTeX document with SageTeX:
http://www.ctan.org/tex-archive/help/Catalogue/entries/sagetex.html

Dan

-- 
---  Dan Drake
-  http://mathsci.kaist.ac.kr/~drake
---


signature.asc
Description: Digital signature


[sage-support] Re: documentation issues

2009-05-12 Thread Stan Schymanski

Thanks, I'll try that. Will this be updated with Sage4.0?

Stan

David Joyner wrote:
 Though outdated, you could try installing extradocs and see if that works:
 http://www.sagemath.org/packages/optional/

 On Tue, May 12, 2009 at 6:14 AM, Stan Schymanski schym...@gmail.com wrote:
   
 Dear all,

 I was very happy to see that the new documentation system had a search
 function, but for some reason it rarely works for me. The link is not
 active at all from the intro page and it usually does not find any
 results when I actually get to use it. Does anyone else have problems
 with that?

 Also, I noticed that the online Python documentation looks very
 similar and wondered if there is an easy way of installing the Python
 documentation locally and perhaps linking it to the Sage
 documentation. The Sage user is often referred to the Python
 documentation for some very helpful details, but this is only
 available to me when I am online.

 Cheers
 Stan
 

 
   

-- 


Stan Schymanski
Scientist
Max Planck Institute for Biogeochemistry
Postfach 10 01 64
D-07701 Jena

Phone: +49.3641.576264
Fax: +49.3641.577274
WWW: http://www.bgc-jena.mpg.de/~sschym

Biospheric Theory and Modelling Group
http://www.bgc-jena.mpg.de/bgc-theory/
_


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: documentation on show()

2008-09-04 Thread john_perry_usm

Update: when I say that axes and frame don't appear to work, I mean
after creating an implicit plot. They work find with a regular plot.

thanks
john perry

On Sep 4, 9:16 am, john_perry_usm [EMAIL PROTECTED] wrote:
 Hello,

 I think I've found a documentation bug, but perhaps I just don't know
 how to read the documentation. Trac #2132 seems to reflect the same
 misunderstanding I had and could perhaps be closed either immediately
 or after a change in documentation.

 The documentation for show() states that the options include
     figsize -- [width, height] (same for square aspect)
 This looks for all the world as if P.show(figsize=[200,200]) should
 produce a square aspect image of P. On the other hand,
 P.show(figsize=(6,6)) *does* show a square aspect image of P.

 (1) Should one read [x,y] throughout the documentation as a list [.,.]
 of two elements or as a tuple (.,.) of two elements? If a tuple, then
 my bad and perhaps Trac #2132 can be closed.

 (2) How is one to interpret width  height anyway? It clearly does not
 mean pixels, which was my assumption (and probably the assumption of
 Trac #2132). Does it mean dpi*width, dpi*height? (A guess from
 experimentation.)

 (3) From the API documentation, aspect_ratio is also a valid
 parameter, but this does not apepar when typing show(). Neither do
 some other parameters, which appear useful. Some of them don't appear
 to work however: frame and axes come to mind.

 thanks
 john perry
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---