Re: [sage-devel] How about moving the AUTHORS section to the last?

2017-04-21 Thread Jori Mantysalo

On Thu, 20 Apr 2017, Kwankyu Lee wrote:


I propose to move the AUTHORS section to the last of the heading:


+1.

--
Jori Mäntysalo

Re: [sage-devel] Sage-server, best practices

2017-04-01 Thread Jori Mantysalo

On Sat, 1 Apr 2017, Volker Braun wrote:


IMHO the docker image is the second-best solution, the best being just
installing Linux natively on your computer. Of course thats assuming that
your goal is scientific computation. On the other hard, if you just want to
get to a notebook with the least number of keystrokes the VM is probably the
best.


What if the goal is to allow scientific computation to the whole 
department with best possible security, while still allowing 
administrator to install optional packages, also packages for GAP inside 
Sage?


I guess it is Docker package running as isolated process, Shibboleth 
instead of LDAP and maybe computation run as separated Docker instances. I 
guess it is possible in thery, but how about practise?


--
Jori Mäntysalo

Re: [sage-devel] Re: Showing poset, which way up?

2015-04-21 Thread Jori Mantysalo

On Mon, 20 Apr 2015, Nathann Cohen wrote:

I made http://trac.sagemath.org/ticket/16865 from this 8 months ago, 
but nobody has said which should be defined correct way.



Given the following output, it would indeed make more sense if 2 were... at the 
top.

sage: Poset([[1,2],[[1,2]]]).top()
2


Good point. :=)


Write the code - -


I tried to see where the error jumps in. But after long series of 'c' in 
trace(P.plot()) I got, at


ipdb s

/home/jm58660/sage/local/lib/python2.7/site-packages/sage/graphs/generic_graph.py(9923)edge_iterator()

   9922 elif self._directed:
- 9923 return self._backend.iterator_out_edges(vertices, labels)
   9924 else:

, the result


/home/jm58660/sage/local/lib/libcsage.so(print_backtrace+0x31)[0x7f3263410859]
/home/jm58660/sage/local/lib/libcsage.so(sigdie+0x1e)[0x7f3263410a13]
/home/jm58660/sage/local/lib/libcsage.so(sage_signal_handler+0x1cb)[0x7f32634102ad]
/lib64/libpthread.so.0[0x36a46100d0]
/home/jm58660/sage/local/lib/libpython2.7.so.1.0(PyObject_GetAttr+0x3a)[0x7f326e4f48ca]
/home/jm58660/sage/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x166d)[0x7f326e55a90d]
 . . .
Attaching gdb to process id 31921.
 . . .
Missing separate debuginfos, use: debuginfo-install 
glibc-2.20-8.fc21.x86_64 keyutils-libs-1.5.9-4.fc21.x86_64 
krb5-libs-1.12.2-15.fc21.x86_64 libcom_err-1.42.12-3.fc21.x86_64 
libselinux-2.3-5.fc21.x86_64 openssl-libs-1.0.1k-6.fc21.x86_64 
pcre-8.35-8.fc21.x86_64 xz-libs-5.1.2-14alpha.fc21.x86_64

 . . .
warning: File /home/jm58660/sage/local/lib64/libstdc++.so.6.0.20-gdb.py 
auto-loading has been declined by your `auto-load safe-path' set to 
$debugdir:$datadir/auto-load.

  File string, line 4
SyntaxError: from __future__ imports must occur at the beginning of the file
Error while executing Python code.

Saved trace to /home/jm58660/.sage/crash_logs/sage_crash_K_eIoF.log

Unhandled SIGSEGV: A segmentation fault occurred in Sage.

and so I don't yet even know where to look at.

--
Jori Mäntysalo


[sage-devel] Showing poset, which way up?

2015-04-19 Thread Jori Mantysalo

Can I just say I'm getting tired of people changing things in visual
representation (e.g. show)

Somewhat related: how should Sage plot

Poset([[1,2],[[1,2]]]).show()

? I made http://trac.sagemath.org/ticket/16865 from this 8 months ago, but 
nobody has said which should be defined correct way. Do we at least have 
same opinion about that this is a bug?


--
Jori Mäntysalo


Re: [sage-devel] __contains__ in Matrix

2015-04-15 Thread Jori Mantysalo

On Wed, 15 Apr 2015, Vincent Delecroix wrote:


I do not like it since a matrix can also be thought as a list of vectors.


True. OK with this.


sage: m = matrix(3, range(9))
sage: list(m)
[(0, 1, 2), (3, 4, 5), (6, 7, 8)]


I didn't know this. m.list() gives list of elements. But (just checked) 
that is documented on .list() so everything is fine.


--
Jori Mäntysalo


[sage-devel] __contains__ in Matrix

2015-04-15 Thread Jori Mantysalo
Would it break something if matrix class would have __contains__() so that 
one could say for example 42 in M instead of 42 in M.list()?


--
Jori Mäntysalo


[sage-devel] Status of IPython

2015-04-15 Thread Jori Mantysalo
1) What is the status of multiuser-ipython now? Will it replace sagenb as 
a GUI for Sage?


2) How much memory it will eat per user?

--
Jori Mäntysalo


[sage-devel] Memory footprint

2015-04-15 Thread Jori Mantysalo
What Sage actually loads to memory at startup? It seems that every 
instance of Sage 6.6.rc3 (from CUI, no GUI at all) eats almost 100 MB.


This means that for 30 students we need 3 GB of memory -- for the two 
hours they are having exercises at a class. That would be no problem with 
some memory ballooning system at virtual servers -- but that we don't 
have. Now it is annoying.


And to make this worse, SageNB seems to left ssh connections (and so, 
processes) open even after the studen has stopped worksheets and logged 
out.


--
Jori Mäntysalo


Re: [sage-devel] Re: Memory footprint

2015-04-15 Thread Jori Mantysalo

On Wed, 15 Apr 2015, Volker Braun wrote:


A 4GB RAM Stick sets you back about EUR 25.


I know, if I have a home-PC on the floor of my room. We have few servers 
with ECC memory, backups run regularly etc. And Sage as a one small 
application to run there.



If you can't afford that, move the Sage instances to the student
computers, presumably they have = 100 MB RAM.


Won't help if they want to share worksheet to teacher (or to some other 
student).



Or use virtual machines on the server, KVM + KSM.


Thanks. Going to check if KSM helps.

--
Jori Mäntysalo


[sage-devel] About __len__

2015-04-14 Thread Jori Mantysalo

Just wondering, so feel free to ignore.

I noticed that MatrixSpace(GF(3), 4, 5).cardinality() raises an exception. 
However, there is __len__:


sage: MatrixSpace(GF(3), 4, 5).__len__()
3486784401
sage: len(MatrixSpace(GF(3), 4, 5))
3486784401

but

sage: MatrixSpace(GF(2003), 4, 5).__len__()
1080485606479352381688319506340455348506693332851960692625585464401L
sage: len(MatrixSpace(GF(2003), 4, 5))
 . . . OverflowError: long int too large to convert to int

I don't get this. Is `len` somehow internally redefined in Sage? Where? 
What is the meaning of len and __len__? Should there be .cardinality() in 
all Sage objects where it has some meaning?


--
Jori Mäntysalo,
Maybe returned to 4-year old and got questioning-age again.


Re: [sage-devel] About __len__

2015-04-14 Thread Jori Mantysalo

On Tue, 14 Apr 2015, Vincent Delecroix wrote:

It would indeed be better to also support a cardinality method for 
`MatrixSpace` (be careful to return a Sage integer there) and to support the 
following


sage: MatrixSpace(GF(3),4,5) in FiniteSets()
True

(this is currently returning False)


I made a ticket of this: http://trac.sagemath.org/ticket/18186 . For the 
last point a marked it as a defect, not as an enhancement.


Is .cardinality() almost one-line function (+docs), or does categories 
make some complications?


--
Jori Mäntysalo

[sage-devel] Two poset tickets: graded vs. ranked

2015-04-14 Thread Jori Mantysalo
There has been some discussion about 'graded' vs. 'ranked' in posets. 
However, these two tickets are still waiting someone knowing about the 
area to clarify:


http://trac.sagemath.org/ticket/17485
http://trac.sagemath.org/ticket/17487

I can modify the docs and/or code if needed, but don't know for sure what 
to do.


--
Jori Mäntysalo


Re: [sage-devel] Re: Deprecate or just remove

2015-04-14 Thread Jori Mantysalo

On Tue, 14 Apr 2015, Niles Johnson wrote:


another 2c: There is also the option of deprecating, but for less than the
somewhat arbitrary 1 year.


I would say no to this. If there is some reason to add a deprecating at 
all, then it should be there for one year at least.


--
Jori Mäntysalo


Re: [sage-devel] Re: Generating matrix of GF with given determinant

2015-04-13 Thread Jori Mantysalo

On Sun, 12 Apr 2015, Rob Beezer wrote:

The point was to quickly make examples that would be useful for students 
to study from. - - So random was never meant to mean uniform.  Maybe 
the documentation should say that.


I think so. I made #18177 from this and put you to CC.

--
Jori Mäntysalo


Re: [sage-devel] Re: Generating matrix of GF with given determinant

2015-04-13 Thread Jori Mantysalo

On Mon, 13 Apr 2015, Vincent Delecroix wrote:

This is indeed important. In Sage there is a lot of ambiguity with the word 
random...


So, if someone has too much free time, then the someone can collect all 
random functions to some list?


(Not all functions even use random_seed, I guess. At least I have found 
and corrected a bug on some random function of posets.)


--
Jori Mäntysalo


[sage-devel] Random unimodular matrices

2015-04-09 Thread Jori Mantysalo
Matrix.random(ZZ, ..., algorithm='unimodular') works just as the 
documentation says: generates a matrix with determinant +1. On the other 
hand, unimodularity on ZZ is normally defined as having determinant +1 or 
-1.


Should we 1) leave this as it is, 2) correct the code or 3) add some kind 
of warning to documentation?


(Also I guess there is faster ways to generate random unimodular matrix 
than current implementation. For example by making upper and lower 
triangular matrices with +/- 1 on diagonal and multiplying them; but of 
course it is not enought because then every matrix will have +1 or -1 as 
an element, so they are not that random.)


--
Jori Mäntysalo


Re: [sage-devel] Random unimodular matrices

2015-04-09 Thread Jori Mantysalo

On Thu, 9 Apr 2015, Vincent Delecroix wrote:

Sorry to insist. I really do not like the keyword algorithm here. The fact 
that the output is a unimodular matrix has nothing to do with the algorithm 
used to generate it!


True.

Some properties of matrices do not mix: skew symmetric vs. symmetrix. Some 
combinations are quite silly: upper triangular + lower triangular = 
diagonal. And some can be mixed: unimodular + [upper|lower] triangular is 
meaningful.


So what should be parameters for this function?

On the ambiguity for unimodular, I agree and it fits with the wikipedia 
definition: square integer matrix with det +1 or -1.


Wikipedia also defines unimodular matrix to be just invertible when base 
ring is a field. For general ring it should be matrix whose determinant is 
(some) unit of the ring.


Btw, there seems to be algorithm for generating random matrix with given 
determinant over finite field: 
http://www.eecs.berkeley.edu/Pubs/TechRpts/1991/6147.html


(Haven't read the paper yet.)

--
Jori Mäntysalo


[sage-devel] Random skew-symmetric matrix

2015-04-08 Thread Jori Mantysalo
I was asked to test a hypothesis about skew-symmetric matrices, so I'll 
generate some at random.


Could this kind of function be useful to others? If so, would best way for 
it be to add algorithm='skew-symmetric' to 
sage.matrix.constructor.random_matrix()?


--
Jori Mäntysalo


Re: [sage-devel] Random skew-symmetric matrix

2015-04-08 Thread Jori Mantysalo

On Wed, 8 Apr 2015, Vincent Delecroix wrote:


It would definitely be useful (at least to me). But the word
algorithm looks strange to me. What if we do want a unimodular
skew-symmetric matrix? I would rather go for keywords

sage: random_matrix(ZZ, 4, unimodular=True, skew_symmetric=True)


I made a ticket for this: http://trac.sagemath.org/ticket/18143

Maybe there could be a keyword to get symmetric, skew symmetric, 
diagonal, upper triangular or lower triangular matrix? Say, form='...', 
and then it would raise exception if tried with non-square matrix.


--
Jori Mäntysalo


[sage-devel] Left-behind ssh connections on Sage server

2015-04-08 Thread Jori Mantysalo

We have Sage version 6.4 running. It is run by

su -c 'nohup authbind --deep .../sage-6.4/sage -c notebook(secure=true, 
interface=\\, port=443, timeout=..., 
server_pool=[\sagecalc@localhost\])  ... ' - sagegui


i.e. id sagegui runs notebook interface and sagecalc runs computations. 
For example just now there is 9 notebook as running state, but ps shows 31 
times ssh -t sagecalc@localhost


It seems that 31-9=22 ssh connections are just left behind when users have 
logged out, closed worksheet or idled until timeout. Why is that? How to 
correct it?


(I guess this suites to -devel list. Move to -support if you think 
otherwise.)


--
Jori Mäntysalo


Re: [sage-devel] Random skew-symmetric matrix

2015-04-08 Thread Jori Mantysalo

About random matrices:

Random integer matrices.  With no arguments, the majority of the entries
are -1 and 1, never zero, and rarely large. ::

sage: random_matrix(ZZ, 5, 5)
[ -8   2   0   0   1]
[ -1   2   1 -95  -1]
[ -2 -12   0   0   1]
[ -1   1  -1  -2  -1]
[  4  -4  -6   5   0]

Never zero, but even the given example has zeros. A bug, or maybe I 
don't quite understand this.


--
Jori Mäntysalo


[sage-devel] Re: [sage-support] Re: Whats wrong with my function syntax?

2015-04-02 Thread Jori Mantysalo

On Thu, 2 Apr 2015, William Stein wrote:


We could translate en dash into hypen on the commandline to avoid that
surprise...



Another idea would be to do something only if an exception is actually
raised.   I.e., if a user interactively runs some block of input (in a
notebook, command line, whatever), and it raises an exception, we
could have a library of tests we run on that input which could then be
used to provide further help to the user.


That would be great. First one could be just checking parenthesis, i.e. 
saying something meaninful to sin(log(x).


Different kinds of minus sign can be copypasted from PDF or even from 
Word. Maybe also multiplication signs(?).


--
Jori Mäntysalo


[sage-devel] Re: Why inequalities are not converted to boolean?

2015-04-01 Thread Jori Mantysalo

[ From sage-support to sage-devel ]

On Wed, 1 Apr 2015, Nils Bruin wrote:


That was new to me. Why Sage can not raise exception?

Yes, it could and perhaps it does sometimes. This would quickly extend 
to == and != as well, though, and most code expects A==B to return 
without an exception, so there raising an exception is problematic.


First, a question: What python exactly does when saying

if f(x):

or

if xy:

? Does it bool(f(x)) and bool(xy)?

Mathematically I think that A equals B is maybe mostly used concept, but 
the meaning of it is not clear. A is isomorphic to B? Something else? 
Hence A==B is hard to define so that it will always make sense.


But AB is usually not defined at all.

--
Jori Mäntysalo


Re: [sage-devel] Re: [sage-combinat-devel] Re: Order of Partitions()

2015-03-18 Thread Jori Mantysalo

On Wed, 18 Mar 2015, Jeroen Demeyer wrote:


So would it make sense to have an optional parameter sorted=None,
which one could set to 'lex' or 'revlex' to get them in a desired order.
The documentation could warn about the issues you just raised.


If there is a general agreement on this, I could add such an option in 
#17920.


What should be the default? Somehow I think that by default one should 
have nice, easy, simple etc. results, and by optional parameter 
fast, optimized, not stable between Sage releases etc.


But I haven't looked at this specific case.

--
Jori Mäntysalo


Re: [sage-devel] Sage code for educational purposes only?

2015-02-26 Thread Jori Mantysalo

On Thu, 26 Feb 2015, Pedro Cruz wrote:


+1 for the  package educational-algorithms but called
educational-packages or educational-library.


Yes, '-packages' or '-library' is better name.

Hmmm... actually there could be, in principle, three kind of algorithms:

1) Fast ones, that we normally use.

2) Educational, algorithms that made it easy to see some computational 
proof etc.


3) Most basic and directly from formal definition made algorithms to 
cross-check fast ones.


Usually type 2 and 3 are same thing. Always?


--
Jori Mäntysalo


Re: [sage-devel] Sage code for educational purposes only?

2015-02-25 Thread Jori Mantysalo

On Wed, 25 Feb 2015, Jeroen Demeyer wrote:

Should there be code in Sage which is extremely slow and for educational 
purposes only?


As an additional package educational-algorithms?

--
Jori Mäntysalo


Re: [sage-devel] Re: Sage 6.5, pyzmq, Fedora GCC

2015-02-24 Thread Jori Mantysalo
This time I got Can't locate ExtUtils/MakeMaker.pm. Full log is 
attached. And this is from serial build on fresh Fedora 21 server 
installation.


I will continue after installing perl pacakges.

--
Jori Mäntysalo
Found local metadata for git-2.1.2
Found local sources at /home/user/sage-6.5/upstream/git-2.1.2.tar.gz
Checksum: 25bd471879e0cbdc4d6cc6eedf307491 vs 25bd471879e0cbdc4d6cc6eedf307491
git-2.1.2

Setting up build directory for git-2.1.2
Finished set up

Host system:
Linux localhost.localdomain 3.17.4-301.fc21.x86_64 #1 SMP Thu Nov 27 19:09:10 
UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.9.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla 
--enable-bootstrap --enable-shared --enable-threads=posix 
--enable-checking=release --enable-multilib --with-system-zlib 
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object 
--enable-linker-build-id --with-linker-hash-style=gnu 
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --enable-plugin 
--enable-initfini-array --disable-libgcj 
--with-isl=/builddir/build/BUILD/gcc-4.9.2-20150212/obj-x86_64-redhat-linux/isl-install
 
--with-cloog=/builddir/build/BUILD/gcc-4.9.2-20150212/obj-x86_64-redhat-linux/cloog-install
 --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.9.2 20150212 (Red Hat 4.9.2-6) (GCC) 

Using install program /bin/install
make[3]: Entering directory 
'/home/user/sage-6.5/local/var/tmp/sage/build/git-2.1.2/src'
GIT_VERSION = 2.1.2
make[3]: 'GIT-VERSION-FILE' is up to date.
make[3]: Leaving directory 
'/home/user/sage-6.5/local/var/tmp/sage/build/git-2.1.2/src'
Configuring git...
configure: Setting SANE_TOOL_PATH to ''
configure: Setting lib to 'lib' (the default)
configure: Will try -pthread then -lpthread to enable POSIX Threads.
configure: CHECKS for site configuration
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
configure: Setting PYTHON_PATH to /home/user/sage-6.5/local/bin/python
configure: CHECKS for programs
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for inline... inline
checking if linker supports -R... no
checking if linker supports -Wl,-rpath,... yes
checking for gtar... gtar
checking for gnudiff... no
checking for gdiff... no
checking for diff... diff
checking for asciidoc... no
configure: CHECKS for libraries
checking for SHA1_Init in -lcrypto... no
checking for SHA1_Init in -lssl... no
checking for curl_global_init in -lcurl... no
checking for XML_ParserCreate in -lexpat... no
checking for iconv in -lc... yes
checking for deflateBound in -lz... yes
checking for socket in -lc... yes
checking for inet_ntop... yes
checking for inet_pton... yes
checking for hstrerror... yes
checking for basename in -lc... yes
checking for gettext in -lc... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
configure: CHECKS for header files
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking for inttypes.h... (cached) yes
checking for old iconv()... no
configure: CHECKS for typedefs, structures, and compiler characteristics
checking for socklen_t... yes
checking for struct dirent.d_ino... yes
checking for struct dirent.d_type... yes
checking for struct passwd.pw_gecos... yes
checking for struct sockaddr_storage... yes

Re: [sage-devel] Re: Sage 6.5, pyzmq, Fedora GCC

2015-02-24 Thread Jori Mantysalo

On Tue, 24 Feb 2015, Volker Braun wrote:


yum install perl-ExtUtils-MakeMaker


Yes, now it works. So, for others to follow, here is whole command to run 
after installing Fedora 21 server before compiling Sage:


yum install binutils gcc gcc-c++ gcc-gfortran m4 perl perl-ExtUtils-MakeMaker

(Or actually only

yum install binutils gcc-c++ gcc-gfortran m4 perl-ExtUtils-MakeMaker

is needed because of course perl-ExtUtils-MakeMaker depens on perl and 
gcc-c++ on gcc.)


--
Jori Mäntysalo


Re: [sage-devel] Re: Sage 6.5, pyzmq, Fedora GCC

2015-02-23 Thread Jori Mantysalo

On Mon, 23 Feb 2015, Volker Braun wrote:


post the log 


Duh. There was no c++ compiler installed.

It seems that configure continues after not founding g++; contrary to 
this, if ar is not found, configure stops (and last error message is 
meaningful).


I am now compiling without parallel compiling and on fresh installation of 
Fedora 21 server. If I don't write write more to this thread, everything 
went OK.


 * * *

As a side note: to get Sage compiling, I must say

yum install binutils gcc gcc-c++ gcc-gfortran m4 perl

I think that there was some discussion about m4 several months ago.

--
Jori Mäntysalo
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by Sage configure 6.5.rc2, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --disable-compiler-checks

## - ##
## Platform. ##
## - ##

hostname = localhost.localdomain
uname -m = x86_64
uname -r = 3.17.4-301.fc21.x86_64
uname -s = Linux
uname -v = #1 SMP Thu Nov 27 19:09:10 UTC 2014

/usr/bin/uname -p = x86_64
/bin/uname -X = unknown

/bin/arch  = x86_64
/usr/bin/arch -k   = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo  = unknown
/bin/machine   = unknown
/usr/bin/oslevel   = unknown
/bin/universe  = unknown

PATH: /home/user/sage-6.5/src/bin
PATH: /home/user/sage-6.5/local/bin
PATH: /usr/local/bin
PATH: /bin
PATH: /usr/bin
PATH: /usr/local/sbin
PATH: /usr/sbin
PATH: /home/user/.local/bin
PATH: /home/user/bin


## --- ##
## Core tests. ##
## --- ##

configure:2354: checking for a BSD-compatible install
configure:2422: result: /bin/install -c
configure:2433: checking whether build environment is sane
configure:2488: result: yes
configure:2639: checking for a thread-safe mkdir -p
configure:2678: result: /bin/mkdir -p
configure:2685: checking for gawk
configure:2701: found /bin/gawk
configure:2712: result: gawk
configure:2723: checking whether make sets $(MAKE)
configure:2745: result: yes
configure:2774: checking whether make supports nested variables
configure:2791: result: yes
configure:2919: checking whether to enable maintainer-specific portions of 
Makefiles
configure:2928: result: yes
configure:2945: checking for root user
configure:2954: result: no
configure:2994: checking build system type
configure:3008: result: x86_64-unknown-linux-gnu
configure:3028: checking host system type
configure:3041: result: x86_64-unknown-linux-gnu
configure:3172: checking for ar
configure:3188: found /bin/ar
configure:3200: result: yes
configure:3221: checking for m4
configure:3237: found /bin/m4
configure:3249: result: yes
configure:3270: checking for ranlib
configure:3286: found /bin/ranlib
configure:3298: result: yes
configure:3319: checking for strip
configure:3335: found /bin/strip
configure:3347: result: yes
configure:3367: checking for GNU or BSD tar
configure:3415: result: /bin/tar
configure:3482: checking for latex
configure:3510: result: no
configure:3520: WARNING: You do not have 'latex', which is recommended, but not
configure:3522: WARNING: required. Latex is only really used for building pdf
configure:3524: WARNING: documents and for %latex mode in the Sage notebook.
configure:3534: checking for perl
configure:3552: found /bin/perl
configure:3564: result: /bin/perl
configure:3572: checking for Perl version 5.8.0 or later
configure:3583: result: yes
configure:3599: checking for dpkg
configure:3627: result: no
configure:3637: checking for dpkg-architecture
configure:3665: result: no
configure:3744: checking for gcc
configure:3771: result: gcc
configure:4000: checking for C compiler version
configure:4009: gcc --version 5
gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4020: $? = 0
configure:4009: gcc -v 5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.9.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla 
--enable-bootstrap --enable-shared --enable-threads=posix 
--enable-checking=release --enable-multilib --with-system-zlib 
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object 
--enable-linker-build-id --with-linker-hash-style=gnu 
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --enable-plugin 
--enable-initfini-array --disable-libgcj 
--with-isl=/builddir/build/BUILD/gcc-4.9.2-20150212/obj-x86_64-redhat-linux/isl-install
 
--with-cloog=/builddir/build/BUILD/gcc-4.9.2-20150212/obj-x86_64-redhat-linux/cloog-install
 --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 
--build=x86_64-redhat-linux

Re: [sage-devel] Re: Sage 6.5, pyzmq, Fedora GCC

2015-02-23 Thread Jori Mantysalo

On Fri, 20 Feb 2015, Volker Braun wrote:


You need to build the zeromq library before building the python binding for
it:

sage -f zeromq  sage -f pyzmq

Definitely works on Fedora 21


I don't quite understand. I was building whole Sage, not just one package.

Did you test on Fedora 21 server on Fedora 21 normal version? At server 
version, and after installing m4, binutils, perl, gcc and gfortran I got 
error about cpp sanity check failing. But maybe I should first test with 
workstation version.


--
Jori Mäntysalo


Re: [sage-devel] Re: open blockers

2015-02-13 Thread Jori Mantysalo

On Fri, 13 Feb 2015, Jakob Kroeker wrote:

Factory is notoriusly buggy; it improved over time, but it is still 
buggy. There are more than 20 bugs in factory which are fixed in 4.0.1 
but not in 3.1.7


Is there bugs where user gets wrong results? I have seen only polynomials 
giving error messages or halting randomly, but never wrong results. I ran 
quite many test rounds, but only for multivariate QQ-polynomials.


--
Jori Mäntysalo


Re: [sage-devel] Re: Place for internal documentation of a class

2015-01-04 Thread Jori Mantysalo

On Sat, 27 Dec 2014, Travis Scrimshaw wrote:


If you're developing, you're...not...looking at the code? That's how I'm
interpreting your comments.


Is there internal documentation in Sage? If so, where it is?

I mean that if a developer wants to know how some class is made (and maybe 
WHY, if there are nontrivial choises for data structure), should he or she 
always found it with class.__init__?? Or by looking at start of source 
code file, or from the end of file?


--
Jori Mäntysalo


[sage-devel] Place for internal documentation of a class

2014-12-27 Thread Jori Mantysalo

See http://trac.sagemath.org/ticket/17477

I made a little documentation for internals of the poset class. And 
then noticed that __init__ already contains it...


So where should be documentation for things like be? Visible at html page 
or not, visible to user by something like P.__init__? or only at source 
code?


--
Jori Mäntysalo


Re: [sage-devel] Re: Place for internal documentation of a class

2014-12-27 Thread Jori Mantysalo
There is still one possibility: Having a file for *only* internal 
documentation or technical details. Then 
http://www.sagemath.org/doc/reference/combinat/posets.html would contain 
something like Implementation details as a list item.


Also some user might benefit from technical details. Some time ago there 
was no is_connected() for posets. However, knowing that poset really is 
a digraph the user might easily use a is_connected() from graphs. Maybe?


--
Jori Mäntysalo


Re: [sage-devel] The dimension of a Poset: do you know how to compute that ?

2014-12-22 Thread Jori Mantysalo

On Mon, 22 Dec 2014, Nathann Cohen wrote:


I wondered how one could compute the dimension of a poset, i.e. a smallest set 
of
linear extension whose interection is the poset.

It is apparently known for being NP-Hard, but that never stopped us in the past.
Plus I am curious to learn how this could be done. We need some code for that !

Tell me if you have any idea, please !


No ideas.

Should we made *something* for questions like this? As an another example, 
there is no known easy way to compute Frattini sublattice, i.e. 
intersection of all proper sublattices of a given lattice.


Should we just make a function with note This is direct computation with 
no optimization at all.? Being able to compute some examples it might be 
easier to try other algorithms, find some corner cases etc.


--
Jori Mäntysalo


Re: [sage-devel] Mem vs. CPU ; and optimization idea for LatticePoset

2014-12-12 Thread Jori Mantysalo

More general stuff at the end of mail.

On Thu, 11 Dec 2014, Nathann Cohen wrote:


More difficult is to optimize product() or ordinal_sum() etc.

And impossible, I think, is to optimize mobius_function_matrix, because one
can not know if it has already been calculated or not. Or maybe with
test with definition of mobius_function?



I don't know Is it very costly to compute ? The Moebius function
should be quick, shouldn't it ? O_o


It is basically just self.lequal_matrix().inverse().change_ring(ZZ).

lequal_matrix() returns dense integer matrix, and it's .inverse() is of 
course of type dense rational matrix but actually integers only. And 
lequal_matrix() is upper triangular matrix; we have no support for them as 
a basic Matrix type; scipy etc. has support. And to be exact, diagonal 
elements are ones. And more, it is of course boolean matrix. So there are 
much to optimize for, if someone is interested.


 * * *

More general question: should we precalculate things like this? There is 
some kind of memory-cpu tradeoff. Should lattices save meet and join 
matrices? Or should there be some optional parameter, like


P=Q.product(R, compute=True)

what would compute Möbius function matrix, rank function etc. for all Q, R 
and P?


--
Jori Mäntysalo

Re: [sage-devel] Optimizing posets and lattices

2014-12-12 Thread Jori Mantysalo

On Sat, 13 Dec 2014, Nathann Cohen wrote:


It is basically just self.lequal_matrix().inverse().change_ring(ZZ).


Oh. No Poset-specific algorithm. I see. Then we should earn a lot by 
doing so.



But really, in the Poset class we are very very very far from having
implemented correctly all that should be.

Do you know the next operation that we should improve ?


Just now I am not running any specific calculation with posets.

Möbius function matrix depends on other parts. We can do a boolean matrix 
--- take GF(2) as base ring --- but is it stored as bits packed to bytes 
really?


Should we look at posets at all, or to have support for machine integer 
matrix? It must be quite a big poset to have möbius function value bigger 
than 2^31.


On the other hand, is this kind of matrix used in some other part of Sage? 
And it must be converted to normal python integers when returning values 
for the user.


 * * *

Just guessing, but maybe is_isomorphic() and related functions could 
benefit from nauty when it is installed. Is it automatically used on 
(di)graphs?


--
Jori Mäntysalo

[sage-devel] Optimization idea for LatticePoset

2014-12-11 Thread Jori Mantysalo
Just throwing an idea for someone, not going to make this myself in near 
future:


Some poset functions return a lattice if argument[s] are lattices, for 
example dual() and product(). Now, it makes no sense to recompute meet and 
join matrices from the resulting poset. If LatticePoset would define those 
functions, it could compute matrices easily.


--
Jori Mäntysalo


Re: [sage-devel] Re: Optimization idea for LatticePoset

2014-12-11 Thread Jori Mantysalo

On Thu, 11 Dec 2014, Nathann Cohen wrote:


Well, you can cheat already:

1) Create the poset P
2) Compute the meet M/join matrix J
3)  P._meet = M; P._join = J
4) LatticePoset(P) should not recompute them.


True! That would be easy one.

More difficult is to optimize product() or ordinal_sum() etc.

And impossible, I think, is to optimize mobius_function_matrix, because 
one can not know if it has already been calculated or not. Or maybe with

test with definition of mobius_function?

--
Jori Mäntysalo


Re: [sage-devel] Re: Default behaviour of Graph(list_of_edges) wrt multiedges/loops

2014-12-10 Thread Jori Mantysalo

On Thu, 11 Dec 2014, Nathann Cohen wrote:


Well I would not want to make Graph() invalid by requiring every
call to specific explicitly Graph(multiedges=False,loops=False), so I
attempted to make it only a bit more mandatory by leading users of
Graph(list_of_edges_with_repetitions) to add the flag multiedges=True.


Sounds good. If I have a code like

L=function_that_should_return_edges_without_repetitions()
G=Graph(L)

I would like to see if L actually contained multiedges because of a bug in 
previous function.


--
Jori Mäntysalo


Re: [sage-devel] Re: Default behaviour of Graph(list_of_edges) wrt multiedges/loops

2014-12-10 Thread Jori Mantysalo

On Thu, 11 Dec 2014, Nathann Cohen wrote:


Sounds good. If I have a code like

L=function_that_should_return_edges_without_repetitions()
G=Graph(L)

I would like to see if L actually contained multiedges because of a bug in
previous function.


Do you mean that you would like this code to raise an exception ?


No. Just to give a warning.

--
Jori Mäntysalo


Re: [sage-devel] Re: Default behaviour of Graph(list_of_edges) wrt multiedges/loops

2014-12-10 Thread Jori Mantysalo

On Thu, 11 Dec 2014, Nathann Cohen wrote:


Do you mean that you would like this code to raise an exception ?


No. Just to give a warning.


Well, with my branch you would have this warning.

But only for one year, until the default behaviour becomes simple graph.


OK. Still better solution than current.

--
Jori Mäntysalo


Re: [sage-devel] Re: Graph.show() and non-injective relabeling

2014-12-09 Thread Jori Mantysalo

On Tue, 9 Dec 2014, Liang Ze Wong wrote:


Here's a hackish solution I got by digging into the graph_plot
sourcecode: 
http://git.sagemath.org/sage.git/tree/src/sage/graphs/graph_plot.pyThe relevant 
lines are 424 - 426.


+1 for remembering this. I hope that someone who knows graphcis can check 
if this works correctly.


It seems like it should also be possible to label vertices with non-text 
as well (e.g. other graphics components).


That would be nice. A simple example could be having LaTeX-parsed strings 
as labels.


--
Jori Mäntysalo


Re: [sage-devel] About SSLv3 security hole

2014-12-09 Thread Jori Mantysalo

On Fri, 5 Dec 2014, Jan Groenewald wrote:


Please test the fix and report back here:

  sagenb-0.11.1-py2.7.egg/sagenb/notebook/run_notebook.py:
  ssl_context = SSL.Context(SSL.SSLv23_METHOD)

  to

  ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)


This does not make any difference. The command

curl -v3 -X HEAD https://my.server.here

opens connection.

--
Jori Mäntysalo


Re: [sage-devel] User Survey

2014-12-08 Thread Jori Mantysalo

On Mon, 8 Dec 2014, Vincent Delecroix wrote:


Hi Jori,

What do you mean?
- if you mean that this would modify the startup of sage, then I do
not think it is a good idea


Why not? Some programs already do that in a form or another. See Firefox 
for example, or a user counter for alpine.


I guess that a user that has already answered is not so likely to answer 
again. Hence I suggest asking only from 1% of users.


--
Jori Mäntysalo


Re: [sage-devel] User Survey

2014-12-08 Thread Jori Mantysalo

On Mon, 8 Dec 2014, Vincent Knight wrote:

I have Sage running a bunch of numerical experiments on a cluster. If 
this change of start up would stop some of those running (as I wouldn't 
input anything) I also don't think it's a good idea.


Python already knows if it is used interactively or not:

[jm58660@localhost ~]$ echo print 1+2 | python
3
[jm58660@localhost ~]$ python
Python 2.7.5 (default, Nov  3 2014, 14:26:24)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-7)] on linux2
Type help, copyright, credits or license for more information.

1+2

3




No version information in first case.

--
Jori Mäntysalo


Re: [sage-devel] User Survey

2014-12-08 Thread Jori Mantysalo

On Mon, 8 Dec 2014, Vincent Delecroix wrote:


Saying that some others do that is not an argument (should I recall
the code of conduct ;-). More seriously why if sage is used for a web
service? or just run in background for some reason? You should not
expect that a software is run by someone even if most of the time this
is true.



If you add

if randint(0,99) == 0:
   annoying_pop_up()

in the startup, then it will affect 1% of the starting of sage. I
guess that I launch sage hundred times a day.


I mean that 1% of users would _even_ see the question. Sorry for not 
making this clear. I.e.


if randint(0,99) == 0:
if not file_exists('.no-user-survey'):
annoying_pop_up()
make_file('.no-user-survey')

Is it really impossible to see if Sage is used interactively or not?

--
Jori Mäntysalo


Re: [sage-devel] User Survey

2014-12-07 Thread Jori Mantysalo

On Fri, 5 Dec 2014, maldun wrote:

But till now I see only discussions among the devlopers. But I think we 
should also ask the users.


Yep. So Sage should on first start query something. I guess that would be 
easy to implement. But we should know what to do, and first try it with 
small population. An idea: get a random interger from 0 to 99. If it is 0, 
then ask


 = = =

Hello! You have been selected as one-question user survey.

For what do you use Sage:

[ ] Research on pure mathematics.
[ ] Research on applied mathematics.
[ ] Studying math in a course.
[ ] Studying math in myself without teacher.
[ ] Other: ___

[Send answer]

[Postpone and answer later]

[No, I won't answer this]

 = = =

--
Jori Mäntysalo


Re: [sage-devel] Re: What are we unable to do right now ?

2014-12-05 Thread Jori Mantysalo

Factorization of multivariate polynomials on ZZ is not possible.

Actually it is, but you have to convert them to QQ first. And for beginner 
this kind of things are obstacles.


 * * *

I think that also error reporting is not optimal for most users, and 
horror for beginner. It should be something like Error: Unclosed '['. Did 
you forget ']'? Or why do I get SyntaxError from 1 + 2? I just copied 
it from a document, where happens to be non-breaking space (U+00A0).


How make this happen, that I don't know.

 * * *

Having documentation arranged by technical implementation is also bad. 
Having TESTS-section shown for normal user is bad. Having is_lattice() on 
different page that is_meet_semilattice() is bad.


 * * *

The fact that I like Sage does not mean that I don't also hate it.

--
Jori Mäntysalo


Re: [sage-devel] Re: What are we unable to do right now ?

2014-12-05 Thread Jori Mantysalo

On Fri, 5 Dec 2014, Fredrik Johansson wrote:


Another weakness of the Sage reference manual is that the doctest examples
only show text output -- the Ma's examples often show graphical output,
which can be a great help.


Having this would be very, very, very nice thing to have!

For many poset functions it would make written explanation almost 
unneeded.


--
Jori Mäntysalo


[sage-devel] About SSLv3 security hole

2014-12-04 Thread Jori Mantysalo
Anyone knows how for fix SSLv3 hole on Sage? See 
http://trac.sagemath.org/ticket/17164 .


--
Jori Mäntysalo


Re: [sage-devel] About SSLv3 security hole

2014-12-04 Thread Jori Mantysalo

On Thu, 4 Dec 2014, Jan Groenewald wrote:


Depend on the proper version high enough of openssl and it is fixed for you.
(assuming sage server side)
On client side your browser, say, firefox34, latest chrome, it is fixed.

What situation is this for? A server for Tampere university? What 
version of openssl runs on which OS?


We use Sage's internal http[s] server, version of Sage is 6.4. Is it 
possbile to fix by upgrading some Sage internal package?


I know that most browsers are already fixed. Anyways, FUNET (Finnish 
University NETwork) security team complains about this.



PS. I stayed in Tampere for one night in late July.


Oh. Hope you got some good black saucage.

--
Jori Mäntysalo


[sage-devel] Re: About Graph.to_partition and Poset.to_graph

2014-12-02 Thread Jori Mantysalo

On Tue, 2 Dec 2014, Nathann Cohen wrote:


Poset.to_graph)
  There are three graphs that I know which can be associated to a
Poset. Its comparability graph [1], its incomparability graph, and the
undirected version of its Hasse Diagram [2]. When I see
Poset.to_graph I cannot guess which one it may be. Turns out that
P.to_graph is actually Graph(P.hasse_diagram()) or
P.hasse_diagram().to_undirected() which is rather explicit.



I would not see the point of a Poset.hasse_diagram_undirected() or
Poset.undirected_hasse_diagram() when it can already be obtained as
Graph(Poset.hasse_diagram()).


I would have guessed that P.to_graph() returns a digraph.

Could there be just Graph(Poset) and maybe even DiGraph(Poset)?

What is actually a Hasse diagram? A graph with vertices labeled as 
integers from 0 to n-1, some positioning information used for plot(), what 
else?


--
Jori Mäntysalo


Re: [sage-devel] Re: Slow Poset creation and UniqueRepresentation

2014-12-02 Thread Jori Mantysalo

On Mon, 1 Dec 2014, Nils Bruin wrote:

The easy solution for Nathann and Jori for now is just to write their 
high-performance code in terms of primitives: a tuple consisting of the 
base set and some suitable description of the PO


I can use plain Hasse diagram.

A simple example of timings: If I create posets with Posets(7) it takes 
about half a minute. If I use #14110 I can create posets of size 8 with 
about same amount of time --- this is where UniqueRepresentation comes to 
bottleneck. And if I use #14110 and create Hasse diagrams instead of 
posets it takes about half a minute to generate posets of size 9 --- now 
bottleneck is on using posets, not creating them.


--
Jori Mäntysalo


Re: [sage-devel] Re: About Graph.to_partition and Poset.to_graph

2014-12-02 Thread Jori Mantysalo

On Tue, 2 Dec 2014, Nathann Cohen wrote:


Could there be just Graph(Poset) and maybe even DiGraph(Poset)?


Same problem, we would not know which graph or which digraph it 
represents. With P.hasse_diagram() or P.comparability_graph() we know.


True. Then I think we should just remove .to_graph(). (Good name could be 
coverings_digraph(), but we already has hasse_diagram().)


--
Jori Mäntysalo


Re: [sage-devel] Oneliners

2014-12-02 Thread Jori Mantysalo

On Wed, 3 Dec 2014, Vincent Delecroix wrote:

By one line function I meant one line function that anybody can 
reproduce after one hour of Python.


To give two specific examples: on posets there are is_connected() and 
minimal_elements(). First is just a direct wrapper to graph function with 
same name. Second wraps sources() and gives meaningful name for poset.


So should we get rid of at least first one? I think no, but how about 
others?


--
Jori Mäntysalo


Re: [sage-devel] Re: Maple versus Mathematica

2014-11-30 Thread Jori Mantysalo

On Mon, 1 Dec 2014, Nathann Cohen wrote:


How would you attract teachers here ? How would you convince them that
Sage is THE tool for teaching ? (no mention of research)


1) Whole error reporting should be changed. 1+2+ and (1+(2+3) should 
give meaningful (and different) error message like Did you forget closing 
parenthesis?, not SyntaxError.


2) Graphical features should have still more visibility.

--
Jori Mäntysalo


[sage-devel] Generating small posets of given size (ticket #14110)

2014-11-24 Thread Jori Mantysalo
Anyone interested in http://trac.sagemath.org/ticket/14110 ? Before 
continuing it would nice to know if the code compiles on Macintosh(es) at 
all.


Also there is a question about how this should be used.

--
Jori Mäntysalo


[sage-devel] Relabeling posets vs. lattices

2014-11-18 Thread Jori Mantysalo

This says that after relabeling a lattice we have a poset:

L=LatticePoset({0:[1]})
type(L.relabel(lambda n: n+1))

Should this be corrected at posets.py, or should lattices.py contain 
wrapper functions? As a code perspective it seems logical to a class 
derived from poset to define it's own function. On the user perspective 
relabeling of a lattice is just a relabeling of a poset, it is kind of 
just the same thing. (Whereas, for example, subposet of a lattice is not 
always a lattice.)


Or should we left it to user to say LatticePoset(L.relabel(...))?

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Relabeling posets vs. lattices

2014-11-18 Thread Jori Mantysalo

On Tue, 18 Nov 2014, Nathann Cohen wrote:

Why don't you do what you did for ordinal sum, and change the code of 
Poset to deal with the lattice case ?


Because after thinking this it kind of feels wrong. A class should not 
know other classes deriving from it. And in theory someone could also 
extend class hierarchy, for example to have distributed lattices to be own 
class (with, for example, function giving the unique complement of an 
element). After that one should also modify posets.py.



P.S. : please add me in Cc for the review


It is #17142 and you already are at cc field.

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Warning message and encoding

2014-11-17 Thread Jori Mantysalo

Matrix(RR, [[1,2],[3,4]]).eigenvalues() gives warning message Using
generic algorithm for an inexact ring - -, which is of course correct.
After that it prints #!/usr/bin/env python.

But on one occasion I already get # -*- coding: utf-8 -*- aftew warning 
on version 6.4.


Is this reproducible everywhere, or does it depend on OS / charset / 
something?


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: trac milestone

2014-11-14 Thread Jori Mantysalo
But how should milestones be used? For bugs it seems easy to have next 
release as default milestone, but about enhancements? I have put them on 
whislist, if I think that I might do it myself, but don't know when.


--
Jori Mäntysalo


Re: [sage-devel] Re: Posets: interval/closed_interval

2014-11-13 Thread Jori Mantysalo

On Wed, 12 Nov 2014, Travis Scrimshaw wrote:


That's exactly what I'm saying. With this change, that may not occur if
someone had overwritten interval() with some slightly different behavior in
a subclass and was calling closed_interval(), they would experience an
unexpected change (or, perhaps more likely, a major slow-down). It would be
calling the interval() of FinitePoset rather than the subclass.


rsk.py contains robinson_schensted_knuth = RSK, posets.py contains 
Posets_all = Posets and poset_examples.py contains posets = Posets. 
Does same thing happen with those also?


 * * *

As I wrote to ticket, it seems a little confusing for me to have 
documentation with two functions, both with examples and so, that actually 
does same thing. Maybe docstring of other could be only Alias for 
linkxxx()/link.?


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Posets: interval/closed_interval

2014-11-11 Thread Jori Mantysalo

On Wed, 5 Nov 2014, Travis Scrimshaw wrote:


There's a minor difference between redirecting vs alias in that an alias
does not respect inheritance:


So, this does not affect because no class deriving from FinitePoset 
defines own interval() or closed_interval(). I made a ticket for this: 
http://trac.sagemath.org/ticket/17314


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Posets: interval/closed_interval

2014-11-05 Thread Jori Mantysalo
What is the logic having both interval() and closed_interval() defined on 
posets? Last one is really defined as a function, but is just calls first 
one.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Trac field priority

2014-11-05 Thread Jori Mantysalo

On Wed, 5 Nov 2014, kcrisman wrote:

How DOES bug prioritization work in Sage?  You can pick 
blocker/critical/major/minor/trivial when you're creating a ticket.


- -There is certainly very little double-checking, and very little 
setting to anything other than major:


Is there even documentation about using trac fields? How should one 
differentiate between major and minor?


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Can We Trust Computer Algebra Systems?

2014-10-30 Thread Jori Mantysalo

On Wed, 29 Oct 2014, Jakob Kroeker wrote:


I suggest to think about offering bounties for new reported bugs


When having a course of mathematical software, the teacher could give some 
extra point to those who report [new] bugs.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] BooleanLattice(n) with n=0 and n=1

2014-10-27 Thread Jori Mantysalo

for i in [3,2,1,0]: print Posets.BooleanLattice(i)

prints

Finite lattice containing 8 elements
Finite lattice containing 4 elements
Finite lattice containing 1 elements
Traceback (click to the left of this block for traceback)

It sounds natural to have BooleanLattice(0) be 1-element lattice, but is 
it normal mathematical definition? And to check, shouldn't 
BooleanLattice(2) return the 2-element chain?


Btw, Posets.BooleanLattice('cat-says-meow') says unsupported operand 
type(s) for ** or pow(): 'int' and 'str'... I have already open a ticket 
for this.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Poset/lattice, join and join_matrix

2014-10-27 Thread Jori Mantysalo

On Mon, 27 Oct 2014, Samuel Lelievre wrote:


Here is how I would put it:



- gcd([]) is zero because
  zero is the identity element for gcd
  (for any x, gcd(0,x) equals x);


Understood. Thanks.

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: ipython notebook

2014-10-24 Thread Jori Mantysalo

On Thu, 23 Oct 2014, Fernando Perez wrote:

Yup, we're a little behind... :)  Trying to get 3.0 out before the end 
of the year. The JupyterHub tool is more admin-oriented, so we don't 
have a release date for it yet: people are using it for now straight out 
of github, and until we feel that we have an API and model we really 
like, it will likely continue that way.


So, for an Sage server admin this means that there is no horry to look at 
IPython yet? And on the other hand, IPython will come, and there is no 
meaning to make big enhancements to sagenb?


For now sagenb works quite well for user viewpoint. As an admin I see 
missing features, like really deleting a given user include data, and 
deleting accounts that have no local password and ldap does not found use 
anymore. Also main page for documentation on sagemath.org does not contain 
Admin's Guide parallel to Developer's Guide.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Can We Trust Computer Algebra Systems?

2014-10-24 Thread Jori Mantysalo

On Fri, 24 Oct 2014, Jakob Kroeker wrote:

Does Sage warn somehow the user if a user calls a function which is 
*known* to be buggy?


Sometimes, but for example

On Fri, 24 Oct 2014, Jean-Pierre Flori wrote:


We're stuck at http://trac.sagemath.org/ticket/17184.
I've also posted on Singular forum:


I know that Singular versions 3.x has a heisenbug, it stucks sometimes 
when factoring multivariate polynomials over rationals. There is no 
warning message.


(But of course user do not get wrong answer, if there is no answer at 
all.)


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Poset/lattice, join and join_matrix

2014-10-23 Thread Jori Mantysalo

On Wed, 22 Oct 2014, Nathann Cohen wrote:

given a Poset, how can you detect if this poset is a meet semilattice ? 
For sure we need a function for that ! And it seems that this function 
is exactly what join_matrix does.


Of course one can try to build a [semi]lattice and see if it works or not. 
But is there some faster way? For a distributive lattice there is, see
http://www.lirmm.fr/~nourine/Papiers/dist-recognition.ps . It links to 
http://download.springer.com/static/pdf/172/chp%253A10.1007%252F3-540-10854-8_14.pdf?auth66=1414046623_37fe0879bd09fb6dd923acdc2237f214ext=.pdf 
which says that detecting if a poset is lattice can be done on O(n^2.5).



My way of doing that (what would yours be?) to:
1) Have a FinitePoset.is_meet_semilattice() function that would try to 
build that matrix and answer yes/no accordingly. The matrix, when built, 
would be cached somewhere.

2) Move Poset.join_matrix() to FiniteMeetSemiLattice 

The good thing is that if you:
a) Build a Poset
b) Notice it is a MeetSemiLattice by calling .is_meet_semilattice (which 
builds the matrix)

c) Build the MeetSemiLattice from the poset

Then step c should not re-build the matrix as the matrix is currently a 
lazy attribute of the hasse diagram, which has no reason to be changed 
by those commands.


Yes. This way user can say somewhat more naturally

if P.is_lattice(): LatticePoset(P).do_something()

and not

try: L=LatticePoset(P)... except...


  2) Would it be useful to have join() function taking more than two
  arguments? And if so, should then also L.join(x) return x if x in L, and
  maybe even L.join() return L.top()? Or could join take a list as argument,
  so that both L.join(x,y) and L.join([x,y]) would work and latter one be
  possible to extend to L.join([x,y,z,...])?


+1


Ok. To have join(a,b,c,...) or join([a,b,c,...])?

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: ipython notebook

2014-10-23 Thread Jori Mantysalo

On Wed, 22 Oct 2014, Volker Braun wrote:


Its in 6.4.beta6. Run with sage --notebook=ipython


It said that pyzmq is missing. Then sage -i pyzmq said that zmq.h was not 
found. (And last yum whatprovides 'zmq.h' found no matches...). A bug in 
pyzmq?


(Might be, again, something wrong with my setup. Don't use much time for 
this.)


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Poset/lattice, join and join_matrix

2014-10-23 Thread Jori Mantysalo

On Thu, 23 Oct 2014, Nathann Cohen wrote:


which says that detecting if a poset is lattice can be done on O(n^2.5).


Oh. Cool.


Now somebody should just read, understand and implement it. :=)


Ok. To have join(a,b,c,...) or join([a,b,c,...])?


Hmmm.. Well, we can have both at the same time.


True, but is it good for user perspective to have two ways to same end?

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Poset/lattice, join and join_matrix

2014-10-23 Thread Jori Mantysalo

On Thu, 23 Oct 2014, Nathann Cohen wrote:


It really is not a problem either to only have this P.join(a_list) available


And it can always be later expanded to accept also another kind of args.

Btw, I noticed that there kind of is a function for this already: sum(). 
But not that easy to use.


L=Posets.BooleanLattice(4)
L=LatticePoset(L, facade=False)
print sum([L(1), L(2), L(4)], L.bottom())

(Grr, facade-argument available for some but not all example posets.)

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: ipython notebook

2014-10-23 Thread Jori Mantysalo

On Thu, 23 Oct 2014, Volker Braun wrote:


Did you run make after pulling the git branch? The zeromq and pyzmq packages 
are new and need to be compiled.


I did not. But no help from that:

running configure
Configure: Autodetecting ZMQ settings...
Custom ZMQ dir:   /home/jm58660/sage/local

creating build/temp.linux-x86_64-2.7/scratch/tmp
cc -c /tmp/timer_createratiAV.c -o 
build/temp.linux-x86_64-2.7/scratch/tmp/timer_createratiAV.o
cc build/temp.linux-x86_64-2.7/scratch/tmp/timer_createratiAV.o -o 
build/temp.linux-x86_64-2.7/scratch/a.out
build/temp.linux-x86_64-2.7/scratch/tmp/timer_createratiAV.o: In function 
`main':

timer_createratiAV.c:(.text+0x15): undefined reference to `timer_create'
collect2: error: ld returned 1 exit status
gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC 
-I/home/jm58660/sage/local/include -Izmq/utils -Izmq/backend/cython 
-Izmq/devices -c build/temp.linux-x86_64-2.7/scratch/vers.c -o 
build/temp.linux-x86_64-2.7/scratch/vers.o
build/temp.linux-x86_64-2.7/scratch/vers.c:4:17: fatal error: zmq.h: No 
such file or directory

 #include zmq.h
 ^
compilation terminated.

error: command 'gcc' failed with exit status 1

Fatal: Falling back on bundled libzmq, but setup.cfg has explicitly 
prohibited building the libzmq extension.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: ipython notebook

2014-10-23 Thread Jori Mantysalo

On Thu, 23 Oct 2014, Volker Braun wrote:


Workaround is to run

sage -f zeromqsage -f pyzmq
sage -f ipython


[Errno 104] Connection reset by peer

I.e. sagemath.org stalled. Mirrors of those somewhere?

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: ipython notebook

2014-10-23 Thread Jori Mantysalo

I got ipython to run. Looks nice.

How is account management done with it? Ldap integration?

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] OT: Sage notebook as a interface for python

2014-10-23 Thread Jori Mantysalo

Off-topic. Sorry.

Has anyone used Sage notebook as a GUI for python only? I was asked to 
make some easy way for 15-25 students to use python, some python libraries 
and some example materials.


Sage kind of is not logical answer for this. But if ipython can't handle 
this, what else to do? Can Sage be configured to not preparse input, i.e. 
answer to 1/2 just like plain python would?


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Poset/lattice, join and join_matrix

2014-10-22 Thread Jori Mantysalo
1) Why is join() defined for join-semilattices, but join_matrix() 
defined for posets? (I.e. it works by giving exception if the poset is 
not join-semilattice.)


2) Would it be useful to have join() function taking more than two 
arguments? And if so, should then also L.join(x) return x if x in L, and 
maybe even L.join() return L.top()? Or could join take a list as argument, 
so that both L.join(x,y) and L.join([x,y]) would work and latter one be 
possible to extend to L.join([x,y,z,...])?


3) s/join/meet for questions 1 and 2.

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Graphs and order of vertices

2014-10-21 Thread Jori Mantysalo

On Mon, 20 Oct 2014, Erik Massop wrote:


Shortly, do (di)graphs have some kind of order of vertices?



If the vertices happen to have a total ordering everything should be
fine.


OK. Then I can use it on poset, because labels for vertices in Hasse 
diagram are just natural numbers. But...



especially useful if there is no total ordering on the vertices, or when
comparisons throw exceptions. Shall I open a ticket for this?

Here is an example of a comparison throwing an exception:

sage: G = Graph({complex(3):[complex(4)]})
sage: G.vertices()

TypeError: no ordering relation is defined for complex numbers


At least for me this seems as an error; but on the other hand, I don't 
know how it should behave. What makes this interesting is


G = Graph({complex(3):[complex(4)]})
for x in G.vertex_iterator(): print x

works as i guessed, but however

G=Graph()
for i in range(0,10): G.add_vertex(10-i)
for x in G.vertex_iterator(): print x
G.vertices()

Does print numbers from 1 to 10 in order. On the other hand

G=Graph()
for i in range(0,10): G.add_vertex(randint(1,1000))
for x in G.vertex_iterator(): print x
G.vertices()

gives them in about random order.

I started thinking this when doing http://trac.sagemath.org/ticket/17173 . 
Nathann suggested using directly (sub)graphs instead of (sub)poset. It is 
OK with .vertices() but not with .vertex_iterator(); try


G=Graph()
for i in range(2,50): G.add_vertex(i)
for i in range(2,50):
if not is_prime(i):
G.delete_vertex(i)
for x in G.vertex_iterator(): print x

This seems to be quite open door for nasty bugs. .vertex_iterator might 
give vertices in order when graph is small or has not been modified many 
times.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Graphs and order of vertices

2014-10-20 Thread Jori Mantysalo
When I hit this, I was making a code for posets, but this is actually more 
general question. Shortly, do (di)graphs have some kind of order of 
vertices? To start, will


Graph({'b':['a']}).vertices()

always print ['a', 'b'], not ['b', 'a']? How about directed graphs? What 
about adding or deleting vertex (or edge), can it change order of 
remaining vertices? How about list of incoming or outgoing list?


Is there even some kind of general rule about this kind of thing at Sage?

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Graph.show() and non-injective relabeling

2014-10-14 Thread Jori Mantysalo

On Tue, 14 Oct 2014, Nathann Cohen wrote:


G=DiGraph({0:[1,2]})
G.set_edge_label(0,1,'Hi!')
G.set_edge_label(0,2,'Hi!')

(But .relabel(lambda e: ...) -syntax is easier, I think.)


Yes but we can't do the same for the vertices of a graph, of we would
have no way to differentiate them afterwards. It should really be a
plot parameter.


That was what I was thinking. I don't know if relabel is good name for 
parameter of plot(). Maybe not.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] KASH and polynomials of degree 22 and 23

2014-10-14 Thread Jori Mantysalo
See http://trac.sagemath.org/ticket/13810 . Can somebody confirm that KASH 
really bugs with polynomials of degree 22 and 23? For me it works only 
up to 21 in three different Linux-machine. I did ask about this from mail 
address found on KANT/KASH www-page, but got no response.


And in any case there is a bug: Sage says automatically restarting but 
do not.


(See! I can also ask something not related to posets! :=) )

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Graph.show() and non-injective relabeling

2014-10-13 Thread Jori Mantysalo

On Fri, 3 Oct 2014, Nathann Cohen wrote:

A ticket about this: http://trac.sagemath.org/ticket/15206 . This is 
not related to posets only, but to graphs in general. Is anyone 
planning to do this?



I do not understand: do you only want to draw a graph with anything you
want as labels of the vertices ?


Yes. Just like adges can be labelled so that more than one edge has same 
label:


G=DiGraph({0:[1,2]})
G.set_edge_label(0,1,'Hi!')
G.set_edge_label(0,2,'Hi!')

(But .relabel(lambda e: ...) -syntax is easier, I think.)


If so, I have no idea why it seems to have been half-implemented in the
posets file. That's clearly a Graph matter, which Posets would then call.
This being said, you should not make this work by relabelling the graph
itself: if several vertices of a graph have the same name, we would have no
way to do things as simple as getting the degree of a vertex.

This being said, there is in Graph.plot() an option currently named
vertex_labels which can be set to True/False according to whether you want
to display the vertices' labels when the graph is drawn. If you just make it
accept a dictionary of labels, there must then be a way to plot the labels
you gave this way instead of the vertices' names.


Sounds like a great plan! Now we just wait for somebody to do it!

I will not, not at least in any near future.

 * * *

Btw, why default color changes when you give color of one element? See

G=DiGraph({0:[1]})
G.show(vertex_colors='pink')
G.show(vertex_colors={'red':[0]})

changing background color of 1.

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Posets and lattices, location of functions

2014-10-12 Thread Jori Mantysalo

On Sun, 12 Oct 2014, Nathann Cohen wrote:


True; also for example there could be doublehasse, i.e. structure with
both upper and lower covers saved as a list for an element.



Isn't that already the case ? A hasse digram should be a (sparse)
digraph, and a (sparse) digraph should be stored twice internally,
once for in-neighborhood and one for out-neighborhood.


I don't know. Where should the code for that be?

Your implementation of static sparce graph is so fast that I don't know if 
there is any significant difference at all.


Did you find the in-neighbors method too slow somewhere ? We had a 
problem like that at some point.


Not a real problem. At http://trac.sagemath.org/ticket/13223 Darij 
Grinberg writes I've improved the situation in #13240; the algorithm is 
now polynomial time. Wouldn't hurt to improve it nevertheless. Actually 
algorithm is linear already. I was just thinking what he have had in mind 
when writing that; there doesn't seem to be significantly better 
algorithm.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Cannot compile

2014-10-11 Thread Jori Mantysalo

On Sat, 11 Oct 2014, Volker Braun wrote:


But apparently you do have a permission problem with cp -p.


That might be because source filesystem has acl's enabled and target fs 
has not. Or in principle target system might be for example fat32 withouth 
support for almost anything.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: Posets.ChainPoset(n), n500

2014-10-11 Thread Jori Mantysalo
This might be of general interest, even if this specific example is just 
for lattices.


On Fri, 10 Oct 2014, Nathann Cohen wrote:


About using hasse diagrams directly: Is it possible to do for example
Posets.ChainPoset(500) without 10 seconds of cpu time?


That such a thing takes so long does not make the slightest sense.
%prun -s cumulative says that a call to copy takes a lot of time,
and the call to 'meet' too. But whatever is called is clearly wasting
ressouces.


ChainPoset() is oneliner:
return LatticePoset((range(n), [[x,x+1] for x in range(n-1)]))

This does

P = Poset(data...)
if not P.is_lattice():
raise ValueError(Not a lattice.)
return FiniteLatticePoset(P...)

So first it checks that given data really is a poset (i.e. has no loops). 
After that it checks if poset is also lattice --- and it does so by really 
calculating meet- and join-matrices. For n=500 that means matrix with 
500*500=25 entries, because there is no support for lower or upper 
triangular matrices.


Well, I guess we have shortcut: use FiniteLatticePoset directly. But

n=500
P=Poset((range(n), [[x,x+1] for x in range(n-1)]))
L=FiniteLatticePosets(P)

gives AssertionError.

 * * *

Is this a general pattern? It is good to check arguments also in 
internal use, so that we find programming errors easily. But sometimes 
there should be shortcuts to pass lenghty checks when we really know what 
we are doing. It this thinked on other parts of Sage?


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Posets and lattices, location of functions

2014-10-11 Thread Jori Mantysalo
First of all, a warning: I am not a mathematician, just a computer support 
and IT admin interested in strange things.


On Fri, 10 Oct 2014, Anne Schilling wrote:

When Travis and I were working on the bug fix for 14019, we were also 
contemplating deprecating HasseDiagram and moving the methods to 
FinitePoset


OK, then I'm not only one wondering this.

On Fri, 10 Oct 2014, Nathann Cohen wrote:


- Is it meant to be possible to totally change backend? Not just to hasse
diagram with some other graph backend, but to some bit vector or
matrix-based system or something?


HMmmm... Well for some things it may be much better to have a binary
matrix indeed, for instance when you need to compare a lot of elements
and would like to store the dense version of the adjacency matrix.
Right now it is not possble for all I know. And if what you have in
mind can also be thought of as a graph backend, then perhaps nothing
needs to be changed on the Poset side.


True; also for example there could be doublehasse, i.e. structure with 
both upper and lower covers saved as a list for an element. But let's 
suppose that we could have some totally other backend, called foo and not 
yet invented, for posets. Then posets.py would be mostly like


def compute_something(self, a, b):
if _hasse_diagram:
_hasse_diagram.compute_something(a, b)
else:
_foo.compute_something(a, b)

def compute_something_else(self, a, b):
if _hasse_diagram:
_hasse_diagram.compute_something(a, b)
else:
raise NotImplemented(Not done yet. Sorry!)

But still, our foo might have compute_something_else() formally defined 
but so that it just raises a NotImplemented exception.



- It might make sense to have functions for ALL posets, not just finite
ones. Then maybe poset class could have is_lattice defined as
is_meet_semilattice  is_join_semilattice? However, for now there is just
two infinite poset defined.



Well, the current class is called FinitePoset. Some Poset class
could do that. I did not know that infinite posets were supported
though.


Actually there is mathematically, for example, class inclusion chain

finite lattices \subset locally finite lattices \subset (all) lattices.

For example upper_covers() can not be defined on general lattice: On 
([0,1], \le) element covering 0 should be smallest positive real number. 
On divisor lattice of positive integers there is infinite upper covers on 
1: all primes; hence on locally finite lattices on might have 
upper_covers_iterator() but not upper_covers.



- Hasse diagram is backend to posets and [semi]lattices. Could some function
be used differently, like omitting some checks if we have lattice and not
just poset?


I suppose, but those functions can be implemented in FiniteLattice
already. I believe you did that in a recent patch by the way.


I tried, did not work. Linear extension must be computed, because C code 
gave posets with wrong order; but it generates posets, so there no need 
to check for being acyclic.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Posets and lattices, location of functions

2014-10-10 Thread Jori Mantysalo

On Fri, 10 Oct 2014, Nathann Cohen wrote:


So, what is the logic behind this?



I don't think that there is any.


Duh.


To understand what I mean, just observe that posets have a .base_ring()
method. Or a .construction() method.


And .is_exact(). But to be honest, at the end of documentation of 
.base_ring() it says Todo Move this method elsewhere - -.


About the location of functions: I personally think that it makes more 
sense to do everything in the FinitePoset class. It does not make sense 
to scatter implemented methods everywhere, and the same way that we 
cannot put anything in the category files we cannot put everything in 
the HasseDiagram class.


By the way, HasseDiagram are not meant to be created by the users (it 
assumes several things that are never checked when the diagram is 
created) so I do not see the point of implementing functions there, 
especially when it needs to be exposed in the FinitePoset class right 
afterward.


Thinking more about (possible) logic behind this...

- Is it meant to be possible to totally change backend? Not just to hasse 
diagram with some other graph backend, but to some bit vector or 
matrix-based system or something?


- It might make sense to have functions for ALL posets, not just finite 
ones. Then maybe poset class could have is_lattice defined as 
is_meet_semilattice  is_join_semilattice? However, for now there is just 
two infinite poset defined.


- Hasse diagram is backend to posets and [semi]lattices. Could some 
function be used differently, like omitting some checks if we have lattice 
and not just poset?


About using hasse diagrams directly: Is it possible to do for example
Posets.ChainPoset(500) without 10 seconds of cpu time?

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Posets and lattices, location of functions

2014-10-09 Thread Jori Mantysalo
I have made some additions to posets and lattices, for example 
http://trac.sagemath.org/ticket/17121


But I am confused about logic (if any...) behind location of functions on 
different places. For example


is_bounded := has_top  has_bottom

and all three functions are defined on hasse_diagram.py with one-line 
wrappers in posets.py. But then


is_lattice := is_meet_semilattice  is_join_semilattice

and is_lattice is on categories/finite_posets.py, 
is_[join|meet]_semilattice on hasse_diagram.py.


Also is_selfdual is on categories/finite_posets.py, is_ranked is on 
hasse_diagram.py and is_graded on posets.py. (And there is also is_graded 
on hasse_diagram.py, but defineq equal to is_ranked, conflicting with 
definition on posets.py.)


hasse_diagram.py contains function is_distributive_lattice, and before 
ticket #17121 is is used only from lattices.py, even if the name suggest 
it be available also on posets.py.


So, what is the logic behind this?

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Notebook bug with '' - ''?

2014-10-08 Thread Jori Mantysalo

P = Poset({1:[]},facade=False)
type(P(1))

This prints class 
'sage.combinat.posets.elements.FinitePoset_with_category.element_class' 
from command line, but on notebook I got


class
'sage.combinat.posets.elements.FinitePoset_with_category.element_class'\
gt;

What part of Sage bugs here?

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Generating random posets by given restriction

2014-10-03 Thread Jori Mantysalo

Now we have Posets.RandomPoset(n, p). It generates a poset of n
element. Second argument is propability: p=1.0 will always make chains, 
p=0.0 will always make antichains.


Does it sound natural to have syntax like for example

Posets.RandomPoset(10, p, ['graded', 'connected'])

? 3. argument would default to None, meaning that all kind of posets might 
be generated. It would be a list of restrictions (usually giving 
NotImplemented...). Parameter p should be somehow normalized to have 
some kind of rational meaning.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Graph.show() and non-injective relabeling

2014-10-02 Thread Jori Mantysalo
A ticket about this: http://trac.sagemath.org/ticket/15206 . This is not 
related to posets only, but to graphs in general. Is anyone planning to do

this?

It seems that mostly part append(text(str(v) at set_vertices on 
graph_plot.py must be changed, and the chain of function calls changed to 
forward relabeling dict to there. But I am not sure if for example dot2tex 
complicates this. (Because it, for example, reverses poset -- see #16865.)


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Eric Raymond on open source and math

2014-10-02 Thread Jori Mantysalo

On Thu, 2 Oct 2014, Francesco Biscani wrote:


Thanks for the other pointers as well.


At Tampere we used Sage to study singularity of lcm-matrices of gcd-closed 
sets. With Sage it is very easy to show divisor semilattice of such a set. 
On the other direction we generated all lattices of given size on set 
var('a'), var('b')..., discard some of them for some known property, then 
make a polynomial of those variables and möbius function values of 
lattice.


I have no idea if this would have been easy with some other software.

With next release of Sage this will be still easier, thanks to .width() 
and other additions to posets.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Why I don't think Sage has failed as a replacement for Maple, Mathematica and other Ma*'s

2014-09-26 Thread Jori Mantysalo

On Thu, 25 Sep 2014, rjf wrote:

I am curious as to what parts of Sage you use.  I suspect you are using 
it mostly as a front-end to Maxima, In which case -- have you considered 
using Maxima directly, esp. wxmaxima?


Installing Sage is quite easy; it took time if you compile it yourself, 
but in any case it almost always compiles. (Installing LDAP is another 
story; but not too hard today, for which I am very glad.)


I have had problems when trying to install for example PARI or GAP. (Not 
with Maxima, however, and R always works like charm.)


So it is not necessary bad idea to install whole Sage, even if you are 
going to use just one part of it.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Trac and sort by lastmod

2014-09-26 Thread Jori Mantysalo

After clicking Lastmod-header it got tickets sorted like

1 mins  23 hours  32 mins   8 days

Is this bug in trac in general or some setting at sage trac?

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Height of poset

2014-09-18 Thread Jori Mantysalo
I think that Sage documentation should contain a phrase height of poset 
somewhere.


If P is a poset, it can be computed with P.rank()+1. (Or, maybe, P.rank() 
--- which one is definition of height?)


Should there be a .height() function? Nathann Cohen said that probably, 
but I should ask about it on this list. Travis Scrimshaw said I wouldn't 
think of using rank for a non-ranked poset.


So, to make a new small function or to add a note to documentation?

--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: About docs (and code) of poset

2014-09-14 Thread Jori Mantysalo

On Thu, 28 Aug 2014, Nicolas M. Thiery wrote:


Posets(5)

which internally does something like

[x for x in GenerateAllDirectedGrapsh(5) if x.is_poset()]



Semantically, this is correct. Luckily the implementation is more
clever than this: it only runs through digraphs that are actually
Hasse diagrams. For details, see the section Graphs up to
isomorphism in sage.combinat.tutorial?


OK. However, I did a quick test:

%timeit
x=0
for P in Posets(7):
if P.has_top():
x=x+1
print x

took (in quite old computer) 128 seconds. I modified the code written by 
Gunnar Brinkmann to output dicts. It took milliseconds to create a file 
containing dicts for posets of size 7. After that


%timeit
x=0
with open('/tmp/7.tosage') as myfile:
for line in myfile:
if Poset(eval(line)).has_top():
x=x+1
print x

took about 10 second. Of course this would be faster if we can integrate 
code more directly; propably only milliseconds if glued together with 
static_sparse_graph.pyx.


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] is_lattice(): Optimization for what end?

2014-09-14 Thread Jori Mantysalo

I was just playing with posets. Let L=Posets(7). Then

len([x for x in L if x.is_lattice()])

takes about two times more time than

len([x for x in L if x.is_bounded() and x.is_lattice()])

Is this just some marginal and uninterestin case, or is algorithm badly 
chosen, or is is_lattice() meant to be used in situations where posets 
usually are bounded?


--
Jori Mäntysalo

--
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


  1   2   >