[sage-support] Re: log function that understands exponentiation and multiplication?

2010-06-19 Thread Daniel Dvorkin
Excellent, thank you!

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


[sage-support] Re: log function that understands exponentiation and multiplication?

2010-06-19 Thread ma...@mendelu.cz
(log(x^2*y)).simplify_full()

Robert

On 19 čvn, 23:02, Daniel Dvorkin  wrote:
> This is a newbie question that has probably been asked and answered
> before, but I can't find it in the archives.  I'd like a log function
> that "knows" the basic properties of logarithms with respect to
> exponentiation and multiplication; IOW, if I enter:
>
> (x^2 * y).log()
>
> what I get is:
>
> log(x^2*y)
>
> but what I'd like is:
>
> 2*log(x) + log(y)
>
> Is there a function that will do this, or an easy way to write my
> own?  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
URL: http://www.sagemath.org


[sage-support] log function that understands exponentiation and multiplication?

2010-06-19 Thread Daniel Dvorkin
This is a newbie question that has probably been asked and answered
before, but I can't find it in the archives.  I'd like a log function
that "knows" the basic properties of logarithms with respect to
exponentiation and multiplication; IOW, if I enter:

(x^2 * y).log()

what I get is:

log(x^2*y)

but what I'd like is:

2*log(x) + log(y)

Is there a function that will do this, or an easy way to write my
own?  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
URL: http://www.sagemath.org


[sage-support] Re: bad linebreaks in published worksheets

2010-06-19 Thread ma...@mendelu.cz
On 19 čvn, 20:11, William Stein  wrote:
> No, I do *not* see this bug:
>
> http://sagenb.org/home/pub/2162/

Thanks for testing, this "bug" seems to be caused by my web browser (K-
Meleon). Everything is O.K. with Firefox.

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
URL: http://www.sagemath.org


Re: [sage-support] search for ability to reference sage variable within html block in notebook

2010-06-19 Thread William Stein
On Mon, Jun 7, 2010 at 12:56 AM, Dmitry Semikin
 wrote:
> Hi,
> I'm watching for the ability to create html block, which references
> sage varible in notebook. So, the questions:
>
> 1) is it possible to reference sage variable from TiniMCE html block?
>
> or
>
> 2) is it possible to generate normal (not '') html block as
> output of sage cell
>
> Rationale:
> It is much more convenient to read problem statement and results of
> calculations as reach text (mean html), which has introductory words
> and formatted with bolds, italic, headers, includes typesetted
> fromulas etc.
>
> But now as I cannot reference sage variable (e. g. with result) within
> html block, I have to manually copy its value, obtained as result of
> calculation cell  (or defined within sage cell) to the html block
> (which is not very convenient), or to be satisfied with poor output of
> calculation cell (or look for varables definition within cell itself).
>
> Example of intended usage:
>
> sage_cell {
> %hide
> #auto
> a = 10
> b = 20
> }
>
> html_block {
> Problem statement
> We are solving the problem about ... 
> Solution is given with $$ c = a + b, $$ 
> where
> $a =  $ - descriptionn of variable
> a...
> $b =  $ - description of variable
> b...
> }
>
> sage_cell {
> c = a + b
> # actually inmplementation of some long calculation goes here. May be
> with %hide option
> }
>
> html_block {
> The result of calculation is
> $$ c = $$
> }
>
> Of course, real life example would be longer.
>
> I did not find any mentions of such kind of feature in sage
> documentation, nor in this group.
>

There is no such feature in Sage.

> I tried to implement second way of solution (see above) using html()
> sage command. But the prolems arisen. For some reason result of html()
> function is put into the '' tag in the output (although
> documentation says, that it shoud not), so it gives inconvenient
> results.

The html(...) function does not put  tags in the output:

sage: html("2")
2

sage:


The problem is that the  tags are already there -- they aren't
introduced by the html command.


> In more details, my idea was to make something like this:
> sage_cell {
> %hide
> #auto
> a = 10
> b = 20
>
> html(
> 'Problem statement'+
> 'Introductory text here (with html markup).. It can be very very
> very very very long.'+
> '$$ a = {0} $$'.format(a) +
> '$$ b = {0} $$'.format(b) +
> '... more text here, if needed ...'
> )
> }
>
> As a result of cell evaluation I would like to get necely formatted
> (html) output wich includes numbers actually used in calculations. The
> result is almost acceptable, except one thing. As it is '', the
> paragraph content is not wrapped into page width, which is
> inacceptable. Besides, it is printed with monospaced font, which is
> not fatal, but not desireable.

A hack is that you can turn off ..., e.g.,

   html('Stuff that is NOT pre  and stuff that is pre')

>
> Note, there is still ability to obtain nicely typesetted output using
> show() function like this:
>
> sage_cell{
> a_i = 12.3456789
> show('Acceleratin of i-th particle:\n$a_i = {0:.2f}'.format(float(a_i))
> +
> ' \\; \\mathrm{\\frac{m}{s^2}}$')
> }
>
> Although, there are still some clashes with braces used for format()
> function and for math markup (in the example given string is splitted
> to two for this reason). Either you should remember to escape back-
> slashes and explicitly convert sage-typed variables to float (or int)
> to use formatting.
>
>
>
>
> If someone knows some some standard methods or tricks for doing
> things, discussed above, share them.
>
> Thanks,
> Dmitry.
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



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

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


Re: [sage-support] bad linebreaks in published worksheets

2010-06-19 Thread William Stein
On Sat, Jun 19, 2010 at 11:06 AM, ma...@mendelu.cz  wrote:
> Dear sage-support,
>
> I think that publishing worksheet is broken for nontrivial worksheets
> (more than one input line in cell). Could you confirm this bug?

No, I do *not* see this bug:

http://sagenb.org/home/pub/2162/

>
> If I write three lines in one cell, like
>
> x
> x^2
> sin(x)
>
> and publish the worksheet, The published version contains one line
> only
>
> x x^2 sin(x)
>
> Has been observed on Sage 4.4.2 and Sage 4.4.3. These linebreaks are
> broken also on worksheets which have been published in previous
> versions of Sage, where there were no problems with linebreaks.
>
> Many thanks. Robert Marik
>
> ( Has been reported also at 
> http://groups.google.cz/group/sage-notebook/browse_thread/thread/f6929e89838da9d7
> several days ago. No progress yet.)
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



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

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


[sage-support] bad linebreaks in published worksheets

2010-06-19 Thread ma...@mendelu.cz
Dear sage-support,

I think that publishing worksheet is broken for nontrivial worksheets
(more than one input line in cell). Could you confirm this bug?

If I write three lines in one cell, like

x
x^2
sin(x)

and publish the worksheet, The published version contains one line
only

x x^2 sin(x)

Has been observed on Sage 4.4.2 and Sage 4.4.3. These linebreaks are
broken also on worksheets which have been published in previous
versions of Sage, where there were no problems with linebreaks.

Many thanks. Robert Marik

( Has been reported also at 
http://groups.google.cz/group/sage-notebook/browse_thread/thread/f6929e89838da9d7
several days ago. No progress yet.)

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


[sage-support] Re: Sage can't find a Python program I wrote

2010-06-19 Thread TianWei
> If you look 
> athttp://www.sagemath.org/doc/tutorial/programming.html#section-standalone
> , you find the text:
> "It is also easy to access C functions defined in separate *.c files.
> Here’s an example. Create files test.c and test.spyx in the same
> directory with contents:"
>
> I'm using VMware player + Windows, so I have no direct access to
> Windows directories. Thus WHERE must I put the files test.c and
> test.spyx?

I'm assuming you have the following configuration from bottom up:

Windows -- VMware player -- Linux -- Sage

(correct me if I'm wrong here)

If this is the case, then you would need to place the files "test.c"
and "test.spyx" inside your virtual machine, so that it would be
visible to Linux.

Once that's done, you should be able to attach the "test.spyx" file
from within a running sage session by entering:
attach("/test.spyx")

This method should always work, since this specifies an absolute path.

If you want to simply use:
   attach("test.spyx")

then "test.spyx" would need to be in a directory that sage can find.
There must be some variable that specifies which directories sage will
try to search, but I don't actually know myself.

I apologize if I completely misinterpreted your question.

-- Tianwei

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


Re: [sage-support] Quotient of two submodules

2010-06-19 Thread Dr. David Kirkby

On 06/19/10 04:15 PM, William Stein wrote:

On Sat, Jun 19, 2010 at 8:04 AM, Johannes  wrote:

I'm working with the version, contained in ubuntu 10.04


Delete that and get a recent version from http://sagemath.org/.  The
Ubuntu/Debian
version is ancient (well over 2 years old), and nobody working on Sage knows how
to update it or get it removed from Ubuntu.

William


I don't know how to do it, but

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

should stop a lot of this happening.

Dave


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


[sage-support] MILP problems defining variables giving duplicates

2010-06-19 Thread Michele Comignano

I'm modeling a flow problem on graph using sage.
Once the graph was ready I've modeled a MILP problem with constraints.
I've problems having unique variables.

What I do is to use v = p.new_variable() and subsequently use the v 
variable in a loop iterating the edges of the graph in such as:


for origin, destination, attributes in G.edges():
attributes['v_component_for_that_edgs'] = v[('origin', 'destination')]

But at the end some variable are duplicate!

The code producing that strange behavior is attached to this mail.
Is an error of mine or a Sage problem?

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
URL: http://www.sagemath.org
# -*- coding: utf8 -*-
vertices = {
'A': {'flow_balance_af': -7, 'flow_balance_fa': 12},
'B': {'flow_balance_af': 0, 'flow_balance_fa': 0},
'C': {'flow_balance_af': 0, 'flow_balance_fa': 0},
'D': {'flow_balance_af': 0, 'flow_balance_fa': 0},
'E': {'flow_balance_af': 0, 'flow_balance_fa': 0},
'F': {'flow_balance_af': 7, 'flow_balance_fa': -12}
}
edges = [
('A', 'B', {'fixed_cost': 1, 'variable_cost': 300}),
('A', 'E', {'fixed_cost': 2, 'variable_cost': 150}),
('B', 'C', {'fixed_cost': 1, 'variable_cost': 300}),
('B', 'F', {'fixed_cost': 2, 'variable_cost': 300}),
('C', 'D', {'fixed_cost': 1, 'variable_cost': 500}),
('C', 'A', {'fixed_cost': 2, 'variable_cost': 350}),
('D', 'E', {'fixed_cost': 1, 'variable_cost': 200}),
('D', 'B', {'fixed_cost': 2, 'variable_cost': 300}),
('E', 'C', {'fixed_cost': 1, 'variable_cost': 400}),
('F', 'A', {'fixed_cost': 5000, 'variable_cost': 400}),
('F', 'D', {'fixed_cost': 5000, 'variable_cost': 250}),
('F', 'E', {'fixed_cost': 5000, 'variable_cost': 300})
]
# Creating the graph
G = DiGraph()
G.add_vertices(vertices)
G.add_edges(edges)

p = MixedIntegerLinearProgram(maximization=False)

# Posta ad uno se l'arco viene scelto
choice_variable = p.new_variable()
p.set_binary(choice_variable)

# Flusso che viene instradato da A ad F attraverso un nodo se scelto
used_resource_variable_af = p.new_variable()
p.set_real(used_resource_variable_af)

# Flusso che viene instradato da F ad A attraverso un nodo se scelto
used_resource_variable_fa = p.new_variable()
p.set_real(used_resource_variable_fa)

# Assigning variables components to edges attributes
for o, d, a in G.edges():
# Associamo le variabili sugli archi in modo da facilitare il lavoro dopo
a['choice_var'] = choice_variable[(o, d)]
a['used_res_var_af'] = used_resource_variable_af[(o, d)]
a['used_res_var_fa'] = used_resource_variable_fa[(o, d)]

for a in G.edges():
print a


[sage-support] MILP problems defining variables giving duplicates

2010-06-19 Thread comick
I'm modeling a flow problem on graph using sage.
Once the graph was ready I've modeled a MILP problem with constraints.
I've problems having unique variables.

What I do is to use v = p.new_variable() and subsequently use the v
variable in a loop iterating the edges of the graph in such as:

for origin, destination, attributes in G.edges():
attributes['v_component_for_that_edgs'] = v[('origin', 'destination')]

But at the end some variable are duplicate!

The code producing that strange behavior is attached to this mail.
Is an error of mine or a Sage problem?

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
URL: http://www.sagemath.org


try.sage
Description: Binary data


Re: [sage-support] Quotient of two submodules

2010-06-19 Thread William Stein
On Sat, Jun 19, 2010 at 8:04 AM, Johannes  wrote:
> I'm working with the version, contained in ubuntu 10.04

Delete that and get a recent version from http://sagemath.org/.  The
Ubuntu/Debian
version is ancient (well over 2 years old), and nobody working on Sage knows how
to update it or get it removed from Ubuntu.

William

>
> j_sch...@neo:~$ sage -version
> | SAGE Version 3.0.5, Release Date: 2008-07-11                       |
> j_sch...@neo:~$ uname  -a
> Linux neo 2.6.31-22-generic #60-Ubuntu SMP Thu May 27 00:22:23 UTC 2010
> i686 GNU/Linux
> j_sch...@neo:~$ python --version
> Python 2.6.4
>
> greatz
>
> Am 19.06.2010 16:51, schrieb William Stein:
>> On Sat, Jun 19, 2010 at 7:33 AM, Johannes  wrote:
>>
>>> i tried the first example in the given link and i get the following error:
>>>
>>> sage: V0 = span([[1/2,0,0],[3/2,2,1],[0,0,1]],ZZ)
>>> ---
>>> TypeError                                 Traceback (most recent call last)
>>>
>>> /home/j_schn14/ in ()
>>>
>>> /usr/lib/python2.5/site-packages/sage/modules/free_module.pyc in span(R,
>>> gens, check, already_echelonized)
>>>    349         [1 0 1]
>>>    350     """
>>> --> 351     if len(gens) == 0:
>>>    352         return FreeModule(R, 0)
>>>    353     else:
>>>
>>> /usr/lib/python2.5/site-packages/sage/rings/integer_ring.so in
>>> sage.rings.integer_ring.IntegerRing_class.__len__
>>> (sage/rings/integer_ring.c:3903)()
>>>
>>> TypeError: len() of unsized object
>>>
>>> is this a bug, or am I doing something wrong?
>>> greatz Mad
>>>
>> What version of Sage are you using?  It works fine in recent versions:
>>
>> flat:Library wstein$ sage
>> --
>> | Sage Version 4.4.2, Release Date: 2010-05-19                       |
>> | Type notebook() for the GUI, and license() for information.        |
>> --
>> sage: V0 = span([[1/2,0,0],[3/2,2,1],[0,0,1]],ZZ)
>> sage:
>> sage: V0
>> Free module of degree 3 and rank 3 over Integer Ring
>> Echelon basis matrix:
>> [1/2   0   0]
>> [  0   2   0]
>> [  0   0   1]
>>
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



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

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


Re: [sage-support] Quotient of two submodules

2010-06-19 Thread Johannes
I'm working with the version, contained in ubuntu 10.04

j_sch...@neo:~$ sage -version
| SAGE Version 3.0.5, Release Date: 2008-07-11   |
j_sch...@neo:~$ uname  -a
Linux neo 2.6.31-22-generic #60-Ubuntu SMP Thu May 27 00:22:23 UTC 2010
i686 GNU/Linux
j_sch...@neo:~$ python --version
Python 2.6.4

greatz

Am 19.06.2010 16:51, schrieb William Stein:
> On Sat, Jun 19, 2010 at 7:33 AM, Johannes  wrote:
>   
>> i tried the first example in the given link and i get the following error:
>>
>> sage: V0 = span([[1/2,0,0],[3/2,2,1],[0,0,1]],ZZ)
>> ---
>> TypeError Traceback (most recent call last)
>>
>> /home/j_schn14/ in ()
>>
>> /usr/lib/python2.5/site-packages/sage/modules/free_module.pyc in span(R,
>> gens, check, already_echelonized)
>>349 [1 0 1]
>>350 """
>> --> 351 if len(gens) == 0:
>>352 return FreeModule(R, 0)
>>353 else:
>>
>> /usr/lib/python2.5/site-packages/sage/rings/integer_ring.so in
>> sage.rings.integer_ring.IntegerRing_class.__len__
>> (sage/rings/integer_ring.c:3903)()
>>
>> TypeError: len() of unsized object
>>
>> is this a bug, or am I doing something wrong?
>> greatz Mad
>> 
> What version of Sage are you using?  It works fine in recent versions:
>
> flat:Library wstein$ sage
> --
> | Sage Version 4.4.2, Release Date: 2010-05-19   |
> | Type notebook() for the GUI, and license() for information.|
> --
> sage: V0 = span([[1/2,0,0],[3/2,2,1],[0,0,1]],ZZ)
> sage:
> sage: V0
> Free module of degree 3 and rank 3 over Integer Ring
> Echelon basis matrix:
> [1/2   0   0]
> [  0   2   0]
> [  0   0   1]
>   

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


Re: [sage-support] Re: Animation

2010-06-19 Thread jrodri14ii
I installed imagemagick and Marshall's idea worked.
El jun 19, 2010, a las 8:58 a.m., John H Palmieri escribió:

> On Jun 19, 7:18 am, jrodri1...@gmail.com wrote:
>> I'm on os X Snow Leopard
> 
> Are you using the notebook interface or the command line?  I don't
> think this will work from the command line: the OS X preview command
> doesn't seem to deal with animated gif's very well.  Try saving it:
> 
> a = animate(...)
> a.save()
> 
> Then open the resulting gif file in a web browser.  Or try running the
> whole thing in the notebook.
> 
> 
>> El jun 18, 2010, a las 9:24 p.m., Marshall Hampton escribió:
>> 
>> 
>> 
>> 
>> 
>>> On Jun 17, 5:31 pm, jrodri1...@gmail.com wrote:
 I tried it, but does not do anything except plot one frame. Am I supposed 
 to see something move?
>> 
>>> Yes, it should be an animated gif.  Its possible that your system does
>>> not have the "convert" command of imagemagick installed - what sort of
>>> system are you running sage on?
>> 
>>> -Marshall
>> 
>>> --
>>> 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 
>>> athttp://groups.google.com/group/sage-support
>>> URL:http://www.sagemath.org
> 
> -- 
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org

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


[sage-support] Re: Animation

2010-06-19 Thread John H Palmieri
On Jun 19, 7:18 am, jrodri1...@gmail.com wrote:
> I'm on os X Snow Leopard

Are you using the notebook interface or the command line?  I don't
think this will work from the command line: the OS X preview command
doesn't seem to deal with animated gif's very well.  Try saving it:

a = animate(...)
a.save()

Then open the resulting gif file in a web browser.  Or try running the
whole thing in the notebook.


> El jun 18, 2010, a las 9:24 p.m., Marshall Hampton escribió:
>
>
>
>
>
> > On Jun 17, 5:31 pm, jrodri1...@gmail.com wrote:
> >> I tried it, but does not do anything except plot one frame. Am I supposed 
> >> to see something move?
>
> > Yes, it should be an animated gif.  Its possible that your system does
> > not have the "convert" command of imagemagick installed - what sort of
> > system are you running sage on?
>
> > -Marshall
>
> > --
> > 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 
> > athttp://groups.google.com/group/sage-support
> > URL:http://www.sagemath.org

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


Re: [sage-support] Re: Animation

2010-06-19 Thread jrodri14ii
Nice. Very nice. You are the MAN.
El jun 18, 2010, a las 9:24 p.m., Marshall Hampton escribió:

> 
> 
> On Jun 17, 5:31 pm, jrodri1...@gmail.com wrote:
>> I tried it, but does not do anything except plot one frame. Am I supposed to 
>> see something move?
> 
> Yes, it should be an animated gif.  Its possible that your system does
> not have the "convert" command of imagemagick installed - what sort of
> system are you running sage on?
> 
> -Marshall
> 
> -- 
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org

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


Re: [sage-support] Quotient of two submodules

2010-06-19 Thread William Stein
On Sat, Jun 19, 2010 at 7:33 AM, Johannes  wrote:
> i tried the first example in the given link and i get the following error:
>
> sage: V0 = span([[1/2,0,0],[3/2,2,1],[0,0,1]],ZZ)
> ---
> TypeError                                 Traceback (most recent call last)
>
> /home/j_schn14/ in ()
>
> /usr/lib/python2.5/site-packages/sage/modules/free_module.pyc in span(R,
> gens, check, already_echelonized)
>    349         [1 0 1]
>    350     """
> --> 351     if len(gens) == 0:
>    352         return FreeModule(R, 0)
>    353     else:
>
> /usr/lib/python2.5/site-packages/sage/rings/integer_ring.so in
> sage.rings.integer_ring.IntegerRing_class.__len__
> (sage/rings/integer_ring.c:3903)()
>
> TypeError: len() of unsized object
>
> is this a bug, or am I doing something wrong?
> greatz Mad

What version of Sage are you using?  It works fine in recent versions:

flat:Library wstein$ sage
--
| Sage Version 4.4.2, Release Date: 2010-05-19   |
| Type notebook() for the GUI, and license() for information.|
--
sage: V0 = span([[1/2,0,0],[3/2,2,1],[0,0,1]],ZZ)
sage:
sage: V0
Free module of degree 3 and rank 3 over Integer Ring
Echelon basis matrix:
[1/2   0   0]
[  0   2   0]
[  0   0   1]


>
>
> Am 19.06.2010 00:32, schrieb William Stein:
>> On Fri, Jun 18, 2010 at 3:26 PM, Mad  wrote:
>>
>>> Hi folkz,
>>> i want to create a quotient of two submodules generatet by some
>>> vektors and i don't know how to do this.
>>>
>> See the examples here:
>>
>>   http://sagemath.org/doc/reference/sage/modules/fg_pid/fgp_module.html
>>
>> Already, the first example there is what you're asking about.
>>
>> William
>>
>>
>>> i tried this:
>>> m = ZZ^2
>>> m1 = m.submodul([2,1],[1,2])  #this is ZZ^2 again, but of type
>>> 'sage.modules.free_module.FreeModule_submodule_pid'
>>> m2 = m.submodul([3,2],[2,1])
>>> #i want to do something like:
>>> mQuot = m1.quotient(m2)
>>>
>>> but m1 (or FreeModule_submodule_pid) does not have a member quotient
>>> like it has sage.modules.free_module.FreeModule_ambient_pid (of wich
>>> typ m is).
>>>
>>> How do i have to do it?
>>>
>>> greatz and thnx for your tipps and answers Mad
>>>
>>> --
>>> To post to this group, send email to sage-support@googlegroups.com
>>> To unsubscribe from this group, send email to 
>>> sage-support+unsubscr...@googlegroups.com
>>> For more options, visit this group at 
>>> http://groups.google.com/group/sage-support
>>> URL: http://www.sagemath.org
>>>
>>>
>>
>>
>>
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



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

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


Re: [sage-support] Quotient of two submodules

2010-06-19 Thread Johannes
i tried the first example in the given link and i get the following error:

sage: V0 = span([[1/2,0,0],[3/2,2,1],[0,0,1]],ZZ)
---
TypeError Traceback (most recent call last)

/home/j_schn14/ in ()

/usr/lib/python2.5/site-packages/sage/modules/free_module.pyc in span(R,
gens, check, already_echelonized)
349 [1 0 1]
350 """
--> 351 if len(gens) == 0:
352 return FreeModule(R, 0)
353 else:

/usr/lib/python2.5/site-packages/sage/rings/integer_ring.so in
sage.rings.integer_ring.IntegerRing_class.__len__
(sage/rings/integer_ring.c:3903)()

TypeError: len() of unsized object

is this a bug, or am I doing something wrong?
greatz Mad


Am 19.06.2010 00:32, schrieb William Stein:
> On Fri, Jun 18, 2010 at 3:26 PM, Mad  wrote:
>   
>> Hi folkz,
>> i want to create a quotient of two submodules generatet by some
>> vektors and i don't know how to do this.
>> 
> See the examples here:
>
>   http://sagemath.org/doc/reference/sage/modules/fg_pid/fgp_module.html
>
> Already, the first example there is what you're asking about.
>
> William
>
>   
>> i tried this:
>> m = ZZ^2
>> m1 = m.submodul([2,1],[1,2])  #this is ZZ^2 again, but of type
>> 'sage.modules.free_module.FreeModule_submodule_pid'
>> m2 = m.submodul([3,2],[2,1])
>> #i want to do something like:
>> mQuot = m1.quotient(m2)
>>
>> but m1 (or FreeModule_submodule_pid) does not have a member quotient
>> like it has sage.modules.free_module.FreeModule_ambient_pid (of wich
>> typ m is).
>>
>> How do i have to do it?
>>
>> greatz and thnx for your tipps and answers Mad
>>
>> --
>> To post to this group, send email to sage-support@googlegroups.com
>> To unsubscribe from this group, send email to 
>> sage-support+unsubscr...@googlegroups.com
>> For more options, visit this group at 
>> http://groups.google.com/group/sage-support
>> URL: http://www.sagemath.org
>>
>> 
>
>
>   

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


Re: [sage-support] Re: Animation

2010-06-19 Thread jrodri14ii
I'm on os X Snow Leopard
El jun 18, 2010, a las 9:24 p.m., Marshall Hampton escribió:

> 
> 
> On Jun 17, 5:31 pm, jrodri1...@gmail.com wrote:
>> I tried it, but does not do anything except plot one frame. Am I supposed to 
>> see something move?
> 
> Yes, it should be an animated gif.  Its possible that your system does
> not have the "convert" command of imagemagick installed - what sort of
> system are you running sage on?
> 
> -Marshall
> 
> -- 
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org

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


Re: [sage-support] Re: MemoryError

2010-06-19 Thread David Kirkby
On 29 May 2010 05:53, Rolandb  wrote:
> Tnx Robert,
>
> I rewrote the routine somewhat to use less stored values. Still I got
> the following message:
>
> error: no more memory
> System -1596988k:2096917k Appl -1763860k/20285k Malloc 277k/0k Valloc
> -1743852k/20285k Pages 612613/0 Regions 5045:5045
>
> What does this tell me?
>
> Roland

As Robert says, you are probably running out of memory.

I'm somewhat  surprised those numbers are negative though.

As Robert says - you need to provide information about your computer
system and data. I would try it on a subset of your data, and see how
far you can get. If it works on 90% of your data, you can probably get
around the problem by adding swap space. If it only works on 10%, I
doubt it will be practical, as it would be too slow.

You might want to have a read of
http://www.catb.org/~esr/faqs/smart-questions.html

Dave

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