[sage-support] Combinatorics: Listing minimal subset covers(?)

2018-07-23 Thread Jori Mäntysalo

Let L be a list of lists, like [[1,2], [2,3,4], [4,5]].

Is there a function to list minimal sets S such that for every (sub)list 
of L there is at least one element in S? For example {1, 3, 5} would be 
one "cover" that I am looking for. It is minimal, i.e. {1, 3}, {1, 5} and 
{3, 5} would not cover all (sub)lists of L, even if it is not minimun ({2, 
4} and {2, 5} are).


I suppose that this is NP-complete but can be done in small cases. Might 
be that this could be formulated as a graph theory problem.


--
Jori Mäntysalo


Re: [sage-support] Parallel computation in Sage

2018-07-16 Thread Jori Mäntysalo

On Mon, 16 Jul 2018, chandra chowdhury wrote:


I want to calculate the determinant of a large matrix
with large entries. So it is taking time. In my machine,
I have 32 CPUs. Is it possible in Sage to use all CPUs
parallelly to find the determinant?


Are values real number or complex numbers, finite field elements...? 
Symbolics?


--
Jori Mäntysalo

Re: [sage-support] Abstract Algebra tutorial ?

2018-07-11 Thread Jori Mäntysalo

On Tue, 10 Jul 2018, Pat Browne wrote:

Can anyone recommend a good tutorial for using sage Permutations and 
groups? I am a complete newbie and haven't been able to figure out how 
to do things with symmetry or permutation multiplications. I'm pretty 
sure that sage would be a great help in understanding these things.


See http://abstract.ups.edu/sage-aata.html

--
Jori Mäntysalo

Re: [sage-support] Re: gap: cannot extend the workspace any more! with tons of free memory.

2018-05-30 Thread Jori Mäntysalo

On Wed, 30 May 2018, sbrandho...@web.de wrote:


This is how my memory looks like before gap crashes:

Every 5.0s: free -m Wed May 30 22:03:55 2018

  total    used    free     shared  buff/cache   
available
Mem:  15960    2539   11498 300    2021      12845
Swap:  8007   0    8007


I suggest that you try to increase swap to 2 times on RAM. Something like 
this might work (as root):


head -c $((12*1024**3)) /dev/zero > /home/SWAPFILE
chmod og= /home/SWAPFILE
mkswap /home/SWAPFILE
swapon /home/SWAPFILE

--
Jori Mäntysalo

Re: [sage-support] Route inspection problem

2018-04-01 Thread Jori Mäntysalo

On Sun, 1 Apr 2018, Dima Pasechnik wrote:


this is also known as Chinese postman problem. There is a tutorial on doing it 
in networkx.
http://brooksandrew.github.io/simpleblog/articles/intro-to-graph-optimization-solving-cpp/


Duh. Was more complicated than I thank. Anyways, thanks; maybe I'll 
implement that some day.


--
Jori Mäntysalo

[sage-support] Route inspection problem

2018-03-31 Thread Jori Mäntysalo
I was walking at 
https://kintulammi.fi/wp-content/uploads/Kintulammi_Opaskartta.jpg and 
hence wondered if Sagemath has a function to solve 
https://en.wikipedia.org/wiki/Route_inspection_problem . Didn't found any, 
is it hidden with some other name or module?


--
Jori Mäntysalo


Re: [sage-support] Are they equivalent ?

2018-03-31 Thread Jori Mäntysalo

On Sun, 1 Apr 2018, Henri Girard wrote:

I am surprise because graph is different it should n't because the adjacency 
matrix is the same ?


They are:

sage: W = graphs.WheelGraph(4)
sage: H = Graph(W.adjacency_matrix ())
sage: W == H
True

However, for almost every built-in graph or graph family Sage also knows 
some "nice" way to draw it. For other graphs it tries to found a "nice" 
drawing by partly randomized algorithm.


You can also try

H.show(layout='planar')

--
Jori Mäntysalo

Re: [sage-support] avoiding startup time cost with multiple invocations

2018-01-11 Thread Jori Mäntysalo

On Thu, 11 Jan 2018, Berkeley Churchill wrote:

I'll look into using a pipe, that's a good suggestion and might be 
easier than the embedded interpreter.


There are many ways to do this. Sage could read a pipe and write to files, 
another program could busy-wait to see for a file with given name to apper 
(of course Sage should first write to temporary file and then rename it). 
Or instead of busy-wait loop Sage could write to pipe when it's done. Also 
inotify is one possible solution.


In any case, after you get rid of the startup time I suppose the next 
slowest part is converting data structures between Python and C.


--
Jori Mäntysalo

Re: [sage-support] avoiding startup time cost with multiple invocations

2018-01-10 Thread Jori Mäntysalo

On Wed, 10 Jan 2018, Berkeley Churchill wrote:

(@Jori: unfortunately starting one process and doing all the 
computations at once won't work for us because we need to dynamically 
generate the n+1st computation based on the output of the nth 
computation.  We could theoretically port all that logic to python/sage, 
but we don't really think that's worth it right now)


Maybe you should then use pipe? First

mkfifo thepipe
./sage -q < thepipe > thepipe

and on the another window I tested with

jm58660@j-op7010:~/sage$ echo 1+2 > thepipe
jm58660@j-op7010:~/sage$ read result < thepipe
jm58660@j-op7010:~/sage$ echo $result
sage: 3
jm58660@j-op7010:~/sage$ tmp=$(echo $result | cut -f 2 -d ' ')
jm58660@j-op7010:~/sage$ echo $tmp+3 > thepipe
jm58660@j-op7010:~/sage$ read anotherresult < thepipe
jm58660@j-op7010:~/sage$ echo $anotherresult
sage: 6
jm58660@j-op7010:~/sage$ echo quit > thepipe

Or maybe use Sage as controller part, i.e. call C++-program from Sage 
instead of calling Sage from C++-program?


--
Jori Mäntysalo


Re: [sage-support] avoiding startup time cost with multiple invocations

2018-01-10 Thread Jori Mäntysalo

On Wed, 10 Jan 2018, Berkeley Churchill wrote:


As part of a research project we're using sage as a subroutine for some matrix 
computations over rings.  We have hundreds or thousands of these computations, 
but each computation
is fairly quick.  Right now, for each computation we write python code into a .sage file, 
and then start a new process with "sage somefile.sage > output".  This works 
fine, except
each time we incur the startup time, which is about 2.5 seconds (whereas running a 
tiny python program is < 0.02s).  Since we call sage hundreds of times, this 
adds up pretty
quickly.  


In Sage - actually in Python - you can handle exceptions:

L = [2, 0, -3]
for x in L:
try:
print(1/x)
except ZeroDivisionError:
print("Can't compute inverse of %x." % x)

so why you can't just make you C++ program to output, say, 1 of matrix 
computation to a .sage file having some try-except -structure on them?


--
Jori Mäntysalo

Re: [sage-support] Random connected poset on n elements

2017-11-30 Thread Jori Mäntysalo

On Thu, 30 Nov 2017, Christian Stump wrote:


  How big is your n?

not very big, I aim for the biggest n for which I can loop through all 
permutations
of n and compute some numbers. I expect this to be between 10 and 14.
 
  "Almost all" finite posets are connected, so uniform distribution of
  all posets would work too for bigger n.


how would I get uniform distribution on all posets?


I meant that it won't help you to discard unconnected ones.

There is a code for generating posets, see attachment at 
https://trac.sagemath.org/ticket/14110 , but unfortunately it has not been 
integrated to Sage. I just tested and it takes about 2,2 seconds to 
generate 11-element posets (there are 46749427 of those) and 38 seconds 
for 12-element posets. I guess you could use that up to 14 elements.


--
Jori Mäntysalo

Re: [sage-support] Random connected poset on n elements

2017-11-30 Thread Jori Mäntysalo

On Thu, 30 Nov 2017, Christian Stump wrote:


Is there a way to obtain a random connected poset on n unlabelled elements in 
sage?


How big is your n?

"Almost all" finite posets are connected, so uniform distribution of all 
posets would work too for bigger n.


--
Jori Mäntysalo

Re: [sage-support] Generation of graphs where all maximal cliques have the same size

2017-10-19 Thread Jori Mäntysalo

On Thu, 19 Oct 2017, Jori Mantysalo wrote:


Might be worth trying to use from_graph6 directly.


Tested. Don't bother, does not give really speedup that would mean 
something.


--
Jori Mäntysalo

Re: [sage-support] Generation of graphs where all maximal cliques have the same size

2017-10-19 Thread Jori Mäntysalo

On Thu, 19 Oct 2017, Christian Stump wrote:


But this seems to be too slow, already because it takes too long for this to
turn the graph6 string from nauty into a sage graph.


Might be worth trying to use from_graph6 directly. Currenty nauty_geng() 
says G = graph.Graph(s[:-1], format='graph6'), and the function for that 
first does some checks and then does


if format == 'graph6':
if weighted   is None: weighted   = False
self.allow_loops(loops if loops else False, check=False)
self.allow_multiple_edges(multiedges if multiedges else False, 
check=False)

from .graph_input import from_graph6
from_graph6(self, data)

I think that doing import in a loop might take some time in Python.

This won't help much, but maybe a little.

--
Jori Mäntysalo

Re: [sage-support] Well covered graph

2017-09-18 Thread Jori Mäntysalo

On Mon, 18 Sep 2017, Selvaraja S wrote:


Definition:
A graph $G$ is called well-covered if all minimal vertex covers of $G$ have
the same number of elements.

What is the coding to check well-covered graph?


Maybe you can reformulate the question using independent sets and use 
PairwiseCompatibleSubsets, see the last example in page

http://doc.sagemath.org/html/en/reference/combinat/sage/combinat/subsets_hereditary.html

--
Jori Mäntysalo

[sage-support] Data structure for partition refinement

2017-08-31 Thread Jori Mäntysalo
Sage has a static data structure SetPartition, and a dynamic structure 
DisjointSet that can *combine* blocks. Is there a "dual" structure of 
latter, something that would start from one big block and would have 
functions to *split* block?


--
Jori Mäntysalo


Re: [sage-support] Re: Installing GAP packages & SageNB

2017-01-26 Thread Jori Mäntysalo

Solved, kind of, but please read...

On Thu, 26 Jan 2017, Dima Pasechnik wrote:


  But from the SageNB I got

  #I  MakeReadOnlyGlobal: GradedAlgebraPresentationType no value
  bound
  true

This looks OK


But why the error message?


GroupHomology(G,99);

(I tried this with contents "gap" - set by the 4th
switch above the cells)


Me too.


Forgotten ';' or something like this?


No. I tried

GroupHomology(G,99x);

to test and got an error

RuntimeError: Gap terminated unexpectedly while reading in a large line:
Gap produced error output
Error, Variable: '99x' must have a value

I also tried

F:=FreeGroup(2);; x:=F.1;; y:=F.2;;
G:=F/[x^2,y^201,(x*y)^2];; G:=Image(IsomorphismPermGroup(G));

and got



So, I tried

foo:=GroupHomology(G,99);

and a cell with only

foo

and got

[ 2, 3, 67 ]

So what the hell... I do not get output from the last line as I should? 
SageNB and some strang error?


--
Jori Mäntysalo

[sage-support] Installing GAP packages & SageNB

2017-01-26 Thread Jori Mäntysalo
I was asked to install the optional package HAP to the GAP inside 
SageMath.


I run ./sage -i gap_packages and then followed instructions at 
https://wiki.sagemath.org/InstallingGapPackages . Now it works from 
command line, i.e. I can say


gap_console()

and then

LoadPackage("HAP");
F:=FreeGroup(2);; x:=F.1;; y:=F.2;;
G:=F/[x^2,y^201,(x*y)^2];; G:=Image(IsomorphismPermGroup(G));;
GroupHomology(G,99);

and got

[ 2, 3, 67 ]

But from the SageNB I got

#I  MakeReadOnlyGlobal: GradedAlgebraPresentationType no value bound
true

from LoadPackage() and nothing from GroupHomology(G,99).

What to do?

--
Jori Mäntysalo


Re: [sage-support] Re: How to limit heavy computations

2016-11-27 Thread Jori Mäntysalo

On Sun, 27 Nov 2016, Jeroen Demeyer wrote:


In general it is not easy to limit resource usage in Linux.


It's not easy, that's true. But that's independent of the fact that 
ulimit within SageNB simply doesn't work due to some SageNB bug.


Yes, bugs are one thing. But the other is limiting resources for some 
users. And that is much harder when the resource use comes through SageNB 
or some similar system.


I won't except to see good solutions to this in near future.

--
Jori Mäntysalo

Re: [sage-support] Re: How to limit heavy computations

2016-11-27 Thread Jori Mäntysalo

On Sun, 27 Nov 2016, Enrique Artal wrote:


Thanks, As you say, it would be better something more direct, but your
approach is a strong improvement for my needs. By the way, I changed in our
experimental notebook 7.4 -> 7.3 and the limits work: they stop the process
and the notebook is still running.


OK, so there is a degeneration somewhere. Hopefully this is read by some 
of developers who can do something for it.


In general it is not easy to limit resource usage in Linux. That's due to 
subprocesses, overcommit and the way programs are usually done. And of 
course having something like SageNB above process level does this even 
more complicated.


--
Jori Mäntysalo

Re: [sage-support] Re: How to limit heavy computations

2016-11-26 Thread Jori Mäntysalo

On Sat, 26 Nov 2016, Enrique Artal wrote:


By the way, using server_pool, is there a way to know which user of the
notebook is using a user of the server_pool? 


AFAIK not really. I can list files in /tmp and run fuser for them, i.e.

fuser /tmp/*

and see, for example

/tmp/tmpwIR2_j:   7589c

and in that file I can see a line like

DATA = . . . /sage_notebook.sagenb/home/jm58660

and hence user jm58660 is behind the process #7589.

This could be scripted of course, but I would like to have better NB made 
as admin viewpoint in mind.


--
Jori Mäntysalo

Re: [sage-support] Randomness test

2016-11-03 Thread Jori Mäntysalo

On Thu, 3 Nov 2016, chandra chowdhury wrote:


I have sequence like



{57,  44,  40,  57,  50,  53,  17,  24,  20,  3,  8,  51,  62,  56,  2, ..},


where each value is between 0 to 63.  I want to check its randomness. Is 
there any function in Sage for this? 


How do you define "random"? Sometimes a perfect random number generator 
will generate the sequence 1,2,3, Only definition of "random" I can 
invent is "Can not be compressed." So can we do that?


I think that no. That would need some kind of heuristic, as the numbers 
might have infinite number of generating functions. For example this is 
not random at all: 92, 65, 35, 89, 79, 32, 38, 46: I got it from 
str(pi.n(digits=30))[10:].


Suppose that your list has 1000 integers. Now we make a program "print 57, 
44, 40". That program is, say, 1010 characters long. Is there any program 
of at most 1009 characters that prints those numbers? Theoretically we can 
just generate all strings up to 1009 characters, run them, and see what 
happens. But if some program of 453 characters has been run for a day, has 
produced first ten numbers of your list, and is still running, we do not 
know if it will eventually produce other 990 numbers.


So, do you have some kind of guess about those numbers, something that 
they might be produced from a


--
Jori Mäntysalo

Re: [sage-support] Re: Element vs UniqueRepresentation

2016-10-08 Thread Jori Mäntysalo

On Sat, 8 Oct 2016, Nils Bruin wrote:


  What are all of the drawbacks?

The ones I am aware of:


Also random testing for a hypotheses is hard. I can generate infinitely 
many random graphs in a loop and try to found a counterexample, but the 
same does not apply to posets.


--
Jori Mäntysalo


Re: [sage-support] Is it possible to add methods to an existing class at runtime ?

2016-10-08 Thread Jori Mäntysalo

On Sat, 8 Oct 2016, Emmanuel Charpentier wrote:


I wonder if it is possible to patch a new method in an existing class.


TypeError: can't set attributes of built-in/extension type 
'sage.symbolic.ex pression.Expression'


AFAIK it is impossible due to limitations of Python. You can patch classes 
not defined in C, like


type(Graph()).is_eulerian_and_hamiltonian = lambda self: self.is_eulerian() and 
self.is_hamiltonian()

but that won't work for example to Sage integers.

--
Jori Mäntysalo


Re: [sage-support] Re: plotting ln(x) graph on sagemath

2016-09-19 Thread Jori Mäntysalo

On Sun, 18 Sep 2016, jack wrote:


Ubuntu16.04. 



P=plot(log((1+x)/(1-x)), (x, -1,1))
show(P)
gives a lengthy error message which ends with
ImportError: cannot import name scimath

I installed sage at /home/jack/Tools

One clue might be the initial message I get on initiating sage in a
terminal. It reads:


sys:1: RuntimeWarning: not adding directory '' to sys.path since everybody
can write to it.


I have no real clue, but I would start with

strace -e file ./sage 2> log-f

then write

plot(sin)

or something similar and then quit Sage. After that

fgrep tmp_ log-f

shows

open(".../.sage/temp/j-op7010/12072/tmp_n3Sn3X.png", ...) = 11

etc. and

fgrep EACCESS log-f

finds nothing.

--
Jori Mäntysalo

Re: [sage-support] Paper citing sagemath

2016-08-30 Thread Jori Mäntysalo

On Tue, 30 Aug 2016, Montgomery-Smith, Stephen wrote:


I just submitted a paper: https://arxiv.org/abs/1608.06314 that cites
sagemath.  Would you guys like to add it to your webpage?

http://www.sagemath.org/library-publications.html


Is that web page maintained at all?

If it is: Me too! See http://arxiv.org/abs/1403.5389 (publication 
information 
http://dl.acm.org/citation.cfm?id=2801897&CFID=662122917&CFTOKEN=12870255)


--
Jori Mäntysalo


Re: [sage-support] How should I determine if two strongly regular graphs are isomorphic?

2016-08-23 Thread Jori Mäntysalo

On Tue, 23 Aug 2016, Paul Leopardi wrote:


Do you have the package bliss or nauty installed?


sage: is_package_installed('bliss')
True


That explains it. canonical_label() uses Bliss by default if it is 
installed. Setting algorithm='sage' will override this (and slow down 
computation). So we should just expose more Bliss and Nauty features to 
Sage.


--
Jori Mäntysalo


Re: [sage-support] Meta question: How do I best specify graphs in sage-support?

2016-08-23 Thread Jori Mäntysalo

On Tue, 23 Aug 2016, Paul Leopardi wrote:

Is there a particular reason why you prefer DiGraph(g).dig6_string() to 
g.graph6_string() even though it likely to give a string that is twice 
as long?


No. I just didn't know that.

(TODO: Add seealso-links to documentation.)

--
Jori Mäntysalo


Re: [sage-support] Meta question: How do I best specify graphs in sage-support?

2016-08-22 Thread Jori Mäntysalo

On Mon, 22 Aug 2016, Paul Leopardi wrote:


I am seeing a problem where "g.is_isomorphic(h)" is taking an inordinately
long time, where g and h are graphs, even though
"g.automorphism_group().order() == h.automorphism_group().order()", and
"g.canonical_label() == h.canonical_label()" both take a reasonable time.


Do you have Bliss installed? If so, then canonical_label() uses it, but 
is_isomorphic() does not.



My main question for the moment is how do I specify graphs here in
sage-support so that others can reproduce the problem?


dig6_string() is only available do directed graphs, but a Graph made from 
DiGraph is just a graph with directions forgotten. So you can say


DiGraph(g).dig6_string()

and on the other direction

Graph(DiGraph('DOOOW?'))

will give an undirected graph. We can then try to relabel your graph (like 
g.relabel(lambda x: x+1) ) and check for isomorphism.


--
Jori Mäntysalo


Re: [sage-support] Re: Installing the optional python3 package seems to break Sage

2016-08-10 Thread Jori Mäntysalo

On Wed, 10 Aug 2016, William Stein wrote:


I was really surprised when I started Sage that people would often try
to **install all optional packages**, then report anything that went
wrong.I bet people still try to do this...


Isn't it supposed to work... And on the servers I would like to have good 
coverage of features. This is not sage-specific: I can guess that some 
users here will use R and some might use Octave, so why not install both 
of them? (Well, nowadays I can just forward them to our Sage-server.)


Of course I will not install all packages for, say, Ubuntu Linux, but Sage 
has not that many available.


--
Jori Mäntysalo


Re: [sage-support] how to display graph legend with colored digraph

2016-07-27 Thread Jori Mäntysalo

Quoting Ben :


That is great. Now, is there someway to permanently associate those two
parameters to the graph? i.e., G.show() has the colors and title?


AFAIK no.

You can set positions for vertices with set_pos() and you can attach  
an arbitrary value to a vertex like


G.set_vertex(2, 'red')

but there seems to be no way to otherwise set default options. There is

G.graphics_array_defaults

that says among other things "'graph_border': True", but it seems to  
have no effect. Hopefully someone can tell what for it is.


 * * *

New version of Sage will make it possible to say

G.show(vertex_color='red', vertex_colors={'blue': [0, 1], 'green': [2, 3, 4]})

so that you can have a default color for vertices not listed in  
vertex_colors. Same will be available for edge colors.


--
Jori Mäntysalo

--
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.


Re: [sage-support] how to display graph legend with colored digraph

2016-07-26 Thread Jori Mäntysalo

On Tue, 26 Jul 2016, Ben wrote:


.graphplot() or .show() to do this. However, I'm having trouble displaying
some kind a legend to go along with the graph to explain which colors are
which properties.



I'd like to display with the graph something like

color1 = property A
color2 = property B


Good question. You can say

G = DiGraph({1:[2,3], 2:[3]})
G.show(vertex_colors={'red': G.sinks(), 'blue': G.sources()}, title="Sinks in 
red.\nSources in blue.")

but I don't know how to add text to a plot. For example

G = DiGraph({1:[2,3], 2:[3]})
gr = G.plot(vertex_colors={'red': G.sinks(), 'blue': G.sources()})
graphics_array([gr, text("Some colors\nto show special vertices.", (0,0))])

does something that you don't want. I guess that LaTeX (with, say, Tikz) 
is needed for production quality pictures. Sage's graphics works for 
demonstration in classroom.


--
Jori Mäntysalo


[sage-support] Matrix over SR, reduced row echelon form

2016-04-28 Thread Jori Mäntysalo

What is the logic behind this:

var('a b c d')
M = Matrix(SR, [[a, b], [c, d]])
M.rref()

-->

[1 0]
[0 1]

?

--
Jori Mäntysalo


[sage-support] Default output form for AlgebraicNumber

2016-04-19 Thread Jori Mäntysalo
Matrix(QQ, [[1,2],[3,4]]).eigenvalues() --> [-0.3722813232690144?, 
5.372281323269015?]


Not good for teaching (and I just got a complain for that). Of course I 
can do map(lambda x: x.radical_expression(), M.eigenvalues()) or something 
similar. Or begin with Matrix(SR, ...).


But is there a default setting to change output type of AlgebraicNumber?

--
Jori Mäntysalo


Re: [sage-support] Re: Weber point

2016-04-07 Thread Jori Mäntysalo

On Thu, 7 Apr 2016, kcrisman wrote:

It's very easy to install a new R package from within Sage, even in 
sagenb, though.  r.install_packages('orloca')


True. Took about two seconds to download, compile and install. But I have 
self-compiled Sage - does it also work in ready-made binary Sage?


Installation ends with message "Please restart Sage in order to use 
'orloca'.". However, even restarting worksheet was not needed.


--
Jori Mäntysalo


Re: [sage-support] Re: Weber point

2016-04-07 Thread Jori Mäntysalo

On Thu, 7 Apr 2016, Dominique Laurain wrote:


Trying just now in sagemath cloud worksheet

  r.library('orloca')

and it seems no package orlorca (or depth)


This is actually more general problem that comes from the "building a car" 
-principle. SageMath contains at least R and GAP, and they both have their 
own subpackage system. I think I tried semigroup-package of GAP some time 
ago, and there was some complication when installing it inside Sage.


 * * *

OFF-TOPIC:

R is extremely easy to install. It has ready-made binaries for Windows and 
Mac. For Linux at least for both Ubuntu and Fedora have it in standard 
repository.


So I suggest you to install local R.

--
Jori Mäntysalo


[sage-support] Weber point

2016-04-05 Thread Jori Mäntysalo

[ Not important, I am just curious. ]

Does SageMath have a function that takes a set of points in a plane as an 
argument and return an approximation of the point that has shortest 
distance to given points in average? The point is called the Weber point 
if I have understood this right.


r.eval(...something...) maybe?

--
Jori Mäntysalo


Re: [sage-support] graph plotting: heights option

2016-03-11 Thread Jori Mäntysalo

On Fri, 11 Mar 2016, Pierre wrote:


This is from the documentation of the plot method of the Digraph class:

sage: T = list(graphs.trees(7))
sage: t = T[3]
sage: t.plot(heights={0:[0], 1:[4,5,1], 2:[2], 3:[3,6]})

The result (on SMC, and I think it used to be the same on my local sage) is 
not what I expected at all: perhaps I misunderstand the 'heights' option, bu

t I thought that the vertices 3 and 6, for example, would be on the same hor
izontal line, as would be 4, 5, 1. Not the case for me at all !


I can confirm this. I know that this may depend on dot2text, installing it 
may make difference.


For example after t = Posets.PentagonPoset().hasse_diagram() the 
height-option makes nothing. Except that it does, if you use option 
layout='acyclic'.


I am afraid that you must directly use .set_pos() on the graph.

--
Jori Mäntysalo


Re: [sage-support] Re: %latex and no output

2016-03-10 Thread Jori Mäntysalo

On Thu, 10 Mar 2016, William Stein wrote:


The real bug is that we have no guide to installing Sage server.


https://wiki.sagemath.org/SageServer


I stand corrected. I guess I will go throught that after Ubuntu 16.04 LTS 
is out.


--
Jori Mäntysalo


Re: [sage-support] Re: %latex and no output

2016-03-10 Thread Jori Mäntysalo

On Thu, 10 Mar 2016, kcrisman wrote:


I found the reason. File permissions.


In your specific case, or in general?  If in general, we can open an 
issue to at least keep track of it and suggest workarounds.


Sage only has notebook(..., server_pool=['someone@somewhere'], ...). It is 
up to administrator to make the account running Sage GUI to be able to log 
in as someone@somewhere.


The real bug is that we have no guide to installing Sage server.

But... If I say plot(sin) it works: the process running GUI as uid 
'sagegui' makes a file to /tmp, the process running computation as uid 
'sagecalc' reads it and makes a picture file that 'sagegui' can read. 
But for %latex it does not work: file written by 'sagecalc' gets 
permissions that do not allow 'sagegui' to read it. Why so?


I think you'd have to go through the code that parses the various 
percent directives in sagenb and see how they get used; sometimes I 
think they do start up new processes, whereas plot() is a "Sage native" 
process.


OK, so there is some difference coming from system() vs. some other 
functin. Duh. I will look this at monday, when we have a service break.


--
Jori Mäntysalo


Re: [sage-support] Re: %latex and no output

2016-03-02 Thread Jori Mäntysalo

On Mon, 29 Feb 2016, kcrisman wrote:

Got it.  As I say, I can't see this in any current Sage I have, except a 
server with no LaTeX, so it would be hard to debug.  


I found the reason. File permissions.

But... If I say plot(sin) it works: the process running GUI as uid 
'sagegui' makes a file to /tmp, the process running computation as uid 
'sagecalc' reads it and makes a picture file that 'sagegui' can read. But 
for %latex it does not work: file written by 'sagecalc' gets permissions 
that do not allow 'sagegui' to read it. Why so?


--
Jori Mäntysalo


Re: [sage-support] Re: %latex and no output

2016-02-26 Thread Jori Mäntysalo

On Thu, 25 Feb 2016, Henri Girard wrote:

In sagenb you don't need to write %latex ? Just click on the box latex to 
mark it ?


What box?

But now I tested "Typeset" box. It works, so LaTeX installation is OK. And 
for example %timeit works, so %-string works. Strange.


--
Jori Mäntysalo


Re: [sage-support] Re: %latex and no output

2016-02-25 Thread Jori Mäntysalo

On Thu, 25 Feb 2016, kcrisman wrote:


  %latex
  x

  does not provide any output. Where to start debugging?



Is this in sagenb?


Yes.

 I can confirm this works for me in 7.1.beta3, though I do have LaTeX 
installed. In the server I have access to with 6.9 I get this.  6.5 on 
my computer works fine, so I *suspect* it is related to the LaTeX on the 
server somehow.  But maybe there was something that was wrong and fixed 
in short order in Sage itself?


Can it relate to server_pool -option? With a slight misconfiguration one 
can get SageNB where sin(0) works but plot(sin) does not.


--
Jori Mäntysalo


[sage-support] %latex and no output

2016-02-25 Thread Jori Mäntysalo

A cell containing only

%latex
x

does not provide any output. Where to start debugging?

This works on my local computer with newest beta. On server where this 
does not work we use latest stable release. For example


%latex
x^2

gives

An error occurred.
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) 
(format=pdflatex 2016.1.4)  25 FEB 2016 15:40

entering extended mode
 restricted \write18 enabled.

   . . .

(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for 
TeX Liv

e
))
! Missing $ inserted.

$
l.37 x^
   2
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

LaTeX Font Info:Try loading font information for U+msa on input line 
37.

(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd
File: umsa.fd 2013/01/14 v3.01 AMS symbols A

  . . .

I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

[1

{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./sage65.aux) )
Here is how much of TeX's memory you used:
 2798 strings out of 495028

--
Jori Mäntysalo


Re: [sage-support] Writing 'n' variables in Sagemath linux ubuntu

2016-01-26 Thread Jori Mäntysalo

If I understood this, isn't

var(['a'+str(i) for i in range(1,4)])

what is wanted? It will make a1, a2 and a3 to variables.

--
Jori Mäntysalo


Re: [sage-support] redirecting input and output to Sage

2016-01-23 Thread Jori Mäntysalo

Quoting Luis Finotti 
stdbuf --output=L ./sage tmp.sage > tmp.out



I was unfamiliar with stdbuf...


Then maybe you don't know time, timeout, ulimit etc. either.
And in some (rare) cases even "at" would be nice for some
users.

Actually, maybe I should write a short text for Linux
commands maybe useful for advanced Sage users.

--
Jori Mäntysalo

--
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.


Re: [sage-support] redirecting input and output to Sage

2016-01-23 Thread Jori Mäntysalo

Quoting Luis Finotti :


Could someone explain how redirection works with Sage (or point me in the
right direction)?


I suggest to not do anything sage- or python-specific to general problem
like this. Instead rely on usual tools, stdbuf in this example:

stdbuf --output=L ./sage tmp.sage > tmp.out

Also check if the command "tee" fits your purpose.

--
Jori Mäntysalo

--
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.


Re: [sage-support] Packages needed for self-compiled Sage on Ubuntu

2016-01-06 Thread Jori Mäntysalo

On Wed, 6 Jan 2016, Jeroen Demeyer wrote:


Is there a list somewhere on Ubuntu packages that are needed to install
fully working Sage from source?


The hard part here is defining "fully working".


"Everything that is supposed to work without optional packages (installed 
with sage -i) really works."?


--
Jori Mäntysalo


[sage-support] Packages needed for self-compiled Sage on Ubuntu

2016-01-06 Thread Jori Mäntysalo
Is there a list somewhere on Ubuntu packages that are needed to install 
fully working Sage from source?


For example now I have a machine where view() does not work as LaTeX has 
no tikz. Instead of every admin to do the same job it would be nice to 
have a copy-and-paste help.


--
Jori Mäntysalo


Re: [sage-support] For loop difference between sage in the cloud and local instalation

2015-12-26 Thread Jori Mäntysalo

On Sat, 26 Dec 2015, William Stein wrote:


  quite sure that I was able to do something like

  for x in SomeObjects(n):
      if x.foo() and not x.bar():
          x.show()

  and see pictures coming as the loop is running.

 Yep.  But there are no print statements above. 


OK. But what has changed, as now the pictures does not come one-by-one?

--
Jori Mäntysalo


Re: [sage-support] For loop difference between sage in the cloud and local instalation

2015-12-26 Thread Jori Mäntysalo

On Sat, 26 Dec 2015, William Stein wrote:


  print "Original:"
  P.show()
  print "Reversed:"
  P.dual().show()

It has never worked that way.


?? Then my main memory is corrupted. Got to reboot for this evening.

What about outputting graphics as the computation goes on? I am quite sure 
that I was able to do something like


for x in SomeObjects(n):
if x.foo() and not x.bar():
x.show()

and see pictures coming as the loop is running.

--
Jori Mäntysalo


Re: [sage-support] For loop difference between sage in the cloud and local instalation

2015-12-26 Thread Jori Mäntysalo

On Wed, 23 Dec 2015, Kazimierz Kurz wrote:


On my own instance of sagemath ( ver. 6.8) there is complete different!
The same code produces first list of 36 elements of G[k][0],G[k][1] and them
36 plots.

Is this normal?


Yes, it is. And I don't like that either.

In some previous version of Sage I was able to say

P = Poset({1: [2]})
print "Original:"
P.show()
print "Reversed:"
P.dual().show()

in the notebook and got expected result. It just does not work that way 
anymore.


--
Jori Mäntysalo


[sage-support] Using graphic object as a sub-figure

2015-12-17 Thread Jori Mäntysalo
Is it possible to use a plot of some object as a subfigure in given 
position?


Suppose for example that g is a graph. What if I want to plot g, an arrow, 
and g with some edge deleted? There is graphic_array, but it is not quite 
flexible. I would like to have something like


G = Graphics()
G.add(g.plot(), position=(2,3))
G.add_primitive(Arrow(...))
 . . .

--
Jori Mäntysalo


Re: [sage-support] Relabel vertices

2015-12-07 Thread Jori Mäntysalo

On Mon, 7 Dec 2015, Selva Raja S wrote:


Suppose I want to draw the graph. Coding is

Can i change the relabel vertices?


g = Graph({1:[2,3],2:[3]})
g.relabel(lambda x: chr(ord('a')+x), inplace=False).show()

--
Jori Mäntysalo


Re: [sage-support] How to hide output when opening a sagemath worksheet

2015-11-24 Thread Jori Mäntysalo

On Tue, 17 Nov 2015, Gabriel Cardona wrote:


I am sorry but cannot find that setting... where is the Action menu?


Sorry, on SageNB. I.e. not in cloud version(?) of Sage GUI, I guess.

--
Jori Mäntysalo


Re: [sage-support] Re: Server and certificate chain

2015-11-17 Thread Jori Mäntysalo

On Tue, 17 Nov 2015, kcrisman wrote:


Jori, are you using Jonathan Gutow's branch for proxying?


No.

I rearranged things. We have now a) redirection http://sage.our.unit -> 
https://sage.our.unit and b) documentation online at 
http://sage-doc.our.unit.


This seems to now work. Apache is used as a proxy to locally running 
sagenb.


--
Jori Mäntysalo


Re: [sage-support] How to hide output when opening a sagemath worksheet

2015-11-17 Thread Jori Mäntysalo

On Tue, 17 Nov 2015, Gabriel Cardona wrote:


I evaluate it and hide the output, but when I open the worksheet again the
'2' is not hidden (I want my students to open the worksheet and evaluate the
expression themselves).


Can you just use Action / Delete All Output?

--
Jori Mäntysalo


Re: [sage-support] Re: Server and certificate chain

2015-11-16 Thread Jori Mäntysalo

On Fri, 13 Nov 2015, Jori Mantysalo wrote:


RewriteRule ^(.*)$ http://localhost:1234/$1 [P]


Now I was able to delete this and everything almost work.

I have static documentation available without login at port 80. Server is 
at 443 so that Sage listens port 8000 and Apache configuration have


  ProxyPass http://localhost:8000/
  ProxyPassReverse http://localhost:8000/

However, login sent user to http root, not to https root, and so does new 
worksheet. So I have on non-sssl configuration


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/documentation
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_URI} !^/index.html$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

But basically we need SITE_ROOT as a configuration for the notebook.

 * * *

Btw, see http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass

Context:server config, virtual host, directory

vs.

Note: This directive cannot be used within a  context.

--
Jori Mäntysalo

Re: [sage-support] Re: Server and certificate chain

2015-11-12 Thread Jori Mäntysalo

On Thu, 12 Nov 2015, Gutow, Jonathan H wrote:

I strongly recommend using a frontend like ngix or Apache.  The 
efficiency of the Sagenb server when doing encryption is low.  Let an 
industrial strength web server handle that and the encryption.


Speed is not a bottleneck for me, but anyways, I'll try Apache.

Now, do anyone have ready-to-go configuration for lazy IT admins? I tried 
basically just


RewriteRule ^(.*)$ http://localhost:1234/$1 [P]

(where 1234 is the port that Sage listens), and it has at least the error 
with logout link.


--
Jori Mäntysalo


Re: [sage-support] Re: Server and certificate chain

2015-11-12 Thread Jori Mäntysalo

On Thu, 12 Nov 2015, Karl-Dieter Crisman wrote:

Without proxying on a local machine sagenb just launches.  The only 
difference is that it is now at http://localhost:8080/sage/.


Would the same be true for a non-proxied launch to the internet? (Assuming one 
did such a thing.)


Yes. I have done that. (On port 443 with authbind.)

--
Jori Mäntysalo


Re: [sage-support] Re: Server and certificate chain

2015-11-12 Thread Jori Mäntysalo

On Thu, 12 Nov 2015, Michael Orlitzky wrote:


Can Sagenb send certificate chain instead of just certificate of the
server itself? If yes, how?


You can probably just concatenate the certificate files. Something like,

 $ cat www.example.com.crt intermediate.pem > combined.crt


Tested, but it seems that Sage sends only first certificate.

--
Jori Mäntysalo


[sage-support] Re: Server and certificate chain

2015-11-12 Thread Jori Mäntysalo

On Wed, 11 Nov 2015, Jori Mantysalo wrote:


If not, what do you use as a frontend? Apache?


Apache seems to work, I was able to log in and saw my worksheet and 
plot() worked. However, logout sent me to localhost. So not all links work 
-- maybe there are more that do not work.


Suggestions welcome.

--
Jori Mäntysalo


[sage-support] Server and certificate chain

2015-11-11 Thread Jori Mäntysalo
Can Sagenb send certificate chain instead of just certificate of the 
server itself? If yes, how?


If not, what do you use as a frontend? Apache?

--
Jori Mäntysalo


Re: [sage-support] Same Matrix Construction gives two different results

2015-11-08 Thread Jori Mäntysalo

On Sun, 8 Nov 2015, Nils Bruin wrote:


Ah, that's a very important detail: that indicates that something that the
preprocessor does makes a difference.


Todo to someone: add something like 
http://doc.sagemath.org/html/en/faq/faq-usage.html#what-exactly-does-sage-do-when-i-type-0-6-2 
to FAQ so that in future we could just give a link as an answer.


--
Jori Mäntysalo


Re: [sage-support] Same Matrix Construction gives two different results

2015-11-08 Thread Jori Mäntysalo

On Sun, 8 Nov 2015, Sihuang Hu wrote:


I just used the following commands to construct an matrix:

q = 2
r = 2
s = 2
n = s*(r+1)
d = 3
P = matrix(ZZ, r+2, r+2, lambda u, k: Krawtchouk(r+1, q, k, u))

But sage gives me two different results at different times:


I was not able to reproduce the error. I tried in two system, about 
500,000 tests together. If there is a real heisenbug, it must depend on 
architechture etc. So Linux or Mac, what processor...?


--
Jori Mäntysalo


Re: [sage-support] Installation using VMare Workstation on Windows 7 64-bit

2015-11-08 Thread Jori Mäntysalo

On Sun, 8 Nov 2015, anga wrote:


I did install--multiple times.

First time, everything worked: the VM launched and displayed Sage
interface. Couldn't install VMware tools. So, deleted VM and reinstalled:
VM starts and displays the following:

Network boot from AMD 
CLIENT MAC ADDR: xx xx xx xx xx xx  GUID: 
PXE-E53: No boot filename received


OK. For this I can not help. Sorry. Maybe someone else.

--
Jori Mäntysalo


[sage-support] "Factoring" cartesian product of posets

2015-11-07 Thread Jori Mäntysalo
Can Sage "factor" a poset, i.e. given poset P compute P1 and P2 such that 
P is isomorphic to P1.product(P2)?


There is a module for that on undirected graphs: 
http://doc.sagemath.org/html/en/reference/graphs/sage/graphs/graph_decompositions/graph_products.html 
. However, how to differentiate situations where P1 might be Poset({0:[1, 
2]}) or Poset({0: [1], 1: [2]})? They have isomorphic cover relations 
graph.


--
Jori Mäntysalo


Re: [sage-support] Installation using VMare Workstation on Windows 7 64-bit

2015-11-07 Thread Jori Mäntysalo

On Sat, 7 Nov 2015, anga wrote:

Is there an guide for installing Sagemath 6.9 using VMware workstation 
12 on Windows 7 64-bit?


Did you try? .ova -file should work with VMware products; it is not a 
VirtualBox specific but a common format to export virtual machines. See 
https://en.wikipedia.org/wiki/Open_Virtualization_Format .



2. How to access the command prompt?


See http://wiki.sagemath.org/SageAppliance#Using_the_Sage_shell . You need 
to know what is your "host key" on virtual machine manager.


--
Jori Mäntysalo


Re: [sage-support] \leq converted to <=, can't we use unicode?

2015-10-06 Thread Jori Mäntysalo

On Tue, 6 Oct 2015, Dima Pasechnik wrote:


What we assume the user to have on command line? 



IMHO we can assume a UTF-8 capable terminal.


OK. And as this example showed, even real Linux console has quite good 
support for unicode. (But it was a little surprise to have \cap but not 
\cup.)



(Perhaps not for input, but for output for sure)


Can this be a problem? I guess no, but theoretically one might want 
information about Möbius function without being able to write it.


--
Jori Mäntysalo


Re: [sage-support] Re: Where is possible to view the code of one command? for example: lagrange_polynomial?

2015-10-06 Thread Jori Mäntysalo

On Tue, 6 Oct 2015, Simon King wrote:


Also this does not work with all (longer?) functions in the notebook. Try

g = Graph()
g.plot??

for an example of one kind of a bug.


Works for me (on the command line at least).


Yes, it works on command line and on jyputer notebook. But with older Sage 
notebook it does not. Same happens if you type


@cached_method
def f():
return 1+2

and then try

f??


you see how it was redefined when you computed the matrix. You can not
know that before trying or reading source code for few .py files.



That's not a bug, because you see the source code.


Not a bug from a technical viewpoint. But unexpected for a new user, and 
worth mentioning.


--
Jori Mäntysalo


Re: [sage-support] \leq converted to <=, can't we use unicode?

2015-10-05 Thread Jori Mäntysalo

On Mon, 5 Oct 2015, Dima Pasechnik wrote:

In docstrings we have \leq converted to <=, can't we use unicode, and 
get ≤? More importantly, can we do similar things to \cap (∩) and \cup 
(∪), and perhaps even more of this?


What we assume the user to have on command line?

I just read your email in real Linux console, Ubuntu 14.04 LTS. \cap was 
OK, \cup was shown as a kind of diamond. In this gnome-terminal on X that 
I normally use for email everything is fine.


Personally I don't mind the change, and I am sure that nobody whose 
computer support I am will complain.


 * * *

Btw, I have corrected M\"obius function to Möbius function in docs. I hope 
that it is OK for everyone. (Linux has used US keyboard layout as a 
default from 0.03 I think. Before it was finnish layout. :=) )


--
Jori Mäntysalo

Re: [sage-support] Re: Where is possible to view the code of one command? for example: lagrange_polynomial?

2015-10-05 Thread Jori Mäntysalo

On Mon, 5 Oct 2015, kcrisman wrote:


sage: lagrange_polynomial?? # should be code

Note that the latter doesn't always work (for instance Python built-ins, 
or some (all?) Cythonized functions) or so it seems to me.


Also this does not work with all (longer?) functions in the notebook. Try

g = Graph()
g.plot??

for an example of one kind of a bug.

 * * *

And of course it might be tricky to follow the code. For example

P = Poset()
P.mobius_function??

basically shows that you must look from the code of Hasse diagram. So you 
continue with


P._hasse_diagram.mobius_function??

and see the function? Yes and no. If you say

P = Poset()
P.mobius_function_matrix()
P.mobius_function??

you see how it was redefined when you computed the matrix. You can not 
know that before trying or reading source code for few .py files.


--
Jori Mäntysalo


Re: [sage-support] Building Sage on Ubuntu 14.04 LTS 3

2015-10-04 Thread Jori Mäntysalo

On Sun, 4 Oct 2015, Dmitrij Moreinis wrote:


unfortunatelly the command: make doesnt work.

I have added the install.log.


As it says: "You cannot build Sage as root"

--
Jori Mäntysalo


Re: [sage-support] CGI through sagemath

2015-09-24 Thread Jori Mäntysalo

On Thu, 24 Sep 2015, avi kaur wrote:


How to use sage through CGI?


CGI in year 2015...


I am calling sage inside CGI script but it is not executing. What I
want to do is to get data through CGI and run sage.


Permissions problem? Maybe try with "bash sage" instead of just "sage"?

--
Jori Mäntysalo


Re: [sage-support] Re: correct derivative command returns syntax error

2015-09-21 Thread Jori Mäntysalo

On Mon, 21 Sep 2015, Simon King wrote:


What computer algebra systems (or pocket calculators) would understand
that 5x means 5*x?


Mathematica understand at least "5 x". Or at least understood in version 
4.


--
Jori Mäntysalo


Re: [sage-support] The sage notebook does not show results

2015-09-01 Thread Jori Mäntysalo

On Tue, 1 Sep 2015, Oscar Lazo wrote:


I am setting up a sage notebook server at my research institute to showcase
software I have been writing in atomic physics. So I followed the
instructions in

http://wiki.sagemath.org/SageServer


Point 6 says "I don't thing the following sudo syntax works anymore. I 
had to do this by hand now." Did you do that?



2+2

the notebook waits a little while and then shows no result.



2015-09-01 14:20:49-0500 [HTTPChannel,8,127.0.0.1] Permission denied
(publickey,password).


What happened on point 7 of instructions? If it worked, have you tried it 
with accounts sage1, sage2 and so on?


I would also, for a start, change

server_pool=['sage%d@localhost'%i for i in range(10)]

to just

server_pool=['sage0@localhost']

--
Jori Mäntysalo

Re: [sage-support] Plotting a q analogue function as a challenge?

2015-08-13 Thread Jori Mäntysalo

On Thu, 13 Aug 2015, saad khalid wrote:


I'm currently trying to get support from my professors in order for our
school to move from Mathematica to Sage Math. One of them challenged me 
to - -


What should we give as an exhange? Wasn't there some discussion about 
speed of gamma function on sage-devel, maybe a year ago? Or some graph 
theory question that is easy to do in Sage?


--
Jori Mäntysalo


Re: [sage-support] Re: List of values for vertex_shape

2015-05-29 Thread Jori Mäntysalo

On Fri, 29 May 2015, Nathann Cohen wrote:


I just looked at the code and it seems that "vertex_shape" is an alias for
the "marker" parameter from matplotlib.
Thus, the possible shapes are there:
http://matplotlib.org/api/markers_api.html

We should add this information in the documentation - -


Done this. (#18541)

--
Jori Mäntysalo


[sage-support] List of values for vertex_shape

2015-05-28 Thread Jori Mäntysalo
Plotting a graph has option vertex_shape. Where is the list of possible 
values?


--
Jori Mäntysalo


Re: [sage-support] Re: graphics_array() and titles

2015-05-26 Thread Jori Mäntysalo

On Tue, 26 May 2015, kcrisman wrote:

But as has been pointed out on some relatively recent ticket, 
graphics_array needs an overhaul in any case and thus needs someone with 
the time and expertise to do that.  Should you have that time I would be 
very happy to review! 


Uh, no. I know about nothing about generating graphics in general. Same 
with sage internals about graphics.


--
Jori Mäntysalo


Re: [sage-support] Re: graphics_array() and titles

2015-05-24 Thread Jori Mäntysalo

On Fri, 22 May 2015, kcrisman wrote:

This prints "Another funcion" but not "Some funcion". Is this a bug or 
a feature?



Almost certainly related to http://trac.sagemath.org/ticket/10657 


Thanks. This is where I actually noticed this:
http://trac.sagemath.org/ticket/18471

In general: should graphics_array work something like decorator pattern, 
so that it would have .plot() function and one could even combine arrays 
to bigger ones?


--
Jori Mäntysalo


[sage-support] graphics_array() and titles

2015-05-22 Thread Jori Mäntysalo

s=plot(sin(x), (0, 2*pi), title="Some funcion")
c=plot(cos(x), (0, 2*pi), title="Another funcion")
graphics_array([s, c])

This prints "Another funcion" but not "Some funcion". Is this a bug or a 
feature?


 * * *

How to print something like

   TRIG FUNCTIONS

[fig-1-here] [fig-2-here]
[fig-1-here] [fig-2-here]
[fig-1-here] [fig-2-here]

     sin  cos

?

--
Jori Mäntysalo


Re: [sage-support] find_root for systems

2015-05-07 Thread Jori Mäntysalo

On Thu, 7 May 2015, Dima Pasechnik wrote:


nobody really knows how to solve systems of (non-polynomial) equations in 
general.
There are heuristics implemented in various systems...


What of those are built-in in Sage?

--
Jori Mäntysalo


[sage-support] Simplifying binomials

2015-05-07 Thread Jori Mäntysalo

I was asked where

f(n,k)=(binomial(2*n + 2, n + 1) / 2 - binomial(2*n, n) - sum(binomial(n, k) * 
binomial(n, k-1), k,1,n))
f.full_simplify()

got magic constant sqrt(pi). Right answer is zero.

--
Jori Mäntysalo


Re: [sage-support] find_root for systems

2015-05-06 Thread Jori Mäntysalo

On Tue, 5 May 2015, Paul Royik wrote:


How can this be applied to systems?


What kind of systems? Let us define f(x,y):

f(\sqrt{2}, \sqrt[3}) = 0
f(x,y) = x^2+y^2+1 if (x is not \sqrt{2}) or (y is not \sqrt[3})

Now this clearly has a root, but no numerical method can find it. So we 
must have some assumptions.


--
Jori Mäntysalo


Re: [sage-support] Re: Default charset problem?

2015-04-28 Thread Jori Mäntysalo

On Tue, 28 Apr 2015, Volker Braun wrote:

We might be able to hack around this is the displayhook, but I'd rather 
not. It just is how Python 2.x works. Switching to Python 3 is the 
proper fix for this issue.


OK. It's not that important feature.

(Much more important is handling of len(), looping over a string and so 
on. But they are another story.)


--
Jori Mäntysalo


[sage-support] Default charset problem?

2015-04-28 Thread Jori Mäntysalo

On sagenb worksheet, Sage version 6.6

print "Direct translation of 'Mäntysalo' is 'Pine forest'."

works as expected, but

x="Direct translation of 'Mäntysalo' is 'Pine forest'"; x

outputs

"Direct translation of 'M\xc3\xa4ntysalo' is 'Pine forest'"

Can this be changed?

--
Jori Mäntysalo