[sage-devel] Re: Output Form versus Internal Structure

2008-04-02 Thread Jason Grout

David Roe wrote:
> That's the plan.  Though I'll have to ask around to figure out how to
> determine if _repr_ is being called from the notebook or iPython.
> David

There is a variable EMBEDDED_MODE that you need to check.  Grep the 
source for EMBEDDED_MODE to see how it is used.

Jason


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



[sage-devel] Re: _fast_float_ for symbolic equalities/inequalities

2008-04-02 Thread Jason Grout

Jason Grout wrote:
> Robert Bradshaw wrote:
>> On Apr 1, 2008, at 9:15 PM, Jason Grout wrote:
>>
>>> I'm trying to add _fast_float_ functionality to SymbolicEquation
>>> objects.  However, a perusal of the sage.ext.fast_eval.pyx file  
>>> seems to
>>> indicate that the operations <, <=, ==, >=, >, and != are not  
>>> supported
>>> by the fast_float machinery.  Is that correct?
>> That is correct.
>>
>>> If so, how do I add
>>> these operations?  If not, then how do I construct a FastDoubleFunc
>>> object appropriately?
>>>
>>> Or, should I just use the python operators and call fast_float on  
>>> each side?
>> The latter is what I would do--the result of evaluating a symbolic  
>> equation object is a boolean not a float so it would be kind of hard  
>> to hook into this mechanism anyways (well, one could represent True  
>> by one float and False by another, but I don't think that's a very  
>> clean solution).
> 
> 
> Sorry, Robert, I didn't see your message until just now (after all the 
> work was done).  If you want to veto the patch, I understand and I'll do 
> it the way you suggest.
> 

"the patch" = the patch up at #2768.

Jason


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



[sage-devel] Re: sdmp - closed-source library for sparse multivariate polynomial arithmetic

2008-04-02 Thread Roman Pearce

On Apr 1, 11:36 pm, Michael Brickenstein <[EMAIL PROTECTED]> wrote:
> I don't find it very impressive, posting some benchmark for just one
> example.

There are 4 benchmarks in 
http://www.cecm.sfu.ca/~rpearcea/sdmp/2008_04_01/benchmarks.txt
6376 x 46376 = 635376 terms (dense, 4 variables)
26599 x 36365 = 19631157 terms (sparse, 10 variables)
6188 x 6188 = 5821335 terms (very sparse, 5 variables)
531441 / 15625 terms = 15625 quotient + 515816 remainder (dense, 6
variables)

The last one is a pseudo-division, and Singular messed up.  I bet it
scales the entire dividend every time something is merged into the
geobucket, or whenever the leading term of the geobucket is computed.
This could be easily fixed.  Otherwise Singular performed very well on
the division benchmarks.

Also, while I'm on the topic of Singular's geobucket implementation, I
looked at the code and it looks like there are buckets for each
coefficient ?  I'm not sure.  Anyways, you should store a denominator
for each bucket, and integer coefficients in the polynomials.  Then
store a multiplier for each bucket that you use to merge leading
terms.  For a pseudo-division f / g = (q,r) that would give you N*log
N multiplications in Z, where N = f + q*g.  That's not as good as my
implementation, but it would perform well in practice.

> Note, that the example is dense.
> If he is using fast (Strassen-like) algorithms, then it is quite
> natural, to achieve
> good results in these problems.

I can assure you, for an n x m multiplication we multiply, sort, and
merge n*m products of terms.  The sorting is O(n*m*log(min(n,m))).
For a division f/g = (q,r), the sorting is O(f + q*g*log(min(q,g)))
comparisons, whereas I believe geobuckets are N*log N where N = f +
q*g in the worst case and N*log(g) on average.

Also I would like to credit the Singular group for designing the fast
packed monomial representations that I use (with modifications).  That
is in the paper of course.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: sdmp - closed-source library for sparse multivariate polynomial arithmetic

2008-04-02 Thread Michael Brickenstein

Hi Roman!
Sorry, I just saw the first problem.

The coefficients for each bucket are disabled at the moment.
We put some work in it, but we had the problem, that every
modification to Singular: Polynomial ring over rings (instead fields),
noncommutative polynomial rings (this was the guilty one) had its own
routines accessing buckets,
which were at some point incompatible with that. Then we gave up,
since for our normal use cases, the coefficients only had very subtle
effect.

Thank you for your comments on Singular.
Naming this weak points hopefully leads to improvements.
I think that the leading term of g is not normalized during pseudo
division, but that would have to be checked.

Best regards.
Michael

On 2 Apr., 09:39, Roman Pearce <[EMAIL PROTECTED]> wrote:
> On Apr 1, 11:36 pm, Michael Brickenstein <[EMAIL PROTECTED]> wrote:
>
> > I don't find it very impressive, posting some benchmark for just one
> > example.
>
> There are 4 benchmarks 
> inhttp://www.cecm.sfu.ca/~rpearcea/sdmp/2008_04_01/benchmarks.txt
> 6376 x 46376 = 635376 terms (dense, 4 variables)
> 26599 x 36365 = 19631157 terms (sparse, 10 variables)
> 6188 x 6188 = 5821335 terms (very sparse, 5 variables)
> 531441 / 15625 terms = 15625 quotient + 515816 remainder (dense, 6
> variables)
>
> The last one is a pseudo-division, and Singular messed up.  I bet it
> scales the entire dividend every time something is merged into the
> geobucket, or whenever the leading term of the geobucket is computed.
> This could be easily fixed.  Otherwise Singular performed very well on
> the division benchmarks.
>
> Also, while I'm on the topic of Singular's geobucket implementation, I
> looked at the code and it looks like there are buckets for each
> coefficient ?  I'm not sure.  Anyways, you should store a denominator
> for each bucket, and integer coefficients in the polynomials.  Then
> store a multiplier for each bucket that you use to merge leading
> terms.  For a pseudo-division f / g = (q,r) that would give you N*log
> N multiplications in Z, where N = f + q*g.  That's not as good as my
> implementation, but it would perform well in practice.
>
> > Note, that the example is dense.
> > If he is using fast (Strassen-like) algorithms, then it is quite
> > natural, to achieve
> > good results in these problems.
>
> I can assure you, for an n x m multiplication we multiply, sort, and
> merge n*m products of terms.  The sorting is O(n*m*log(min(n,m))).
> For a division f/g = (q,r), the sorting is O(f + q*g*log(min(q,g)))
> comparisons, whereas I believe geobuckets are N*log N where N = f +
> q*g in the worst case and N*log(g) on average.
>
> Also I would like to credit the Singular group for designing the fast
> packed monomial representations that I use (with modifications).  That
> is in the paper of course.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Output Form versus Internal Structure

2008-04-02 Thread William Stein

On Tue, Apr 1, 2008 at 11:28 PM, David Roe <[EMAIL PROTECTED]> wrote:
>
>  That's the plan.  Though I'll have to ask around to figure out how to
>  determine if _repr_ is being called from the notebook or iPython.

In most cases the base class __repr__ just calls _repr_, and the
notebook and/or Ipython no nothing about this -- they always call
__repr__ (or __str__).

def __repr__(self):
if hasattr(self, '__custom_name'):
name = self.__custom_name
if name is not None:
return name
if hasattr(self, '_repr_'):
return self._repr_()
return str(type(self))


>  David
>
>
>
>  On Tue, Apr 1, 2008 at 7:01 PM, Dan Drake <[EMAIL PROTECTED]> wrote:
>  > Robert Bradshaw wrote:
>  >  > Thanks for your input. We are considering a more advanced model
>  >  > (David Roe has lots of ideas on this front), but this falls outside
>  >  > of the central focus coercion scheme. (This is one reason to use
>  >  > _repr_ rather than the Python __repr__ so that the base object's
>  >  > __repr__ can do more sophisticated things (although now it just calls
>  >  > _repr_).
>  >
>  >  I would really like something like this. For example, take Young
>  >  tableaux: when working in the Sage interpreter, I might want a tableau
>  >  to print out like this:
>  >
>  >7532
>  >642
>  >632
>  >1
>  >
>  >  but in the notebook interface, or for including into a LaTeX document, I
>  >  might want the tableau to print out a TikZ picture environment:
>  >
>  >   \begin{tikzpicture}
>  > \draw ...
>  >   \end{tikzpicture}
>  >
>  >  Also, Francophones will want those same things printed upside down. :)
>  >  So more flexibility, and multiple printed representations, would be very
>  >  nice.
>  >
>  >  Dan
>  >
>  >  --
>  >  ---  Dan Drake <[EMAIL PROTECTED]>
>  >  -  KAIST Department of Mathematical Sciences
>  >  ---  http://math.kaist.ac.kr/~drake
>  >
>  > -BEGIN PGP SIGNATURE-
>  >  Version: GnuPG v1.4.6 (GNU/Linux)
>  >
>  >  iD8DBQFH8ujrr4V8SljC5LoRAv81AJ0YtScjIEi9FCAQ9uk12ZcIJcCTJwCeK1Nc
>  >  fs73ezUTiHz0Dj+6Cf2F2f0=
>  >  =hS/w
>  >  -END PGP SIGNATURE-
>
>
> >
>  >
>
>  >
>



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

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



[sage-devel] Re: Sage 3.0.alpha0 released

2008-04-02 Thread Alex Ghitza

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Builds and tests without problems on 32-bit machine running Gentoo.

Alex



mabshoff wrote:
| Hello folks,
|
| the Sage 3.0 release cycle has started. So far we have merged
|
|  * the new Crystal code
|  * PolyBoRi 0.3.1
|  * plenty of Debian build fixes
|
| Alpha1 is planned for the next 36 hours and should finally make
| compilation with gcc 4.3 possible.
|
| The source and binaries are in the usual place:
|
|
http://sage.math.washington.edu/home/mabshoff/release-cycles-3.0/sage-3.0.alpha0.tar
|
|
http://sage.math.washington.edu/home/mabshoff/release-cycles-3.0/sage-3.0.alpha0-sage.math-only-x86_64-Linux.tar.gz
|
| As usual please build, doctest and report any issue. There
| are currently no known doctest failures. If you have patches
| outstanding waiting to be merged please make sure they
| apply cleanly against this tree or otherwise please rebase.
| There are plenty of patches to review, so feel free to browse
| trac for interesting things to do.
|
| Cheers,
|
| Michael
|
| Merged in alpha0:
|
| #1452: Robert Miller: Guava - in gap-4.4.10, Leon's code is never
|compiled
| #1863: Martin Albrecht: implement f.change_ring(R) for f a
|multivariate polynomial
| #2060: Martin Albrecht, Burin Erocal: Update PolyBoRi interface
|and spkg to 0.3.1
| #2200: Tim Abbott: copyright documentation for various spkgs
| #2477: Robert Miller, Jason Grout: 3d plotting of graphs -- need
|to force aspect_ratio=[1,1,1] by default
| #2620: Martin Albrecht: generator generator support for ideal
| #2641: David Joyner: GAP: replace guava 3.1 by guava 3.3
| #2651: Jason Grout, Ryan Hinton, Martin Albrecht: rewrite matrix()
|constructor
| #2667: Ryan Hinton, Carl Witty, Mike Hansen, Robert Bradshaw:
|transform.pyx calls matrix() with an RDF vector inside of a
|list instead of a flat list.
| #2698: John Cremona, Alex Ghitza: Small improvements to integer
|lcm, gcd on lists and a new xlcm function
| #2726: Tim Abbott: SAGE debian build system update
| #2729: Robert Bradshaw: tiny jmol spheres have holes
| #2735: Tim Abbott: minor eclib build system improvements
| #2738: Martin Albrecht: LaTeX description environment in docstrings
| #2742: Jason Bandlow, Dan Bump, Mike Hansen, Anne Schilling, Nicolas
|Thiery, Justin Walker: add crystals to the main branch of Sage
| #2747: Tim Abbott: fix SAGE doctest import errors due to introdution
|of $SAGE_TESTDIR
| #2752: Michael Kallweit:  Speedup for all_paths()
| #2756: Tim Abbott: Debianize GAP spkg
| #2757: Tim Abbott: Debianize scipy_sandbox package
| #2758: Tim Abbott: iml and linbox updates for Debian gfortran
|transition
| #2759: Tim Abbott: SAGE debian/ directory update
| #2760: Tim Abbott: Debian amd64 fixes for NTL
| #2761: Tim Abbott: Debian amd64 fixes for tachyon
| #2762: Tim Abbott: Debian amd64 fixes for FLINT
| #2763: Tim Abbott: Debian amd64 fixes for rubiks
| |
|


- --
Alexandru Ghitza
Assistant Professor
Department of Mathematics
Colby College
Waterville, ME 04901
http://bayes.colby.edu/~ghitza/
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH84eHdZTaNFFPILgRAiL5AJ0WXUNAAoswWpmRu8jjoRc6INU2igCgn04R
5/yi9qhY1pStCzvNNnTZsBE=
=nN/z
-END PGP SIGNATURE-

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



[sage-devel] Re: Sage 3.0.alpha0 released

2008-04-02 Thread William Stein

On Wed, Apr 2, 2008 at 6:17 AM, Alex Ghitza <[EMAIL PROTECTED]> wrote:
>
>  -BEGIN PGP SIGNED MESSAGE-
>  Hash: SHA1
>
>  Builds and tests without problems on 32-bit machine running Gentoo.
>

* Works on sage.math.

* integer.pyx fails on meccah (32-bit athlon):

sage -t  devel/sage-main/sage/rings/integer.pyx


Unhandled SIGSEGV: A segmentation fault occured in SAGE.
This probably occured because a *compiled* component
of SAGE has a bug in it (typically accessing invalid memory)
or is not properly wrapped with _sig_on, _sig_off.
You might want to run SAGE under gdb with 'sage -gdb' to debug this.
SAGE will now terminate (sorry).


* works fine on osx ppc

 * debian 32/rhel 5 intel: segfault in integer.pyx
   pbori.pyx is busted:
sage -t  devel/sage-main/sage/rings/polynomial/pbori.pyx
**
File "pbori.pyx", line 2305:
sage: f(x=var('a'),y=var('b'),z=var('c'))
Exception raised:
Traceback (most recent call last):
  File "/home/was/build/sage-3.0.alpha0/local/lib/python2.5/doctest.py",
line 1212, in __run
compileflags, 1) in test.globs
  File "", line 1, in 
f(x=var('a'),y=var('b'),z=var('c'))###line 2305:
sage: f(x=var('a'),y=var('b'),z=var('c'))
  File "sage_object.pyx", line 92, in
sage.structure.sage_object.SageObject.__repr__
  File "/home/was/build/sage-3.0.alp

 * debian64 intel: pbori.pyx broken.

 * ubuntu32bit intel -- integer.pyx segfault

gdb traceback:



Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210173232 (LWP 6821)]
PyObject_Malloc (nbytes=26) at Objects/obmalloc.c:747
747 Objects/obmalloc.c: No such file or directory.
in Objects/obmalloc.c
(gdb)
#0  PyObject_Malloc (nbytes=26) at Objects/obmalloc.c:747
#1  0x080912f5 in string_concat (a=0xb76888c0, bb=0xb7687440) at
Objects/stringobject.c:975
#2  0x0809145e in PyString_Concat (pv=0xbfdfc348, w=0xb7687440)
at Objects/stringobject.c:4052
#3  0x080c1a8f in string_concatenate (v=0xb76888c0, w=0xb7687440, f=0x821c93c,
next_instr=0xb76843b8 "|\001") at Python/ceval.c:4304
#4  0x080c71f9 in PyEval_EvalFrameEx (f=0x821c93c, throwflag=0) at
Python/ceval.c:1137
#5  0x080c95a5 in PyEval_EvalCodeEx (co=0xb768b188,
globals=0xb7d8479c, locals=0x0,
args=0xb7d9ed78, argcount=1, kws=0x0, kwcount=0, defs=0x0,
defcount=0, closure=0x0)
at Python/ceval.c:2831
#6  0x0831 in function_call (func=0xb7695aac, arg=0xb7d9ed6c, kw=0x0)
at Objects/funcobject.c:517
#7  0x0805c6c7 in PyObject_Call (func=0xa29b000, arg=0xb7d9ed6c, kw=0x0)
at Objects/abstract.c:1860
#8  0x080c17bc in PyEval_CallObjectWithKeywords (func=0xb7695aac,
arg=0xb7d9ed6c, kw=0x0)
at Python/ceval.c:3433
#9  0x080bf396 in builtin_map (self=0x0, args=0x9dbda0c) at
Python/bltinmodule.c:948
#10 0x080c837c in PyEval_EvalFrameEx (f=0x9e72afc, throwflag=0) at
Python/ceval.c:3564
#11 0x080c95a5 in PyEval_EvalCodeEx (co=0xb603a020,
globals=0xb60294f4, locals=0x0,
args=0x9e853ac, argcount=2, kws=0x9e853b4, kwcount=0, defs=0x0,
defcount=0, closure=0x0)
at Python/ceval.c:2831
#12 0x080c7a69 in PyEval_EvalFrameEx (f=0x9e85224, throwflag=0) at
Python/ceval.c:3660
#13 0x080c95a5 in PyEval_EvalCodeEx (co=0x8fb9b18, globals=0x8f5279c,
locals=0x0,
args=0x94145d4, argcount=1, kws=0x94145d8, kwcount=0,
defs=0x91bec98, defcount=2,
closure=0x0) at Python/ceval.c:2831
#14 0x080c7a69 in PyEval_EvalFrameEx (f=0x9414494, throwflag=0) at
Python/ceval.c:3660
#15 0x080c87a5 in PyEval_EvalFrameEx (f=0xa285efc, throwflag=0) at
Python/ceval.c:3650
#16 0x080c87a5 in PyEval_EvalFrameEx (f=0xa285d1c, throwflag=0) at
Python/ceval.c:3650
#17 0x080c95a5 in PyEval_EvalCodeEx (co=0x8f979f8, globals=0x8f5279c,
locals=0x0,
args=0x93a6f18, argcount=1, kws=0x0, kwcount=0, defs=0x91bed18,
defcount=1, closure=0x0)
at Python/ceval.c:2831
#18 0x0831 in function_call (func=0x91c5df4, arg=0x93a6f0c, kw=0x0)
at Objects/funcobject.c:517
#19 0x0805c6c7 in PyObject_Call (func=0xa29b000, arg=0x93a6f0c, kw=0x0)
at Objects/abstract.c:1860
#20 0x08062824 in instancemethod_call (func=0x98dabbc, arg=0x93a6f0c, kw=0x0)
at Objects/classobject.c:2497
#21 0x0805c6c7 in PyObject_Call (func=0xa29b000, arg=0xb7da302c, kw=0x0)
at Objects/abstract.c:1860
#22 0xb75dd709 in
__pyx_pf_4sage_9structure_11sage_object_10SageObject___repr__ (
__pyx_v_self=0x9e27644) at sage/structure/sage_object.c:626
#23 0x0805c6c7 in PyObject_Call (func=0xa29b000, arg=0xb7da302c, kw=0x0)
at Objects/abstract.c:1860
#24 0x080c17bc in PyEval_CallObjectWithKeywords (func=0x9dbd2ac,
arg=0xb7da302c, kw=0x0)
at Python/ceval.c:3433
#25 0x0809c42a in slot_tp_repr (self=0x9e27644) at Objects/typeobject.c:4547
#26 0x080892d5 in PyObject_Repr (v=0x9e27644) at Objects/object.c:361
#27 0x080705ac in PyFile_WriteObject (v=0x9e27644, f=0x9db0

[sage-devel] Re: Sage 3.0.alpha0 released

2008-04-02 Thread mabshoff



On Apr 2, 3:32 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Wed, Apr 2, 2008 at 6:17 AM, Alex Ghitza <[EMAIL PROTECTED]> wrote:
>
> >  -BEGIN PGP SIGNED MESSAGE-
> >  Hash: SHA1
>
> >  Builds and tests without problems on 32-bit machine running Gentoo.
>
> * Works on sage.math.
>
> * integer.pyx fails on meccah (32-bit athlon):
>
> sage -t  devel/sage-main/sage/rings/integer.pyx
>
> 
> Unhandled SIGSEGV: A segmentation fault occured in SAGE.
> This probably occured because a *compiled* component
> of SAGE has a bug in it (typically accessing invalid memory)
> or is not properly wrapped with _sig_on, _sig_off.
> You might want to run SAGE under gdb with 'sage -gdb' to debug this.
> SAGE will now terminate (sorry).
> 
>
> * works fine on osx ppc
>
>  * debian 32/rhel 5 intel: segfault in integer.pyx
>    pbori.pyx is busted:
> sage -t  devel/sage-main/sage/rings/polynomial/pbori.pyx
> **
> File "pbori.pyx", line 2305:
>     sage: f(x=var('a'),y=var('b'),z=var('c'))
> Exception raised:
>     Traceback (most recent call last):
>       File "/home/was/build/sage-3.0.alpha0/local/lib/python2.5/doctest.py",
> line 1212, in __run
>         compileflags, 1) in test.globs
>       File "", line 1, in 
>         f(x=var('a'),y=var('b'),z=var('c'))###line 2305:
>     sage: f(x=var('a'),y=var('b'),z=var('c'))
>       File "sage_object.pyx", line 92, in
> sage.structure.sage_object.SageObject.__repr__
>       File "/home/was/build/sage-3.0.alp
>
>  * debian64 intel: pbori.pyx broken.
>
>  * ubuntu32bit intel -- integer.pyx segfault


I suspect I am hitting the same problem with Python 2.5.2 - see #2344.
Since that (or a similar segfault) is a blocker from getting 2.5.2 in
(which I need for OSX 10.5 64 bit) I would really like to get that
resolved.

William: Can you run the integer.pyx with "-verbose" to see what
crahes in detail?

Cheers,

Michael

> gdb traceback:
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1210173232 (LWP 6821)]
> PyObject_Malloc (nbytes=26) at Objects/obmalloc.c:747
> 747     Objects/obmalloc.c: No such file or directory.
>         in Objects/obmalloc.c
> (gdb)
> #0  PyObject_Malloc (nbytes=26) at Objects/obmalloc.c:747
> #1  0x080912f5 in string_concat (a=0xb76888c0, bb=0xb7687440) at
> Objects/stringobject.c:975
> #2  0x0809145e in PyString_Concat (pv=0xbfdfc348, w=0xb7687440)
>     at Objects/stringobject.c:4052
> #3  0x080c1a8f in string_concatenate (v=0xb76888c0, w=0xb7687440, f=0x821c93c,
>     next_instr=0xb76843b8 "|\001") at Python/ceval.c:4304
> #4  0x080c71f9 in PyEval_EvalFrameEx (f=0x821c93c, throwflag=0) at
> Python/ceval.c:1137
> #5  0x080c95a5 in PyEval_EvalCodeEx (co=0xb768b188,
> globals=0xb7d8479c, locals=0x0,
>     args=0xb7d9ed78, argcount=1, kws=0x0, kwcount=0, defs=0x0,
> defcount=0, closure=0x0)
>     at Python/ceval.c:2831
> #6  0x0831 in function_call (func=0xb7695aac, arg=0xb7d9ed6c, kw=0x0)
>     at Objects/funcobject.c:517
> #7  0x0805c6c7 in PyObject_Call (func=0xa29b000, arg=0xb7d9ed6c, kw=0x0)
>     at Objects/abstract.c:1860
> #8  0x080c17bc in PyEval_CallObjectWithKeywords (func=0xb7695aac,
> arg=0xb7d9ed6c, kw=0x0)
>     at Python/ceval.c:3433
> #9  0x080bf396 in builtin_map (self=0x0, args=0x9dbda0c) at
> Python/bltinmodule.c:948
> #10 0x080c837c in PyEval_EvalFrameEx (f=0x9e72afc, throwflag=0) at
> Python/ceval.c:3564
> #11 0x080c95a5 in PyEval_EvalCodeEx (co=0xb603a020,
> globals=0xb60294f4, locals=0x0,
>     args=0x9e853ac, argcount=2, kws=0x9e853b4, kwcount=0, defs=0x0,
> defcount=0, closure=0x0)
>     at Python/ceval.c:2831
> #12 0x080c7a69 in PyEval_EvalFrameEx (f=0x9e85224, throwflag=0) at
> Python/ceval.c:3660
> #13 0x080c95a5 in PyEval_EvalCodeEx (co=0x8fb9b18, globals=0x8f5279c,
> locals=0x0,
>     args=0x94145d4, argcount=1, kws=0x94145d8, kwcount=0,
> defs=0x91bec98, defcount=2,
>     closure=0x0) at Python/ceval.c:2831
> #14 0x080c7a69 in PyEval_EvalFrameEx (f=0x9414494, throwflag=0) at
> Python/ceval.c:3660
> #15 0x080c87a5 in PyEval_EvalFrameEx (f=0xa285efc, throwflag=0) at
> Python/ceval.c:3650
> #16 0x080c87a5 in PyEval_EvalFrameEx (f=0xa285d1c, throwflag=0) at
> Python/ceval.c:3650
> #17 0x080c95a5 in PyEval_EvalCodeEx (co=0x8f979f8, globals=0x8f5279c,
> locals=0x0,
>     args=0x93a6f18, argcount=1, kws=0x0, kwcount=0, defs=0x91bed18,
> defcount=1, closure=0x0)
>     at Python/ceval.c:2831
> #18 0x0831 in function_call (func=0x91c5df4, arg=0x93a6f0c, kw=0x0)
>     at Objects/funcobject.c:517
> #19 0x0805c6c7 in PyObject_Call (func=0xa29b000, arg=0x93a6f0c, kw=0x0)
>     at Objects/abstract.c:1860
> #20 0x08062824 in instancemethod_call (func=0x98dabbc, arg=0x93a6f0c, kw=0x0)
>     at Objects/classobject.c:2497
> #21 0x0805c6c7 in PyObject_Call (func=0xa29b000, arg=0xb7da302c, kw=0x0)
>     at Objects/a

[sage-devel] Re: Sage 3.0.alpha0 released

2008-04-02 Thread William Stein

On Wed, Apr 2, 2008 at 6:45 AM, mabshoff
<[EMAIL PROTECTED]> wrote:
>
>
>
>  On Apr 2, 3:32 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
>
>
> > On Wed, Apr 2, 2008 at 6:17 AM, Alex Ghitza <[EMAIL PROTECTED]> wrote:
>  >
>  > >  -BEGIN PGP SIGNED MESSAGE-
>  > >  Hash: SHA1
>  >
>  > >  Builds and tests without problems on 32-bit machine running Gentoo.
>  >
>  > * Works on sage.math.
>  >
>  > * integer.pyx fails on meccah (32-bit athlon):
>  >
>  > sage -t  devel/sage-main/sage/rings/integer.pyx
>  >
>  > 
>  > Unhandled SIGSEGV: A segmentation fault occured in SAGE.
>  > This probably occured because a *compiled* component
>  > of SAGE has a bug in it (typically accessing invalid memory)
>  > or is not properly wrapped with _sig_on, _sig_off.
>  > You might want to run SAGE under gdb with 'sage -gdb' to debug this.
>  > SAGE will now terminate (sorry).
>  > 
>  >
>  > * works fine on osx ppc
>  >
>  >  * debian 32/rhel 5 intel: segfault in integer.pyx
>  >pbori.pyx is busted:
>  > sage -t  devel/sage-main/sage/rings/polynomial/pbori.pyx
>  > **
>  > File "pbori.pyx", line 2305:
>  > sage: f(x=var('a'),y=var('b'),z=var('c'))
>  > Exception raised:
>  > Traceback (most recent call last):
>  >   File 
> "/home/was/build/sage-3.0.alpha0/local/lib/python2.5/doctest.py",
>  > line 1212, in __run
>  > compileflags, 1) in test.globs
>  >   File "", line 1, in 
>  > f(x=var('a'),y=var('b'),z=var('c'))###line 2305:
>  > sage: f(x=var('a'),y=var('b'),z=var('c'))
>  >   File "sage_object.pyx", line 92, in
>  > sage.structure.sage_object.SageObject.__repr__
>  >   File "/home/was/build/sage-3.0.alp
>  >
>  >  * debian64 intel: pbori.pyx broken.
>  >
>  >  * ubuntu32bit intel -- integer.pyx segfault
>
>
>  I suspect I am hitting the same problem with Python 2.5.2 - see #2344.
>  Since that (or a similar segfault) is a blocker from getting 2.5.2 in
>  (which I need for OSX 10.5 64 bit) I would really like to get that
>  resolved.
>
>  William: Can you run the integer.pyx with "-verbose" to see what
>  crahes in detail?

Trying:
(-Integer(1))**(Integer(1)/Integer(3))###line 1118:_sage_>>> (-1)^(1/3)
Expecting:
(-1)^(1/3)



Unhandled SIGSEGV: A segmentation fault occured in SAGE.
This probably occured because a *compiled* component
of SAGE has a bug in it (typically accessing invalid memory)
or is not properly wrapped with _sig_on, _sig_off.
You might want to run SAGE under gdb with 'sage -gdb' to debug this.
SAGE will now terminate (sorry).


NOTE: from the command line that input doesn't crash:

[EMAIL PROTECTED] sage-3.0.alpha0]$ ./sage
--
| SAGE Version 3.0.alpha0, Release Date: 2008-04-01  |
| Type notebook() for the GUI, and license() for information.|
--

sage: (-1)^(1/3)
(-1)^(1/3)


---

I can give you an account on one of the 32-bit linux'es...

William

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



[sage-devel] derivatives of elements of fraction fields

2008-04-02 Thread Michel

Hi,

A short remark. It seems that taking the derivative of an element of a
fraction field is not supported at this point. This feels somewhat
inconsistent (tested with sage 2.10.4)

sage: R=QQ['x']
sage: x=R.gen()
sage: derivative(x^2,x)
2*x
sage: derivative(1/x,x)
---
 Traceback (most recent call
last)


More fundamentally, I wonder if it makes sense to define the general
concept of a derivation.
Derivations are given by their values on generators so they fit well
in the sage framework.
The advantage of having abstract derivations would be that one could
add them, take their
commutatior etc

Regards,
Michel


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



[sage-devel] Re: Sage 3.0.alpha0 released

2008-04-02 Thread Jaap Spies

mabshoff wrote:
> Hello folks,
> 
> the Sage 3.0 release cycle has started. So far we have merged
> 
>  * the new Crystal code
>  * PolyBoRi 0.3.1
>  * plenty of Debian build fixes
> 
> Alpha1 is planned for the next 36 hours and should finally make
> compilation with gcc 4.3 possible.
> 
> The source and binaries are in the usual place:
> 

On Fedora 7, 32 bits:

--
All tests passed!
Total time for all tests: 3915.4 seconds
grep: .test-dsage.log: No such file or directory
Please see /home/jaap/downloads/sage-3.0.alpha0/tmp/test.log for the complete 
log from this test.
[EMAIL PROTECTED] sage-3.0.alpha0]$

Jaap


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



[sage-devel] Experimental Gröbner Bases over Rings via Singular CVS

2008-04-02 Thread Martin Albrecht

Hi there,

while conversing with Hans Schönemann about GCC 4.3 support for Singular the 
topic of shipping CVS code of Singular came up. The CVS version of Singular 
has experimental (and thus possibly broken) support for Gröbner bases over 
rings (Z, Z/n).

Basically, we have the okay from Hans to ship this version iff we make it 
perfectly clear that this stuff is experimental.

Also, the implementation is still considered too slow by the Singular team.

However, as there was pretty strong demand for this on this list several times 
I could try to provide an experimental singular-cvs SPKG + wrapper for those 
interested to play around. The gathered feedback/excitement could help to 
improve the implementation or maybe somebody wants to even jump in and help 
out. 

If we want this, then I propose the following:

 * Get the okay from Oliver Wienand the main author of the code. I think 
Oliver is reading this list.
 * I try to provide an SPKG based on the most current Singular checkout + a 
wrapper (maybe only via pexpect for now)
 * Whenever someone tries to use the code we print a big fat warning that this 
is alpha code.

Thoughts?
Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


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



[sage-devel] Re: Experimental Gröbner Bases over Rin gs via Singular CVS

2008-04-02 Thread William Stein

On Wed, Apr 2, 2008 at 8:41 AM, Martin Albrecht
<[EMAIL PROTECTED]> wrote:
>
>  Hi there,
>
>  while conversing with Hans Schönemann about GCC 4.3 support for Singular the
>  topic of shipping CVS code of Singular came up. The CVS version of Singular
>  has experimental (and thus possibly broken) support for Gröbner bases over
>  rings (Z, Z/n).
>
>  Basically, we have the okay from Hans to ship this version iff we make it
>  perfectly clear that this stuff is experimental.
>
>  Also, the implementation is still considered too slow by the Singular team.
>
>  However, as there was pretty strong demand for this on this list several 
> times
>  I could try to provide an experimental singular-cvs SPKG + wrapper for those
>  interested to play around. The gathered feedback/excitement could help to
>  improve the implementation or maybe somebody wants to even jump in and help
>  out.
>
>  If we want this, then I propose the following:
>
>   * Get the okay from Oliver Wienand the main author of the code. I think
> Oliver is reading this list.
>   * I try to provide an SPKG based on the most current Singular checkout + a
> wrapper (maybe only via pexpect for now)
>   * Whenever someone tries to use the code we print a big fat warning that 
> this
> is alpha code.
>
>  Thoughts?

Make sure the warning is via the verbose command with level=0.
Alternatively, we could have a command
I.groebner_experimental_alpha_version()
or
   I.groebner(algorithm="singular:experimental...")
and if either is explicitly selected then there is no other warning.

 -- William

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



[sage-devel] WIMS

2008-04-02 Thread David Kohel

I learned of WIMS (http://wims.unice.fr/) by virtue of the
announcement of a new lecturer
position here in Luminy, who is supposed to be responsible for
computer-based teaching
with WIMS (http://wims.unice.fr/).  It overlaps many of the teaching-
related goals of
sage.  I just downloaded it and haven't yet successfully run it on
MacOSX, but it has a
huge overlap in underlying GPL code (pari, maxima, gap) with sage,
lots of graphics
applications, and associated exercises which are an integral part of
WIMS (teaching being
the driving force).  I wonder what solutions or applications they have
which would could
be run from the sage notebook, and what complementary solutions sage
and WIMS have
found which could be mutually borrowed.

--David


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



[sage-devel] bug in factoring over number fields?

2008-04-02 Thread David Harvey

Is the following a bug?

sage: K. = NumberField(x^2 + 1)
sage: R. = PolynomialRing(K)
sage: f = 2*y^2 + 2*z^2
sage: F = f.factor(); F
2 * (y + (-a)*z) * (y + a*z)
sage: F.unit_part()
1

Shouldn't the unit part be 2? It seems to be listing 2 as a bona fide  
factor.

(This was reported by Genya Zaytman.)

david


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



[sage-devel] Re: WIMS

2008-04-02 Thread Jaap Spies

David Kohel wrote:
> I learned of WIMS (http://wims.unice.fr/) by virtue of the
> announcement of a new lecturer
> position here in Luminy, who is supposed to be responsible for
> computer-based teaching
> with WIMS (http://wims.unice.fr/).  It overlaps many of the teaching-
> related goals of
> sage.  I just downloaded it and haven't yet successfully run it on
> MacOSX, but it has a
> huge overlap in underlying GPL code (pari, maxima, gap) with sage,
> lots of graphics
> applications, and associated exercises which are an integral part of
> WIMS (teaching being
> the driving force).  I wonder what solutions or applications they have
> which would could
> be run from the sage notebook, and what complementary solutions sage
> and WIMS have
> found which could be mutually borrowed.
> 

I once (long ago) used WIMS as a teaching tool. You can install it
on a local server and give students access to it.

WIMS can be made more viable by integrating Sage! I don't see any profit
the other way around. Interfacing to WIMS seems to be problematic.

Jaap


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



[sage-devel] Re: bug in factoring over number fields?

2008-04-02 Thread John Cremona

You are right.  As a list, F has three elements of which the first is
(2,1) -- i.e. 2 to the power 1 -- but when the list is converted to a
Factorization type this first factor is left alone instead of being
converted into the __unit part.

John

On 02/04/2008, David Harvey <[EMAIL PROTECTED]> wrote:
>
>  Is the following a bug?
>
>  sage: K. = NumberField(x^2 + 1)
>  sage: R. = PolynomialRing(K)
>  sage: f = 2*y^2 + 2*z^2
>  sage: F = f.factor(); F
>  2 * (y + (-a)*z) * (y + a*z)
>  sage: F.unit_part()
>  1
>
>  Shouldn't the unit part be 2? It seems to be listing 2 as a bona fide
>  factor.
>
>  (This was reported by Genya Zaytman.)
>
>  david
>
>
>  >
>

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



[sage-devel] Re: WIMS

2008-04-02 Thread mabshoff



On Apr 2, 6:44 pm, Jaap Spies <[EMAIL PROTECTED]> wrote:
> David Kohel wrote:
> > I learned of WIMS (http://wims.unice.fr/) by virtue of the
> > announcement of a new lecturer
> > position here in Luminy, who is supposed to be responsible for
> > computer-based teaching
> > with WIMS (http://wims.unice.fr/).  It overlaps many of the teaching-
> > related goals of
> > sage.  I just downloaded it and haven't yet successfully run it on
> > MacOSX, but it has a
> > huge overlap in underlying GPL code (pari, maxima, gap) with sage,
> > lots of graphics
> > applications, and associated exercises which are an integral part of
> > WIMS (teaching being
> > the driving force).  I wonder what solutions or applications they have
> > which would could
> > be run from the sage notebook, and what complementary solutions sage
> > and WIMS have
> > found which could be mutually borrowed.
>
> I once (long ago) used WIMS as a teaching tool. You can install it
> on a local server and give students access to it.
>
> WIMS can be made more viable by integrating Sage! I don't see any profit
> the other way around. Interfacing to WIMS seems to be problematic.
>
> Jaap

I think WIMS is quote nice and does mostly address the educational
market. Sage could certainly take a look at the modules they have for
classes and courses. Most of their teaching material seems to be in
French with some of it also available in Spanish, Dutch and Cantonese
[or is it Mandarin - since there is no such thing as Chinese] and
several other languages.

As far as combining Sage as an engine for WIMS: It should be fairly
easy looking at the Interface code, but the subset of functionality
they use from pari is small and they do not seems to use the pari C
interface at all. It is also GPL V2 or later.

My Conclusion? I don't know if there is more than potential for cross
pollination. Do you know the developers or somebody from the
community? Are they aware of Sage? Have they voiced interest?

Cheers,

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



[sage-devel] Re: _fast_float_ for symbolic equalities/inequalities

2008-04-02 Thread Robert Bradshaw


On Apr 1, 2008, at 11:59 PM, Jason Grout wrote:
>
> Robert Bradshaw wrote:
>> On Apr 1, 2008, at 9:15 PM, Jason Grout wrote:
>>
>>> I'm trying to add _fast_float_ functionality to SymbolicEquation
>>> objects.  However, a perusal of the sage.ext.fast_eval.pyx file
>>> seems to
>>> indicate that the operations <, <=, ==, >=, >, and != are not
>>> supported
>>> by the fast_float machinery.  Is that correct?
>>
>> That is correct.
>>
>>> If so, how do I add
>>> these operations?  If not, then how do I construct a FastDoubleFunc
>>> object appropriately?
>>>
>>> Or, should I just use the python operators and call fast_float on
>>> each side?
>>
>> The latter is what I would do--the result of evaluating a symbolic
>> equation object is a boolean not a float so it would be kind of hard
>> to hook into this mechanism anyways (well, one could represent True
>> by one float and False by another, but I don't think that's a very
>> clean solution).
>
>
> Sorry, Robert, I didn't see your message until just now (after all the
> work was done).  If you want to veto the patch, I understand and  
> I'll do
> it the way you suggest.
>
> The use-case I had in mind called for getting 0 for false and 1 for
> true, so that is how I implemented it (e.g., contour_plot(x (x,-1,1),
> (y,-1,1))).
>
> Still, it was fun to muck around in the fast_float file.  You're  
> amazing!

Thanks.

I put a comment up on trac, but it boils down to

sage: f = (x == 1)
sage: g = (1 == x)
sage: bool(f+g)
True
sage: ff = f._fast_float_('x') + g._fast_float_('x')
sage: ff(0)
0.0

but I think piecewise functions would be a good way to implement the  
desired functionality.

- Robert


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



[sage-devel] Re: WIMS

2008-04-02 Thread Jaap Spies

mabshoff wrote:
> 
> 
> On Apr 2, 6:44 pm, Jaap Spies <[EMAIL PROTECTED]> wrote:

>> WIMS can be made more viable by integrating Sage! I don't see any profit
>> the other way around. Interfacing to WIMS seems to be problematic.
>>
>> Jaap
> 
> I think WIMS is quote nice and does mostly address the educational
> market. Sage could certainly take a look at the modules they have for
> classes and courses. Most of their teaching material seems to be in
> French with some of it also available in Spanish, Dutch and Cantonese
> [or is it Mandarin - since there is no such thing as Chinese] and
> several other languages.
> 


> As far as combining Sage as an engine for WIMS: It should be fairly
> easy looking at the Interface code, but the subset of functionality
> they use from pari is small and they do not seems to use the pari C
> interface at all. It is also GPL V2 or later.
> 
> My Conclusion? I don't know if there is more than potential for cross
> pollination. Do you know the developers or somebody from the
> community? Are they aware of Sage? Have they voiced interest?
>

There is not much of a community as far as I know. I had some contacts
with the one and only developer Xiao Gang, but as I said this is long time
ago (> 5 years). At that time I'm pretty sure they were not aware of
Sage :-)! Maybe now after Sage won the Trophées du Libre?

WIMS can greatly win by adopting Sage!

Jaap



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



[sage-devel] Re: derivatives of elements of fraction fields

2008-04-02 Thread Robert Bradshaw

On Apr 2, 2008, at 7:35 AM, Michel wrote:
>
> Hi,
>
> A short remark. It seems that taking the derivative of an element of a
> fraction field is not supported at this point. This feels somewhat
> inconsistent (tested with sage 2.10.4)
>
> sage: R=QQ['x']
> sage: x=R.gen()
> sage: derivative(x^2,x)
> 2*x
> sage: derivative(1/x,x)
> -- 
> -
>  Traceback (most recent call
> last)
> 

Looks like this was recently fixed:

SAGE Version 2.11, Release Date: 2008-03-30

sage: R=QQ['x']
sage: x=R.gen()
sage: derivative(1/x,x)-1/x^2


> More fundamentally, I wonder if it makes sense to define the general
> concept of a derivation.
> Derivations are given by their values on generators so they fit well
> in the sage framework.
> The advantage of having abstract derivations would be that one could
> add them, take their
> commutatior etc

Yes. David Roe and I were talking about this the other day (in  
another context). It essentially boils down to the ability to do  
element -> [some abstract representation in terms of generators] ->  
[modified representation in terms of generators] -> element. We were  
talking about this in terms of morphisms, so the parents of the  
elements on the two sides may not be the same, and the representation  
needs to be in a form they both understand (e.g. based on the category)

For algebras and rings, the representation would probably be a tree  
of binary operations, with leaf nodes being generators and elements  
of the base ring. Doing something more general requires more thought.

- Robert



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



[sage-devel] Re: quaternions

2008-04-02 Thread Justin C. Walker


On Mar 27, 2008, at 4:03 PM, Nick Alexander wrote:
>
>>> [*] Some methods are shown due to inheritance, and might actually  
>>> not
>>> apply in a specific situation.
>
> If this is true, there is a problem with the class hierarchy that
> should be complained about, loudly.
>
>>> [+] Documentation: the best documentation is had with "??" we might
>>> not find it in either case, if it's not in a ".py" file.
>
> ?? is intended to work in both .py and .pyx files.  If it doesn't
> work in some reproducible way, please file a ticket and let me know
> -- I am the maintainer-by-default.

As requested, one example, with sage-2.11:



Cheers,

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Absorption of Federal Funds

Some people have a mental horizon of radius zero, and
call it their point of view.
   -- David Hilbert




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



[sage-devel] Cell splitting/merging in notebook

2008-04-02 Thread Andrey Novoseltsev

Is it possible to realize some convenient and fast (in the sense of
keyboard use) cell splitting/merging? It seems to me that now it
involves manual copying of a part of code and creating/removing a
cell, or editing the text representation. I really liked the ability
to do it in Maple (back when I was using it ;-) by pressing some hot
keys since it allows you to group cells for executing in one step and
nicer visual presentation or break them back when you want to interact
with intermediate values.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: _fast_float_ for symbolic equalities/inequalities

2008-04-02 Thread Jason Grout

Robert Bradshaw wrote:
> 
> On Apr 1, 2008, at 11:59 PM, Jason Grout wrote:
>> Robert Bradshaw wrote:
>>> On Apr 1, 2008, at 9:15 PM, Jason Grout wrote:
>>>
 I'm trying to add _fast_float_ functionality to SymbolicEquation
 objects.  However, a perusal of the sage.ext.fast_eval.pyx file
 seems to
 indicate that the operations <, <=, ==, >=, >, and != are not
 supported
 by the fast_float machinery.  Is that correct?
>>> That is correct.
>>>
 If so, how do I add
 these operations?  If not, then how do I construct a FastDoubleFunc
 object appropriately?

 Or, should I just use the python operators and call fast_float on
 each side?
>>> The latter is what I would do--the result of evaluating a symbolic
>>> equation object is a boolean not a float so it would be kind of hard
>>> to hook into this mechanism anyways (well, one could represent True
>>> by one float and False by another, but I don't think that's a very
>>> clean solution).
>>
>> Sorry, Robert, I didn't see your message until just now (after all the
>> work was done).  If you want to veto the patch, I understand and  
>> I'll do
>> it the way you suggest.
>>
>> The use-case I had in mind called for getting 0 for false and 1 for
>> true, so that is how I implemented it (e.g., contour_plot(x> (x,-1,1),
>> (y,-1,1))).
>>
>> Still, it was fun to muck around in the fast_float file.  You're  
>> amazing!
> 
> Thanks.
> 
> I put a comment up on trac, but it boils down to
> 
> sage: f = (x == 1)
> sage: g = (1 == x)
> sage: bool(f+g)
> True
> sage: ff = f._fast_float_('x') + g._fast_float_('x')
> sage: ff(0)
> 0.0
> 
> but I think piecewise functions would be a good way to implement the  
> desired functionality.

What sort of interface do you see with piecewise functions and the 
_fast_float_ interface (i.e., what sort of opcodes?)

You bring up a good point about the clash between the current semantics 
of operations of symbolic equalities and my proposed fast_float 
extension.  Currently, operations operate on both sides of the equation 
if it makes sense (many times it doesn't make sense and an error is 
thrown!).

In the patch above, I think of a symbolic equation as a characteristic 
function (i.e., 1 where it is true, 0 where it is false).  This provides 
a very natural, short, and easy notation for such things:

x*(x<1) + (-x)*(x>3) means piecewise([[(-Infinity,1), x], [(1, 
Infinity), 0]]) + Piecewise([[(-Infinity, 3), 0], [(3, Infinity), -x]])

and

x*(x<1) + (-x)*(x^2>4) means -- well, I don't know how to express the 
constraint that x^2 > 4 using piecewise.

while:

x*(x<1) + (-x*y)*(x^2+y^2<1) -- I'm not sure even how to write this down 
using the two variables using piecewise.

Personally, it seems that the characteristic-function approach is more 
generally useful (and much nicer notationally) when calling 
_fast_float_.  Thoughts?


As a middle-ground, how about I implement a SymbolicFormula class that 
allows us to express logical combinations of SymbolicEquations.  The 
SymbolicFormula class, when multiplied under _fast_float_, will act as a 
characteristic function.

Jason


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



[sage-devel] bool() and SymbolicEquation

2008-04-02 Thread Jason Grout

Currently, False is returned when bool() is called on a SymbolicEquation 
  when the equation is really false *or* when it is not known whether it 
is true or false.  This, of course, makes a return value of False pretty 
meaningless.

Can I change this (per cwitty's suggestion) so that if it is not known 
if a SymbolicEquation is false or true, an error is thrown?

i.e.:

sage: bool(xx+1)
False
sage: var('y')

***CURRENTLY***
sage: bool(xhttp://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: bool() and SymbolicEquation

2008-04-02 Thread Timothy Clemans

+1

On Wed, Apr 2, 2008 at 12:12 PM, Jason Grout
<[EMAIL PROTECTED]> wrote:
>
>  Currently, False is returned when bool() is called on a SymbolicEquation
>   when the equation is really false *or* when it is not known whether it
>  is true or false.  This, of course, makes a return value of False pretty
>  meaningless.
>
>  Can I change this (per cwitty's suggestion) so that if it is not known
>  if a SymbolicEquation is false or true, an error is thrown?
>
>  i.e.:
>
>  sage: bool(x  True
>  sage: bool(x>x+1)
>  False
>  sage: var('y')
>
>  ***CURRENTLY***
>  sage: bool(x  False
>
>  ***Proposed***
>  sage: bool(x  Error is thrown
>
>  Jason
>
>
>  >
>

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



[sage-devel] Notebook servers

2008-04-02 Thread Justin C. Walker

Hi, all,

It appears that running multiple notebook servers is not really  
supported.  Is that true?  If I start a notebook server from a sage  
instance, and there is already one running, I get a complaint that  
implies I can do this by trying again with "pidfile" and "logfile"  
set to different values (and of course, using a different port).

However this doesn't seem to work.  There's not much to see in the  
Sage source, and I haven't looked at twisted source at all.

I hope I'm not missing something obvious.

Thanks!

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Absorption of Federal Funds

Some people have a mental horizon of radius zero, and
call it their point of view.
   -- David Hilbert




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



[sage-devel] Re: Notebook servers

2008-04-02 Thread Timothy Clemans

You can run different notebooks from different directories. I've
certainly done this in the past.

notebook(directory='Mary',port=9876)
notebook(directory='Tables',port=8765)

On Wed, Apr 2, 2008 at 12:27 PM, Justin C. Walker <[EMAIL PROTECTED]> wrote:
>
>  Hi, all,
>
>  It appears that running multiple notebook servers is not really
>  supported.  Is that true?  If I start a notebook server from a sage
>  instance, and there is already one running, I get a complaint that
>  implies I can do this by trying again with "pidfile" and "logfile"
>  set to different values (and of course, using a different port).
>
>  However this doesn't seem to work.  There's not much to see in the
>  Sage source, and I haven't looked at twisted source at all.
>
>  I hope I'm not missing something obvious.
>
>  Thanks!
>
>  Justin
>
>  --
>  Justin C. Walker, Curmudgeon-At-Large
>  Institute for the Absorption of Federal Funds
>  
>  Some people have a mental horizon of radius zero, and
>  call it their point of view.
>-- David Hilbert
>  
>
>
>
>  >
>

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



[sage-devel] Re: Notebook servers

2008-04-02 Thread Justin C. Walker


On Apr 2, 2008, at 12:31 PM, Timothy Clemans wrote:
>
> You can run different notebooks from different directories. I've
> certainly done this in the past.
>
> notebook(directory='Mary',port=9876)
> notebook(directory='Tables',port=8765)

Argh!  Thanks!  I looked right past that in the error message :-}

I created a Trac item:



Justin

--
Justin C. Walker, Curmudgeon-At-Large
Director
Institute for the Enhancement of the Director's Income

Here lies Lester Moore
Two bullets from a .44
No less, no more




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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread boothby

I'm sick at home today, and this actually has a braindead solution that I might 
be able to implement in my current (braindead) state.  What hotkeys do you want?


On Wed, 2 Apr 2008, Andrey Novoseltsev wrote:

>
> Is it possible to realize some convenient and fast (in the sense of
> keyboard use) cell splitting/merging? It seems to me that now it
> involves manual copying of a part of code and creating/removing a
> cell, or editing the text representation. I really liked the ability
> to do it in Maple (back when I was using it ;-) by pressing some hot
> keys since it allows you to group cells for executing in one step and
> nicer visual presentation or break them back when you want to interact
> with intermediate values.
> >
>



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



[sage-devel] Re: bool() and SymbolicEquation

2008-04-02 Thread Jason Grout

Timothy Clemans wrote:
> +1
> 
> On Wed, Apr 2, 2008 at 12:12 PM, Jason Grout
> <[EMAIL PROTECTED]> wrote:
>>  Currently, False is returned when bool() is called on a SymbolicEquation
>>   when the equation is really false *or* when it is not known whether it
>>  is true or false.  This, of course, makes a return value of False pretty
>>  meaningless.
>>
>>  Can I change this (per cwitty's suggestion) so that if it is not known
>>  if a SymbolicEquation is false or true, an error is thrown?
>>
>>  i.e.:
>>
>>  sage: bool(x>  True
>>  sage: bool(x>x+1)
>>  False
>>  sage: var('y')
>>
>>  ***CURRENTLY***
>>  sage: bool(x>  False
>>
>>  ***Proposed***
>>  sage: bool(x>  Error is thrown


This is now #2781.  A preliminary patch is up there now.

Jason


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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread David Kohel

Hi,

On the subject of notebook features:

One feature that would be really nice is to have distinct text cells,
in html or
even better latex mode.  A text cell could created by a hot key (say
)
in edit mode which displays the source latex or html, then toggled out
of edit
mode to display the formatted text.  This could be nicer for
preparing
worksheets for teaching which combine latex formatted exercises with
sage
cells for code, rather than using

# Exercise 1.  Let p = 75361.  Evaluate x^(p-1) mod p for x = 2, 5, 7,
and 11.
# What do you observe?  Is p a prime?

Create text cell in edit mode:

%latex
{\bf Exercise 1.}  Let $p = 75361$. Evaluate $x^{p-1} \bmod p$ for $x
= 2, 3,
5, 7$ and $11$ with the commands
\begin{verbatim}
p = 75361
for x in (2,3,5,7,11):
powermod(x,p-1,p)
\end{verbatim}
What do you observe?  Is $p$ a prime?



This would look much more professional than just using comments as in
the first
example.

Even better, I could imagine exporting the worksheet as a latex file
and conversely
reading a marked up latex file as a workshop.

Is this feasible?

--David





On Apr 2, 11:08 pm, [EMAIL PROTECTED] wrote:
> I'm sick at home today, and this actually has a braindead solution that I 
> might be able to implement in my current (braindead) state.  What hotkeys do 
> you want?
>
> On Wed, 2 Apr 2008, Andrey Novoseltsev wrote:
>
> > Is it possible to realize some convenient and fast (in the sense of
> > keyboard use) cell splitting/merging? It seems to me that now it
> > involves manual copying of a part of code and creating/removing a
> > cell, or editing the text representation. I really liked the ability
> > to do it in Maple (back when I was using it ;-) by pressing some hot
> > keys since it allows you to group cells for executing in one step and
> > nicer visual presentation or break them back when you want to interact
> > with intermediate values.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread Nick Alexander


On 2-Apr-08, at 2:53 PM, David Kohel wrote:

>
> Hi,
>
> On the subject of notebook features:
>
> One feature that would be really nice is to have distinct text cells,
> in html or
> even better latex mode.

+1 -- I was surprised that I couldn't figure out how to make a cell  
"just text" in the notebook a few days ago.

Nick

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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread William Stein

On Wed, Apr 2, 2008 at 2:53 PM, David Kohel <[EMAIL PROTECTED]> wrote:
>
>  Hi,
>
>  On the subject of notebook features:
>
>  One feature that would be really nice is to have distinct text cells,
>  in html or
>  even better latex mode.  A text cell could created by a hot key (say
>  )
>  in edit mode which displays the source latex or html, then toggled out
>  of edit
>  mode to display the formatted text.  This could be nicer for
>  preparing
>  worksheets for teaching which combine latex formatted exercises with
>  sage
>  cells for code, rather than using
>
>  # Exercise 1.  Let p = 75361.  Evaluate x^(p-1) mod p for x = 2, 5, 7,
>  and 11.
>  # What do you observe?  Is p a prime?
>
>  Create text cell in edit mode:
>
>  %latex
>  {\bf Exercise 1.}  Let $p = 75361$. Evaluate $x^{p-1} \bmod p$ for $x
>  = 2, 3,
>  5, 7$ and $11$ with the commands
>  \begin{verbatim}
>  p = 75361
>  for x in (2,3,5,7,11):
> powermod(x,p-1,p)
>  \end{verbatim}
>  What do you observe?  Is $p$ a prime?
>
>  
>
>  This would look much more professional than just using comments as in
>  the first
>  example.
>
>  Even better, I could imagine exporting the worksheet as a latex file
>  and conversely
>  reading a marked up latex file as a workshop.
>
>  Is this feasible?
>

Have you ever tried clicking the blue edit button in the upper
right side of the screen?  It gives you a plain text representation
of the worksheet.  You can enter arbitrary HTML between the
cells (the {{{ }}}), and it appears looking more professional
when you click the "Save and Use" button.   In fact, internally
all the text between subsequent {{{ }}} compute cells *is*
a TextCell.  There is also one bonus -- if you put math in $'s or
$$'s, it will get typeset as mathematics.

 -- William

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



[sage-devel] Re: bug in factoring over number fields?

2008-04-02 Thread David Harvey
This is now

http://trac.sagemath.org/sage_trac/ticket/2780

david

On Apr 2, 2008, at 12:57 PM, John Cremona wrote:

>
> You are right.  As a list, F has three elements of which the first is
> (2,1) -- i.e. 2 to the power 1 -- but when the list is converted to a
> Factorization type this first factor is left alone instead of being
> converted into the __unit part.
>
> John
>
> On 02/04/2008, David Harvey <[EMAIL PROTECTED]> wrote:
>>
>>  Is the following a bug?
>>
>>  sage: K. = NumberField(x^2 + 1)
>>  sage: R. = PolynomialRing(K)
>>  sage: f = 2*y^2 + 2*z^2
>>  sage: F = f.factor(); F
>>  2 * (y + (-a)*z) * (y + a*z)
>>  sage: F.unit_part()
>>  1
>>
>>  Shouldn't the unit part be 2? It seems to be listing 2 as a bona  
>> fide
>>  factor.
>>
>>  (This was reported by Genya Zaytman.)
>>
>>  david
>>

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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread William Stein

On Wed, Apr 2, 2008 at 2:58 PM, Nick Alexander <[EMAIL PROTECTED]> wrote:
>
>
>  On 2-Apr-08, at 2:53 PM, David Kohel wrote:
>
>  >
>  > Hi,
>  >
>  > On the subject of notebook features:
>  >
>  > One feature that would be really nice is to have distinct text cells,
>  > in html or
>  > even better latex mode.
>
>  +1 -- I was surprised that I couldn't figure out how to make a cell
>  "just text" in the notebook a few days ago.
>
>  Nick
>

I want to add that I'm *not* suggesting in my previous email that the
functionality
you want is in Sage.   Just that there is some related functionality.

Regarding exporting to latex, that has been on the todo list for a
long long time.
It is trac ticket #66:
   http://trac.sagemath.org/sage_trac/ticket/66

I don't think the notebook is going to seriously go anywhere until there
are actually people that want to work on developing it and know what
they are doing.  IS THERE ANYBODY OUT THERE?   Since I don't
know of a single person seriously interested on working on the usability
and polish of the notebook, even for money.   Anybody?

 -- William

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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread alex clemesha
On Wed, Apr 2, 2008 at 3:01 PM, William Stein <[EMAIL PROTECTED]> wrote:

>
> On Wed, Apr 2, 2008 at 2:58 PM, Nick Alexander <[EMAIL PROTECTED]>
> wrote:
> >
> >
> >  On 2-Apr-08, at 2:53 PM, David Kohel wrote:
> >
> >  >
> >  > Hi,
> >  >
> >  > On the subject of notebook features:
> >  >
> >  > One feature that would be really nice is to have distinct text cells,
> >  > in html or
> >  > even better latex mode.
> >
> >  +1 -- I was surprised that I couldn't figure out how to make a cell
> >  "just text" in the notebook a few days ago.
> >
> >  Nick
> >
>
> I want to add that I'm *not* suggesting in my previous email that the
> functionality
> you want is in Sage.   Just that there is some related functionality.
>
> Regarding exporting to latex, that has been on the todo list for a
> long long time.
> It is trac ticket #66:
>   http://trac.sagemath.org/sage_trac/ticket/66
>
> I don't think the notebook is going to seriously go anywhere until there
> are actually people that want to work on developing it and know what
> they are doing.  IS THERE ANYBODY OUT THERE?   Since I don't
> know of a single person seriously interested on working on the usability
> and polish of the notebook, even for money.   Anybody?


This is probably a good time to let others know our plans
with Knoboo (A general web+desktop computation notebook - www.knoboo.com).

We continue to spend a *massive amount* of time working on
Knoboo - some recent work has been done by Dorian Raymer to
get Knoboo working (almost perfectly) with Sage.

I invite people to look through the Knoboo trac site:
http://trac.knoboo.com/browser and see the effort, code, and incoming
additions.

---

In case it is unclear, I want to stress that one very immediate
and 'almost' complete goal is that with extremely minimal configuration:

=> Knoboo is exactly like the Sage notebook, but more feature rich,
professional looking, and consisting of well thought out, decoupled pieces
<=

now the above statement is slighlty 'vapor-ware -ish',
but as anyone who has worked on the notebook knows, it's hard and
time-consuming. period.

I'm confident that if you look through our trac timeline (
http://trac.knoboo.com/timeline)
and try out the svn trunk: ( svn co svn://www.knoboo.com/trunk/knoboo ),
even if you see some bugs / missing features, you will know we are very
serious about this goal.

---

Just to relate to the subject of this thread, one *awesome* feature already
in Knoboo is
abitrary nesting of cells: code cells, section (text) cells, and plain text
cells,
(section plain-text cells can be added with a simple right click on an
existing cell)

There is also some latex functionality, which Dorian has recently put in,
which he might be able to comment more on.

---

So in summary, there are people *very seriously* working on the notebook,
in the above mentioned form :)


-Alex




















>
>
>  -- William
>
> >
>

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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread Mike Hansen

> So in summary, there are people *very seriously* working on the notebook,
> in the above mentioned form :)

Hi Alex,

Can Knoboo work with Sage's pexpect interfaces, or is it a "Python-only" thing?

--Mike

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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread Jason Grout

alex clemesha wrote:
> 
> 
> On Wed, Apr 2, 2008 at 3:01 PM, William Stein <[EMAIL PROTECTED] 
> > wrote:
> 
> 
> On Wed, Apr 2, 2008 at 2:58 PM, Nick Alexander
> <[EMAIL PROTECTED] > wrote:
>  >
>  >
>  >  On 2-Apr-08, at 2:53 PM, David Kohel wrote:
>  >
>  >  >
>  >  > Hi,
>  >  >
>  >  > On the subject of notebook features:
>  >  >
>  >  > One feature that would be really nice is to have distinct text
> cells,
>  >  > in html or
>  >  > even better latex mode.
>  >
>  >  +1 -- I was surprised that I couldn't figure out how to make a cell
>  >  "just text" in the notebook a few days ago.
>  >
>  >  Nick
>  >
> 
> I want to add that I'm *not* suggesting in my previous email that the
> functionality
> you want is in Sage.   Just that there is some related functionality.
> 
> Regarding exporting to latex, that has been on the todo list for a
> long long time.
> It is trac ticket #66:
>   http://trac.sagemath.org/sage_trac/ticket/66
> 
> I don't think the notebook is going to seriously go anywhere until there
> are actually people that want to work on developing it and know what
> they are doing.  IS THERE ANYBODY OUT THERE?   Since I don't
> know of a single person seriously interested on working on the usability
> and polish of the notebook, even for money.   Anybody?
> 
> 
> This is probably a good time to let others know our plans
> with Knoboo (A general web+desktop computation notebook - www.knoboo.com 
> ).
> 
> We continue to spend a *massive amount* of time working on
> Knoboo - some recent work has been done by Dorian Raymer to
> get Knoboo working (almost perfectly) with Sage.
> 
> I invite people to look through the Knoboo trac site:
> http://trac.knoboo.com/browser and see the effort, code, and incoming 
> additions.
> 
> ---
> 
> In case it is unclear, I want to stress that one very immediate
> and 'almost' complete goal is that with extremely minimal configuration:
> 
> => Knoboo is exactly like the Sage notebook, but more feature rich,
> professional looking, and consisting of well thought out, decoupled 
> pieces <=


Just curious: does Knoboo implement anything like the new @interact 
functionality?  That is a big plus for me in the current Sage notebook.

Incidentally, recently I was trying very hard to remember the name of 
this project, but couldn't and I couldn't find it when searching, 
several times.  What's the reasoning behind the name?  (If I have that, 
it'll probably be easier to remember the name).

Jason


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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread alex clemesha
On Wed, Apr 2, 2008 at 4:39 PM, Mike Hansen <[EMAIL PROTECTED]> wrote:

>
> > So in summary, there are people *very seriously* working on the
> notebook,
> > in the above mentioned form :)
>
> Hi Alex,
>
> Can Knoboo work with Sage's pexpect interfaces, or is it a "Python-only"
> thing?


Sure, Pexpect is just a small Python implementation of 'Expect'.

But this brings up a bigger issue, which is:

"how does 'the computation engine' backend (Sage), connect to the frontend"

and related questions like:
-what if I want the 'computation engine' to be on another machine (remote) ?
-how do you *decouple* the backend from the front-end ?
-what if you cant use Pexpect (Windows) ?

we are solving this problems with the notion of a 'Kernel',
which is an object that deals with the above issues.
Pexpect is just one type of kernel connection.

There are a lot of details to this, but I'm not sure
how much you want to know.

-Alex











>
>
> --Mike
>
> >
>

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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread Jaap Spies

Jason Grout wrote:

> Incidentally, recently I was trying very hard to remember the name of 
> this project, but couldn't and I couldn't find it when searching, 
> several times.  What's the reasoning behind the name?  (If I have that, 
> it'll probably be easier to remember the name).
> 

Get drunk and try to pronounce "notebook" :)

Jaap


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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread alex clemesha
On Wed, Apr 2, 2008 at 4:53 PM, Jason Grout <[EMAIL PROTECTED]>
wrote:

>
> alex clemesha wrote:
> >
> >
> > On Wed, Apr 2, 2008 at 3:01 PM, William Stein <[EMAIL PROTECTED]
> > > wrote:
> >
> >
> > On Wed, Apr 2, 2008 at 2:58 PM, Nick Alexander
> > <[EMAIL PROTECTED] > wrote:
> >  >
> >  >
> >  >  On 2-Apr-08, at 2:53 PM, David Kohel wrote:
> >  >
> >  >  >
> >  >  > Hi,
> >  >  >
> >  >  > On the subject of notebook features:
> >  >  >
> >  >  > One feature that would be really nice is to have distinct text
> > cells,
> >  >  > in html or
> >  >  > even better latex mode.
> >  >
> >  >  +1 -- I was surprised that I couldn't figure out how to make a
> cell
> >  >  "just text" in the notebook a few days ago.
> >  >
> >  >  Nick
> >  >
> >
> > I want to add that I'm *not* suggesting in my previous email that
> the
> > functionality
> > you want is in Sage.   Just that there is some related
> functionality.
> >
> > Regarding exporting to latex, that has been on the todo list for a
> > long long time.
> > It is trac ticket #66:
> >   http://trac.sagemath.org/sage_trac/ticket/66
> >
> > I don't think the notebook is going to seriously go anywhere until
> there
> > are actually people that want to work on developing it and know what
> > they are doing.  IS THERE ANYBODY OUT THERE?   Since I don't
> > know of a single person seriously interested on working on the
> usability
> > and polish of the notebook, even for money.   Anybody?
> >
> >
> > This is probably a good time to let others know our plans
> > with Knoboo (A general web+desktop computation notebook - www.knoboo.com
> > ).
> >
> > We continue to spend a *massive amount* of time working on
> > Knoboo - some recent work has been done by Dorian Raymer to
> > get Knoboo working (almost perfectly) with Sage.
> >
> > I invite people to look through the Knoboo trac site:
> > http://trac.knoboo.com/browser and see the effort, code, and incoming
> > additions.
> >
> > ---
> >
> > In case it is unclear, I want to stress that one very immediate
> > and 'almost' complete goal is that with extremely minimal configuration:
> >
> > => Knoboo is exactly like the Sage notebook, but more feature rich,
> > professional looking, and consisting of well thought out, decoupled
> > pieces <=
>
>
> Just curious: does Knoboo implement anything like the new @interact
> functionality?  That is a big plus for me in the current Sage notebook.

I agree that the @interact is awesome, but it is pretty badly
coupled to the other pieces of the Sage notebook and HTML.
This is actually a big issue which materializes when others try
to add new functionality and extend existing functionality.
It's an issue of markup (HTML) vs data (plot points) basically.

I've done some work related to this using the "flot" (
http://code.google.com/p/flot/)
 javascript library (a jquery plugin) that does plotting and allows a great
deal
of interactivity and extendability because you only pass it raw data (JSON
objects).

Here is an example of it in action, which dynamically redraws the
plot after each interaction (it gets raw plot point data with Ajax calls):
http://alex.knoboo.com/earthquake/
(the example is an earthquake event explorer prototype thing I did at work)

I do want to say again that the @interact functionality is awesome,
and we hope to have something similar, but nothing exists now.


>
>
> Incidentally, recently I was trying very hard to remember the name of
> this project, but couldn't and I couldn't find it when searching,
> several times.  What's the reasoning behind the name?  (If I have that,
> it'll probably be easier to remember the name).


*Kno*wledge Note*boo*k
Knoboo. (Rhymes with Yahoo!)

It's a little quirky, but I kinda like it! ;)

-Alex


>
>
> Jason
>
>
> >
>

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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread alex clemesha
On Wed, Apr 2, 2008 at 5:23 PM, Jaap Spies <[EMAIL PROTECTED]> wrote:

>
> Jason Grout wrote:
>
> > Incidentally, recently I was trying very hard to remember the name of
> > this project, but couldn't and I couldn't find it when searching,
> > several times.  What's the reasoning behind the name?  (If I have that,
> > it'll probably be easier to remember the name).
> >
>
> Get drunk and try to pronounce "notebook" :)


Nice! I like that even better :)

-Alex


>
>
> Jaap
>
>
> >
>

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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread Jason Grout

alex clemesha wrote:
> 
> 
> Just curious: does Knoboo implement anything like the new @interact
> functionality?  That is a big plus for me in the current Sage notebook.
> 
> I agree that the @interact is awesome, but it is pretty badly
> coupled to the other pieces of the Sage notebook and HTML.
> This is actually a big issue which materializes when others try
> to add new functionality and extend existing functionality.
> It's an issue of markup (HTML) vs data (plot points) basically.
> 
> I've done some work related to this using the "flot" 
> (http://code.google.com/p/flot/)
>  javascript library (a jquery plugin) that does plotting and allows a 
> great deal
> of interactivity and extendability because you only pass it raw data 
> (JSON objects).
> 
> Here is an example of it in action, which dynamically redraws the
> plot after each interaction (it gets raw plot point data with Ajax calls):
> http://alex.knoboo.com/earthquake/
> (the example is an earthquake event explorer prototype thing I did at work)
> 
> I do want to say again that the @interact functionality is awesome,
> and we hope to have something similar, but nothing exists now.
>  


I look forward to seeing your interact design.  The current @interact is 
the result of several iterations, and I think it's fairly 
straightforward to add new widgets and things (I know; I've done it). 
Of course, it does have its weak points as you point out, but they 
relate more to the design of having all computation (and drawing!) done 
in the Sage backend and almost no (mathematical) intelligence in the 
notebook.  One notable exception to this is JMOL.  Also, as you point 
out, the method of communicating between the server and client could be 
developed more.  Robert Bradshaw's recent proposal of an HTTP 
communication protocol is a step in that direction.

That said, I am *very* impressed with your cell interface.  It looks 
like a very nice design.  I am also impressed with the general visual 
feel of knoboo.  I'm glad that you've thought a lot about client-server 
communication.  You're right that the current Sage notebook is very 
tightly coupled with Sage, which makes it hard to spin off to other 
developers and develop outside interest in the notebook.  It also 
influences the design quite a bit.

I'm curious if you have any google summer of code projects going (maybe 
under the Python projects?).  I hope you guys succeed; you have some 
very nice work already.  It would be very interesting for us to see an 
interface to Sage with Knoboo.

Thanks,

Jason


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



[sage-devel] multivariate polys over residue fields of number fields are broken

2008-04-02 Thread David Harvey
This example from Genya Zaytman:

sage: F1. = NumberField(x^6 + 6*x^5 + 124*x^4 + 452*x^3 + 4336*x^2  
+ 8200*x + 42316)
sage: reduct_id = F1.factor_integer(47)[0][0]
sage: Rf = F1.residue_field(reduct_id)   # = GF(47^3)
sage: R1. = PolynomialRing(Rf)
sage: ubar = Rf(u)
sage: I = ideal([ubar*X+Y])
sage: I.groebner_basis()
[boom]

Is this supposed to work? It's just a multivariate poly over a finite  
field.

I've put it up at:

http://trac.sagemath.org/sage_trac/ticket/2789

david


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



[sage-devel] Re: _fast_float_ for symbolic equalities/inequalities

2008-04-02 Thread Robert Bradshaw

On Apr 2, 2008, at 12:05 PM, Jason Grout wrote:

> Robert Bradshaw wrote:
>>
>> Thanks.
>>
>> I put a comment up on trac, but it boils down to
>>
>> sage: f = (x == 1)
>> sage: g = (1 == x)
>> sage: bool(f+g)
>> True
>> sage: ff = f._fast_float_('x') + g._fast_float_('x')
>> sage: ff(0)
>> 0.0
>>
>> but I think piecewise functions would be a good way to implement the
>> desired functionality.
>
> What sort of interface do you see with piecewise functions and the
> _fast_float_ interface (i.e., what sort of opcodes?)

Actually, given more thought, I think the opcodes you have chosen  
make sense, but there should be an "IF" opcode that operates on  
[true_val false_val test_val] as well which would allow for a full  
range of piecewise functions. (One could look at making conditional  
jumps so as to not calculate both sides of the expression, though  
this would be a fundamental change to the code. Hmm...)

> You bring up a good point about the clash between the current  
> semantics
> of operations of symbolic equalities and my proposed fast_float
> extension.  Currently, operations operate on both sides of the  
> equation
> if it makes sense (many times it doesn't make sense and an error is
> thrown!).
>
> In the patch above, I think of a symbolic equation as a characteristic
> function (i.e., 1 where it is true, 0 where it is false).  This  
> provides
> a very natural, short, and easy notation for such things:
>
> x*(x<1) + (-x)*(x>3) means piecewise([[(-Infinity,1), x], [(1,
> Infinity), 0]]) + Piecewise([[(-Infinity, 3), 0], [(3, Infinity), - 
> x]])
>
> and
>
> x*(x<1) + (-x)*(x^2>4) means -- well, I don't know how to express the
> constraint that x^2 > 4 using piecewise.
>
> while:
>
> x*(x<1) + (-x*y)*(x^2+y^2<1) -- I'm not sure even how to write this  
> down
> using the two variables using piecewise.
>
> Personally, it seems that the characteristic-function approach is more
> generally useful (and much nicer notationally) when calling
> _fast_float_.  Thoughts?

In Sage 3*(x<1) becomes 3x < 3. One can argue whether or not this is  
a good thing (I think it is) but it shows how symbolic equations are  
distinct objects from symbolic expressions.

I'm not thinking of piecewise functions as being limited by what the  
Piecewise class can do. (I'm sure there's a better name for it, but  
it's evading me for the moment. Basically, I'm thinking the condition  
is an arbitrary equation, and there is an expression for each truth  
value.) Basically the ternary operation.

> As a middle-ground, how about I implement a SymbolicFormula class that
> allows us to express logical combinations of SymbolicEquations.  The
> SymbolicFormula class, when multiplied under _fast_float_, will act  
> as a
> characteristic function.

I like this idea a lot, though I'm not sure "SymbolicFormula" is the  
best name for it. Perhaps "SymbolicCondition?" One could construct  
such things using && and ||, and it could short-circuit on  
evaluation. The output would be a boolean, which of course turns into  
a 1 or 0 when float(...) is called.

- Robert


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



[sage-devel] Re: _fast_float_ for symbolic equalities/inequalities

2008-04-02 Thread Jason Grout

Robert Bradshaw wrote:
> On Apr 2, 2008, at 12:05 PM, Jason Grout wrote:
> 
>> Robert Bradshaw wrote:
>>> Thanks.
>>>
>>> I put a comment up on trac, but it boils down to
>>>
>>> sage: f = (x == 1)
>>> sage: g = (1 == x)
>>> sage: bool(f+g)
>>> True
>>> sage: ff = f._fast_float_('x') + g._fast_float_('x')
>>> sage: ff(0)
>>> 0.0
>>>
>>> but I think piecewise functions would be a good way to implement the
>>> desired functionality.
>> What sort of interface do you see with piecewise functions and the
>> _fast_float_ interface (i.e., what sort of opcodes?)
> 
> Actually, given more thought, I think the opcodes you have chosen  
> make sense, but there should be an "IF" opcode that operates on  
> [true_val false_val test_val] as well which would allow for a full  
> range of piecewise functions. (One could look at making conditional  
> jumps so as to not calculate both sides of the expression, though  
> this would be a fundamental change to the code. Hmm...)


Having a jump statement (maybe even just a je (jump if equal to zero) or 
jne (jump if not equal to zero)) would indeed be powerful.  I'm too 
tired to think through how to implement them, but no doubt you've 
already figured out a much more clever way :).




> 
>> You bring up a good point about the clash between the current  
>> semantics
>> of operations of symbolic equalities and my proposed fast_float
>> extension.  Currently, operations operate on both sides of the  
>> equation
>> if it makes sense (many times it doesn't make sense and an error is
>> thrown!).
>>
>> In the patch above, I think of a symbolic equation as a characteristic
>> function (i.e., 1 where it is true, 0 where it is false).  This  
>> provides
>> a very natural, short, and easy notation for such things:
>>
>> x*(x<1) + (-x)*(x>3) means piecewise([[(-Infinity,1), x], [(1,
>> Infinity), 0]]) + Piecewise([[(-Infinity, 3), 0], [(3, Infinity), - 
>> x]])
>>
>> and
>>
>> x*(x<1) + (-x)*(x^2>4) means -- well, I don't know how to express the
>> constraint that x^2 > 4 using piecewise.
>>
>> while:
>>
>> x*(x<1) + (-x*y)*(x^2+y^2<1) -- I'm not sure even how to write this  
>> down
>> using the two variables using piecewise.
>>
>> Personally, it seems that the characteristic-function approach is more
>> generally useful (and much nicer notationally) when calling
>> _fast_float_.  Thoughts?
> 
> In Sage 3*(x<1) becomes 3x < 3. One can argue whether or not this is  
> a good thing (I think it is) but it shows how symbolic equations are  
> distinct objects from symbolic expressions.
> 
> I'm not thinking of piecewise functions as being limited by what the  
> Piecewise class can do. (I'm sure there's a better name for it, but  
> it's evading me for the moment. Basically, I'm thinking the condition  
> is an arbitrary equation, and there is an expression for each truth  
> value.) Basically the ternary operation.
> 
>> As a middle-ground, how about I implement a SymbolicFormula class that
>> allows us to express logical combinations of SymbolicEquations.  The
>> SymbolicFormula class, when multiplied under _fast_float_, will act  
>> as a
>> characteristic function.
> 
> I like this idea a lot, though I'm not sure "SymbolicFormula" is the  
> best name for it. Perhaps "SymbolicCondition?" One could construct  
> such things using && and ||, and it could short-circuit on  
> evaluation. The output would be a boolean, which of course turns into  
> a 1 or 0 when float(...) is called.

cwitty suggested the SymbolicFormula name based on symbolic logic.  An 
alternative would be SymbolicProposition.  Your suggestion works too, 
but seems more limiting (i.e., it seems to restrict the use to only 
characteristic functions).  The idea is that the class would encapsulate 
any sort of logical proposition, including ones with quantifiers.  I 
like that idea; cwitty can use it, for example, to interface with qepcad.

For reference, the Mma way to do this is to wrap the symbolic statement 
in the Boole function, which takes a statement and outputs 0 if false, 1 
if true.  However, Boole interacts well with integration and other 
symbolic things; see 
http://reference.wolfram.com/mathematica/ref/Boole.html )

So, how about this summary:

fast_float(SymbolicFormula*SymbolicExpression) --> the way things work 
under my patch, but with SymbolicFormula instead of SymbolicEquation 
(there's no need for an if-statement; the multiplication takes care of 
it).  The conditional jump opcode and corresponding if statement would 
provide another way to do things, though.

boole(SymbolicEquation) --> SymbolicFormula encapsulating the 
SymbolicEquation  (We could also convert a SymbolicEquation to an 
equivalent SymbolicFormula with SymbolicEquation & 1, for example). I 
don't like the name "boole"; I would rather have something like 
characteristic_function or indicator_function, but those are too long.


SymbolicFormula*SymbolicExpression --> a generalized piecewise function 
(i.e., If SymbolicFormula Then 

[sage-devel] Re: Root Systems and Weyl Groups

2008-04-02 Thread Justin C. Walker


On Mar 12, 2008, at 10:01 , William Stein wrote:
>
> On Wed, Mar 12, 2008 at 9:58 AM, Joel B. Mohler <[EMAIL PROTECTED] 
> > wrote:
>>
>> On Wednesday 12 March 2008 10:55, William Stein wrote:
 I'm a bit underwhelmed with lie as a software engineering  
 project.  It's
 one of the most opaque hunks of code I've ever looked at.  I'd  
 like to
 see this be faster than a p-expect interface too.  Lie doesn't  
 have a
 library and it doesn't look like much fun to make such an interface
 either.  Although, it is a very small package so it wouldn't be
 impossible to just beat it into shape. I'm curious if other  
 people have
 thought about this.
>>>
>>> Is it actively developed anymore?
>>>
>>> It's still not in Sage for a reason, though at the moment
>>> I'm not sure exactly what that reason is.  (Maybe just
>>> lack of demand.)
>>
>> I don't know for sure about it's status, but it's web page seems to
>> acknowledge that 2000 was about the end for any serious work.  It  
>> seems to be
>
> Yep.  2000 is the most recent change date on any of the files  
> (except one).
>
>> the canonical computational reference for these topics for at least  
>> a few
>> people.  I suppose that means it might be a worthwhile project to  
>> make a list
>> of the main features/algorithms and make sure that sage either  
>> includes them
>> or exceeds them so that we can state that sage is a viable  
>> migration path.

I just tripped over this "package": AllTypes ().  It's entirely web-based, and it does not appear to  
be open, but it seems to be kept up to date.  It's referenced in
"Algorithmic Lie Theory for Solving Ordinary Differential  
Equations" by F. Schwarz.

I don't think AllTypes is Lie-specific, but it might be worth finding  
out what's behind it, and if there's anything there to be "shared".

The website gives you a "signup" option; filling in the details gets  
you a response with a password, and you can use it (again: seems to be  
only web-based).

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Absorption of Federal Funds

If you're not confused,
You're not paying attention





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



[sage-devel] Re: Cell splitting/merging in notebook

2008-04-02 Thread Andrey Novoseltsev

How about Ctrl+s split at the current line and Ctrl+m merge with the
previous one? (Or next one, I am not sure which one is more natural.)

On Apr 2, 2:08 pm, [EMAIL PROTECTED] wrote:
> I'm sick at home today, and this actually has a braindead solution that I 
> might be able to implement in my current (braindead) state.  What hotkeys do 
> you want?
>
>
>
> On Wed, 2 Apr 2008, Andrey Novoseltsev wrote:
>
> > Is it possible to realize some convenient and fast (in the sense of
> > keyboard use) cell splitting/merging? It seems to me that now it
> > involves manual copying of a part of code and creating/removing a
> > cell, or editing the text representation. I really liked the ability
> > to do it in Maple (back when I was using it ;-) by pressing some hot
> > keys since it allows you to group cells for executing in one step and
> > nicer visual presentation or break them back when you want to interact
> > with intermediate values.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-devel] Re: _fast_float_ for symbolic equalities/inequalities

2008-04-02 Thread Robert Bradshaw

On Apr 2, 2008, at 10:32 PM, Jason Grout wrote:
>
> Robert Bradshaw wrote:
>> On Apr 2, 2008, at 12:05 PM, Jason Grout wrote:
>>
>>> Robert Bradshaw wrote:
 Thanks.

 I put a comment up on trac, but it boils down to

 sage: f = (x == 1)
 sage: g = (1 == x)
 sage: bool(f+g)
 True
 sage: ff = f._fast_float_('x') + g._fast_float_('x')
 sage: ff(0)
 0.0

 but I think piecewise functions would be a good way to implement  
 the
 desired functionality.
>>> What sort of interface do you see with piecewise functions and the
>>> _fast_float_ interface (i.e., what sort of opcodes?)
>>
>> Actually, given more thought, I think the opcodes you have chosen
>> make sense, but there should be an "IF" opcode that operates on
>> [true_val false_val test_val] as well which would allow for a full
>> range of piecewise functions. (One could look at making conditional
>> jumps so as to not calculate both sides of the expression, though
>> this would be a fundamental change to the code. Hmm...)
>
> Having a jump statement (maybe even just a je (jump if equal to  
> zero) or
> jne (jump if not equal to zero)) would indeed be powerful.  I'm too
> tired to think through how to implement them, but no doubt you've
> already figured out a much more clever way :).

I've given it some thought, I think it'd just involve passing &i as a  
parameter to process_op. Once concern is it would make it much harder  
to convert the list of opcodes back into an expression...

>>
>>> As a middle-ground, how about I implement a SymbolicFormula class  
>>> that
>>> allows us to express logical combinations of SymbolicEquations.  The
>>> SymbolicFormula class, when multiplied under _fast_float_, will act
>>> as a
>>> characteristic function.
>>
>> I like this idea a lot, though I'm not sure "SymbolicFormula" is the
>> best name for it. Perhaps "SymbolicCondition?" One could construct
>> such things using && and ||, and it could short-circuit on
>> evaluation. The output would be a boolean, which of course turns into
>> a 1 or 0 when float(...) is called.
>
> cwitty suggested the SymbolicFormula name based on symbolic logic.  An
> alternative would be SymbolicProposition.  Your suggestion works too,
> but seems more limiting (i.e., it seems to restrict the use to only
> characteristic functions).

SymbolicFormula (to me) sounds like an expression, e.g. pi *r^2 is a  
symbolic formula. I like SymbolicProposition.

> The idea is that the class would encapsulate
> any sort of logical proposition, including ones with quantifiers.  I
> like that idea; cwitty can use it, for example, to interface with  
> qepcad.

Yes, sounds very good.

> For reference, the Mma way to do this is to wrap the symbolic  
> statement
> in the Boole function, which takes a statement and outputs 0 if  
> false, 1
> if true.  However, Boole interacts well with integration and other
> symbolic things; see
> http://reference.wolfram.com/mathematica/ref/Boole.html )
>
> So, how about this summary:
>
> fast_float(SymbolicFormula*SymbolicExpression) --> the way things work
> under my patch, but with SymbolicFormula instead of SymbolicEquation
> (there's no need for an if-statement; the multiplication takes care of
> it).  The conditional jump opcode and corresponding if statement would
> provide another way to do things, though.
>
> boole(SymbolicEquation) --> SymbolicFormula encapsulating the
> SymbolicEquation  (We could also convert a SymbolicEquation to an
> equivalent SymbolicFormula with SymbolicEquation & 1, for example). I
> don't like the name "boole"; I would rather have something like
> characteristic_function or indicator_function, but those are too long.

I don't like the name "boole" either (though the function sounds  
good). Maybe someone else has some ideas. In any case, with tab  
completion, unique first-couple-of-characters can be more important  
than the overall length of the function name.

> SymbolicFormula*SymbolicExpression --> a generalized piecewise  
> function
> (i.e., If SymbolicFormula Then SymbolicExpression).  This generalized
> thing can be used in integration or other places where it can use the
> information intelligently.  If fast_float is called on it, it can  
> either
> use an IF statement or do the multiplication like my patch.

yeah.

> On another note: && and || are not valid syntax (you probably already
> knew that :).

I always remember its either && or & that's valid, but can never  
remember which one. (If I think about it it should be clear though).

> We can overload & and | (the bitwise operators).  They
> have the wrong precedence, but we can insist that people use  
> parentheses
> or they will get weird errors.

Most people it seems have a hard time remembering which is "supposed"  
to come first anyway...

> I wish we could overload "and", "or", and friends.

Yeah, though I don't think this is possible while retaining their  
short-circuiting behavior.

> In any case, it s

[sage-devel] Re: _fast_float_ for symbolic equalities/inequalities

2008-04-02 Thread Jason Grout

Robert Bradshaw wrote:
> On Apr 2, 2008, at 12:05 PM, Jason Grout wrote:
> 
>> Robert Bradshaw wrote:
>>> Thanks.
>>>
>>> I put a comment up on trac, but it boils down to
>>>
>>> sage: f = (x == 1)
>>> sage: g = (1 == x)
>>> sage: bool(f+g)
>>> True
>>> sage: ff = f._fast_float_('x') + g._fast_float_('x')
>>> sage: ff(0)
>>> 0.0
>>>
>>> but I think piecewise functions would be a good way to implement the
>>> desired functionality.
>> What sort of interface do you see with piecewise functions and the
>> _fast_float_ interface (i.e., what sort of opcodes?)
> 
> Actually, given more thought, I think the opcodes you have chosen  
> make sense, but there should be an "IF" opcode that operates on  
> [true_val false_val test_val] as well which would allow for a full  
> range of piecewise functions. (One could look at making conditional  
> jumps so as to not calculate both sides of the expression, though  
> this would be a fundamental change to the code. Hmm...)
> 

A thought occurred to me when I looked at the fast_eval code: what's the 
possibility of doing these sorts of computations on a GPU?  Would it be 
worth it?  If I recall correctly, the limitation of those things is that 
they are floating point, but, of course, that's the assumption in 
fast_float.

GPU computations seem to fit the bill here also because these fast_float 
operations generally are called on a huge range of data and could be 
done in parallel.

Jason


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



[sage-devel] Re: _fast_float_ for symbolic equalities/inequalities

2008-04-02 Thread Robert Bradshaw

On Apr 2, 2008, at 11:46 PM, Jason Grout wrote:
>
> Robert Bradshaw wrote:
>> On Apr 2, 2008, at 12:05 PM, Jason Grout wrote:
>>
>>> Robert Bradshaw wrote:
 Thanks.

 I put a comment up on trac, but it boils down to

 sage: f = (x == 1)
 sage: g = (1 == x)
 sage: bool(f+g)
 True
 sage: ff = f._fast_float_('x') + g._fast_float_('x')
 sage: ff(0)
 0.0

 but I think piecewise functions would be a good way to implement  
 the
 desired functionality.
>>> What sort of interface do you see with piecewise functions and the
>>> _fast_float_ interface (i.e., what sort of opcodes?)
>>
>> Actually, given more thought, I think the opcodes you have chosen
>> make sense, but there should be an "IF" opcode that operates on
>> [true_val false_val test_val] as well which would allow for a full
>> range of piecewise functions. (One could look at making conditional
>> jumps so as to not calculate both sides of the expression, though
>> this would be a fundamental change to the code. Hmm...)
>>
>
> A thought occurred to me when I looked at the fast_eval code:  
> what's the
> possibility of doing these sorts of computations on a GPU?  Would  
> it be
> worth it?  If I recall correctly, the limitation of those things is  
> that
> they are floating point, but, of course, that's the assumption in
> fast_float.

Often they are single rather then double-precision floating point  
numbers too, but I think some more modern GPUs can do the latter as  
well.

> GPU computations seem to fit the bill here also because these  
> fast_float
> operations generally are called on a huge range of data and could be
> done in parallel.

Yes, it would be very interesting to look at. That being said I know  
nothing about programming GPUs, except that supposedly its a whole  
new ballgame (i.e. usually you don't just compile a .c file for a GPU).

- Robert
  

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