[sage-support] Re: getting output of one matrix row in two workbook lines

2009-01-19 Thread Mate Kosor



> Use
>
>    show(foo)
>
> to typeset an output line, which won't word wrap.
This gives me latex output?

> Or, after getting output as you do above, just click to the left of
> the output to toggle through:
>     word wrap --> no word wrap --> hide
This works!

Thanks a lot.

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



[sage-support] Re: Minimal notebook - just 1 cell

2009-01-19 Thread Tim Lahey


On Jan 19, 2009, at 11:42 PM, Timothy Clemans wrote:

>
> Is this similar to making it easy to post @interact demonstrations on
> webpages including a blog?

Well, there is a new Python blog engine being done by some of the
same people who did Sphinx.

http://zine.pocoo.org/

It would be nice if @interact demonstrations and cells (both read-only
and read-write) could be added to blog entries.

Cheers,

Tim.


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



[sage-support] Re: Minimal notebook - just 1 cell

2009-01-19 Thread Timothy Clemans

Is this similar to making it easy to post @interact demonstrations on
webpages including a blog?

On Mon, Jan 19, 2009 at 11:39 PM, William Stein  wrote:
>
> On Mon, Jan 19, 2009 at 8:32 PM, Skylar  wrote:
>>
>> Well, I am certainly no javascript master.  I think maybe the best
>> that I can do is to understand the simple server and build from there.
>>
>> Maybe I can do it in some number of months half-time.  It would be a
>> useful adaptation to introduce kids to sage that don't necessarily
>> need to be managing whole worksheets much less whole notebooks.
>
> If nothing else, it is a really good idea, and I think something like
> it would be useful.  Thanks for suggesting it.
>
> Just out of curiosity, what do you think of this:
>
>   http://magma.maths.usyd.edu.au/calc/
>
> It wrote it years ago (before Sage), but could do a Sage version that
> would be included standard in sage.
>
>
>>
>> sos
>>
>> On Jan 19, 10:39 pm, William Stein  wrote:
>>> On Mon, Jan 19, 2009 at 5:05 PM, Robert Bradshaw
>>>
>>>  wrote:
>>>
>>> > On Jan 19, 2009, at 4:39 PM, Skylar wrote:
>>>
>>> >> I was rather hoping to keep all of the great js/css and everything
>>> >> having to do with the cell like the tab completion and the way that
>>> >> the input and output are handled - all are fantastic in the notebook.
>>> >> I was just hoping that I could send a single cell the way that it is
>>> >> displayed and functioning in the full notebook to an address/port.  I
>>> >> am not sure that using the simple server would be the best way to
>>> >> accomplish this.
>>>
>>> > You're right--it would probably would be easier to try and modify the
>>> > notebook to get this effect. The simple API was more designed to be a
>>> > "back end" interface.
>>>
>>> You will probably have to copy out a bunch of javascript from
>>>
>>>  SAGE_ROOT/devel/sage/sage/server/notebook/js.py
>>>
>>> in some clever way into your webpage.  Then probably use
>>> the simple API as the backend to actually do the work.
>>>
>>> To do this right would probably require some serious refactoring
>>> of js.py, and at least understanding that javascript code.  I'm sure
>>> it could be done and that I could do it.  I would estimate it would
>>> take me a week of fulltime work to do this right.  (I'm probably not
>>> going to do this; I'm just sharing some thoughts.)
>>>
>>>  -- William
>> >
>>
>
>
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washington
> http://wstein.org
>
> >
>

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



[sage-support] Re: Minimal notebook - just 1 cell

2009-01-19 Thread William Stein

On Mon, Jan 19, 2009 at 8:32 PM, Skylar  wrote:
>
> Well, I am certainly no javascript master.  I think maybe the best
> that I can do is to understand the simple server and build from there.
>
> Maybe I can do it in some number of months half-time.  It would be a
> useful adaptation to introduce kids to sage that don't necessarily
> need to be managing whole worksheets much less whole notebooks.

If nothing else, it is a really good idea, and I think something like
it would be useful.  Thanks for suggesting it.

Just out of curiosity, what do you think of this:

   http://magma.maths.usyd.edu.au/calc/

It wrote it years ago (before Sage), but could do a Sage version that
would be included standard in sage.


>
> sos
>
> On Jan 19, 10:39 pm, William Stein  wrote:
>> On Mon, Jan 19, 2009 at 5:05 PM, Robert Bradshaw
>>
>>  wrote:
>>
>> > On Jan 19, 2009, at 4:39 PM, Skylar wrote:
>>
>> >> I was rather hoping to keep all of the great js/css and everything
>> >> having to do with the cell like the tab completion and the way that
>> >> the input and output are handled - all are fantastic in the notebook.
>> >> I was just hoping that I could send a single cell the way that it is
>> >> displayed and functioning in the full notebook to an address/port.  I
>> >> am not sure that using the simple server would be the best way to
>> >> accomplish this.
>>
>> > You're right--it would probably would be easier to try and modify the
>> > notebook to get this effect. The simple API was more designed to be a
>> > "back end" interface.
>>
>> You will probably have to copy out a bunch of javascript from
>>
>>  SAGE_ROOT/devel/sage/sage/server/notebook/js.py
>>
>> in some clever way into your webpage.  Then probably use
>> the simple API as the backend to actually do the work.
>>
>> To do this right would probably require some serious refactoring
>> of js.py, and at least understanding that javascript code.  I'm sure
>> it could be done and that I could do it.  I would estimate it would
>> take me a week of fulltime work to do this right.  (I'm probably not
>> going to do this; I'm just sharing some thoughts.)
>>
>>  -- William
> >
>



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

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



[sage-support] Re: Minimal notebook - just 1 cell

2009-01-19 Thread Skylar

Well, I am certainly no javascript master.  I think maybe the best
that I can do is to understand the simple server and build from there.

Maybe I can do it in some number of months half-time.  It would be a
useful adaptation to introduce kids to sage that don't necessarily
need to be managing whole worksheets much less whole notebooks.

sos

On Jan 19, 10:39 pm, William Stein  wrote:
> On Mon, Jan 19, 2009 at 5:05 PM, Robert Bradshaw
>
>  wrote:
>
> > On Jan 19, 2009, at 4:39 PM, Skylar wrote:
>
> >> I was rather hoping to keep all of the great js/css and everything
> >> having to do with the cell like the tab completion and the way that
> >> the input and output are handled - all are fantastic in the notebook.
> >> I was just hoping that I could send a single cell the way that it is
> >> displayed and functioning in the full notebook to an address/port.  I
> >> am not sure that using the simple server would be the best way to
> >> accomplish this.
>
> > You're right--it would probably would be easier to try and modify the
> > notebook to get this effect. The simple API was more designed to be a
> > "back end" interface.
>
> You will probably have to copy out a bunch of javascript from
>
>  SAGE_ROOT/devel/sage/sage/server/notebook/js.py
>
> in some clever way into your webpage.  Then probably use
> the simple API as the backend to actually do the work.
>
> To do this right would probably require some serious refactoring
> of js.py, and at least understanding that javascript code.  I'm sure
> it could be done and that I could do it.  I would estimate it would
> take me a week of fulltime work to do this right.  (I'm probably not
> going to do this; I'm just sharing some thoughts.)
>
>  -- William
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: getting output of one matrix row in two workbook lines

2009-01-19 Thread William Stein

On Mon, Jan 19, 2009 at 11:02 AM, Mate Kosor  wrote:
>
> I am using Sage workbook 3.2.3. in Mozilla Firefox 3.0.5 I have a
> problem with matrix output.
>
> Line:
> matrix([[diff(v_r(r, z), r), 0, diff(v_z(r, z), r)/2], [0, 0, 0],[diff
> (v_z(r, z), r,)/2, 0, 0]])
>
> produces output where one matrix row spans 2 rows on web browser
> worksheet, like this
> [  diff(v_r(r, z), r, 1)   0 diff(v_z(r, z), r,
> 1)/2]
> [  0   0
> 0]
> [diff(v_z(r, z), r, 1)/2   0
> 0]
>
> I have tried zooming out, which changes to smaller font, without
> success.
>
> How can I get a matrix row in one line only?
>

Use

   show(foo)

to typeset an output line, which won't word wrap.

Or, after getting output as you do above, just click to the left of
the output to toggle through:
word wrap --> no word wrap --> hide

William

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



[sage-support] Re: number field question

2009-01-19 Thread William Stein

On Mon, Jan 19, 2009 at 4:46 PM, Alex Raichev  wrote:
>
> Hi everyone:
>
> I'm applying for a grant from the New Zealand government to fund some
> Sage development in the area of computational algebraic and analytic
> geometry.  For part of the application i need to report on the 'state
> of the field'.  Part of my response to this will be to mention that
> Sage doesn't have an implementation of factorization, ideal, and
> variety calculations over QQbar.  To double-check, is this true?
> Related to that, do any major computer algebra systems (Singular
> included) have such implementations?
>
> Alex

Any commutative algebra computer computation over QQbar can be reduced
to a computation over a specific absolute number field, since there
are only finitely many symbols in the input to the calculation.
Singular, etc., fully supports doing commutative algebra over absolute
number fields.  I think Singular doesn't explicitly support relative
extensions, but might be able to do them anyways by just throwing in
more variables.   So if you're asking whether computer algebra systems
such as Singular, Macaulay 2, Magma, etc., implement commutative
algebra over QQbar the answer is formally "yes", in that there is a
direct translation of any problem over QQbar into a problem they are
designed to solve.

Sage and probably the other systems are probably VERY awkward for
actually doing computations over QQbar.  There's a lot of bookkeeping
and stuff that one would have to do, and conceptually it would be
painful.  Also, being able to do relative extensions is critical,
since e.g., your coefficients could be the square roots of the primes
up to 1000, and as an absolute field they would generate an extension
of degre 2^168, which is too big.

So, I'm curious, did you envision your proposal to be to automate all
bookkeeping in translating between QQbar (as presented to the user)
and numbers fields (as fed to the backend Singular)?   I think this
would be very nice and useful.

 - William

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



[sage-support] Re: Minimal notebook - just 1 cell

2009-01-19 Thread William Stein

On Mon, Jan 19, 2009 at 5:05 PM, Robert Bradshaw
 wrote:
>
> On Jan 19, 2009, at 4:39 PM, Skylar wrote:
>
>> I was rather hoping to keep all of the great js/css and everything
>> having to do with the cell like the tab completion and the way that
>> the input and output are handled - all are fantastic in the notebook.
>> I was just hoping that I could send a single cell the way that it is
>> displayed and functioning in the full notebook to an address/port.  I
>> am not sure that using the simple server would be the best way to
>> accomplish this.
>
> You're right--it would probably would be easier to try and modify the
> notebook to get this effect. The simple API was more designed to be a
> "back end" interface.

You will probably have to copy out a bunch of javascript from

 SAGE_ROOT/devel/sage/sage/server/notebook/js.py

in some clever way into your webpage.  Then probably use
the simple API as the backend to actually do the work.

To do this right would probably require some serious refactoring
of js.py, and at least understanding that javascript code.  I'm sure
it could be done and that I could do it.  I would estimate it would
take me a week of fulltime work to do this right.  (I'm probably not
going to do this; I'm just sharing some thoughts.)

 -- William

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



[sage-support] Notebook_minimal + content management system

2009-01-19 Thread Skylar

I am wondering if anyone on this list has managed to glue a cell of
the notebook onto a content-driven web application.  If anyone has any
ideas on this front I would be interested to hear them.

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



[sage-support] Re: Minimal notebook - just 1 cell

2009-01-19 Thread Robert Bradshaw

On Jan 19, 2009, at 4:39 PM, Skylar wrote:

> I was rather hoping to keep all of the great js/css and everything
> having to do with the cell like the tab completion and the way that
> the input and output are handled - all are fantastic in the notebook.
> I was just hoping that I could send a single cell the way that it is
> displayed and functioning in the full notebook to an address/port.  I
> am not sure that using the simple server would be the best way to
> accomplish this.

You're right--it would probably would be easier to try and modify the  
notebook to get this effect. The simple API was more designed to be a  
"back end" interface.

- Robert


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



[sage-support] Re: Minimal notebook - just 1 cell

2009-01-19 Thread Robert Bradshaw

On Jan 19, 2009, at 4:27 PM, Skylar wrote:

> Yes, I am starting to understand how I can use that.  What are the
> sleep(0.5), sleep(1)'s there for?  I know that they delay execution.
> I don't know exactly what that means and why it would be useful in the
> code in that docstring.

The sleeps are there just to give the server (which runs in a  
different thread in the background) time to start up.

- Robert



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



[sage-support] Re: number field question

2009-01-19 Thread Alex Raichev

Hi everyone:

I'm applying for a grant from the New Zealand government to fund some
Sage development in the area of computational algebraic and analytic
geometry.  For part of the application i need to report on the 'state
of the field'.  Part of my response to this will be to mention that
Sage doesn't have an implementation of factorization, ideal, and
variety calculations over QQbar.  To double-check, is this true?
Related to that, do any major computer algebra systems (Singular
included) have such implementations?

Alex

On Dec 5 2008, 10:55 am, "William Stein"  wrote:
> On Thu, Dec 4, 2008 at 1:48 PM, AlexRaichev wrote:
>
> > Thanks for your help, Carl.  Where did you find the documentation for
> > the command number_field_elements_from_algebraics(c)?
>
> I'm guessing Carl knew about that command since he implemented it.
>
> Typing
>
> sage: help(sage.rings.qqbar)
>
> in Sage is pretty helpful too.
>
> >    Yes, i'd find it very useful to have ideal and variety
> > computations over QQbar implemented.  I don't have the know-how or the
> > time at present to do this myself, but i am learning more about Sage
> > every day and my next job might support this endeavor more than my
> > present one.  So perhaps in the future i can work on this.
>
> > Alex
>
> Awesome.  I hope you get said next job!
>
>  -- William
>
>
>
>
>
> > On Dec 4, 9:31 am, Carl Witty  wrote:
> >> On Nov 30, 1:27 pm, AlexRaichev wrote:
>
> >> > > It would be helpful if you could give a more concrete example, e.g., a 
> >> > > session
> >> > > where you have some elements, and finally want to do something with 
> >> > > them.
>
> >> > That's good idea, William.  Let me back up to and change my question
> >> > to a more fundamental one.  How does one compute in QQbar with Sage?
> >> > For example, how about factoring a polynomial, computing a radical
> >> > ideal, or computing a variety (see below)?  I get the same error for
> >> > all these: "no conversion of this ring to a Singular ring defined".
>
> >> > Alex
>
> >> None of these things are implemented for polynomials over QQbar; and
> >> as far as I know there are no plans to implement them.
>
> >> Simpler variants of a couple of your problems are implemented:
>
> >> For univariate polynomials, you can find the roots with .roots
> >> (ring=QQbar), and it's trivial to compute the factorization from
> >> there.
>
> >> You can compute the variety (over QQbar) of a zero-dimensional ideal
> >> of polynomials with rational coefficients, using .variety(ring=QQbar).
>
> >> It would be great to have more functionality implemented for
> >> polynomials over QQbar; is that something you would be interested in
> >> contributing?
>
> >> Carl
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://wstein.org
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Minimal notebook - just 1 cell

2009-01-19 Thread Skylar

I was rather hoping to keep all of the great js/css and everything
having to do with the cell like the tab completion and the way that
the input and output are handled - all are fantastic in the notebook.
I was just hoping that I could send a single cell the way that it is
displayed and functioning in the full notebook to an address/port.  I
am not sure that using the simple server would be the best way to
accomplish this.

> Yes, use the simple api that was designed. See the doctstring at the  
> top ofhttp://hg.sagemath.org/sage-main/file/b0aa7ef45b3c/sage/server/
> simple/twist.py
>
> - Robert
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Minimal notebook - just 1 cell

2009-01-19 Thread Skylar

Yes, I am starting to understand how I can use that.  What are the
sleep(0.5), sleep(1)'s there for?  I know that they delay execution.
I don't know exactly what that means and why it would be useful in the
code in that docstring.

On Jan 19, 5:52 pm, Robert Bradshaw 
wrote:

>
> Yes, use the simple api that was designed. See the doctstring at the  
> top ofhttp://hg.sagemath.org/sage-main/file/b0aa7ef45b3c/sage/server/
> simple/twist.py

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



[sage-support] Re: Finding a duplicated vector in a list of vectors

2009-01-19 Thread David Joyner

You're right. This is what I meant:

sage: L = [vector([1,0,0]), vector([1,2,0]), vector([1,0,3]), vector([1,0,0])]
sage: LL = [tuple(v.list()) for v in L]
sage: Set(LL)
{(1, 0, 0), (1, 0, 3), (1, 2, 0)}

But that is probably what you said in the first place.

Here's another idea:

sage: L = [vector([1,0,0]), vector([1,2,3]), vector([1,2,3]), vector([1,0,0])]
sage: iL = Set([L.index(v) for v in L])
sage: [L[i] for i in iL]
[(1, 0, 0), (1, 2, 3)]


Does this help in your situatiuon?


On Mon, Jan 19, 2009 at 6:26 PM, slabbe  wrote:
>
>> I don't know if this is the best idea or not but I definitely have
>> run into this problem before and what I think I did was
>> to store the list of vectors as a *Set* of *lists*.
>
> Are you sure? Because as vectors, lists are unhashable :
>
> ...
> TypeError: list objects are unhashable
> >
>

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



[sage-support] Re: Jordan Normal Form Problem

2009-01-19 Thread Jason Grout

c mullan wrote:
> Hi all,
> 
> by general theory I know that an invertible transformation matrix P
> exists such that A = ~P*J*P where J is the Jordan Normal Form of a
> square matrix A. When I try to calculate P, some strange things
> happen..
> 
> M=MatrixSpace(GF(2),7)
> A=M.random_element()
> f=A.charpoly()
> d = lcm([p.degree() for p,e in f.factor()])
> J,P=A.jordan_form(GF(2^d,'b'),transformation=True)  # in general,
> A's e.values will live in an extension field
> 
> In some instances I get an error message like:
> 
> ValueError: cannot compute the basis of the Jordan block of size 6
> with eigenvalue 0
> 


Can you give a specific example of it not working, or if the above 
example doesn't work, exactly what you expect?  When I run the above 
commands in 3.2.3, I get the following.  Note that there was a bug in 
the Jordan Form code a few versions back, so you might be running into 
problems if you are running an old version of Sage.

sage: M=MatrixSpace(GF(2),7)
sage: A=M.random_element()
sage: f=A.charpoly()
sage: d = lcm([p.degree() for p,e in f.factor()])
sage: J,P=A.jordan_form(GF(2^d,'b'),transformation=True)
sage: J

[1|0|0|0 0|0 0]
[-+-+-+---+---]
[0|b|0|0 0|0 0]
[-+-+-+---+---]
[0|0|b + 1|0 0|0 0]
[-+-+-+---+---]
[0|0|0|0 1|0 0]
[0|0|0|0 0|0 0]
[-+-+-+---+---]
[0|0|0|0 0|0 1]
[0|0|0|0 0|0 0]
sage: P

[0 1 1 1 0 1 1]
[1 1 1 0 0 1 0]
[0 b + 1 b 1 1 1 0]
[0 0 0 1 0 1 0]
[1 1 1 0 1 0 1]
[0 1 1 1 1 0 1]
[0 1 1 1 0 0 1]


Jason


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



[sage-support] Re: Finding a duplicated vector in a list of vectors

2009-01-19 Thread slabbe

> I don't know if this is the best idea or not but I definitely have
> run into this problem before and what I think I did was
> to store the list of vectors as a *Set* of *lists*.

Are you sure? Because as vectors, lists are unhashable :

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



[sage-support] Jordan Normal Form Problem

2009-01-19 Thread c mullan

Hi all,

by general theory I know that an invertible transformation matrix P
exists such that A = ~P*J*P where J is the Jordan Normal Form of a
square matrix A. When I try to calculate P, some strange things
happen..

M=MatrixSpace(GF(2),7)
A=M.random_element()
f=A.charpoly()
d = lcm([p.degree() for p,e in f.factor()])
J,P=A.jordan_form(GF(2^d,'b'),transformation=True)  # in general,
A's e.values will live in an extension field

In some instances I get an error message like:

ValueError: cannot compute the basis of the Jordan block of size 6
with eigenvalue 0

(nothing special about the e.value 0 here) and in other instances I
get no error messages but the matrix P is singular!

Can anyone see what the problem is here?
Thanks.
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Minimal notebook - just 1 cell

2009-01-19 Thread Robert Bradshaw

On Jan 19, 2009, at 1:34 PM, Skylar wrote:

>
> Hello,
>
> I have been annoying the good folks of #sage-devel hoping to hack
> together a way to make notebook() run but be able to retrieve just 1
> cell of a worksheet for insertion into another webpage.  Does anyone
> have a quick hack that I can use here?

Yes, use the simple api that was designed. See the doctstring at the  
top of http://hg.sagemath.org/sage-main/file/b0aa7ef45b3c/sage/server/ 
simple/twist.py

- Robert


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



[sage-support] Re: Finding a duplicated vector in a list of vectors

2009-01-19 Thread David Joyner

I don't know if this is the best idea or not but I definitely have
run into this problem before and what I think I did was
to store the list of vectors as a *Set* of *lists*.

On Mon, Jan 19, 2009 at 4:43 PM, slabbe  wrote:
>
> PROBLEM :
> In a list of vectors, I want to know if there is a pair of equal
> vectors.
>
> I have two solutions. The first to create an empty list L and append
> the vectors one per one. If a vector is already in L before adding it,
> then I found a pair of equal vectors. But looking if a vector belongs
> to a list is apparently very slow on my computer :
>
> sage: v = vector((1, SR(0)))
> sage: w = vector((1, sqrt(2)))
> sage: time v in [v,v,v,v,v,v,v,v,v]
> CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
> Wall time: 0.00 s
> True
> sage: time w in [v]
> CPU times: user 0.92 s, sys: 0.20 s, total: 1.12 s
> Wall time: 5.17 s
> False
> sage: time w in [v,v]
> CPU times: user 1.86 s, sys: 0.46 s, total: 2.32 s
> Wall time: 12.32 s
> False
> sage: time w in [v,v,v,v]
> CPU times: user 4.83 s, sys: 1.14 s, total: 5.97 s
> Wall time: 32.42 s
> False
>
> My second solution is to put them in a set. But since vectors are not
> hashable, I first convert them into tuples. But I then get two equal
> vectors having distinct hash values:
>
> sage: z = vector((1,sqrt(2)-sqrt(2))); z
> (1, 0)
> sage: v = vector((1, SR(0))) ; v
> (1, 0)
> sage: z == v
> True
> sage: tuple(z) == tuple(v)
> True
> sage: hash(tuple(z))
> -1374268819
> sage: hash(tuple(v))
> 1302034650
> sage: map(type, z)
> [,
>  ]
> sage: map(type, v)
> [,
>  ]
>
> Anybody has a better idea?
>
> Thank you
>
> Sébastien Labbé
>
> >
>

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



[sage-support] Finding a duplicated vector in a list of vectors

2009-01-19 Thread slabbe

PROBLEM :
In a list of vectors, I want to know if there is a pair of equal
vectors.

I have two solutions. The first to create an empty list L and append
the vectors one per one. If a vector is already in L before adding it,
then I found a pair of equal vectors. But looking if a vector belongs
to a list is apparently very slow on my computer :

sage: v = vector((1, SR(0)))
sage: w = vector((1, sqrt(2)))
sage: time v in [v,v,v,v,v,v,v,v,v]
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall time: 0.00 s
True
sage: time w in [v]
CPU times: user 0.92 s, sys: 0.20 s, total: 1.12 s
Wall time: 5.17 s
False
sage: time w in [v,v]
CPU times: user 1.86 s, sys: 0.46 s, total: 2.32 s
Wall time: 12.32 s
False
sage: time w in [v,v,v,v]
CPU times: user 4.83 s, sys: 1.14 s, total: 5.97 s
Wall time: 32.42 s
False

My second solution is to put them in a set. But since vectors are not
hashable, I first convert them into tuples. But I then get two equal
vectors having distinct hash values:

sage: z = vector((1,sqrt(2)-sqrt(2))); z
(1, 0)
sage: v = vector((1, SR(0))) ; v
(1, 0)
sage: z == v
True
sage: tuple(z) == tuple(v)
True
sage: hash(tuple(z))
-1374268819
sage: hash(tuple(v))
1302034650
sage: map(type, z)
[,
 ]
sage: map(type, v)
[,
 ]

Anybody has a better idea?

Thank you

Sébastien Labbé

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



[sage-support] Minimal notebook - just 1 cell

2009-01-19 Thread Skylar

Hello,

I have been annoying the good folks of #sage-devel hoping to hack
together a way to make notebook() run but be able to retrieve just 1
cell of a worksheet for insertion into another webpage.  Does anyone
have a quick hack that I can use here?

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



[sage-support] getting output of one matrix row in two workbook lines

2009-01-19 Thread Mate Kosor

I am using Sage workbook 3.2.3. in Mozilla Firefox 3.0.5 I have a
problem with matrix output.

Line:
matrix([[diff(v_r(r, z), r), 0, diff(v_z(r, z), r)/2], [0, 0, 0],[diff
(v_z(r, z), r,)/2, 0, 0]])

produces output where one matrix row spans 2 rows on web browser
worksheet, like this
[  diff(v_r(r, z), r, 1)   0 diff(v_z(r, z), r,
1)/2]
[  0   0
0]
[diff(v_z(r, z), r, 1)/2   0
0]

I have tried zooming out, which changes to smaller font, without
success.

How can I get a matrix row in one line only?

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



[sage-support] Re: lost connection to maxima

2009-01-19 Thread mabshoff



On Jan 19, 10:07 am, "ma...@mendelu.cz"  wrote:
> On 14 Led, 08:50, mabshoff 

Hi Robert,

> To finish this thread: I had another lecture in computer lab today. We
> had 2GB RAM, very  very big swap and 15 rather slow students with
> allmost no experiences with computer algebra systems ( = short
> worksheets and not many requests in short time). No problem occured
> today.

Thanks for the update. Please let us know if you run into any more
trouble or want to share more of your experience with Sage with us.

> I hope, this information could be usefull for some other educators
> using sage.
>
> Thank you for your help.
>
> Robert M.

Cheers,

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



[sage-support] Re: lost connection to maxima

2009-01-19 Thread ma...@mendelu.cz



On 14 Led, 08:50, mabshoff  wrote:
>
> Your server calls Maxima and without taking a closer look it is
> unclear to me if you start a Maxima process per user or not. Overall
> Maxima is lighter than Sage primarily because it is all common lisp
> and does not use any external libraries per default, which is one of
> the reasons Sage's memory footprint is larger than Maxima's. OTOH
> Maxima is missing a lot of he functionality that Sage provides, but
> the price we pay for that is a larger footprint. So if you were to use
> Sage "just" as a tool to do calculus (which is mostly handled by
> Maxima at the moment) we cannot be less large than Maxima by itself :)

To finish this thread: I had another lecture in computer lab today. We
had 2GB RAM, very  very big swap and 15 rather slow students with
allmost no experiences with computer algebra systems ( = short
worksheets and not many requests in short time). No problem occured
today.

I hope, this information could be usefull for some other educators
using sage.

Thank you for your help.

Robert M.

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



[sage-support] Re: graph.automorphism_group(translation=True) gives error in 3.2.3

2009-01-19 Thread Robert Miller

Nikos,

> It seems that when the vertices are labelled 0,..., n-1 then the
> translation is simply 0 <-> n, and the rest is fixed.  At least
> this is the case with all examples I've seen.  Can I assume that
> this will allways be the case?

This is what happens. At first, the graph calls its relabel command
with no arguments. See

sage: G.relabel??

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



[sage-support] Re: unstable modules + creating a small library

2009-01-19 Thread John H Palmieri

On Jan 19, 6:28 am, Pierre  wrote:
> hi all
>
> I've just realized that SAGE knows about the Steenrod algebra now.
> Does it know about unstable modules, too ?

No, it doesn't, unfortunately.  (Sage doesn't know about tensor
products, which has delayed me from implementing various things, like
the coproduct, and I suppose modules.)

> I have another, related question. I have computed the unstable module
> structure on the mod 2 cohomology rings of quite a bunch of finite
> groups, see
>
> http://www-irma.u-strasbg.fr/~guillot/research/cohomology_of_groups/i...

This looks very nice.

> I was thinking that I should, somehow, provide a file readable by SAGE
> so that people could use these algebras.

Sure.

> For one thing it would
> provide many examples of unstable modules, which is always good to
> test ideas about the Steenrod algebra. And regardless of the steenrod
> operations, even the cohomology rings, as computed by Carlson and
> others, are not available in SAGE yet (they're there as Magma files).
> At this point I can relatively easily provide a partial translation
> into SAGE.

I think Simon King does some group cohomology computations with Sage,
but I don't know exactly how he does it.

> However I was wondering about the best "format" for this: assuming the
> unstable algebra class does not exist, shall I present the algebras as
> quotients of polynomial rings ? or just give a couple of SAGE lists
> with the generators and relations, possibly just members of the formal
> ring ? or something pickled perhaps ? I really don't know. Note that
> I've got more information on these algebras yet (Stiefel-Whitney
> classes...)

It sounds to me as though you should create a new class, the
UnstableAlgebra class, or the ModularGroupCohomology class, or
something, which should derive from the class of quotients of
polynomial algebras (so you can define at least part of the structure
by specifying such a quotient), and then there should be extra
structure: the Steenrod operations and Stiefel-Whitney classes and
whatever else you have.

> And shall I think of a mechanism for people to download ALL the
> examples at once rather than separately ? (perhaps useful to try a
> conjecture about unstable modules ?)

You might have two files: one which defines the class, and another
which presents all of the examples.  I haven't used databases in Sage,
but perhaps the examples could be a dictionary indexed by the group,
or something like that?

I'm looking forward to whatever you come up with.

  John Palmieri

> suggestions most welcome.
> Thanks,
>
> pierre



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



[sage-support] Operator for Function Composition

2009-01-19 Thread kcrisman


>
> With an operator (say @@) for iterated composition,
> I could write simply instead:
>
> sage: f = lambda e: integrate(e,x)
> sage: (f @@ 4)(_)

I will ask the stupid question:  Can SymbolicComposition etc. in the
calculus module be used for this after making something symbolic?

(My guess is no, since it wasn't brought up.)

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



[sage-support] unstable modules + creating a small library

2009-01-19 Thread Pierre

hi all

I've just realized that SAGE knows about the Steenrod algebra now.
Does it know about unstable modules, too ?

I have another, related question. I have computed the unstable module
structure on the mod 2 cohomology rings of quite a bunch of finite
groups, see

http://www-irma.u-strasbg.fr/~guillot/research/cohomology_of_groups/index.html

I was thinking that I should, somehow, provide a file readable by SAGE
so that people could use these algebras. For one thing it would
provide many examples of unstable modules, which is always good to
test ideas about the Steenrod algebra. And regardless of the steenrod
operations, even the cohomology rings, as computed by Carlson and
others, are not available in SAGE yet (they're there as Magma files).
At this point I can relatively easily provide a partial translation
into SAGE.

However I was wondering about the best "format" for this: assuming the
unstable algebra class does not exist, shall I present the algebras as
quotients of polynomial rings ? or just give a couple of SAGE lists
with the generators and relations, possibly just members of the formal
ring ? or something pickled perhaps ? I really don't know. Note that
I've got more information on these algebras yet (Stiefel-Whitney
classes...)

And shall I think of a mechanism for people to download ALL the
examples at once rather than separately ? (perhaps useful to try a
conjecture about unstable modules ?)

suggestions most welcome.
Thanks,

pierre


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