Re: [sage-support] Very slow matrix calculations in SAGE

2011-07-13 Thread William Stein
On Wed, Jul 13, 2011 at 6:51 PM, hdevalence  wrote:
> Hello,
>
> I'm having some trouble with some matrix calculations in SAGE. I'd
> like to find the kernel of some matrices, but I think I'm doing
> something wrong, because it's very slow.
>
> For example:
> sage: M = matrix(RDF, 200,400, lambda i,j: i+j)
> sage: %time M.right_kernel()
> CPU times: user 379.39 s, sys: 0.55 s, total: 379.94 s
> Wall time: 380.66 s
> Vector space of degree 400 and dimension 398 over Real Double Field
> Basis matrix:
> 398 x 400 dense matrix over Real Double Field
>
> whereas, say, this small C++ program using the Eigen2 libraries:
> #include 
> using namespace Eigen;
> int main()
> {
>    MatrixXd m(200,400);
>    for(int i = 0; i < 200; ++i)
>        for(int j = 0; j < 400; ++j)
>            m(i,j) = i+j;
>    LU lu(m);
>    MatrixXd ker(m.rows(), lu.dimensionOfKernel());
>    lu.computeKernel(&ker);
>    return 0;
> }
>
> does the following:
> time ./matrix
>
> real    0m0.014s
> user    0m0.000s
> sys     0m0.010s
>
> Is there something I'm missing about how to use the SAGE matrix
> classes? Five orders of magnitude faster in C++ seems a bit surprising
> to me; perhaps SAGE isn't reaching ATLAS or numpy or whatever it's
> supposed to use internally?

Sage is probably just using some completely generic general
implementation of "kernel" for matrices.
There is an SVD implementation in Sage, which computes the Singular
Value Decomposition of your matrix quickly:

sage: M = matrix(RDF, 200,400, lambda i,j: i+j)
sage: time S = M.SVD()
Time: CPU 0.10 s, Wall: 0.07 s
sage:

One can read off the kernel of a matrix from the SVD (exercise in
google or linear algebra).
Hopefully you can consider writing a little function for yourself to
do this, and even better submit
a patch to trac.sagemath.org...

http://sagemath.org/doc/developer/walk_through.html

>
> Henry de Valence
>
> --
> 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] Polynomials Mod 7

2011-07-13 Thread William Stein
On Thu, Jul 14, 2011 at 3:23 AM, Mel  wrote:
> Hi,
>
> I've been having an issue with a program I've written in sage. I need
> to calculate a polynomial mod 7. When I do this using the command
> line, I don't have any trouble.  Example:
>
>
> sage: x = var('x')
> sage: y = var('y')
> sage: IntegerPolyRing. = ZZ[]
> sage: ideal = -6*x - y
> sage: ideal = IntegerPolyRing(ideal)
> sage: print type(ideal)
>  'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'>
> sage: print ideal%7
> x + 6*y
>
> However, when my program calculates an ideal which is equal to -6*x -
> y and has the type
> 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular',
> it always gets 0 for ideal%7. This happens for every ideal that the
> program calculates. I'm flummoxed. Any ideas as to what might be
> causing this?

Can you post precise directions that allow anybody to replicate your problem?

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


[sage-support] Re: Graphics() objects and a histogram

2011-07-13 Thread Jason Grout

On 7/13/11 3:29 PM, David Monarres wrote:

Hello all,

Today I was working on a top-level histogram plotting function by
exposing matplotlib's hist as a Graphics object


Nice!  Were you using http://trac.sagemath.org/sage_trac/ticket/9671 or 
doing it yourself?



and I ran into something

that has stumped me. This is not surprising since I know very little
about matplotlib and am not all that experienced with programming in
general. I mainly wanted a nice simple histogram function that worked a
lot like the current plot and plot3D. I got a working prototype done in
a couple of hours but the code I had to resort to a bit of a kludge to
get a piece to work the way that I wanted. I basically am mirroring how
the scatter_plot.py works.
My problem is how to establish the axis information (in
self.get_minmax_data()) before I have computed the histogram. The 'xmin'
and 'xmax' are functions of the data but the frequencies are a function
of the bins computed by hist. I have solved this for now by running the
histogram code twice, once when initializing the class and once when
creating the matplotlib subplot. This seems like a waste. Does anybody
have an idea of how to work around this or another part of Sage where
this problem has been solved.


It looks like in trac ticket 9671 that I did the same thing that you did.




I will post the patches to Sage if anybody is interested in their
inclusion. Though I think that most people are happy working directly
with matplotlib or finance.timeseries to really be interested.



I have wanted matplotlib histograms to be wrapped in Sage for a long 
time now.  This fall I will be teaching a modeling course where I will 
almost surely use such things.  So thanks for working on this!


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


[sage-support] Re: ultraspherical (Gegenbauer polynomials)

2011-07-13 Thread Steven Pollack
So, for anyone interested, I was able to *sort-of* solve the Gegenbauer 
polynomial problem. 

Using a lambda-function:

C = lambda (n, Lambda, x): sum( 
[(2*x)^(n-2*m)*(-1)^(m)*rising_factorial(Lambda,n-m)/(factorial(m)*factorial(n-2*m))
 
for m in [0..floor(n/2)]] )

(the definition is taken from Higher Transcendental Functions, volume 2, 
page 175) You get that C([n,a,x]) yields polynomials which are equivalent to 
GegenbauerC[n,a,x] in Mathematica (see 
here) 
or GegenbauerC(n,a,x) in Maple (see 
here
).

The important thing to note about C([n,a,x]) is that C([2,-1/2,x]) doesn't 
throw up an error, where as ultraspherical(2,-1/2,x) does. Specifically, you 
get the error:

TypeError: error evaluating "ultraspherical(2,-1/2,x)":

Error executing code in Maxima

CODE:

ultraspherical(2,-1/2,x);

Maxima ERROR:

Division by 0

 -- an error. To debug this try: debugmode(true);

Since I know, personally, that there exists a Gegenbauer polynomial 
associated to n=2 and a=-1/2, this is extremely fishy (and annoying). 

I hope this code helps anyone trying to do any work in Sage with the 
ultraspherical(n,a,x) function.

-Steven

-- 
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] Polynomials Mod 7

2011-07-13 Thread Mel
Hi,

I've been having an issue with a program I've written in sage. I need
to calculate a polynomial mod 7. When I do this using the command
line, I don't have any trouble.  Example:


sage: x = var('x')
sage: y = var('y')
sage: IntegerPolyRing. = ZZ[]
sage: ideal = -6*x - y
sage: ideal = IntegerPolyRing(ideal)
sage: print type(ideal)

sage: print ideal%7
x + 6*y

However, when my program calculates an ideal which is equal to -6*x -
y and has the type
'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular',
it always gets 0 for ideal%7. This happens for every ideal that the
program calculates. I'm flummoxed. Any ideas as to what might be
causing this?

-- 
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] Graphics() objects and a histogram

2011-07-13 Thread Tom Boothby
Sorry, I didn't read carefully; you do seem to know about the
timeseries code.  I'm assuming that the xmax is the midpoint of the
rightmost bin + half the bin width; are you doing something else?
It's hard to guess at what's going wrong if you don't post code.

FWIW, I'd prefer that "plot_histogram" were a global, along the lines of

def plot_histogram(x, *args, **kwargs):
return TimeSeries(x).plot_histogram(*args,**kwargs)

so I'm happy to see somebody working on this.

On Wed, Jul 13, 2011 at 3:29 PM, David Monarres  wrote:
> Hello all,
> Today I was working on a top-level histogram plotting function by exposing
> matplotlib's hist as a Graphics object and I ran into something that has
> stumped me. This is not surprising since I know very little about matplotlib
> and am not all that experienced with programming in general. I mainly wanted
> a nice simple histogram function that worked a lot like the current plot and
> plot3D. I got a working prototype done in a couple of hours but the code I
> had to resort to a bit of a kludge to get a piece to work the way that I
> wanted. I basically am mirroring how the scatter_plot.py works.
>
> My problem is how to establish the axis information  (in
> self.get_minmax_data()) before I have computed the histogram. The 'xmin' and
> 'xmax' are functions of the data but the frequencies are a function of the
> bins computed by hist.  I have solved this for now by running the histogram
> code twice, once when initializing the class and once when creating the
> matplotlib subplot. This seems like a waste.  Does anybody have an idea of
> how to work around this or another part of Sage where this problem has been
> solved.
>
> I have also tried to use matplotlib 'patches' which outputted by the hist
> function and add them one by one to the the subplot in _render_on_subplot(),
> but the result was shifted in a funny way and I was worried that I may be
> losing some of the generality provided by using the subplot's hist method
> for the graphics generation.
> I will post the patches to Sage if anybody is interested in their inclusion.
> Though I think that most people are happy working directly with matplotlib
> or finance.timeseries to really be interested.
> Thank you for your help.
> David Monarres
>
> --
> 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] Graphics() objects and a histogram

2011-07-13 Thread Tom Boothby
Try the following:

TimeSeries(s).plot_histogram()



On Wed, Jul 13, 2011 at 3:29 PM, David Monarres  wrote:
> Hello all,
> Today I was working on a top-level histogram plotting function by exposing
> matplotlib's hist as a Graphics object and I ran into something that has
> stumped me. This is not surprising since I know very little about matplotlib
> and am not all that experienced with programming in general. I mainly wanted
> a nice simple histogram function that worked a lot like the current plot and
> plot3D. I got a working prototype done in a couple of hours but the code I
> had to resort to a bit of a kludge to get a piece to work the way that I
> wanted. I basically am mirroring how the scatter_plot.py works.
>
> My problem is how to establish the axis information  (in
> self.get_minmax_data()) before I have computed the histogram. The 'xmin' and
> 'xmax' are functions of the data but the frequencies are a function of the
> bins computed by hist.  I have solved this for now by running the histogram
> code twice, once when initializing the class and once when creating the
> matplotlib subplot. This seems like a waste.  Does anybody have an idea of
> how to work around this or another part of Sage where this problem has been
> solved.
>
> I have also tried to use matplotlib 'patches' which outputted by the hist
> function and add them one by one to the the subplot in _render_on_subplot(),
> but the result was shifted in a funny way and I was worried that I may be
> losing some of the generality provided by using the subplot's hist method
> for the graphics generation.
> I will post the patches to Sage if anybody is interested in their inclusion.
> Though I think that most people are happy working directly with matplotlib
> or finance.timeseries to really be interested.
> Thank you for your help.
> David Monarres
>
> --
> 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: Product probability space

2011-07-13 Thread David Monarres
Does this work for you? 


sage: S = ['h','t']
sage: P = dict(zip(S,[1/2,1/2]))
sage: P
{'h': 1/2, 't': 1/2}  
sage: O = DiscreteProbabilitySpace(S,P)
sage: dict( [ ((s1,s2),P[s1]*P[s2]) for s1 in S for s2 in S] )
{('h', 't'): 1/4, ('t', 't'): 1/4, ('h', 'h'): 1/4, ('t', 'h'): 1/4}

It doesn't really use Sage, just a Python trick. 

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] Graphics() objects and a histogram

2011-07-13 Thread David Monarres
Hello all,

Today I was working on a top-level histogram plotting function by exposing 
matplotlib's hist as a Graphics object and I ran into something that has 
stumped me. This is not surprising since I know very little about matplotlib 
and am not all that experienced with programming in general. I mainly wanted 
a nice simple histogram function that worked a lot like the current plot and 
plot3D. I got a working prototype done in a couple of hours but the code I 
had to resort to a bit of a kludge to get a piece to work the way that I 
wanted. I basically am mirroring how the scatter_plot.py works.  
   
My problem is how to establish the axis information  (in 
self.get_minmax_data()) before I have computed the histogram. The 'xmin' and 
'xmax' are functions of the data but the frequencies are a function of the 
bins computed by hist.  I have solved this for now by running the histogram 
code twice, once when initializing the class and once when creating the 
matplotlib subplot. This seems like a waste.  Does anybody have an idea of 
how to work around this or another part of Sage where this problem has been 
solved. 

I have also tried to use matplotlib 'patches' which outputted by the hist 
function and add them one by one to the the subplot in _render_on_subplot(), 
but the result was shifted in a funny way and I was worried that I may be 
losing some of the generality provided by using the subplot's hist method 
for the graphics generation.  

I will post the patches to Sage if anybody is interested in their inclusion. 
Though I think that most people are happy working directly with matplotlib 
or finance.timeseries to really be interested. 

Thank you for your help. 

David Monarres

-- 
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: psi function.

2011-07-13 Thread robin
Hello Michael

thanks for this.

Mathematica allows you to specify the metric by which you measure
simplicity (actually, it's called "ComplexityFunction" and IIRC there
are five or six builtins).

As for sage, how about just counting
the number of calls to psi()?  This would just be an integer, with
 "small" being Good. This would make sense because the psi
function is difficult to evaluate.

Is this crazy enough for you?  ;-)

best wishes; keep me posted!

Robin



On Jul 14, 3:23 am, Michael Orlitzky  wrote:
> On 07/12/11 22:07, robin wrote:
>
> > Hi again
>
> > [replying to self]
>
> > I didn't make myself clear here.  What I meant to ask was, I think,
>
> > "Look, sage doesn't seem to know this fact about psi().  Does sage
> > store a list of known facts about the psi function anywhere?
>
> > Because, if it does, I would like to suggest that the following list
> > of identities
> > be added to  sage's list, so that this simplification works nicely".
>
> Sage calls out to Maxima for all of the simplify_foo() functions. It
> wouldn't be too hard to tell Sage about the identity and make the
> substitution yourself (I was going to attempt it), but doing so is
> dependent on having some notion of "simpler" since you don't want it to
> return a more complicated expression.
>
> If there isn't one, I will probably try to think up a crazy heuristic.

-- 
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] Problem with 'desolve_system'

2011-07-13 Thread Ondra Pelech
Hello,

I'm having troubles with using desolve_system on differential equations
system.
There is an Error executing code in Maxima.
I really don't know what might be going on, please help or suggest how
to bypass this.

Thanks a lot

Ondra

the whole notebook is here:
https://molly.kyberia.cz:8000/home/pub/6/

whole errorlog here:
https://molly.kyberia.cz:8000/home/ondra/10/cells/9/full_output.txt

except from errorlog:

Traceback (most recent call last):
  File "", line 1, in 
  File "_sage_input_26.py", line 10, in 
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
-*-\\n" +
_support_.preparse_worksheet_cell(base64.b64decode("cmVzID0gZGVzb2x2ZV9zeXN0ZW0oZXF1YXRpb25zLCB1bmtub3ducywgaWNzPWluaXRpYWxzKQ=="),globals())+"\\n");
 execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single')
  File "", line 1, in 

  File "/tmp/tmpUUopGy/___code___.py", line 2, in 
exec compile(u'res = desolve_system(equations, unknowns,
ics=initials)' + '\n', '', 'single')
  File "", line 1, in 

  File
"/opt/sage/local/lib/python2.6/site-packages/sage/calculus/desolvers.py", line 
739, in desolve_system
if str(soln).strip() == 'false':
  File
"/opt/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py",
line 1725, in __str__
return self.display2d(onscreen=False)
  File
"/opt/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py",
line 1978, in display2d
s = P._eval_line('disp(%s)$'%self.name(), reformat=False)
  File
"/opt/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py",
line 789, in _eval_line
self._error_check(line, out)
  File
"/opt/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py",
line 718, in _error_check
self._error_msg(str, out)
  File
"/opt/sage/local/lib/python2.6/site-packages/sage/interfaces/maxima.py",
line 721, in _error_msg
raise TypeError, "Error executing code in Maxima\nCODE:\n\t%s
\nMaxima ERROR:\n\t%s"%(str, out.replace('-- an error.  To debug this
try debugmode(true);',''))
TypeError: Error executing code in Maxima
CODE:
disp(sage29)$
Maxima ERROR:

-- 
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] Very slow matrix calculations in SAGE

2011-07-13 Thread hdevalence
Hello,

I'm having some trouble with some matrix calculations in SAGE. I'd
like to find the kernel of some matrices, but I think I'm doing
something wrong, because it's very slow.

For example:
sage: M = matrix(RDF, 200,400, lambda i,j: i+j)
sage: %time M.right_kernel()
CPU times: user 379.39 s, sys: 0.55 s, total: 379.94 s
Wall time: 380.66 s
Vector space of degree 400 and dimension 398 over Real Double Field
Basis matrix:
398 x 400 dense matrix over Real Double Field

whereas, say, this small C++ program using the Eigen2 libraries:
#include 
using namespace Eigen;
int main()
{
MatrixXd m(200,400);
for(int i = 0; i < 200; ++i)
for(int j = 0; j < 400; ++j)
m(i,j) = i+j;
LU lu(m);
MatrixXd ker(m.rows(), lu.dimensionOfKernel());
lu.computeKernel(&ker);
return 0;
}

does the following:
time ./matrix

real0m0.014s
user0m0.000s
sys 0m0.010s

Is there something I'm missing about how to use the SAGE matrix
classes? Five orders of magnitude faster in C++ seems a bit surprising
to me; perhaps SAGE isn't reaching ATLAS or numpy or whatever it's
supposed to use internally?

Henry de Valence

-- 
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: psi function.

2011-07-13 Thread Michael Orlitzky
On 07/12/11 22:07, robin wrote:
> Hi again
> 
> [replying to self]
> 
> I didn't make myself clear here.  What I meant to ask was, I think,
> 
> "Look, sage doesn't seem to know this fact about psi().  Does sage
> store a list of known facts about the psi function anywhere?
> 
> Because, if it does, I would like to suggest that the following list
> of identities
> be added to  sage's list, so that this simplification works nicely".

Sage calls out to Maxima for all of the simplify_foo() functions. It
wouldn't be too hard to tell Sage about the identity and make the
substitution yourself (I was going to attempt it), but doing so is
dependent on having some notion of "simpler" since you don't want it to
return a more complicated expression.

If there isn't one, I will probably try to think up a crazy heuristic.

-- 
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: Cannot sign out

2011-07-13 Thread Andrey Novoseltsev
P.S. I tried removing the cookie of the notebook site - this
disconnects me from the notebook server, but after the first login I
cannot logout anymore.

-- 
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] Cannot sign out

2011-07-13 Thread Andrey Novoseltsev
Hello,

I have the following problem on my machine:
- connect to a new secure Sage notebook
- log in
- log out
- log in
- now it is not possible to log out, I am just thrown to the home page
(and it does work, i.e. I still have access to all the worksheets).

Clearing the history of the browser helps in the sense of restoring
the original state - I can log out once.

I have this problem with different servers to which I am trying to
connect from this machine, some of those servers worked fine for a
long time.

I cannot reproduce this problem on another machine so far (I tried one
more) - everything is working fine there.

So - what can be the problem and how can I solve it?

System: fresh (~10 days after installation on a clean disk) Linux Mint
11 Katya 64-bit, almost nothing installed except for LaTeX/Sage and
editors.
Browser: Firefox 5.0.

Thank you!
Andrey

-- 
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] Implementation of Lenstra-Lenstra-Lovesz Algorithm

2011-07-13 Thread Zimmermann Paul
   Hi,

> I have written following Lattice Reduction Algorithm. However, it does not
> work properly (does not matche with the LLL algorithm
> implemented in Sage). It will be great for me if any one check the program.

the output of the LLL algorithm is not unique. You have to check that the
output of Sage and yours are LLL-reduced: see the documentation M.LLL? Note
also that the delta and eta parameters might be different with your
implementation (Sage uses by default delta=3/4 and eta=0.501).

Paul Zimmermann

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