Re: [sage-support] Re: Typesetting arbitrary LaTeX

2011-12-15 Thread Jeroen Demeyer
On 2011-12-14 18:56, John H Palmieri wrote:
> (although I think this never uses JSMath, in case you wanted that).
Yes, I did mean JSMath.  I have an idea on how to fix this, see #12156.

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


[sage-support] Probability of a Boolean Function

2011-12-15 Thread Santanu Sarkar
I have a Boolean Function f which I know is not balanced. In fact f=0
with probability 1/4. If I use the function f.is_balanced() it tells
me that the function is not balanced, which is fine.
But is there a function which will tell me the what the probability of
a Boolean function being zero is ? If not is there any way I can find
out whether the probability of a boolean function f=0 is equal to 'p'
or not?

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


Re: [sage-support] Bug in Minimum Spanning Tree

2011-12-15 Thread David Joyner
On Thu, Dec 15, 2011 at 8:34 AM, Albert Heinle
 wrote:
> Hello Sage-Team,
>
> a friend of mine and I have found a bug today in sage in the algorithm for 
> computing the minimum spanning tree.
>
> We are using Sage Version 4.7, Release Date: 2011-05-23 on a mac with OS X 
> Snow Leopard.
>
> Here is the short example, where the algorithms do fail:
>
> g = Graph(weighted = True)
> g.add_vertices(range(1,5))
> for v in g.vertices():
>  for u in g.vertices():
>      if (u == 1 and v == 3) or (u == 3 and v == 1):
>          g.add_edge(u,v,100)
>          continue
>      if not u == v:
>          g.add_edge((u,v,1))
>
> which is a simple example. The graph looks like this. The edges have all 
> weight 1, except from the one between 3 and 1, which has 100.
>
>
>
> Now, the call of
> g.min_spanning_tree()
> results in
> [(1, 2, 1), (1, 3, 100), (1, 4, 1)]
> which is clearly not the minimum spanning tree. We also tried another
> algorithm (Prim Edge) and got the same results.
>

I got this:

sage: from sage.graphs.spanning_tree import kruskal
sage: kruskal(g, check=True)
[(1, 2, 1), (1, 4, 1), (2, 3, 1)]

The docs say "By default, we turn off the sanity checks for
performance reasons."
Do you think this could explain it?



>
> For further questions on this report, feel free to respond to this mail.
>
> Thanks in advance for fixing it.
>
> Albert Heinle
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>

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


[sage-support] Upgrade from source fails

2011-12-15 Thread Anthony Wickstead
I am trying to upgrade my Sage 4.7.1 installation using "./sage -
upgrade" [and also using "upgrade()" from within sage]. After checking
mirrors, telling me that six packages will be upgraded  and warning me
that it could take hours, the upgrade aborts with the message "There
are uncommitted changes in the Sage root repository. Aborting." Is
this a problem on my installation (actually two independent
installations) or at the remote end of things?

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


[sage-support] Ann: OpenOpt and FuncDesigner 0.37

2011-12-15 Thread dmitrey
Hi all,
I'm glad to inform you about new release 0.37 (2011-Dec-15):

OpenOpt (numerical optimization):

IPOPT initialization time gap (time till first iteration) for
FuncDesigner models has been decreased
Some improvements and bugfixes for interalg, especially for
"search all SNLE solutions" mode (Systems of Non Linear Equations)
Eigenvalue problems (EIG) (in both OpenOpt and FuncDesigner)
Equality constraints for GLP (global) solver de
Some changes for goldenSection ftol stop criterion
GUI func "manage" - now button "Enough" works in Python3, but "Run/
Pause" not yet (probably something with threading and it will be fixed
in Python instead)

FuncDesigner:
Major sparse Automatic differentiation improvements for badly-
vectorized or unvectorized problems with lots of constraints (except
of box bounds); some problems now work many times or orders faster (of
course not faster than vectorized problems with insufficient number of
variable arrays). It is recommended to retest your large-scale
problems with useSparse = 'auto' | True| False

Two new methods for splines to check their quality: plot and
residual
Solving ODE dy/dt = f(t) with specifiable accuracy by interalg
Speedup for solving 1-dimensional IP by  interalg

SpaceFuncs and DerApproximator:

Some code cleanup

You may trace OpenOpt development information in our recently created
entries in Twitter and Facebook, see http://openopt.org for details.

See also: FuturePlans, this release announcement in OpenOpt forum

Regards, D.

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


[sage-support] Re: Please explain this wrong answer with implict multiplication....

2011-12-15 Thread Chris Seberino
I had it turned on but I guess it doesn't get triggered for x (x -1).
Any way to change the behavior or
does that require a patch to Sage?

On Dec 15, 1:37 am, Jason Grout  wrote:
> On 12/15/11 1:31 AM, Chris Seberino wrote:
>
> > I know Sage has some issues with a variable in front of parens when
> > using implicit multiplication.  Why did that make the first give the
> > wrong answer when using implicit multiplication? How is sage
> > interpreting it?
>
> > sage: solve(3 + x (x-1)==5,x)
> > [x == 3]
> > sage: solve(3 + x*(x-1)==5,x)
> > [x == 2, x == -1]
>
> You have to explicitly turn on implicit multiplication; it's not on by
> default.  In your case above, it's not on (unless you turned it on)
>
> So "x(x-1)" is interpreted as:
>
> f(x)=x
> f(x-1)
>
> i.e., x(x-1) is just x-1 (the function y=x evaluated at x-1)
>
> Thanks,
>
> Jason

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


[sage-support] How to get the message from the standard output when interfacing gp and SAGE ?

2011-12-15 Thread Jean-François Biasse
Hi,

I am using Sage to pass elements between gp and Magma. It works just
fine, except for the messages on the standard output.

My version of gp should print some timings, but when I call it through
SAGE, this doesn't work.

I believe this behavior is ruled by interfaces/gp.py, but I am not
experienced enough to make the proper modifications.

If I do :
sage : from sage.interfaces.expect import StdOutContext
sage : ctx = StdOutContext(gp)
sage : with ctx : gp.my_gp_function(...)

I get my messages, but with a whole bunch of useless stuffs.

I also have the option to do
sage : gp.eval('\\g 1')
that turns the debug mode on, but I have the same problem : it prints
out too many things.

Thanks
Jean-François

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


[sage-support] Re: Please explain this wrong answer with implict multiplication....

2011-12-15 Thread kcrisman


On Dec 15, 2:26 pm, Chris Seberino  wrote:
> I had it turned on but I guess it doesn't get triggered for x (x -1).

Even when you turn it on, the behavior is not uniform as the user
might expect, though there is a logic.

sage: implicit_multiplication(10)
sage: (x) (x-1)
(x - 1)*x
sage: x (x-1)
x - 1
sage: (x-1)x
(x - 1)*x
sage: x(x-1)
x - 1


> Any way to change the behavior or
> does that require a patch to Sage?
>

By the way, this is poorly documented in the sense that

implicit_multiplication?

only refers to `implicit_mul`, which however is not in the global
namespace.

But

sage: sage.misc.preparser.implicit_mul?

gives


Definition: sage.misc.preparser.implicit_mul(code, level=5)
Docstring:
   Inserts *'s to make implicit multiplication explicit.

   INPUT:

   * ``code``  -- a string; the code with missing *'s

   * ``level`` -- an integer (default: 5); how aggressive to be in
 placing *'s

 * 0 - Do nothing

 * 1 - Numeric followed by alphanumeric

 * 2 - Closing parentheses followed by alphanumeric

 * 3 - Spaces between alphanumeric

 * 10 - Adjacent parentheses (may mangle call statements)

Perhaps it's time to add a level.

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


[sage-support] Re: Please explain this wrong answer with implict multiplication....

2011-12-15 Thread Nils Bruin
On Dec 15, 11:26 am, Chris Seberino  wrote:
> I had it turned on but I guess it doesn't get triggered for x (x -1).
> Any way to change the behavior or
> does that require a patch to Sage?

You've already discussed that:

http://groups.google.com/group/sage-devel/browse_thread/thread/e67a869f71140ca7/cc07b5ed38951159?hl=en&#cc07b5ed38951159

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


Re: [sage-support] Upgrade from source fails

2011-12-15 Thread William Stein
On Thu, Dec 15, 2011 at 7:16 AM, Anthony Wickstead
 wrote:
> I am trying to upgrade my Sage 4.7.1 installation using "./sage -
> upgrade" [and also using "upgrade()" from within sage]. After checking
> mirrors, telling me that six packages will be upgraded  and warning me
> that it could take hours, the upgrade aborts with the message "There
> are uncommitted changes in the Sage root repository. Aborting." Is
> this a problem on my installation (actually two independent
> installations) or at the remote end of things?
>

This is a bug in Sage, which has been discussed a few times on
sage-devel.  I got around it by commenting out the relevant
sys.exit(2) line in

SAGE_ROOT/local/bin/sage-update

 -- William

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


Re: [sage-support] Upgrade from source fails

2011-12-15 Thread Jeroen Demeyer
On 2011-12-15 22:45, William Stein wrote:
> This is a bug in Sage
It's not really a bug, it is more of a misfeature[1].  It is *intented*
behaviour with unfortunate consequences.

[1] http://catb.org/jargon/html/M/misfeature.html

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


Re: [sage-support] Upgrade from source fails

2011-12-15 Thread William Stein
On Thu, Dec 15, 2011 at 1:59 PM, Jeroen Demeyer  wrote:
> On 2011-12-15 22:45, William Stein wrote:
>> This is a bug in Sage
> It's not really a bug, it is more of a misfeature[1].

I'm confused, because I think it's a straight up bug.  The error
message says there are uncommitted changes.  However, if you do

hg commit

it will say there is nothing to commit.   I think the code for
checking for uncommitted changes is wrong, since it uses "hg status"
and ignores the possibility of files that are not in the repo and not
in .hgignore, hence gets thrown off by all those untracked files
(which are listed with a ? in the output of "hg status").


> It is *intented*
> behaviour with unfortunate consequences.
>
> [1] http://catb.org/jargon/html/M/misfeature.html
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

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


[sage-support] Compiling sage on Ubuntu 11.10 under VirtualBox

2011-12-15 Thread Michael Fawcett
I am having problems compiling Sage on the following setup:

ASUS K52J laptop with Intel Core I3 processor with 4G RAM running Windows 7
VirtualBox 4.1.6
Guest OS Ubuntu 11.10 desktop (i386) with 1933 M RAM allocated. VirtualBox
guest additions have been installed

The install fails during the installation of Atlas with an Illegal
instruction.

Here is atlas-3.8.4.log up to the first error :

Warning: Attempted to overwrite SAGE_ROOT environment variable
atlas-3.8.4
Machine:
Linux UbuntuSage 3.0.0-13-generic #22-Ubuntu SMP Wed Nov 2 13:25:36 UTC
2011 i686 i686 i386 GNU/Linux
Deleting directories from past builds of previous/current versions of
atlas-3.8.4
Extracting package
/home/mike/sage/sage-4.7.2/spkg/standard/atlas-3.8.4.spkg ...
-rw-r--r-- 1 mike mike 2874766 2011-06-17 12:33
/home/mike/sage/sage-4.7.2/spkg/standard/atlas-3.8.4.spkg
Finished extraction

Host system
uname -a:
Linux UbuntuSage 3.0.0-13-generic #22-Ubuntu SMP Wed Nov 2 13:25:36 UTC
2011 i686 i686 i386 GNU/Linux


CC Version
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6.1/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin
--enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686
--with-tune=generic --enable-checking=release --build=i686-linux-gnu
--host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)

make[2]: Entering directory
`/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build'
gcc
-I/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src//CONFIG/include
-g -w -c
/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src//CONFIG/src/atlconf_misc.c
gcc
-I/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src//CONFIG/include
-g -w -o xconfig
/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src//CONFIG/src/config.c
atlconf_misc.o
make[2]: Leaving directory
`/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build'
./xconfig -d s
/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src/ -d b
/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build  -Ss flapack
/home/mike/sage/sage-4.7.2/local/lib/liblapack.a -Si cputhrchk 0 -Fa alg
-fPIC -C if sage_fortran -C xc gcc -C ic gcc -C dm gcc -C sm gcc -C dk gcc
-C sk gcc -b 32 -O 1
make[2]: Entering directory
`/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build'
gcc
-I/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src//CONFIG/include
-g -w -c
/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src//CONFIG/src/atlconf_misc.c
gcc
-I/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src//CONFIG/include
-g -w -o xconfig
/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src//CONFIG/src/config.c
atlconf_misc.o
make[2]: Leaving directory
`/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build'
./xconfig -d s
/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src/ -d b
/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build  -Ss flapack
/home/mike/sage/sage-4.7.2/local/lib/liblapack.a -Si cputhrchk 0 -Fa alg
-fPIC -C if sage_fortran -C xc gcc -C ic gcc -C dm gcc -C sm gcc -C dk gcc
-C sk gcc -b 32 -O 1
make[2]: Entering directory
`/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build'
gcc
-I/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src//CONFIG/include
-g -w -c
/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src//CONFIG/src/probe_comp.c
gcc
-I/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build/../src//CONFIG/include
-g -w -o xprobe_comp probe_comp.o atlconf_misc.o
rm -f config1.out
make -j1 atlas_run
atldir=/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build
exe=xprobe_comp args="-v 0 -o atlconf.txt -O 1 -A 19 -Si nof77 0  -C ic
'gcc' -Fa ic '-fPIC' -C sm 'gcc' -Fa sm '-fPIC' -C dm 'gcc' -Fa dm '-fPIC'
-C sk 'gcc' -Fa sk '-fPIC' -C dk 'gcc' -Fa dk '-fPIC' -C xc 'gcc' -Fa xc
'-fPIC' -C if 'sage_fortran' -Fa if '-fPIC'  -b 32" \
redir=config1.out
make[3]: Entering directory
`/home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-build'
cd /home/mike/sage/sage-4.7.2/spkg/build/atlas-3.8.4/ATLAS-buil

[sage-support] Re: Compiling sage on Ubuntu 11.10 under VirtualBox

2011-12-15 Thread Volker Braun
Is that just the first error in your log or does the compilation really 
stop there? Atlas tests out different CPU instructions, some of which are 
not supported by an i3 and will lead to an illegal instruction error. This 
is normal.

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


[sage-support] Re: Compiling sage on Ubuntu 11.10 under VirtualBox

2011-12-15 Thread Adam Webb


On Dec 15, 5:49 pm, Michael Fawcett  wrote:
> I am having problems compiling Sage on the following setup:
>
> ASUS K52J laptop with Intel Core I3 processor with 4G RAM running Windows 7
> VirtualBox 4.1.6
> Guest OS Ubuntu 11.10 desktop (i386) with 1933 M RAM allocated. VirtualBox
> guest additions have been installed
>
> The install fails during the installation of Atlas with an Illegal
> instruction.
>


Hi,

I have a similar situation (vmware on windows 7). I don't recall if I
get the exact same error but I do get something similar. The build
seems to stop with an error but it also seems to be only that the
output is not updating. If I leave the build for a while (maybe 10
min) it will resume. My guess is that the output is buffered so you
don't see that the build is still working. Try giving it some time
first.

Cheers,
Adam

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