[sage-support] Re: Weird behaviour in integrate code

2012-03-22 Thread ancienthart
On Wednesday, 21 March 2012 22:42:16 UTC+10, kcrisman wrote:
>
>
>> fracintegral(x,1/2)
>>>
>>  
>>>
>> 4/15*x^(5/2)/sqrt(pi)


>>
> Though you should get a deprecation error.
>

Yeah, I do. I don't know the correct way to collect a variable argument 
from inside a function call, and apply that to a named argument call. :(
(t-x)^n*func(x=t) works fine, but don't know how to change "x=" to "y=" 
without using a really ugly apply call.
 

>  
>
But when I try it on exponentials or trigonometric functions, I get the 
>> following weird error.
>>
>>
>> fracintegral(sin(x),1/2)
>>>
>>  
>>>
>>
> I can't reproduce this.
>


I've found that it seems to only show up for me if I start sage and run the 
defined function first. It is guaranteed to give me this error first time 
and will keep on giving me errors until I run the indefinite integral form 
of the same name function. Then it will sometimes give me correct-ish 
answers from then on. I've attached my sage worksheet. I'm on a 64-bit 
machine. Possible issue?
 

>  
>
>> But if I type in 
>>
>>> integrate((x-t)^(1/2)*sin(t),t)
>>
>>
>> it seems to work, but with a really weird result (expintegral_e?)
>>
>>> -1/2*sqrt(t - x)*(((expintegral_e(-1/2, -I*t + I*x) +
 expintegral_e(-1/2, I*t - I*x))*t - (expintegral_e(-1/2, -I*t + I*x) +
 expintegral_e(-1/2, I*t - I*x))*x)*sin(x) - ((-I*expintegral_e(-1/2,
 -I*t + I*x) + I*expintegral_e(-1/2, I*t - I*x))*x +
 (I*expintegral_e(-1/2, -I*t + I*x) - I*expintegral_e(-1/2, I*t -
 I*x))*t)*cos(x))


>>
> See http://trac.sagemath.org/sage_trac/ticket/11143.  This is
>
> The generalized complex exponential integral `E_n(z)`
>
> We just need to finish a few things on this, but you are welcome to use it 
> now.  
>

O, this looks goood. :D 
Is it possible to do this over a binary installation, or will I need to 
install and build from source? I'm asking because as well as my Linux 
install at home, I'm running a binary virtual image on Windows at work.

Thanks for this kcrisman,
Joal Heagney

-- 
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


Fractional Integral.sws
Description: Binary data


[sage-support] An AA field bug

2012-03-22 Thread Håkan Granath
The following code fails for me (on Ubuntu 10.10, 32 bit, Sage 4.8
compiled from source):

m=sqrt(sin(pi/5))
AA(m).minpoly()

I also fails on http://sagemath.org/eval.html

/Håkan


--
| Sage Version 4.8, Release Date: 2012-01-20 |
| Type notebook() for the GUI, and license() for information.|
--
sage: m=sqrt(sin(pi/5))
sage: m.minpoly() # works
x^8 - 5/4*x^4 + 5/16
sage: QQbar(m).minpoly() # works
x^8 - 5/4*x^4 + 5/16
sage: AA(m).minpoly() # does not work
 ...
 
 ...
TypeError: Unable to convert number to real interval.

-- 
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] An AA field bug

2012-03-22 Thread William Stein
On Thu, Mar 22, 2012 at 7:55 AM, Håkan Granath  wrote:
> The following code fails for me (on Ubuntu 10.10, 32 bit, Sage 4.8
> compiled from source):
>
> m=sqrt(sin(pi/5))
> AA(m).minpoly()
>
> I also fails on http://sagemath.org/eval.html
>
> /Håkan
>
>
> --
> | Sage Version 4.8, Release Date: 2012-01-20 |
> | Type notebook() for the GUI, and license() for information.    |
> --
> sage: m=sqrt(sin(pi/5))
> sage: m.minpoly() # works
> x^8 - 5/4*x^4 + 5/16
> sage: QQbar(m).minpoly() # works
> x^8 - 5/4*x^4 + 5/16
> sage: AA(m).minpoly() # does not work
>  ...
>  
>  ...
> TypeError: Unable to convert number to real interval.

This is now http://trac.sagemath.org/sage_trac/ticket/12727

>
> --
> 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] An AA field bug

2012-03-22 Thread William Stein
On Thu, Mar 22, 2012 at 8:14 AM, William Stein  wrote:
> On Thu, Mar 22, 2012 at 7:55 AM, Håkan Granath  
> wrote:
>> The following code fails for me (on Ubuntu 10.10, 32 bit, Sage 4.8
>> compiled from source):
>>
>> m=sqrt(sin(pi/5))
>> AA(m).minpoly()
>>
>> I also fails on http://sagemath.org/eval.html
>>
>> /Håkan
>>
>>
>> --
>> | Sage Version 4.8, Release Date: 2012-01-20 |
>> | Type notebook() for the GUI, and license() for information.    |
>> --
>> sage: m=sqrt(sin(pi/5))
>> sage: m.minpoly() # works
>> x^8 - 5/4*x^4 + 5/16
>> sage: QQbar(m).minpoly() # works
>> x^8 - 5/4*x^4 + 5/16
>> sage: AA(m).minpoly() # does not work
>>  ...
>>  
>>  ...
>> TypeError: Unable to convert number to real interval.
>
> This is now http://trac.sagemath.org/sage_trac/ticket/12727

There is now a patch up, waiting for somebody to review it!

William

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


Re: [sage-support] An AA field bug

2012-03-22 Thread David Loeffler


On Thursday, 22 March 2012 12:23:50 UTC, William wrote:
>
> 
>
> There is now a patch up, waiting for somebody to review it!
>
> William
>
Done. -- David
 

-- 
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] An AA field bug

2012-03-22 Thread William Stein
On Thu, Mar 22, 2012 at 9:55 AM, David Loeffler  wrote:
>
>
> On Thursday, 22 March 2012 12:23:50 UTC, William wrote:
>>
>> There is now a patch up, waiting for somebody to review it!
>>
>> William
>
> Done. -- David
>

Thanks!  And let me take the time to advertise your work doctesting
QQbar's code:

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

Please, somebody referee the above!

William

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



-- 
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] Re: Sorting a list of number field elements

2012-03-22 Thread David Loeffler


On Wednesday, 21 March 2012 16:42:27 UTC, Emil wrote:
>
> Hi David, thanks for your reply!
>
> I was wondering if there is a way to automatically get the desired
> embedding into AA. [snip] Do you think it is worth me making a
> ticket for this?
>
That's more or less what the ticket 12715 I opened is for: Sage should 
"know" how to embed the field into AA.

Regards, David

-- 
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: Weird behaviour in integrate code

2012-03-22 Thread kcrisman


On Thursday, March 22, 2012 5:46:58 AM UTC-4, ancienthart wrote:
>
> On Wednesday, 21 March 2012 22:42:16 UTC+10, kcrisman wrote:
>>
>>
>>> fracintegral(x,1/2)

>>>  

>>> 4/15*x^(5/2)/sqrt(pi)
>
>
>>>
>> Though you should get a deprecation error.
>>
>
> Yeah, I do. I don't know the correct way to collect a variable argument 
> from inside a function call, and apply that to a named argument call. :(
> (t-x)^n*func(x=t) works fine, but don't know how to change "x=" to "y=" 
> without using a really ugly apply call.
>  
>

I'm not sure either offhand, and don't have time to think about it :(  I 
think this is an excellent type of question for ask.sagemath.org, 
especially since the new sage-support interface has been annoying for a lot 
of people on sage-support.
 

> I've found that it seems to only show up for me if I start sage and run 
> the defined function first. It is guaranteed to give me this error first 
> time and will keep on giving me errors until I run the indefinite integral 
> form of the same name function. Then it will sometimes give me correct-ish 
> answers from then on. I've attached my sage worksheet. I'm on a 64-bit 
> machine. Possible issue?
>

No idea, though hopefully someone will know.  It looks like you are "pretty 
printing", or at least so the traceback indicates, so maybe this is part of 
the problem.  Again, one would have to dive into the details.  Here I hope 
someone will take the time to do it on this list.  I can't even get RSS for 
the new Google groups interface, truly bizarre.



>> The generalized complex exponential integral `E_n(z)`
>>
>> We just need to finish a few things on this, but you are welcome to use 
>> it now.  
>>
>
> O, this looks goood. :D 
> Is it possible to do this over a binary installation, or will I need to 
> install and build from source? I'm asking because as well as my Linux 
> install at home, I'm running a binary virtual image on Windows at work.
>
>
You should be able to import the patch using hg_sage (see the developer 
guide for how to apply a patch, though I think you know how to do this) and 
then rebuild Sage using "sage -b", which will change the relevant files and 
then you should be in better shape with that.

>
>

-- 
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: Jmol applets

2012-03-22 Thread Jan Groenewald
Hi

This is worked around by in firefox in about:config, setting
dom.ipc.plugins.java.enabled to true.

From:
http://ubuntudanmark.dk/forum/viewtopic.php?f=24&t=15645

Regards,
Jan


On 21 March 2012 11:58, Simon King  wrote:

> Hi Jan,
>
> Am Dienstag, 20. März 2012 20:30:15 UTC+1 schrieb Simon King:
>
>> Jan Groenewald  aims.ac.za> writes:
>> > In short, random, bad results. I guess we need some better test cases
>> for
>> this?
>> > And I think you need to run it several times, evaluating, closeing and
>> opening
>>
>> OK. But recall that when I say "crash" then I mean that the computer shut
>> down
>> immediately. Nevertheless, I will try, even if that would involve to
>> reboot my
>> computer repeatedly...
>>
>> Fortunatley, I was not able to reproduce the bug. I tested
> sage-5.0.beta8, built with system gcc or with gcc-spkg, built in parallel
> or serially, and built without CFLAGS or with C(XX)FLAGS="-O3 -march=native
> ". I repeated the example 5 to 10 times in each setting, and it worked
> without problems.
>
> Cheers,
> Simon
>
> --
> 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
>



-- 
  .~.
  /V\ Jan Groenewald
 /( )\www.aims.ac.za
 ^^-^^

-- 
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: Vehicle routing problems in sage

2012-03-22 Thread Nathann Cohen
Hell Chris !!!

> I found that when installing cbc I had to add "#include " to
> CbcEventHandler.cpp, otherwise I got compilation errors about NULL not
> being defined.

Arg... Well, this interface is being rewritte anyway. I had a lot of
things to do during the previous week (job application) but I should find
some time to take care of these nasty patches in the next days :-)

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

> I'm using gcc 4.6.1.  The glpk install went smoothly. I
> noticed on your tutorial you also mention IBM's CPLEX.  Are the sage
> wrappers for it open source?

They are ! It is actually part of Sage's source code :
http://hg.sagemath.org/sage-main/file/c239be1054e0/sage/numerical/backends

And you will find at the bottom of this page the instructions to use CPLEX
with Sage :

http://www.sagemath.org/doc/thematic_tutorials/linear_programming.html

Note that the latest version of CPLEX requires an additional symbolic link.
The previous page has not been updated since this ticket is still waiting
for review :

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

> In terms of parallel algorithms, I'm really not sure what would be
> appropriate at this point. I thought there might be some genetic
> algorithms that could take advantage of parallelism and possibly also
> ways to parallelize the objective functions. At the moment I'm mainly
> looking into the background on various logistic and transportation
> problems.

Hmmm... O_o

Well, I do not understand what you mean by "parallelize the objective
functions", but if you try to implement something at some point I guess it
will be the kind of stuff that gets me interested immediately :-)

Nathann

-- 
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] numpy vectorize and cython

2012-03-22 Thread Jim Clark
Hello experts,

Running sage version 4.8 on Mac OS X 10.6.8.
I am attempting to cython-ize a sage script that applies numpy, but I can't get 
cython to compile numpy.vectorize — the error message is

ValueError: failed to determine the number of arguments for 

Is this a bug in cython, or am I mis-applying numpy and cython?

The test script (test.spyx) that produces this error is

import numpy as np
cimport numpy as np
gamma = 1.4
def pressure(rho, u, v, rho_E): return (gamma - 1) * (rho_E - rho * (u * u + v 
* v) / 2.)
vpressure = np.vectorize(pressure, otypes = [np.float], \
 doc = "Vectorized pressure(rho, u, v, rho*E)")

and the full error traceback when I invoke sage: load("test.spyx") is:

Compiling /Users/jim/Documents/Fluid_Mechanics/AA543_HW5/test.spyx...
---
ValueErrorTraceback (most recent call last)

/Users/jim/ in ()

/Applications/sage/local/lib/python2.6/site-packages/sage/structure/sage_object.so
 in sage.structure.sage_object.load (sage/structure/sage_object.c:7715)()

/Applications/sage/local/lib/python2.6/site-packages/sage/misc/preparser.pyc in 
load(filename, globals, attach)
   1648 elif fpath.endswith('.spyx') or fpath.endswith('.pyx'):
   1649 import interpreter
-> 1650 exec(interpreter.load_cython(fpath), globals)
   1651 elif fpath.endswith('.m'):
   1652 # Assume magma for now, though maybe .m is used by maple and

/Users/jim/ in ()

/Users/jim/_Users_jim_Documents_Fluid_Mechanics_AA543_HW5_test_spyx_1.pyx in 
init _Users_jim_Documents_Fluid_Mechanics_AA543_HW5_test_spyx_1 
(_Users_jim_Documents_Fluid_Mechanics_AA543_HW5_test_spyx_1.c:3322)()
  7 cimport numpy as np
  8 gamma = 1.4
  9 def pressure(rho, u, v, rho_E): return (gamma - 1) * (rho_E - rho * (u 
* u + v * v) / 2.)
---> 10 vpressure = np.vectorize(pressure, otypes = [np.float], \
 11  doc = "Vectorized pressure(rho, u, v, rho*E)")

/Applications/sage/local/lib/python2.6/site-packages/numpy/lib/function_base.pyc
 in __init__(self, pyfunc, otypes, doc)
   1767 self.thefunc = pyfunc
   1768 self.ufunc = None
-> 1769 nin, ndefault = _get_nargs(pyfunc)
   1770 if nin == 0 and ndefault == 0:
   1771 self.nin = None

/Applications/sage/local/lib/python2.6/site-packages/numpy/lib/function_base.pyc
 in _get_nargs(obj)
   1699 
   1700 raise ValueError(
-> 1701 "failed to determine the number of arguments for %s" % 
(obj))
   1702 
   1703 

ValueError: failed to determine the number of arguments for 

Thank you,
Jim Clark

-- 
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] Ubuntu Installation show(..) fails with Latex error

2012-03-22 Thread Graham Gerrard
Recently installed Sage on Ubuntu 11.10 from tarball source code.
Cant get the show() function to work from command line in sage.  Error is
"An error occurred. Latex error"
Looks like I have failed to link SageTex to TexLive.
Sage passed all -testall tests no problem.

TexLive is installed (apparently OK).  Tried all the options in the Sage
Installation Guide to no avail.
Even reinstalled TexLive and SageTex.  No change.
kpsewhich returns apparently sensible values for for TEX names.
Sage NoteBook DOES produce successful TEX output when the show command is
used, but still fails when "sage" is invoked via a command line prompt.

Any ideas?  Graham

-- 
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: Ubuntu Installation show(..) fails with Latex error

2012-03-22 Thread John H Palmieri


On Thursday, March 22, 2012 1:53:07 PM UTC-7, firebird wrote:
>
> Recently installed Sage on Ubuntu 11.10 from tarball source code.
> Cant get the show() function to work from command line in sage.  Error is 
> "An error occurred. Latex error"
>

First, I assume that view(...) also fails (with the same arguments you 
passed to show(...))? Is the information printed from view(..., debug=True) 
helpful?

-- 
John

-- 
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] elliptic curve extension degree

2012-03-22 Thread Kenneth A. Ribet
Consider this short sage transcript:

sage: E=EllipticCurve(GF(3),[1,1])
sage: for i in range(3):
...   print i,E.order(extension_degree=i)
0 4
1 4
2 16

Sage seem to think that E has 4 points over the field with 1 element.  Was this 
intended?

Ken

-- 
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] elliptic curve extension degree

2012-03-22 Thread William Stein
On Thu, Mar 22, 2012 at 5:22 PM, Kenneth A. Ribet  wrote:
>
> Consider this short sage transcript:
>
> sage: E=EllipticCurve(GF(3),[1,1])
> sage: for i in range(3):
> ...       print i,E.order(extension_degree=i)
> 0 4
> 1 4
> 2 16
>
> Sage seem to think that E has 4 points over the field with 1 element.  Was
> this intended?
>

When i=0, I would rather get an error message, e.g., Sage should I
think raise a ValueError.  I.e., I don't think that there is an
extension of "degree 0".  Do you agree?


> Ken
>
> --
> 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] Re: Weird behaviour in integrate code

2012-03-22 Thread ancienthart
Thanks for this. I'm very aware of how rushed you must be at the moment, so 
I really appreciate such a quick assist. (Reminds me of when Guido Van 
Rossum used to haunt the general python newsgroup.)
I am pretty printing, will attempt this again with pretty printing turned 
off and post the result back here. Will take care of the other points as 
you have suggested.
Again thank you for your help,

Joal Heagney

On Friday, 23 March 2012 00:12:27 UTC+10, kcrisman wrote:
>
>
>
> On Thursday, March 22, 2012 5:46:58 AM UTC-4, ancienthart wrote:
>>
>> On Wednesday, 21 March 2012 22:42:16 UTC+10, kcrisman wrote:
>>>
>>>
 fracintegral(x,1/2)
>
  
>
 4/15*x^(5/2)/sqrt(pi)
>>
>>

>>> Though you should get a deprecation error.
>>>
>>
>> Yeah, I do. I don't know the correct way to collect a variable argument 
>> from inside a function call, and apply that to a named argument call. :(
>> (t-x)^n*func(x=t) works fine, but don't know how to change "x=" to "y=" 
>> without using a really ugly apply call.
>>  
>>
>
> I'm not sure either offhand, and don't have time to think about it :(  I 
> think this is an excellent type of question for ask.sagemath.org, 
> especially since the new sage-support interface has been annoying for a lot 
> of people on sage-support.
>  
>
>> I've found that it seems to only show up for me if I start sage and run 
>> the defined function first. It is guaranteed to give me this error first 
>> time and will keep on giving me errors until I run the indefinite integral 
>> form of the same name function. Then it will sometimes give me correct-ish 
>> answers from then on. I've attached my sage worksheet. I'm on a 64-bit 
>> machine. Possible issue?
>>
>
> No idea, though hopefully someone will know.  It looks like you are 
> "pretty printing", or at least so the traceback indicates, so maybe this is 
> part of the problem.  Again, one would have to dive into the details.  Here 
> I hope someone will take the time to do it on this list.  I can't even get 
> RSS for the new Google groups interface, truly bizarre.
>
>
>
>>> The generalized complex exponential integral `E_n(z)`
>>>
>>> We just need to finish a few things on this, but you are welcome to use 
>>> it now.  
>>>
>>
>> O, this looks goood. :D 
>> Is it possible to do this over a binary installation, or will I need to 
>> install and build from source? I'm asking because as well as my Linux 
>> install at home, I'm running a binary virtual image on Windows at work.
>>
>>
> You should be able to import the patch using hg_sage (see the developer 
> guide for how to apply a patch, though I think you know how to do this) and 
> then rebuild Sage using "sage -b", which will change the relevant files and 
> then you should be in better shape with that.
>
>>
>>

-- 
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] semidefinite programming using csdp -- python import errors

2012-03-22 Thread Robert Samal

Hi,

I'm trying to use library Csdp  in Sage 
by means of Python numpy wrapper for CSDP called pycsdp (by B. 
Kern).
 


I was assuming that it'll be easy, as one can generally run python scripts 
from sage.

So I installed Csdp library (built against ATLAS library for linear 
algebra), and installed the above said wrapper -- which is done in a 
standard python way by 
python setup.py install
 -- and it works. But only as a "stand-alone python script".

So, next to get it running in sage: I installed it for the sage-python by
sage -python setup.py install.

Now when I run a python script that works in standalone python,
I get an import error -- undefined symbol.

  Traceback (most recent call last):
File "example2.py", line 4, in 
  from pycsdp import _csdp
  ImportError: 
/data/local/sage-4.8-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/lib/python2.6/site-packages/pycsdp/_csdp.so:
 
  undefined symbol: dnrm2_

I also found that the undefined symbol dnrm2_ is defined by the Csdp 
library, that I'd like to use. However, the setup.py script has the address 
of the library in it and it puts it where needed when installed by the 
"normal" python.

What should I do differently, to get this to work in sage? Could the ATLAS 
library I used to build Csdp be interfering with some standard sage 
libraries? (lapack etc.) 

Is there some different way to call python programs from sage, that 
wouldn't need to go through this?

Any ideas are appreciated, thanks for reading this,

   Robert Samal


P.S. I'm using
Sage Version 4.8, Release Date: 2012-01-20
with Debian/Wheezy


-- 
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] Changing basis of a symmetric matrix

2012-03-22 Thread Emil
The current project I'm working on needs to do a lot of matrix
multiplications, of the form

B * D * B.T

where D is a symmetric positive semi-definite matrix with rational
entries, B is a matrix with rational entries, and B * B.T is a
diagonal matrix (not necessarily the identity - i.e. the rows are
orthogonal, but not orthonormal, if those are the correct terms).

I was wondering if Sage will make use of the specific set-up here to
speed up the matrix product?

And if not, is there a faster way to do it?

Thanks,

Emil

-- 
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: Changing basis of a symmetric matrix

2012-03-22 Thread Jason Grout

On 3/22/12 9:03 PM, Emil wrote:

The current project I'm working on needs to do a lot of matrix
multiplications, of the form

B * D * B.T

where D is a symmetric positive semi-definite matrix with rational
entries, B is a matrix with rational entries, and B * B.T is a
diagonal matrix (not necessarily the identity - i.e. the rows are
orthogonal, but not orthonormal, if those are the correct terms).


Yes, those are the correct terms.




I was wondering if Sage will make use of the specific set-up here to
speed up the matrix product?


I don't believe that Sage will use any special algorithms to use the 
structure of D or B, though it may use some special algorithms because D 
and B are rational matrices (if they are defined as matrices over QQ).


Jason

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


[sage-support] Re: semidefinite programming using csdp -- python import errors

2012-03-22 Thread Jason Grout

On 3/22/12 8:58 PM, Robert Samal wrote:


Hi,

I'm trying to use library Csdp  in
Sage by means of Python numpy wrapper for CSDP called pycsdp (by B.
Kern)
.

I was assuming that it'll be easy, as one can generally run python
scripts from sage.

So I installed Csdp library (built against ATLAS library for linear
algebra), and installed the above said wrapper -- which is done in a
standard python way by
python setup.py install
-- and it works. But only as a "stand-alone python script".

So, next to get it running in sage: I installed it for the sage-python by
sage -python setup.py install.

Now when I run a python script that works in standalone python,
I get an import error -- undefined symbol.

Traceback (most recent call last):
File "example2.py", line 4, in 
from pycsdp import _csdp
ImportError:
/data/local/sage-4.8-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/lib/python2.6/site-packages/pycsdp/_csdp.so:
undefined symbol: dnrm2_

I also found that the undefined symbol dnrm2_ is defined by the Csdp
library, that I'd like to use. However, the setup.py script has the
address of the library in it and it puts it where needed when installed
by the "normal" python.

What should I do differently, to get this to work in sage? Could the
ATLAS library I used to build Csdp be interfering with some standard
sage libraries? (lapack etc.)

Is there some different way to call python programs from sage, that
wouldn't need to go through this?

Any ideas are appreciated, thanks for reading this,


Can you post the logs from doing sage -python setup.py instasll, as well 
as explicit instructions (where to download, etc.) for how to duplicate 
the error?


Thanks,

Jason



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