[sage-support] Re: Number theory/group of units: Are

2008-09-05 Thread Craig Citro

>  * K.complex_embeddings()  gives all the embeddings of K into CC (the
> complex numbers).
> You would need to  eliminate one of ecah conjugate pair of embeddings.
>
> TODO: implement a flag to complex_embeddings() which only gives one of
> each pair.
>

Actually, this code already exists:

sage: x = polygen(QQ); K. = NumberField(x^3-2)
sage: K.places()
[Ring morphism:
  From: Number Field in a with defining polynomial x^3 - 2
  To:   Real Field with 106 bits of precision
  Defn: a |--> 1.259921049894873164767210607278,
 Ring morphism:
  From: Number Field in a with defining polynomial x^3 - 2
  To:   Complex Field with 53 bits of precision
  Defn: a |--> -0.629960524947437 + 1.09112363597172*I]

sage: K.places(prec=53)
[Ring morphism:
  From: Number Field in a with defining polynomial x^3 - 2
  To:   Real Double Field
  Defn: a |--> 1.25992104989,
 Ring morphism:
  From: Number Field in a with defining polynomial x^3 - 2
  To:   Complex Double Field
  Defn: a |--> -0.629960524947 + 1.09112363597*I]

It doesn't do anything remarkably clever, and makes the choice to
always take the embedding with positive imaginary part. One could
easily add a flag to make this more customizable ...

-cc

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: problem with range, int, Integer and division in a loop

2008-09-05 Thread Timothy Clemans

srange gives a list of Sage integers and follows the syntax of range.

On Fri, Sep 5, 2008 at 5:41 PM, Harald Schilly <[EMAIL PROTECTED]> wrote:
>
> hello roland
>
> I cross posted this on the sage-support mailing list
> http://groups.google.com/group/sage-support
>
> regarding your bugreport:
> http://spreadsheets.google.com/pub?key=pCwvGVwSMxTzT6E2xNdo5fA
>
>> In loop "/' operand incorrect
>> Hi. Please view worksheet which is publicly viewable at 
>> http://75.75.6.176:80/home/pub/0
>> In a loop, and only then, suddenly 583/2 becomes 291 ...?
>> Roland, sage 3.1.1 on Windows/VMWare
>
> the "problem" is, that range is a native python command and all this
> happens because it is python "only".
> if you just enter numbers, sage preparses them as "Integer(n)" .. then
> they are more complex objects.
>
> there is not much to do about this, either convert to sage integers or
> well, someone has to break python - but that's extremely dangerous.
>
> so, as long as i understood your lengthy example correct, here are two
> commands, run in "pure" python to clarify:
>
 for i in range(1,6): print i/2
> ...
> 0
> 1
> 1
> 2
> 2
>
 for i in range(1,6): print float(i)/2
> ...
> 0.5
> 1.0
> 1.5
> 2.0
> 2.5
>
> -
> in sage
>
> sage: preparse("for i in range(1,6): print i/2")
> 'for i in range(Integer(1),Integer(6)): print i/Integer(2)'
>
> above, division by an integer!
>
> sage: for i in range(1,6): print i/2
> :
> 1/2
> 1
> 3/2
> 2
> 5/2
>
>
> also, you can use the "type" command to get the objects type. native
> integers are "int" and sage's "Integer"
>
> h
>
> >
>

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] problem with range, int, Integer and division in a loop

2008-09-05 Thread Harald Schilly

hello roland

I cross posted this on the sage-support mailing list
http://groups.google.com/group/sage-support

regarding your bugreport:
http://spreadsheets.google.com/pub?key=pCwvGVwSMxTzT6E2xNdo5fA

> In loop "/' operand incorrect
> Hi. Please view worksheet which is publicly viewable at 
> http://75.75.6.176:80/home/pub/0
> In a loop, and only then, suddenly 583/2 becomes 291 ...?
> Roland, sage 3.1.1 on Windows/VMWare

the "problem" is, that range is a native python command and all this
happens because it is python "only".
if you just enter numbers, sage preparses them as "Integer(n)" .. then
they are more complex objects.

there is not much to do about this, either convert to sage integers or
well, someone has to break python - but that's extremely dangerous.

so, as long as i understood your lengthy example correct, here are two
commands, run in "pure" python to clarify:

>>> for i in range(1,6): print i/2
...
0
1
1
2
2

>>> for i in range(1,6): print float(i)/2
...
0.5
1.0
1.5
2.0
2.5

-
in sage

sage: preparse("for i in range(1,6): print i/2")
'for i in range(Integer(1),Integer(6)): print i/Integer(2)'

above, division by an integer!

sage: for i in range(1,6): print i/2
:
1/2
1
3/2
2
5/2


also, you can use the "type" command to get the objects type. native
integers are "int" and sage's "Integer"

h

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: efficient determinant of matrix over polynomial ring

2008-09-05 Thread Martin Albrecht

> So we need to call Singular instead of using the native code. This is now
>
>   http://trac.sagemath.org/sage_trac/ticket/4068

Quick patch is up waiting for reviews. 

Cheers,
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-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: efficient determinant of matrix over polynomial ring

2008-09-05 Thread Martin Albrecht

On Friday 05 September 2008, phil wrote:
> R. = QQ[]
> C = random_matrix(R,10,10)
> Cdet = C.determinant()

Here's a workaround:

sage: R. = QQ[]
sage: C = random_matrix(R,8,8)
sage: %time d = C.determinant()
CPU times: user 2.64 s, sys: 0.00 s, total: 2.65 s
Wall time: 2.67 s

sage: %time d2 = R(C._singular_().det())
CPU times: user 0.04 s, sys: 0.01 s, total: 0.05 s
Wall time: 0.15 s

sage: d2 == d
True

So we need to call Singular instead of using the native code. This is now 

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

Cheers,
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-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] efficient determinant of matrix over polynomial ring

2008-09-05 Thread phil

  I have a matrix that is composed of multivariant polynomial
entries.  I want to compute its determinant.  The problem is that it
is very slow or runs out of memory.  For example,
R. = QQ[]
C = random_matrix(R,10,10)
Cdet = C.determinant()   # this line takes a long time

If you have more variables, it will run out of memory instead (on a 32
bit installation).

Is there a more efficient way to do this?  Would using symbolic
expressions then coercing back to the polynomial ring be better?

Thanks
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Suggestions for the notebook

2008-09-05 Thread Marshall Hampton

Hi,

There is a wiki page for notebook suggestions, but I don't think its
been used much lately: http://wiki.sagemath.org/Notebook_suggestions

Your suggestion (1) is good, that would be nice.  Probably wouldn't be
too hard to do.
(2) I think is problematic - the way I often use the notebook, I
wouldn't want all cells evaluated.  You can use the #auto option to
auto-evaluate.

Cheers,
M. Hampton

On Sep 5, 8:18 am, Maike <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm not sure if this mailing list is the right place for suggestions
> (sorry to all for the extra "spam", if there is a better way, please
> let me know), but here are two ideas for one of the next versions of
> the notebook:
>
> 1. Printing: At the moment the "Print" link prints all source code and
> output. It would be nice to be able to print just the code or just the
> output.
>
> 2. When I open an existing worksheet, not all cells are evaluated.
> Especially ones that start with %hide or %latex don't show the output
> until I choose "Evaluate All" from the "Actions..."-menu. It would be
> nice to have ALL cells evaluated automatically when starting up a
> worksheet.
>
> Great work so far, I'm really impressed with how quickly Sage is
> developing!
> Maike
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How do I share a notebook with collaborators?

2008-09-05 Thread Marshall Hampton

I was going to list links but maybe its easier to say this way: if you
search for "server setup" on sage-support and sage-devel you will find
several discussions of how to do it.  As far as I know there isn't a
tutorial on the wiki, but there should be.

On Sep 5, 8:58 am, Jason Grout <[EMAIL PROTECTED]> wrote:
> Stan Schymanski wrote:
> > UPDATE:
>
> > I found out that the functionality of sharing notebooks only works if
> > the notebook is already placed on a server with several users, such as
> >https://sage.math.washington.edu. In this case, clicking on "Publish"
> > results in an empty box and a list with user names from which one can
> > choose collaborators. That's awesome!
>
> > Since the sage.math.washington.edu server responds very slowly
> > (probably due to large traffic), I need to find out how to install a
> > sage notebook server on a local network. I saw some posts about this
> > previously, but if anyone knows of a good tutorial, that would be
> > great. Thanks!
>
> If you just want to start a Sage server for personal use, after you've
> installed sage, you can just start sage and type: notebook()
>
> That will start sage on the local computer so that it can only be used
> on the local computer.  If you want to install sage for lots of people
> to use on a network, it's a bit harder, but not too much.  Personally, I
> like running the VMWare image of Sage for that, since I don't have to
> worry so much about security issues.
>
> Thanks,
>
> Jason
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Upgrade to version 3.1.1

2008-09-05 Thread Mike Hansen

Hello,

> Okay, here's another big problem that seems to have come with version
> 3.1.1:
> "Edit a copy" doesn't work any more on published worksheets! Sage
> makes a copy, but I can't edit it. This is a big problem, as we're
> working with several users.

I fixed this a few days ago, and it will be in the next release.  You
can find the patch at http://trac.sagemath.org/sage_trac/ticket/3960

--Mike

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How do I share a notebook with collaborators?

2008-09-05 Thread Jason Grout

Stan Schymanski wrote:
> UPDATE:
> 
> I found out that the functionality of sharing notebooks only works if
> the notebook is already placed on a server with several users, such as
> https://sage.math.washington.edu. In this case, clicking on "Publish"
> results in an empty box and a list with user names from which one can
> choose collaborators. That's awesome!
> 
> Since the sage.math.washington.edu server responds very slowly
> (probably due to large traffic), I need to find out how to install a
> sage notebook server on a local network. I saw some posts about this
> previously, but if anyone knows of a good tutorial, that would be
> great. Thanks!

If you just want to start a Sage server for personal use, after you've 
installed sage, you can just start sage and type: notebook()

That will start sage on the local computer so that it can only be used 
on the local computer.  If you want to install sage for lots of people 
to use on a network, it's a bit harder, but not too much.  Personally, I 
like running the VMWare image of Sage for that, since I don't have to 
worry so much about security issues.

Thanks,

Jason


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Suggestions for the notebook

2008-09-05 Thread Maike

Hello,

I'm not sure if this mailing list is the right place for suggestions
(sorry to all for the extra "spam", if there is a better way, please
let me know), but here are two ideas for one of the next versions of
the notebook:

1. Printing: At the moment the "Print" link prints all source code and
output. It would be nice to be able to print just the code or just the
output.

2. When I open an existing worksheet, not all cells are evaluated.
Especially ones that start with %hide or %latex don't show the output
until I choose "Evaluate All" from the "Actions..."-menu. It would be
nice to have ALL cells evaluated automatically when starting up a
worksheet.

Great work so far, I'm really impressed with how quickly Sage is
developing!
Maike
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Upgrade to version 3.1.1

2008-09-05 Thread Maike

Okay, here's another big problem that seems to have come with version
3.1.1:
"Edit a copy" doesn't work any more on published worksheets! Sage
makes a copy, but I can't edit it. This is a big problem, as we're
working with several users.

Please help! Thanks.
Maike
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: Number theory/group of units: Are

2008-09-05 Thread Jannick Asmus

John,

apologies for the late reply.

Thanks for giving the road map of how to tackle that thing in SAGE. I am 
very sure if I can do that since I am real newbie to SAGE, but I will 
give it a try when I have the time. Maybe during the weekend.

Thank you very much.

Best wishes,
J.

On 03.09.2008 12:12, John Cremona wrote:
> That is a good question.
> 
> Sage's number fields get their units and regulator by calling the
> corresponding functions in the pari library.  As far as I can see the
> pari library does not have a function to compute th regulator of an
> arbitrary set of units.  It would not be hard to implement this in
> Sage.
> 
> The ingredients you need are:
>  * K.complex_embeddings()  gives all the embeddings of K into CC (the
> complex numbers).
> You would need to  eliminate one of ecah conjugate pair of embeddings.
> 
> TODO: implement a flag to complex_embeddings() which only gives one of
> each pair.
> 
> * Now just evaluate the embeddings on your units, take logs, construct
> the appropriate matrix of those and find its determinant.
> 
> * To find the index of your units, divide their regulator by the
> field's regulator.
> 
> I have skated over some details, like what to do if the number of your
> units is different from the unit rank.
> 
> Harder TODO:  given any unit and a Z-basis for the units, express your
> unit as a Z-linear combination of the generators.
> 
> If that was implemented, then the answer to your original question
> would be a simple matter of finding the determinant of an integer
> matrix.
> 
> These are all things which it would be good to have implemented in
> Sage.  Feel free to do so and submit a patch!
> 
> John Cremona
> 
> 2008/9/3 Jannick Asmus <[EMAIL PROTECTED]>:
>> Dear All,
>>
>> suppose that K is a number field and U the group of units in the maximal
>> order of K. Then the rank r of U, i.e. the rank r of the free group U_f=
>> U/Tor(U) (where Tor(U) denotes the group of torsion elements in U) is
>> given by Dirichlet's unit theorem. Clearly r is the dimension of the
>> Q-vector space U_Q = U (x)_Z Q.
>>
>> Sage gives a basis of U_Q (sage: K.units()).
>>
>> Now given r units u_1,...,u_r how can it be tested that the u's generate
>> U_Q - or are linearly independent over Q?
>>
>> If the structure of U_Q was additive, this might not be a problem for
>> SAGE as it is a standard problem in linear algebra boiling down to
>> calculate a determinant. But how to tackle this problem when the
>> structure of the Q-vector space is multiplicative, at least in notation.
>>
>> Alternatively we could consider the quotient group U/(u_1,...,u_r) and
>> test if it is of finite order.
>>
>> Thanks for any help.
>>
>> Please do not hesitate to ask for more information if something is
>> unclear or needs more information.
>>
>> Best wishes,
>> J.

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: How do I share a notebook with collaborators?

2008-09-05 Thread Stan Schymanski

UPDATE:

I found out that the functionality of sharing notebooks only works if
the notebook is already placed on a server with several users, such as
https://sage.math.washington.edu. In this case, clicking on "Publish"
results in an empty box and a list with user names from which one can
choose collaborators. That's awesome!

Since the sage.math.washington.edu server responds very slowly
(probably due to large traffic), I need to find out how to install a
sage notebook server on a local network. I saw some posts about this
previously, but if anyone knows of a good tutorial, that would be
great. Thanks!

Stan
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: problems with sage notebook and folder sharing on windows

2008-09-05 Thread mabshoff

On Sep 4, 7:28 pm, david <[EMAIL PROTECTED]> wrote:

Hi David,

> I just installed the VMWare  player and SAGE on my Windows XP
> machine.  The sage notebook does not come up, a slew of error messages
> are given, and the VMWare folder sharing does not seem to work.  I
> would post the error messages but there does not seem to be a way to
> copy data out of the VMWare player, nor to scroll upward in the
> window.  I also tried to run a browser outside of VMWare and open the
> localhost address given, but it did not work.  Any tips?  The sage
> version is 3.0.1 release data 2008-05-05, the VMWare is current as of
> 9-04-08.

That is rather old. Where did you get the VMWare image? The current
download version is 3.0.6 (Sage 3.1.1 is out, but the VMWare image has
not been updated yet).

I suspect your download is either corrupted or incomplete. What size
is it?

> Also the VMWare only uses about a 1/4 of the screen, even in full
> screen mode, is there a way to enlarge the font in the shell?

Hmm, VMWare might have some settings, but there is not many knobs to
tweak.

> best regards,
>
> David

Cheers,

Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] problems with sage notebook and folder sharing on windows

2008-09-05 Thread david

I just installed the VMWare  player and SAGE on my Windows XP
machine.  The sage notebook does not come up, a slew of error messages
are given, and the VMWare folder sharing does not seem to work.  I
would post the error messages but there does not seem to be a way to
copy data out of the VMWare player, nor to scroll upward in the
window.  I also tried to run a browser outside of VMWare and open the
localhost address given, but it did not work.  Any tips?  The sage
version is 3.0.1 release data 2008-05-05, the VMWare is current as of
9-04-08.

Also the VMWare only uses about a 1/4 of the screen, even in full
screen mode, is there a way to enlarge the font in the shell?

best regards,

David

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---