[sage-support] How to create a new virtual environment based on an existing sage installation

2022-03-01 Thread Maarten Derickx
 Hi All,

I am wondering what the best way is to create a new virtual environment 
where I can import stuff from an already existing sage installation:

I tried the following using sage 9.5.beta9

$ sage -python3 -m venv --system-site-packages venv
$ source venv/bin/activate
(venv) $ python3
Python 3.9.9 (main, Dec 25 2021, 18:25:51)
[GCC 9.3.0] on linux 
Type "help", "copyright", "credits" or "license" for more information. 
>>> from sage.all import * 
Traceback (most recent call last): 
File "", line 1, in  
File 
"/scratch/home/mderickx/sages/sage/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/all.py",
 
line 126, in  
from sage.rings.all import * 
File 
"/scratch/home/mderickx/sages/sage/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/rings/all.py",
 
line 87, in  
...
...
File "sage/rings/polynomial/multi_polynomial_libsingular.pyx", line 1, in 
init sage.rings.polynomial.multi_polynomial_libsingular 
(build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:50020) 

File "sage/libs/singular/singular.pyx", line 1558, in init 
sage.libs.singular.singular 
(build/cythonized/sage/libs/singular/singular.cpp:15747) 
File "sage/libs/singular/singular.pyx", line 1525, in 
sage.libs.singular.singular.init_libsingular 
(build/cythonized/sage/libs/singular/singular.cpp:12865) 
File 
"/scratch/home/mderickx/sages/sage/local/var/lib/sage/venv-python3.9.9/lib/python3.9/posixpath.py",
 
line 152, in dirname 
p = os.fspath(p) 
TypeError: expected str, bytes or os.PathLike object, not NoneType

But as you can see this new venv is not created in such a way that sage the 
library is useable (probably because certain sage related environment 
variables are not set).

So what is the best way to get around this?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/972ae225-4f6e-4088-8cbf-fa1320684d40n%40googlegroups.com.


[sage-support] Problem installing sage on Ubuntu.

2021-12-25 Thread Maarten Derickx
Hi all,

I tried installing sage on Ubuntu 18.04.6 LTS by downloading 
sage-9.4-Ubuntu_18.04-x86_64.tar.bz2 
 
from one of the mirrors, unpacking the tar.bz2 file and then starting sage. 
However this results in a broken sage. Anyone any idea what is causing this?

Below is just one command that doesn't work, but there are multiple things 
causing similar stack traces.

┌┐

│ SageMath version 9.4, Release Date: 2021-08-22 │

│ Using Python 3.9.5. Type "help()" for help.│

└┘

sage: M = ModularSymbols(*79*) 
   

sage: S = M.cuspidal_submodule()   
 

---

KeyError  Traceback (most recent call last)

~/sages/SageMath/local/lib/python3.9/site-packages/sage/structure/category_object.pyx
 
in sage.structure.category_object.CategoryObject.getattr_from_category 
(build/cythonized/sage/structure/category_object.c:7074)()

*838* try:

--> 839 return self.__cached_methods[name]

*840* except KeyError:


KeyError: '_ModularSymbolsAmbient__cuspidal_submodule'


During handling of the above exception, another exception occurred:


AttributeErrorTraceback (most recent call last)

~/sages/SageMath/local/lib/python3.9/site-packages/sage/modular/modsym/ambient.py
 
in cuspidal_submodule(self)

*   1398* try:

-> 1399 return self.__cuspidal_submodule

*   1400* except AttributeError:


~/sages/SageMath/local/lib/python3.9/site-packages/sage/structure/category_object.pyx
 
in sage.structure.category_object.CategoryObject.__getattr__ 
(build/cythonized/sage/structure/category_object.c:6993)()

*832* """

--> 833 return self.getattr_from_category(name)

*834* 


~/sages/SageMath/local/lib/python3.9/site-packages/sage/structure/category_object.pyx
 
in sage.structure.category_object.CategoryObject.getattr_from_category 
(build/cythonized/sage/structure/category_object.c:7159)()

*847* 

--> 848 attr = getattr_from_other_class(self, cls, name)

*849* self.__cached_methods[name] = attr


~/sages/SageMath/local/lib/python3.9/site-packages/sage/cpython/getattr.pyx 
in sage.cpython.getattr.getattr_from_other_class 
(build/cythonized/sage/cpython/getattr.c:2551)()

*366* dummy_error_message.name = name

--> 367 raise AttributeError(dummy_error_message)

*368* cdef PyObject* attr = instance_getattr(cls, name)


AttributeError: 'MatrixSpace_with_category' object has no attribute 
'_cache__zero_matrix'


During handling of the above exception, another exception occurred:


SignalError   Traceback (most recent call last)

 in 

> 1 S = M.cuspidal_submodule()


~/sages/SageMath/local/lib/python3.9/site-packages/sage/modular/modsym/ambient.py
 
in cuspidal_submodule(self)

*   1404* except AttributeError:

*   1405* pass

-> 1406 S = self.boundary_map().kernel()

*   1407* S._set_is_cuspidal(True)

*   1408* S._is_full_hecke_module = True


~/sages/SageMath/local/lib/python3.9/site-packages/sage/modules/matrix_morphism.py
 
in kernel(self)

*714* []

*715* """

--> 716 V = self.matrix().kernel()

*717* D = self.domain()

*718* if not D.is_ambient():


~/sages/SageMath/local/lib/python3.9/site-packages/sage/matrix/matrix2.pyx 
in sage.matrix.matrix2.Matrix.left_kernel 
(build/cythonized/sage/matrix/matrix2.c:31551)()

*   4877* 

*   4878* tm = verbose("computing left kernel for %sx%s matrix" % (
self.nrows(), self.ncols()),level=1)

-> 4879 K = self.transpose().right_kernel(*args, **kwds)

*   4880* self.cache('left_kernel', K)

*   4881* verbose("done computing left kernel for %sx%s matrix" % (
self.nrows(), self.ncols()),level=1,t=tm)


~/sages/SageMath/local/lib/python3.9/site-packages/sage/matrix/matrix2.pyx 
in sage.matrix.matrix2.Matrix.right_kernel 
(build/cythonized/sage/matrix/matrix2.c:31019)()

*   4715* 

*   4716* # Go get the kernel matrix, this is where it all happens

-> 4717 M = self.right_kernel_matrix(*args, **kwds)

*   4718* 

*   4719* ambient = R**self.ncols()


~/sages/SageMath/local/lib/python3.9/site-packages/sage/matrix/matrix2.pyx 
in sage.matrix.matrix2.Matrix.right_kernel_matrix 
(build/cythonized/sage/matrix/matrix2.c:29656)()

*   4316* if M is None:

*   4317* try:

-> 4318 format, M = self._right_kernel_matrix(algorithm=
algorithm, 

[sage-support] Re: Building from source not working

2017-10-28 Thread Maarten Derickx
What happens if you just do:

./configure

in the sage directory? Note that void linux is not an officially supported 
platform, so it is not to surprising that there are some problems.

On Friday, 20 October 2017 01:13:35 UTC+2, Christoffer Rasmussen wrote:
>
>
> Hello I followed this guide: 
> http://doc.sagemath.org/html/en/installation/source.html
> But it stops immediately after writing "make".
> I use Void Linux. But I get following error message:
> make build/make/Makefile
> make[1]: Entering directory '/home/unistation/.local/share/sage-8.0'
> rm -f config.log
> mkdir -p logs/pkgs
> ln -s logs/pkgs/config.log config.log
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
> checking for gawk... gawk
> checking whether make sets $(MAKE)... yes
> checking whether make supports nested variables... yes
> checking whether to enable maintainer-specific portions of Makefiles... 
> yes
> configure: WARNING: you should use --build, --host, --target
> configure: WARNING: you should use --build, --host, --target
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
> checking for gawk... gawk
> checking whether make sets $(MAKE)... yes
> checking whether make supports nested variables... yes
> checking whether to enable maintainer-specific portions of Makefiles... 
> yes
> checking for root user... no
> checking build system type... Invalid configuration `x': machine `x' not 
> recognized
> configure: error: bash config/config.sub x failed
> Since 'SAGE_PORT' is set, we will try to build anyway.
> make[1]: Leaving directory '/home/unistation/.local/share/sage-8.0'
> build/bin/sage-logger \
> "cd build/make && ./install 'all'" logs/install.log
> ./install: line 12: 
> /home/unistation/.local/share/sage-8.0/src/bin/sage-env-config: No such 
> file or directory
> Error: Failed to read sage-env-config.  Did you run configure?
> make: *** [Makefile:18: all] Error 1
>
> My build log in SAGE_ROOT/logs/pkgs is attached
>
> Thanks in advance.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Possible new bug of solve()

2017-10-08 Thread Maarten Derickx
It deserves a ticket, the main question is more whether the ticket should be a 
bug or an enhancement. But that is something that can still be changed later. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Crash of sage after launching

2017-10-04 Thread Maarten Derickx
Did you download a binary or install from source or even the package management 
system on fedora? The report says you have Fedora 26 but sage only has fedora 
25 binaries on its website. So if you downloaded that binary then that is 
probably the cause.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: How to consider a field extension as a field and not just a ring?

2014-04-07 Thread Maarten Derickx
You should use on of the following two commands:

A1.theta=FFpr.quotient(ep)


A1.theta=PolynomialQuotientRing(FFpr,ep)

Le lundi 7 avril 2014 16:33:00 UTC+2, Irene a écrit :

 I am programming an example about elliptic curves but I need to define a 
 couple of field extensions to make there some operations and Sage consider 
 them as rings, then it doesn't allow me to compute divisions.
 What can I do?
 Here is the code:

 p=371
 Fp=GF(p)
 E=EllipticCurve([Fp(3),Fp(5)])
 j=E.j_invariant()
 l=13#Atkin prime
 n=((l-1)/2).round()
 r=2# Phi_13 factorize in factors of degree 2
 s=12#Psi_13 factorize in factors of degree 12

 #repsq(a,n) computes a^n
 def repsq(a,n):
 B = Integer(n).binary()
 C=list(B)
 k=len(B)-1
 bk=a
 i=1
 while i = k:
 if C[i]==1:
 bk=(bk^2)*a
 else:
 bk=bk^2
 i=i+1
 return bk

 d=E.division_polynomial(13)
 Fps=GF(repsq(p,s),'a')
 Fpr=GF(repsq(p,r),'b')
 FFpr.x=PolynomialRing(Fpr)
 Fl=GF(l)
 c=GF(2)
 rts=d.roots(Fps,multiplicities=False)
 Px=rts[0]
 Py2=Px^3+3*Px+5
 c=Fl.multiplicative_generator()

 def produx(n,Qx):
 if is_odd(n):
 
 pro=Qx-(E.division_polynomial(n-1,(Qx,1),two_torsion_multiplicity=1)*E.division_polynomial(n+1,(Qx,1),two_torsion_multiplicity=1))/((E.division_polynomial(n,(Qx,1),two_torsion_multiplicity=1)^2)
  
 * (Qx+3*Qx+5))
 else:
 
 pro=Qx-(E.division_polynomial(n-1,(Qx,1),two_torsion_multiplicity=1)*E.division_polynomial(n+1,(Qx,1),two_torsion_multiplicity=1))*(Qx^3+3*Qx+5)/(E.division_polynomial(n,(Qx,1),two_torsion_multiplicity=1)^2)
 return pro
 
 #Ray-polynomial
 def EP(x,Qx,n):
 i=2
 m=(x-Qx)
 while i=n:
 m=m*(x-produx(n,Qx))
 i=i+1
 return m

 ep=EP(x,Px,n)
 #A1.theta=FFpr.extension(ep)
 #A1.theta=PolynomialQuotientRing(Fpr,ep)



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: performance of applying a map to an integer vector

2013-11-20 Thread Maarten Derickx
It seems like your code is mostly doing easy integer operations in tight 
for loops (although in your case the for loop is hidden in v.apply_map). If 
you care about performance in such cases, then you should not use python, 
but cython. Because everything you do in python has a small overhead, and 
normally this doesn't matter because the overhead is relatively small to 
the actual running time of the function. But when doing arithmetic 
operations with integers, this overhead is often much and much bigger then 
the actual running time. The typical solution for this is using cython 
code. For a nice introduction to what cython is and how to use it in sage 
you can read:

http://sagemath.blogspot.fr/2010/11/cython-sage-and-need-for-speed.html

and of course there is the more technical documentation in the developers 
guide:

http://www.sagemath.org/doc/developer/coding_in_cython.html


Le mercredi 20 novembre 2013 11:02:59 UTC+1, Felix Breuer a écrit :

 Hi all!

 I have a large collection (~50,000) of integer vectors in low dimension 
 (~20). For each of these vectors, I want to divide all entries by their 
 gcd. In other words if

 def prim_v(v):
 d = abs(gcd(v))
 return v.apply_map(lambda vi: vi.divide_knowing_divisible_by(d))

 then I want to compute map(prim_v, V) for a long list V. When trying to 
 profile this using %prun, I found it difficult to tell which part of this 
 computation is taking the most time. So I rewrote this as

 def foo(v,d):
 return v.divide_knowing_divisible_by(d)

 def bar(v):
 return abs(gcd(v))

 def prim_v(v):
 d = bar(v)
 return v.apply_map(lambda vi: foo(vi,d))

 Then, profiling this with %prun yields the following information.

  ncalls tottime percall cumtime percall  filename:lineno(function)
   47802   0.119   0.000  13.811   0.000  LDsolver.py:58(prim_v)
   47802   0.116   0.000   3.593   0.000  LDsolver.py:54(bar)
  859898   0.360   0.000   0.524   0.000  LDsolver.py:51(foo)

 If I am reading this correctly, this means that most of the time (~10 
 seconds) is not spent doing the actual computation (using foo and bar) but 
 simply creating vectors and read/writing values to/from vectors (in 
 apply_map). (Do something like return vector((foo(vi,d) for vi in v)) instead 
 of apply_map does not make much a difference.) 


 Now, my questions are:

 1) Why is this so slow? Am I missing something here?
 2) Is there anything I can do to improve performance?


 Thank you very much,
 Felix


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: Applying a function to a product in a free algebra.

2013-07-01 Thread Maarten Derickx
What do you exactly want? There are multiple functions that take x*y to 
-2*x-2*y-4 so it might be good to give a description of the whole function 
to make this question easier to answer. One way to do what you ask is as 
follows, but I'm not sure wether this is what you want!

F.x,y=FreeAlgebra(ZZ,2)
g=x*y
g.substitute(x=-2,y=x+y+2)

Le lundi 1 juillet 2013 16:08:40 UTC+2, broken_symlink a écrit :

 If I have a free algebra over Z generated by x and y and I write x*y is 
 there a way to know that x*y is a product of the generators x and y? I 
 would like to write a function that takes x*y to -2*x -2*y - 4. 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] Re: Applying a function to a product in a free algebra.

2013-07-01 Thread Maarten Derickx
Ok, I think the best way to do what you want is to toy around with the
intrinsics of sage. All the data is already there, but not yet accessible
in a user friendly way (i.e. everything is in _ methods that you don't see
with tab completion). Below an example that shows you how to acces all the
information you need:

F.x,y=FreeAlgebra(ZZ,2)
g=4+3*x^7*y^10*x^13
h=g._FreeAlgebraElement__monomial_coefficients
print h
print h.items()
print h.items()[1][0]._element_list

It should not be a lot of work to write useful functions that return
exactly the information you want. You could indeed add the functions you
want by subclassing sage.algebras.free_algebra_element.FreeAlgebraElement .
There is one problem however, namely that you would also need to subclass a
lot of other sage intrinsics in order for this to work seemlessly. I.e. you
would also need to subclass sage.algebras.free_algebra.FreeAlgebra_generic
and modify its element constructor so that it will use your new subclass
instead of sage.algebras.free_algebra_element.FreeAlgebraElement . What is
easier is instead to directly modify the sage source code and add this
functionality directly to
sage.algebras.free_algebra_element.FreeAlgebraElement (i.e. not
subclassing). If you need help with this I can explain you how. If you
create some usefull acces functions, then you can also create a patch so it
can be included in sage so that others can also use your functions.

By the way, do you really need to work in a non commutative ring? I.e. will
x*y mean something else for your computations then y*x? If there is no
difference then I would advise you to work with
F.x,y=PolynomialRing(ZZ,2) since there is a lot more functionality
available for polyonmial rings then there is for free algebra's.




2013/7/1 broken_symlink syamaj...@gmail.com

 That doesn't seem it would work in general unless I already knew g was x*y.

 What I really have is a free algebra with generators as0, as1, as2, a1s,
 a11, a12, a2s, a21, a22, b11, b12, b21, b22, c11, c12, c21, c22, d11,
 d12, d21, d22, e11, e22 and function that returns a matrix like this,

 [2*a21 - a21*a12*a21 1 - a21*a12]
 [   -1 + a12*a21a12]

 I would like to be able to go through the matrix and replace products
 aij*akl with -2*aij -2akl -4. So, for example, 1 - a21*a12 should become 5
 + 2*a21 + 2*a12. I guess in order to be able to do that I need to be able
 index elements. So, if e = 1 - a21*a12 then e[0] would be 1, e[1] would be
 -a21*a12 and then e[1][0] would be -a21 and e[1][1] would be a12.

 Finally, the bij generators are of degree 1 and the aij generators are of
 degree 0, so I have a differential from b to a. For example, assuming I can
 do the above, the differential for b21 would be -6 + -2*a12 -*a21. I would
 like to build another matrix with bij's labeled as rows and 1 and aij
 labeled as columns so the row b21 would have a -6 in the first column, -2
 in the a12 column and -1 in the a21 column. Then row reduce that matrix to
 get homology. I guess again though in order to be able to do this I need to
 be able to index algebra elements.

 Would it be possible to implement something like this by subclassing
 FreeAlgebraElement or something else?

 On Monday, July 1, 2013 2:40:19 PM UTC-4, Maarten Derickx wrote:

 What do you exactly want? There are multiple functions that take x*y to
 -2*x-2*y-4 so it might be good to give a description of the whole function
 to make this question easier to answer. One way to do what you ask is as
 follows, but I'm not sure wether this is what you want!

 F.x,y=FreeAlgebra(ZZ,2)
 g=x*y
 g.substitute(x=-2,y=x+y+2)

 Le lundi 1 juillet 2013 16:08:40 UTC+2, broken_symlink a écrit :

 If I have a free algebra over Z generated by x and y and I write x*y is
 there a way to know that x*y is a product of the generators x and y? I
 would like to write a function that takes x*y to -2*x -2*y - 4.

  --
 You received this message because you are subscribed to a topic in the
 Google Groups sage-support group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/sage-support/okj9hs9cAAU/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: Conjunctive Normal Form

2013-04-20 Thread Maarten Derickx
sage: import sage.logic.propcalc as propcalc
sage: f = propcalc.formula(a^(bc))
sage: f.convert_cnf()
sage: f
(a|b|c)(a|b|~c)(a|~b|c)(~a|~b|~c)


Le samedi 20 avril 2013 20:39:47 UTC+2, Santanu a écrit :

 Dear all, 
   I want to convert the polynomial f into Conjunctive Normal Form (CNF)
 in Sage. How can I do this? 


 B.a,b,c = BooleanPolynomialRing()
 f=a+b*c
  

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: assume doesn't assume the first time (with limit)

2013-04-17 Thread Maarten Derickx


Le mercredi 17 avril 2013 18:07:04 UTC+2, John H Palmieri a écrit :



 On Wednesday, April 17, 2013 8:58:15 AM UTC-7, Francois Maltey wrote:

 Hello everyone, 

 I must declare assume twice. First time, I get an unevalued form. 
 After the second assume, I get the fine result : 
 I use Sage 5.7 

 sage: forget () ;  var('n') 
 n 
 sage: assume ((x1) and (x0))


 Is assume((x1) and (x0)) supported syntax? If you use assume(x1, 
 x0) instead, I think your example works with just one assume statement. 


Yes, (x1) and (x0) is just a python expression, and you can give that 
as an argument to a function. The reason why he has to assume twice is

sage: (x1) and (x0)
x  1
sage: assume(x1)
sage: (x1) and (x0)
x  0

The assume changes the truth value of the statement x1 causing the 
expresion (x1) and (x0) to return x0 instead of (x1). 

The problem is that it is not yet possible to do symbolic logic using 
symbolic expressions in sage.

 

 -- 
 John



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: slow matrix creation

2012-12-05 Thread Maarten Derickx
It seems that this is exactly the same problem of something I fixed for 
general matrix construction earlier on. See:
http://trac.sagemath.org/sage_trac/ticket/10628

The problem is that the complexity of:  sum(some_list_of_lists,[]) is 
something like n^2*m where n = len(some_list_of_lists) and m is the length 
of all lists contained in some_list_of_lists . This is because when adding 
two lists python creates a new copy to store the new result.
If you first flatten your list of entries (so that it doesn't happen in the 
cyclotomic field initialization code) the slowness should go away.

I.e. do:

tmp=[]
for v in entries:
tmp.extend(v)
entries = tmp
M = MatrixSpace(F,100)(entries)

Maybe we should overwrite the sum() function such that it behaves different 
for lists, since the command sum(entries,[]) looks much more clear and 
intuitive then the for loop.


Le mercredi 5 décembre 2012 19:36:07 UTC+1, Nils Bruin a écrit :



 On Wednesday, December 5, 2012 9:08:13 AM UTC-8, Volker Braun wrote:

 Of course fixing the cyclotomic matrix constructor would be another 
 option ;-

 In fact, John, please do! As your own loop assignment shows, the problem 
 you're experiencing is not inherent to Matrix_cyclo_dense, it's just 
 overhead in creating all these intermediate lists. It's straightforward to 
 refactor that bit of code and you have a motivation for it now.

 Representing a dense matrix as sparse will break you up later, even if 
 initial construction doesn't run into the same pitfall.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: slow matrix creation

2012-12-05 Thread Maarten Derickx


Le mercredi 5 décembre 2012 23:54:24 UTC+1, Maarten Derickx a écrit :

 It seems that this is exactly the same problem of something I fixed for 
 general matrix construction earlier on. See:
 http://trac.sagemath.org/sage_trac/ticket/10628

 The problem is that the complexity of:  sum(some_list_of_lists,[]) is 
 something like n^2*m where n = len(some_list_of_lists) and m is the length 
 of all lists contained in some_list_of_lists . This is because when adding 
 two lists python creates a new copy to store the new result.
 If you first flatten your list of entries (so that it doesn't happen in 
 the cyclotomic field initialization code) the slowness should go away.

 I.e. do:

 tmp=[]
 for v in entries:
 tmp.extend(v)
 entries = tmp
 M = MatrixSpace(F,100)(entries)

 Maybe we should overwrite the sum() function such that it behaves 
 different for lists, since the command sum(entries,[]) looks much more 
 clear and intuitive then the for loop.


It seems like the top level sum in sage is already optimized by doing some 
binary tree balances sum stuff, so maybe just importing that sum in the 
cyclotomic field code should also fix this performance issue.
 



 Le mercredi 5 décembre 2012 19:36:07 UTC+1, Nils Bruin a écrit :



 On Wednesday, December 5, 2012 9:08:13 AM UTC-8, Volker Braun wrote:

 Of course fixing the cyclotomic matrix constructor would be another 
 option ;-

 In fact, John, please do! As your own loop assignment shows, the 
 problem you're experiencing is not inherent to Matrix_cyclo_dense, it's 
 just overhead in creating all these intermediate lists. It's 
 straightforward to refactor that bit of code and you have a motivation for 
 it now.

 Representing a dense matrix as sparse will break you up later, even if 
 initial construction doesn't run into the same pitfall.



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Sage in Computer Lab

2012-09-05 Thread Maarten Derickx
Why don't you ask them to install the sage server on a different machine, 
and let other people acces it via the notebook? In Leiden they have also 
taken this approach and it works fine (see sage.math.leidenuniv.nl).

Thanks Maarten

Le jeudi 30 août 2012 04:34:14 UTC+2, Luis Garcia-Puente a écrit :

 Recently, a few math faculty members requested Computer Services in our 
 university to install Sage in each of the Windows-based computers in one of 
 our Computer Labs to support both our teaching and research needs. 

 After the sys admin installed Sage in one computer, he discovered that 
 SAGE starts a server. Soon after, this was labeled as a security risk and 
 SAGE was removed from every computer in the lab. We have scheduled a 
 meeting with these people to try and move forward with this problem. But I 
 wanted to know if people had encountered this problem in their universities 
 and if there are ways to go around it. It may very well be that nothing 
 will change their opinion, for example we are not allowed to use php in our 
 websites or to use ssh to remotely connect to our computers from home, 
 again because of security concerns.  So I am not sure if this is a very 
 concrete question and if there is a concrete answer. But perhaps something 
 of the form XYZ university has this setup, may help us move in some 
 positive direction.

 Regards,

 Luis



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: see field extensions as a vector space.

2012-09-04 Thread Maarten Derickx
Le mardi 4 septembre 2012 10:40:24 UTC+2, sha2nk a écrit :

 k=GF(2^11);
 K=GF(2^33)

 How to see K as a vector space over filed k ? How to form its basis ? 
 How to construct tower of field extensions ?


Hi, Sadly enough non of these three things are implemented in sage yet for 
finite fields. You currently have K.vector_space() which gives K as a 
vectorspace over GF(2) but there is no method to do it over extensions of 
GF(2) .

Towers of field extensions are possible in sage, but only with numberfields 
and function fields.

sage: L=QQ.extension(cyclotomic_polynomial(5),'a')
sage: K=L.extension(cyclotomic_polynomial(3),'b')
sage: K
Number Field in b with defining polynomial x^2 + x + 1 over its base field
sage: K.absolute_degree()
8
sage: M=K.extension(cyclotomic_polynomial(7),'c')
sage: M
Number Field in c with defining polynomial x^6 + x^5 + x^4 + x^3 + x^2 + x 
+ 1 over its base field
sage: M.absolute_degree()
48
sage: M.relative_vector_space()
(Vector space of dimension 6 over Number Field in b with defining 
polynomial x^2 + x + 1 over its base field, Isomorphism map:
  From: Vector space of dimension 6 over Number Field in b with defining 
polynomial x^2 + x + 1 over its base field
  To:   Number Field in c with defining polynomial x^6 + x^5 + x^4 + x^3 + 
x^2 + x + 1 over its base field, Isomorphism map:
  From: Number Field in c with defining polynomial x^6 + x^5 + x^4 + x^3 + 
x^2 + x + 1 over its base field
  To:   Vector space of dimension 6 over Number Field in b with defining 
polynomial x^2 + x + 1 over its base field)

The best thing to do would be to look at the source code in sage that 
creates towers of numberfields and try to adopt some parts of that code so 
it can be used for more general fields. But this would be quite a big 
project requiring you to know something about the inner workings of sage.

Another option is to hack around this missing functionality. Depending on 
what you want to do with these towers and what kind of functionality you 
need this might be relatively easy.

A small example below shows basic aritmethic and converting an element of 
GF(2^33) to a vector over GF(2^11) and back:

sage: K.b=GF(2^3)
sage: L.a=GF(2^11)
sage: R.c=L.extension(b.minpoly())
sage: v=vector(((a*c+a^2)^200).list())
sage: v
(a^10 + a^5 + a^4 + 1, a^10 + a^6 + a^4 + a^3 + a^2 + a + 1, a^10 + a^8 + 
a^7 + a^6 + a^5 + a^3 + a^2)
sage: R(v.list());(a*c+a^2)^200
(a^10 + a^8 + a^7 + a^6 + a^5 + a^3 + a^2)*c^2 + (a^10 + a^6 + a^4 + a^3 + 
a^2 + a + 1)*c + a^10 + a^5 + a^4 + 1
(a^10 + a^8 + a^7 + a^6 + a^5 + a^3 + a^2)*c^2 + (a^10 + a^6 + a^4 + a^3 + 
a^2 + a + 1)*c + a^10 + a^5 + a^4 + 1

So be creative and you will get there. Note that in the above construction 
sage doesn't really know that R is actually a finite field so it has a lot 
less functionality, but again this is stuff you can probably work around 
with using a bit of creativity.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
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.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] Re: Sagenb and port 443

2012-07-31 Thread Maarten Derickx
I don't know the details of the setup on our department, but I also run my 
own server at sage.mderickx.nl .

I use a combination of 3) and 5) on a debian system. And it has been 
running very stable (no problems since I configured the server about half a 
year ago). The reason why I also have apache is for it's virtualhost 
capabilities. This allows me to run both https://www.mderickx.nl and 
https://sage.mderickx.nl on the same server using the same ip adress.

I'd say just use option 5) if sage is the only service on that server that 
needs port 443.

I think it is a good idea to run sage on a priveleged port, since this 
makes it slightly harder to replace your sage notebook by a fake copy of 
your sage notebook to do evil things. That's why I don't like 6). Although 
I have the feeling that in practice 6 is just as secure as 5. 

A way more important security issue is that you really should use the 
server_pool option of the notebook() command, to specify that the notebook 
process (the sage server) and the worksheet process (the process that runs 
the calculations) run as a seperate user. This prevents the users on your 
system from being able to kill the server process. How to do this is all 
documented, just type:

notebook?

Thanks,
Maarten



Le mardi 31 juillet 2012 14:36:42 UTC+2, jori.ma...@uta.fi a écrit :

 How have you installed sage for department or university? There are at 
 least six options: 

 1) Sage runs at port 8000 or similar. Users have to remember an url that 
 ends with :8000. 
 2) Sage runs as root. Does not sound good. 
 3) Set up Apache, use RewriteRules. Apache needs to be updated, might have 
 bugs. 
 4) Set up lighthttpd. Maybe smaller web server got less bugs? 
 5) Use authbind. Seems to work. Needs one extra component. 
 6) Have iptables to redirect port 443 to (for example) 8000. 

 I think that option 6 is best, but is there something more I should 
 consider before making decision? 

 -- 
 Jori Mï¿œntysalo 


-- 
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: Notebook ldap: crypto missing etc.

2012-07-31 Thread Maarten Derickx


Le mardi 31 juillet 2012 14:20:14 UTC+2, jori.ma...@uta.fi a écrit :

 I am setting up Sage 5.1 on Ubuntu 12.04. 

 I have done 

 sage -sh 
 $ easy_install python-ldap 

 and 

 cd $SAGE_ROOT/devel 
 git clone -b ldap https://github.com/rmartinjak/sagenb.git sagenb-ldap 
 ln -s sagenb sagenb-ldap 

 and tried setup.py develop and setup.py install. Now this gives me webpage 
 with login box: 

 notebook(interface='', secure=False, port=12345) 

 but if I try with secure=True, I got 

 Failed to load application: cannot import name crypto 


Your error is probably longer then the above right? Can you post the full 
traceback. It might help to get to know where it is trying to import the 
name crypto from.

Did you read: https://github.com/rmartinjak/sagenb/tree/ldap
to be precise the part about SSL Support? The things said there might also 
help.

 

 What to install? 

   * * * 

 When trying to log in I just get Error: Username is not in the system. 
 Where can I look logs to see what went wrong? There is propably something 
 wrong in $SAGE_ROOT/devel/sagenb-ldap/sagenb/notebook/server_conf.py but 
 how to see what? 

 -- 
 Jori Mï¿œntysalo 


-- 
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: Notebook ldap: crypto missing etc.

2012-07-31 Thread Maarten Derickx


Le mardi 31 juillet 2012 14:20:14 UTC+2, jori.ma...@uta.fi a écrit :

 I am setting up Sage 5.1 on Ubuntu 12.04. 

 I have done 

 sage -sh 
 $ easy_install python-ldap 

 and 

 cd $SAGE_ROOT/devel 
 git clone -b ldap https://github.com/rmartinjak/sagenb.git sagenb-ldap 
 ln -s sagenb sagenb-ldap 

 and tried setup.py develop and setup.py install. Now this gives me webpage 
 with login box: 

 notebook(interface='', secure=False, port=12345) 

 but if I try with secure=True, I got 

 Failed to load application: cannot import name crypto 

 What to install? 

   * * * 

 When trying to log in I just get Error: Username is not in the system. 
 Where can I look logs to see what went wrong? There is propably something 
 wrong in $SAGE_ROOT/devel/sagenb-ldap/sagenb/notebook/server_conf.py but 
 how to see what? 


I don't know how to help with this. If you don't get an answer here you 
should try to ask the question on the sage-notebook google group.

 

 -- 
 Jori Mï¿œntysalo 


-- 
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: Trace function over GF(8)

2012-04-10 Thread Maarten Derickx
Dear Arthur,

In the other thread I gave a quite explicit example how to do such a thing 
only with less complicated formula's. All the techniques needed to solve 
the problem are given there. What problems are you running in to when 
trying to generalize my example to using more complicated formula's?

Did you by the way work trough some parts of 
http://www.sagemath.org/doc/tutorial/ ? And maybe 
http://docs.python.org/tutorial/ might also be usefull since valid python 
could should also be valid sage code.

Working trough such a tutorial is I guess essential for being able to solve 
your own problems in sage (there is no use typing in stuff as litterally 
told to you by others without understanding).

 

Le mardi 10 avril 2012 13:40:47 UTC+2, ArturZ a écrit :

 Hi,

 I've following problem:

 I want to define the function:

 f(x,y)=Tr(x*g(y/x)), where Tr(x)=x+x^2+x^4 (Tr:GF(8)--GF(2)) and


 x*g(y/x)=[(y*[d^2*[(y/x)^3+1]+d^2*(1+d+d^2)*[(y/x)^2+(y/x)]])/((y/x)^4+d^2*(y/x)^2+1)]+(y/x)^(1/2)

 I've got the following one (after substitution):


 f(x,y)=[[(y*[d^2*[(y/x)^3+1]+d^2*(1+d+d^2)*[(y/x)^2+(y/x)]])/((y/x)^4+d^2*(y/x)^2+1)]+(y/x)^(1/2)]+[[(y*[d^2*[(y/x)^3+1]+d^2*(1+d+d^2)*[(y/x)^2+(y/x)]])/((y/x)^4+d^2*(y/x)^2+1)]+(y/x)^(1/2)]^2+[[(y*[d^2*[(y/x)^3+1]+d^2*(1+d+d^2)*[(y/x)^2+(y/x)]])/((y/x)^4+d^2*(y/x)^2+1)]+(y/x)^(1/2)]^4

 Let d=3 (for example).

 Now, above function will looks like:

 f(x,y)=[[(y*[[(y/x)^3+1]+5*[(y/x)^2+(y/x)]])/((y/x)^4+(y/x)^2+1)]+(y/x)^(1/2)]+[[(y*[[(y/x)^3+1]+5*[(y/x)^2+(y/x)]])/((y/x)^4+(y/x)^2+1)]+(y/x)^(1/2)]^2+[[(y*[[(y/x)^3+1]+5*[(y/x)^2+(y/x)]])/((y/x)^4+(y/x)^2+1)]+(y/x)^(1/2)]^4
  
 --- I think that this function f is correct, am I right?

 With convention that 1/0=0 (y/0=0), I want to see what values this 
 function receives (over GF(2)). How can I do this in SAGE? 

 I'll be glad for any advices and help.

 Regards,
 Artur





-- 
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: Trace function over GF(8)

2012-04-10 Thread Maarten Derickx
You should use the function custom_divide instead(a,b) I wrote for you 
instead of y/x this will make sure the convention 1/0=0 gets followed. Also 
you should use x.nth_power(2) (or in this case even x.pth_power()) instead 
of x^(1/2). Then everything should work. If that doesn't help please post 
an executable piece of code so we can say what you do wrong.

Le mardi 10 avril 2012 20:08:50 UTC+2, ArturZ a écrit :

 Hi,

 I've problem with this function. When I'm trying to use Your idea I see 
 some errors (for example: unsupported operand parent(s) for '/'). I know 
 that there should be definition of this convention (1/0=0). When I was 
 trying to do this without this assumption I saw divided by zeros errors (it 
 is understandable). Next think: there is 1/2 power and I'm not sure if it 
 is correct defined in my example (example: x=a^2, y=a, y/x=a^2+1, and now 
 (a^2+1)^(1/2)).
 Your example is quite nice and I understand it and everything is OK when 
 I'm trying simple examples using this argumentation.

 I think that I should read more about SAGE, like You suggested, and then 
 maybe it will be clearer, I hope. 

 Regards,
 Arthur


 W dniu wtorek, 10 kwietnia 2012 19:20:15 UTC+2 użytkownik Maarten Derickx 
 napisał:

 Dear Arthur,

 In the other thread I gave a quite explicit example how to do such a 
 thing only with less complicated formula's. All the techniques needed to 
 solve the problem are given there. What problems are you running in to when 
 trying to generalize my example to using more complicated formula's?

 Did you by the way work trough some parts of 
 http://www.sagemath.org/doc/tutorial/ ? And maybe 
 http://docs.python.org/tutorial/ might also be usefull since valid 
 python could should also be valid sage code.

 Working trough such a tutorial is I guess essential for being able to 
 solve your own problems in sage (there is no use typing in stuff as 
 litterally told to you by others without understanding).

  

 Le mardi 10 avril 2012 13:40:47 UTC+2, ArturZ a écrit :

 Hi,

 I've following problem:

 I want to define the function:

 f(x,y)=Tr(x*g(y/x)), where Tr(x)=x+x^2+x^4 (Tr:GF(8)--GF(2)) and


 x*g(y/x)=[(y*[d^2*[(y/x)^3+1]+d^2*(1+d+d^2)*[(y/x)^2+(y/x)]])/((y/x)^4+d^2*(y/x)^2+1)]+(y/x)^(1/2)

 I've got the following one (after substitution):


 f(x,y)=[[(y*[d^2*[(y/x)^3+1]+d^2*(1+d+d^2)*[(y/x)^2+(y/x)]])/((y/x)^4+d^2*(y/x)^2+1)]+(y/x)^(1/2)]+[[(y*[d^2*[(y/x)^3+1]+d^2*(1+d+d^2)*[(y/x)^2+(y/x)]])/((y/x)^4+d^2*(y/x)^2+1)]+(y/x)^(1/2)]^2+[[(y*[d^2*[(y/x)^3+1]+d^2*(1+d+d^2)*[(y/x)^2+(y/x)]])/((y/x)^4+d^2*(y/x)^2+1)]+(y/x)^(1/2)]^4

 Let d=3 (for example).

 Now, above function will looks like:

 f(x,y)=[[(y*[[(y/x)^3+1]+5*[(y/x)^2+(y/x)]])/((y/x)^4+(y/x)^2+1)]+(y/x)^(1/2)]+[[(y*[[(y/x)^3+1]+5*[(y/x)^2+(y/x)]])/((y/x)^4+(y/x)^2+1)]+(y/x)^(1/2)]^2+[[(y*[[(y/x)^3+1]+5*[(y/x)^2+(y/x)]])/((y/x)^4+(y/x)^2+1)]+(y/x)^(1/2)]^4
  
 --- I think that this function f is correct, am I right?

 With convention that 1/0=0 (y/0=0), I want to see what values this 
 function receives (over GF(2)). How can I do this in SAGE? 

 I'll be glad for any advices and help.

 Regards,
 Artur





-- 
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] Define function in GF(q)

2012-04-06 Thread Maarten Derickx
I'll give you a small example so hopefully you can figure out the rest. 

The following code first defines the function custom_divide and then prints all 
possible values of that function together with the input. You could also add 
the values to a list or a set to process them later.

def custom_divide(x,y):
if y==0:
return 0
return x/y

F.a=GF(8)
for a,b in F^2:
print a: ,a,b: ,b,a/b:,custom_divide(a,b)

#an example where we add the values to a set

values = set([])
for i,j in F^2:
values.add(custom_divide(i,j)^7)
print values

-- 
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: Exporting data from sage notebook

2012-04-06 Thread Maarten Derickx
Yes the last few lines should read:


for r in p:
output.writerow(r)
del o


Python is indentation sensitive and uses it to determine where the for loop 
stops. 

-- 
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] Importing Cython .so module

2012-04-06 Thread Maarten Derickx
Does executing:

import foo

give what you want or is your problem different?

-- 
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: %cython failing in notebook because of accessing the wrong directory

2012-04-02 Thread Maarten Derickx
In your setup everything worked ok. You just defined a function called 
hello. The function was never executed so you didn't see anything.
To execute the function try the following:

hello()

Considdering you are new with sage I suggest first learn how to use python 
(and don't use the %cython). Only after you are familiar with that it might 
be good to start learning cython.  And then would only need it if you wrote 
some code that calls some fast functions in a smal for loop that is 
annoyingly slow.
 
Le dimanche 1 avril 2012 07:57:40 UTC+2, Priyanka a écrit :

 When I run code :
 %cython
 cdef hello():
 print 'hello world!'
 I got two files , one is html file and another is C file.
 Html contents are:
  1:

  2: include interrupt.pxi  # ctrl-c interrupt block support

  3: include stdsage.pxi  # ctrl-c interrupt block support

  4:

  5: include cdefs.pxi

  6: cdef hello():

  7: print 'hello world!'

 I am new to sage. I dont know much about it. Can you clarify now?
 Whats the problem in actual?
 I also wish to know what is the problem and how  the desired output
 hello world will come.


 -- 
 Priyanka Kapoor
 http://kapoorpriyanka.in
 Linux User Group, Ludhiana



-- 
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: Best way to develop Sage packages?

2012-03-31 Thread Maarten Derickx
I think you should make it an spkg because that is how people using sage expect 
to install it.
Note that the install script in an spkg can contain arbitrary bash code so it 
can do everything you want it to.

-- 
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 installation on windows : browser cannot connect

2012-03-29 Thread Maarten Derickx
Actually the 404 error sais that you alreade got past the firewall and have 
reached the server so the trouble should be somewhere else indeed.
Does the 404 error say more (i.e. does it say what is not found?). A 
screenshot might be usefull.

p.s. I assume that you don't already have your own webserver running on 
localhost:8000 ;)

Le mercredi 28 mars 2012 15:06:31 UTC+2, Matthias L a écrit :

 Dear group,

 I've tried to install Sage on Windows 7 following the installation guide 
 linked below. It seems to work until step 4, I get the same console window 
 as shown in the screen shot there (Open your web browser). But if I do 
 so, I can't connect to Sage and receive a 404 error instead.

 Installation guide
 http://wiki.sagemath.org/SageAppliance

 Virtual Box 4.1.10, Sage 4.8

 Some ideas?

 Thank you, Matthias



-- 
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] %cython failing in notebook because of accessing the wrong directory

2012-03-28 Thread Maarten Derickx
Dear All,

I've setup my own sage server (running sage 4.8 on debian) with two 
accounts. One called sagerunner wich actually runs the notebook and one 
called sageslave wich runs the calculations. To be more precise notebook is 
started with the argument server_pool=[sageslave@localhost]. But when I 
try to use %cython in a cell I get:

Traceback (click to the left of this block for traceback)
...
IOError: [Errno 13] Permission denied:
'/home/sagerunner/.sage/sage_notebook.sagenb/home/maarten/9/code/sage5.s\
pyx'

 

Wich is because the user sageslave doesn't have acces to that place (and he 
indeed should not need to acces that place since it might even be on a 
different host!). I was wondering, is this a problem with my setup or a genuine 
notebook bug?

-- 
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: %cython failing in notebook because of accessing the wrong directory

2012-03-28 Thread Maarten Derickx


Le mercredi 28 mars 2012 23:19:55 UTC+2, Maarten Derickx a écrit :

 Dear All,

 I've setup my own sage server (running sage 4.8 on debian) with two 
 accounts. One called sagerunner wich actually runs the notebook and one 
 called sageslave wich runs the calculations. To be more precise notebook is 
 started with the argument server_pool=[sageslave@localhost]. But when I 
 try to use %cython in a cell I get:

 Traceback (click to the left of this block for traceback)
 ...
 IOError: [Errno 13] Permission denied:
 '/home/sagerunner/.sage/sage_notebook.sagenb/home/maarten/9/code/sage5.s\
 pyx'

  

 Wich is because the user sageslave doesn't have acces to that place (and he 
 indeed should not need to acces that place since it might even be on a 
 different host!). I was wondering, is this a problem with my setup or a 
 genuine notebook bug?


B.T.W. I published a worksheet wich show the problems
https://sage.mderickx.nl/home/pub/0/ 

-- 
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] C-XSC

2012-03-07 Thread Maarten Derickx
You might try this: 
http://www.koders.com/info.aspx?c=ProjectInfopid=8C6XCAPW8UCXPHS5SE2SQRYQBCs=cdef%3areal

-- 
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: Question about UniqueFactory

2012-02-22 Thread Maarten Derickx
If you look in the source code slightly before where the class 
UniqueFactory is defined you will see the following:

from sage_object cimport SageObject

cdef sage_version
from sage.version import version as sage_version

sage_version = sage_version.split('.')
for i in range(len(sage_version)):
try:
sage_version[i] = int(sage_version[i])
except ValueError:
pass
sage_version = tuple(sage_version)


cdef class UniqueFactory(SageObject):



So indeed it doens't expect version()

-- 
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] Order of a cyclic group

2012-01-20 Thread Maarten Derickx
Well the way I first tried is as follows:

age: F.x=GF(2)[]
sage: G.a=F.quotient(x^6 + x^4 + x^2 + x + 1)
sage: a.multiplicative_order()
---
NotImplementedError   Traceback (most recent call last)


But it gives a not implemented error. Luckily the following does work:

sage: G.a=GF(2^6,modulus=x^6 + x^4 + x^2 + x + 1)
sage: a.multiplicative_order()
21

-- 
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: Attribute error when multiplying elements of a quotient free algebra

2012-01-17 Thread Maarten Derickx
Dear Jim,

The problem is that kQ.gens()[0] is not an element of the kQ.monoid() as is 
required as said in the documentation and the examples. To fix your problem:

sage: kQ = FreeAlgebra(QQ ,2 , 'x') 
sage: gens=kQ.monoid().gens()
sage: mons = [gens[0], gens[1], gens[0]*gens[1]]
sage: mats = [Matrix(QQ,3,[1, 0, 0, 0, 1, 0, 0, 0, 0]), Matrix(QQ, 3, [0, 
0, 
: 0, 0, 0, 0, 0, 0, 1])] 
sage: A = FreeAlgebraQuotient(kQ, mons, mats, 'x')
sage: A.gens()[0]*A.gens()[1]
0


-- 
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] issue with combining sub lists into a list

2012-01-10 Thread Maarten Derickx
Note that: sum(a,[]) gets incredibly slow when a contains a lot of lists (it's 
runtime complexity is kwadratic in the number of lists in a). So it's better to 
do:
l=[]
for i in A:
l.extend(i)

-- 
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] Import scikits sklearn fails?

2012-01-01 Thread Maarten Derickx
It seems that you installed sklearn in the wrong way. To install sklearn for 
usage with sage do:

sage -sh

To start a shell wich is configered so that all sage directories and binaries 
and the sage python are in your path. And then do whatever the sklearn 
documentation sais you should do.

We cannot help you much more then this since we are not the sklearn mailinglist 
and hence have no detailed knowledge how to install sklearn properly. 

-- 
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] Import scikits sklearn fails?

2012-01-01 Thread Maarten Derickx
It seems that you installed sklearn in the wrong way. To install sklearn for 
usage with sage do:

sage -sh

To start a shell wich is configered so that all sage directories and binaries 
and the sage python are in your path. And then do whatever the sklearn 
documentation sais you should do.

We cannot help you much more then this since we are not the sklearn mailinglist 
and hence have no detailed knowledge how to install sklearn properly. 

-- 
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 account cracked?

2011-12-19 Thread Maarten Derickx
Thanks for the report, I see the worksheet on my account as well. It looks 
like someone just shared a worksheet with all users (something wich is very 
easy to do). So I should not worry about it to much until someone her can 
tell you more.

It would be a good thing for us to see if this is really the case or if 
something worse is happening. I don't have administrative acces to the 
machine so I cannot find out more then 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


[sage-support] Re: Install package behind proxy

2011-12-18 Thread Maarten Derickx
Good to here your problem got solved. Sadly enough sage does not allow easy 
uninstallation of spkg's. To do this you would have to manually undo 
everything performed by the spkg-install script wich is in the spkg file.

-- 
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: Install package behind proxy

2011-12-16 Thread Maarten Derickx
Dear Vlnay,

You can at least work around the problem by first downloading the spkg file 
and then do:

sage -i path to file in downloads folder

The error you get means that the command UrllibProxy in the file 
/home/vinay/Sage/sage-4.7.2-linux-32bit-ubuntu_10.04_lts-
i686-Linux/local/bin/sage-download_package
does not exist. I find this error very strange since in my version of 
sage-4.7.2.alpha2 there is no urlprx= UrllibProxy(proxy). Did you add that 
line there yourself, if so you should add

from some python package that provides UrllibProxy import UrllibProxy

to the file.

Thanks Maarten

-- 
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: Unicode characters in axes labels?

2011-12-06 Thread Maarten Derickx
Well there is of course the possibility to use only ascii (but I guess you 
already thought of that), the other solution would involve hacking the sage 
source code, since matplotlib has unicode support [1] this should be 
posssible. A third solution is to use matplotlib directly, from sage you 
can do:

import matplotlib

and start working with it. It is documented on [2]

[1] http://matplotlib.sourceforge.net/users/text_intro.html
[2] http://matplotlib.sourceforge.net/contents.html

-- 
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: backend for matplotlib

2011-12-06 Thread Maarten Derickx
Dear Vasudev,

Sage ships it's own version of python. And this python doesn't use the 
system python. When you installed matplotlib using yum, yum took care of 
all dependency's for you. To get other python packages in sage you should 
do:

sage -sh   #this starts up a shell with all environment variables set so 
that you the python you start is the sage python etc
easy_install *packagename*
*
*
For your specific situation it would mean:

sage -sh
easy_install pyGTK

Sage ships as a single product that just works, if you want to make things 
work in a different way (with different backends) then you should expect to 
do some manual installing and configuration and maybe even hacking the sage 
source code. 

-- 
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: Installing latest sage

2011-11-30 Thread Maarten Derickx
This timeout error is not bad. It just means that your tablet cannot 
complete a certain test within the time limit set for the tests. Since your 
tablet is probably slower than a normal desktop pc this is not that bad. 
There is already a ticket (http://trac.sagemath.org/sage_trac/ticket/12023)
 wich will classify these test as long tests so you wont get the timeout 
any more.

-- 
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: Problems with height calculation for points on elliptic curves over number fields

2011-11-26 Thread Maarten Derickx
And apparently the message I gave was useless, since I indeed asumed what 
John explained. But this is not true!

The addition of the patch at the ticket did not change anything to the 
examples above (I got exactly the same answers as you in the case with the 
negative height). And the addition of the patch also doesn't make the 
doctest for heights on points on elliptic curves fail. So the problem must 
be somewhere else (a swift reading of the code also confirms that the 
height function on the numberfields is never called).

-- 
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: Problems with height calculation for points on elliptic curves over number fields

2011-11-25 Thread Maarten Derickx
There is already a ticker for this with a patch wich fixes the problem at: 
http://trac.sagemath.org/sage_trac/ticket/11758 but that ticket still needs 
some work because the doctests are not ajusted jet to the new height 
function.

-- 
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] Building Sage from source fails on OS X with NFS-mounted home directory

2011-11-16 Thread Maarten Derickx



 What's the ETA on that?  Is there a patch I could apply in the 
 meantime? 


Sage does not really work with ETA's, everything depends if there is 
someone willing to work on a specific issue voluntarily. The patches you 
could apply are all mentioned on that ticket, you will also need the spkg 
from there. Let me know if you have problems installing these.

 


 No, many people do, eg all users of the sage.math devel cluster, our 
 remote build farm, etc.   Maybe your issues are Mac + NSF specific - that 
 is a less common combo.


Or even specific to the settings you use to export and mount your NFS 
(things such as *lock* vs *nolock *etc. might have a huge inpact on how 
programs behave on your NFS mount).


-- 
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: Building Sage from source fails on OS X with NFS-mounted home directory

2011-11-15 Thread Maarten Derickx
Ah, then this issue will hopefully be fixed with changing the python in 
sage to 2.7. There is already work being done on that issue 
at http://trac.sagemath.org/sage_trac/ticket/9958 . You can also find a new 
spkg there, so with that spkg you might be able to build from source. But 
the doctest will give probably still a lot of failures.

-- 
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: How to List all available matrix constructors?

2011-11-09 Thread Maarten Derickx
If you type:

Matrix?

You will see in the documentation a lot of different ways to construct a 
matrix. Is this good enough?

-- 
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: trouble upgrading from 4.7.1 to 4.7.2...

2011-11-06 Thread Maarten Derickx
I guess things work different from system to system then. Because when I 
symlink to it, I also have to change the file if I want to execute it from the 
symlink location. 

-- 
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: trouble upgrading from 4.7.1 to 4.7.2...

2011-11-06 Thread Maarten Derickx
I guess things work different from system to system then. Because when I 
symlink to it, I also have to change the file if I want to execute it from the 
symlink location. 

-- 
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: Creating Arrays in sage, and then writing a programme which refers back to the array and uses it.

2011-11-01 Thread Maarten Derickx
Of course the solutions above here will work. But an important thing that 
also should be mentioned is that sage is python+ a lot of mathematics+ some 
additional syntax. The question you asked is possible in almost every basic 
programming language and also very easily possible using python. You should 
consider going trough a basic python tutorial (using sage instead of 
python) to get familiar with all the programming possibilities in sage.

-- 
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: Quotient field of the polynomial ring over the complex numbers

2011-10-21 Thread Maarten Derickx
I suggest that you don't word with symbolic variables then, but make the 
fraction field of a polynomial ring with enough variables to do the 
calculations in, in this case c.numerator() and c.denominator() works also for 
the intermediate results. An other thing you could do is 
CC['x'](c).denominator() if c is a polynomial expression involving only x and 
no symbolic variables 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] Re: Quotient field of the polynomial ring over the complex numbers

2011-10-18 Thread Maarten Derickx
It all depends on how this f is created/defined. Can you give an explicit 
example?

-- 
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: Question about MPI in SAGE

2011-10-16 Thread Maarten Derickx
Dear Juan Grados,

I don't think people have forgotten it, but merely not answering since you 
are asking in the wrong place. This is the sage mailinglist not the mpi4py one 
and the problems you are experiencing are problems with getting mpi4py 
working and not sage. 

Also your large amount of messages to this list lately might have started to 
annoy people here, at least it started to annoy me. A lot of the other 
questions you asked seemed quite trivial and might be answered by yourself 
if you just took the time to do a decent python tutorial and an additional 
sage tutorial. We are not here to solve all your every day problems and you 
should ask yourself two questions before you post to a mailing list. 1) Is 
the mailing list you mail to the right one 2) Did I really try and think 
hard enough to solve the problem myself.

Also when you show in your question in wich ways you already tried to solve 
the problem yourself people might be more inclined to help you since they 
see you already put a lot of effort in it.

-- 
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: Sage Algebra

2011-10-16 Thread Maarten Derickx
Why don't you just work with the quotientring of a polynmial ring?

sage: Rx.x=RR[]  
sage: K.a=Rx.quo(x^6+1)
sage: j=a^4
sage: i=a^3
sage: j^3
1.00
sage: i^2
-1.00
sage: (1+j+j^2) * j
a^4 - a^2 + 1.00
sage: (1+j+j^2)
a^4 - a^2 + 1.00

-- 
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: problem with sagetex

2011-10-09 Thread Maarten Derickx
what happens if you somewhere create a file sagetest.sage with the contents:

print hello world


and try to run that file both with absolute and relative path?
Since the core of the error seems to be not related to sagetex at all.

-- 
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: secure=True and purchased SSL certificate instead of a self-signed certificate

2011-10-09 Thread Maarten Derickx
Have you tried running notebook.setup() from within sage as mentioned 
on http://www.sagemath.org/doc/reference/sagenb/notebook/notebook_object.html

-- 
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: Question about Convert Polynomial

2011-10-09 Thread Maarten Derickx
In sage the types are not that important (it is just an implementation 
detail), but the parent of an object is since that says what the 
mathematical meaning of an object is. Try:

q=p.parent()(q)

-- 
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] Question About Primitive Element

2011-09-29 Thread Maarten Derickx
Phi(z) since by in your example the reduction of z will be primitive by 
definition. 

-- 
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] Strange behaviour in a simple function

2011-09-29 Thread Maarten Derickx
Mod(B*x, M) doesn't return an integer but an element of Integers(M) = the ring 
of integers modulo M. So the differences you see are because B is a normal 
integer so the subtractions involving B and M are just integer subtractions, 
but the substractions involing x and M are substractions in  Integers(M)

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


[sage-support] Re: Sage install errors.

2011-09-25 Thread Maarten Derickx
From the errors it looks like the installation did work, but starting the 
resulting sage didn't work. Can you confirm this by telling what was the 
command you executed to get the errors.

It looks like a problem with circular imports somewhere in numpy (a python 
package used by sage), but those problems should not be platform dependent 
(unless some things in sage are only imported on ubuntu but not on other 
platforms). Another posibility is that for some reason numpy didn't install 
correctly.

I don't have ubuntu myself so I cannot reproduce your problem, so the only 
advise I can give you is to try and install sage-4.7.1 instead of 4.7 and 
see if the problem still occurs. Another possibility would be to install 
from source. But I cannot guarantee that these possibilities will work

-- 
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] Fwd: Sage install errors.

2011-09-25 Thread Maarten Derickx
The fact that you used make to install sage made me slightly confused.
From the path where you installed sage

 /home/li/sage/sage-4.7-linux-32bit-ubuntu_10.04_lts-i686-Linux/

I saw that you downloaded a prebuild binairy for the 32 bits version
of ubuntu 10.04. The procedure of installing prebuild binairy's is
described on: 
http://www.sagemath.org/doc/installation/binary.html#linux-and-os-x
and doesn't involve running make. Also when you install a prebuild
binary you have to really make sure that it matches your system. In
this case you have to verify that you have ubuntu 10.04 and that it is
32bit.

The procedure for installing from source is (and the procedure
involving make) is mentioned at

http://www.sagemath.org/doc/installation/source.html#install-from-source-code

Did you follow during installation any of these two procedures or some
other part of the documentation?


-- Forwarded message --
From: jianrong lij...@gmail.com
Date: Sun, Sep 25, 2011 at 5:26 PM
Subject: Re: Sage install errors.
To: Maarten Derickx m.derickx.stud...@gmail.com


Thank you very much. The command I used is make. I will try again
using your suggestions.



On 9月25日, 上午6时03分, Maarten Derickx m.derickx.stud...@gmail.com
wrote:
 From the errors it looks like the installation did work, but starting the
 resulting sage didn't work. Can you confirm this by telling what was the
 command you executed to get the errors.

 It looks like a problem with circular imports somewhere in numpy (a python
 package used by sage), but those problems should not be platform dependent
 (unless some things in sage are only imported on ubuntu but not on other
 platforms). Another posibility is that for some reason numpy didn't install
 correctly.

 I don't have ubuntu myself so I cannot reproduce your problem, so the only
 advise I can give you is to try and install sage-4.7.1 instead of 4.7 and
 see if the problem still occurs. Another possibility would be to install
 from source. But I cannot guarantee that these possibilities will work

-- 
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: error: C preprocessor /lib/cpp fails sanity check (installing sage-4.7.1 from source)

2011-09-25 Thread Maarten Derickx
You should not neet to run installing as root. The error seems to be caused 
by the fact that your C preprosessor as located in /lib/cpp is behaving 
different from what sage expects. Can you show what is in config.log file?

-- 
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: error: C preprocessor /lib/cpp fails sanity check (installing sage-4.7.1 from source)

2011-09-25 Thread Maarten Derickx
It seems that the error is that on your system you cannot include the c 
header file limits.h . But this is a file which is part of the C standard 
library and hence including it should work on any system with gcc installed. 
From this I conclude that gcc shipped with your linux distro (pradus linux 
right?) is broken. You should ask them on how to fix this problem.

The shortest way to test it my above interpretation of your logs is indeed 
correct is by seeing if excecuting:

echo #include limits.h | cpp

gives any errors. If so my interpretation is correct.

-- 
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] Fwd: Sage install errors.

2011-09-25 Thread Maarten Derickx
Just for the record, this problem is solved.

Begin forwarded message:

*From:* jianrong li lij...@gmail.com
*Date:* September 26, 2011 0:20:57 GMT+02:00
*To:* Maarten Derickx m.derickx.stud...@gmail.com
*Subject:* *Re: Sage install errors.*

Thank you very much. I have installed successfully.


2011/9/25 Maarten Derickx m.derickx.stud...@gmail.com

 The prebuilt binary should be faster and easier to install if you have
 ubuntu 10.04

 2011/9/25 jianrong li lij...@gmail.com:
  Thank you very much. I followed the second one to install. Now I know the
  reason. I will download the source version and try to install it.
 
  Best wishes,
  Jianrong.
 
  在 2011年9月25日 上午11:54,Maarten Derickx m.derickx.stud...@gmail.com写道:
 
  The fact that you used make to install sage made me slightly confused.
  From the path where you installed sage
 
   /home/li/sage/sage-4.7-linux-32bit-ubuntu_10.04_lts-i686-Linux/
 
  I saw that you downloaded a prebuild binairy for the 32 bits version
  of ubuntu 10.04. The procedure of installing prebuild binairy's is
  described on:
  http://www.sagemath.org/doc/installation/binary.html#linux-and-os-x
  and doesn't involve running make. Also when you install a prebuild
  binary you have to really make sure that it matches your system. In
  this case you have to verify that you have ubuntu 10.04 and that it is
  32bit.
 
  The procedure for installing from source is (and the procedure
  involving make) is mentioned at
 
 
 
 http://www.sagemath.org/doc/installation/source.html#install-from-source-code
 
  Did you follow during installation any of these two procedures or some
  other part of the documentation?
 
 
  -- Forwarded message --
  From: jianrong lij...@gmail.com
  Date: Sun, Sep 25, 2011 at 5:26 PM
  Subject: Re: Sage install errors.
  To: Maarten Derickx m.derickx.stud...@gmail.com
 
 
  Thank you very much. The command I used is make. I will try again
  using your suggestions.
 
 
 
  On 9月25日, 上午6时03分, Maarten Derickx m.derickx.stud...@gmail.com
  wrote:
   From the errors it looks like the installation did work, but starting
   the
   resulting sage didn't work. Can you confirm this by telling what was
 the
   command you executed to get the errors.
  
   It looks like a problem with circular imports somewhere in numpy (a
   python
   package used by sage), but those problems should not be platform
   dependent
   (unless some things in sage are only imported on ubuntu but not on
 other
   platforms). Another posibility is that for some reason numpy didn't
   install
   correctly.
  
   I don't have ubuntu myself so I cannot reproduce your problem, so the
   only
   advise I can give you is to try and install sage-4.7.1 instead of 4.7
   and
   see if the problem still occurs. Another possibility would be to
 install
   from source. But I cannot guarantee that these possibilities will work
 
 


-- 
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: where to put Sage

2011-09-21 Thread Maarten Derickx
What solution is best for you really depends on how much you expect sage 
will get used. I definitly advise you to have your own sage notebook server 
running somewhere. And it would be best if that place was accesible from the 
WWW so student can also use it from home.

(3,4) It would not be a large imposition on computer science since sage can 
be installed without root acces they can just give you an account and the 
possibility to run a web service. You or one of your students could then 
install sage yourself, even installing non standard spkgs as you please. 
Running the notebook is also not that hard but also involves some 
coorperation of the CS people since they have to setup dns and other stuff 
depending on the situation at CS (not a huge ammount of work). The server 
load will of course depend on how much you expect the server will get used. 
Here at leiden there we have a dedicated machine (sage.math.leidenuniv.nl) 
witch has 4 cores running at 2.4 ghz and 8gig of memory wich has been enough 
to teach two courses in the same semester involving sage both with about 40 
participants. If you do not intend to give courses using sage you need way 
less then what we have, unless you intend to do heavy parallel 
computations. 

Maintaining a sage install can be very little work or a lot of work. 
Depending on wether you have to make a lot of accounts in the notebook for 
other users. And on how often you want to upgrade. Both of these can be done 
without root acces if the original installation was not done by root.

(7) very easily possible. I've done it even with my macbook pro giving the 
other people on the same wireless as me acces. Although for your solution 
you would probably also get a static IP together with an dns record so 
people can reach it easier.

(8) The hardest one, but worth the effort (at least that is the experience 
with the situation here in leiden).

In leiden sage is also usable form the command line on all machines but this 
is used way less often then the public notebook. People who want the 
commandline most of the time just install sage on their laptop.


-- 
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: help needed with Classes

2011-09-21 Thread Maarten Derickx
z.domain() fails because [0,1] is not a function but a list try:
z.domain

z.operation() fails because operation expects two arguments but it gets none 
try:
z.operation(4,3)

display() fails because it calls failing functions


-- 
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: help needed with Classes

2011-09-21 Thread Maarten Derickx
Note if you really want to do the things you want to do in the right way you 
have to learn about categories, parents, elements and the coercion model in 
sage. 

see http://www.sagemath.org/doc/reference/sage/categories/primer.html and
http://www.sagemath.org/doc/reference/sage/structure/coerce.html

This is all to difficult to grasp at once for a beginning sage/python user I 
guess. But maybe you can understand it using the following sage worksheet 
made by Simon King who gives a complete example of implementing fraction 
fields.

http://flask.sagenb.org/home/pub/82/

-- 
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: no math module!

2011-09-19 Thread Maarten Derickx
In the installation 
guide 
http://www.sagemath.org/doc/installation/source.html#environment-variables 
it is mentioned that for OS X 10.6 and greater you don't need to set 
SAGE64=yes to get a 64 bit install. Do you get the same error without the 
SAGE64=yes? I've managed to build 4.7.2.alpha2 on my macbook pro with OS X 
10.6.8 without problems. (Also some older versions of sage but I don't know 
the exact numbers)

-- 
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: list(factor(1)) yields []: Is this consequent?

2011-09-13 Thread Maarten Derickx
I think it is consequent. list(factor(n)) just gives a list of tuples (p,e) 
where p is a prime dividing n and e is it's exponent. Since there are no 
primes dividing 1 the list is empty.

-- 
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: cleaner?

2011-09-11 Thread Maarten Derickx
I just looked at the code of the script and it should end as long as there 
are no sage processes running anymore. The file itself is a python script 
wich contains a lot of print statements for debugging wich are currently 
commented out. For more info on what goes wrong you can uncomment these 
print statements and uncomment all the print statements and then manually 
run the script. Your run the scipt by doing

python ~/sage/local/bin/sage-cleaner

-- 
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: pni and Sage 4.7

2011-09-02 Thread Maarten Derickx
From the location of your sage install

~/Documents/sage-4.7.1-linux-32bit-ubuntu_10.04_lts- 
i686-Linux

I see you downloaded a prebuild binairy, I guess what's going wrong is that 
this binary was compiled in such a way that it's not compatible with your 
system. This 
post https://groups.google.com/forum/#!topic/sage-support/XJS-3u5z7ws
might be of help. 

I don't know if we have old prebuild binary's publically available 
somewhere, but at least we have old source code 
on http://www.sagemath.org/src-old/

-- 
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: Need to Express integers as 6 bit

2011-09-01 Thread Maarten Derickx
Maybe it's time to install a newer version of sage. 4.2 is quite old now, the 
latest stable release is now 4.7.1. Could you please, still also answer my 
question if it is only in chrome or also in other browsers you have installed?

-- 
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: compiling sage 4.7.1 under OpenSuSE 11.2

2011-09-01 Thread Maarten Derickx
Someone else had the exact same problem on sage-devel. Maybe the solution is 
here https://groups.google.com/d/topic/sage-devel/aL8b9phz3Xc/discussion

-- 
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: compiling sage 4.7.1 under OpenSuSE 11.2

2011-09-01 Thread Maarten Derickx
The way to do this is probably to change the CFLAGS that are exported in the 
pari install script. You find all pari related stuff in the pari spkg, this 
is located in $SAGE_ROOT/spkg/standard . Note that this is a compressed file 
so you have to untar it first. 
On http://www.sagemath.org/doc/developer/producing_spkgs.html there is 
documentation on how to modify/create an spkg.
In that spkg-install file contained in the pari spkg you should modify the 
part that reads:

# Set CFLAGS
if [ $SAGE_DEBUG = yes ]; then
# Disable optimisation, add debug symbols.
CFLAGS=$CFLAGS -O0 -g
else
# Use PARI's default CFLAGS (with -g added).
# PARI's Configure adds -O3 to the CFLAGS, so we don't need to add
# it explicitly.
CFLAGS=-g $CFLAGS
fi

export CFLAGS

Or apparently after having unzipped it and read the file myself it would be 
easier to not change the spkg and just do

export SAGE_DEBUG=yes

before building.

-- 
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: integral() error

2011-09-01 Thread Maarten Derickx
I have OS X 10.6.8 also but I don't have the same version of sage installed 
currently as you (I have sage 4.7.2.alpha2 and 4.6.1) and I don't seem to be 
able to replicate your error in both the older and the newer install. I 
don't have firefox so could you please try it from the command line (i.e. a 
sage terminal session) to rule out the unlikely case the the macsyma error 
is caused by firefox?

I guess since everything works ok for me, installing a newer version of sage 
should make your problem go away.

-- 
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: Can't build sage library

2011-08-31 Thread Maarten Derickx
Is it on a OS X lion machine or is the xcode version 4? Because it is known 
currently that building sage does not work well with those yet.

Search sage-devel for xcode 4 and lion or lionizing for the problems others 
ran into.

-- 
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: Bug in global_height

2011-08-31 Thread Maarten Derickx


On Tuesday, August 30, 2011 11:51:12 PM UTC+2, dkrumm wrote:

 Thanks, Maarten. I'm getting stuck when I run hg_sage.commit() . I do 
 not get a text editor to open as described in the links you gave me. 
 Instead, I get the same info as when I ran hg_sage.diff(), just a list 
 of the changes I made. Any idea of why this might happen? 

 That's why I said don't do points 4 till 10. But nevermind, was williams 
comment good enough to solve your problem? If not you should really try to 
proceed using mercurial queues. The relevant pieces about mercurial queues 
of the developers guide are highlighted in my previous post

-- 
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: Bug in global_height

2011-08-31 Thread Maarten Derickx
On Wed, Aug 31, 2011 at 10:20 PM, jack j...@alcor.concordia.ca wrote:
 Does this bug affect the height algorithm for points on elliptic
 curves?


I don't know if this height function is called by the function for
elliptic curves. The easiest way to find out is I guess to
(temporarely) put a print statement in your fixed version of the code
and then call the height function on elliptic curves and see if it
prints something. It seems quit likely that elliptic curves call the
numberfield height somewhere. I suggest you test this with an elliptic
curve over a non trivial numberfield (QQ somtimes behaves differently
then most numberfields) and also for QQ itself.

The other possibility is reading and understanding the code but this
might be a lot of work.

-- 
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: Can't build sage library

2011-08-31 Thread Maarten Derickx
Ok, I re asked the question on sage devel. 
See https://groups.google.com/forum/#!forum/sage-devel for the most recent 
status.

-- 
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: Bug in global_height

2011-08-30 Thread Maarten Derickx
Ok, so what I do is make sure that I have two versions of sage installed, 
one is just a stable release wich I use for my regular work and one is my 
development copy for development purposes. You could probably also work with 
1 version, but I like to be sure that I have a working sage at all times.

Now to get you up and running without you having to read the entire 
developement guide lets start easy. Before you make changes we first need 
you to set up your mercurial. This is explained at point 3 (don't do points 
4 till 10 since they are the old fashioned way and more difficult) 
from http://www.sagemath.org/doc/developer/walk_through.html#submitting-a-change
then setup mercurial queues as 
in 
http://www.sagemath.org/doc/developer/walk_through.html#starting-with-mercurial-queues
and then the patch creation process is described 
at 
http://www.sagemath.org/doc/developer/walk_through.html#creating-your-own-patch-with-queues
(you can also do it without queues but almost every sage developer does it 
with queues since it has a much easier workflow for creating patches).

After having setup and read the above you are ready to go and edit the 
source code. But first don't forget an important warning 
from 
http://www.sagemath.org/doc/developer/walk_through.html#modifying-sage-source-code
 
about the location of the place you want to edit the source code.

The build process will copy the necessary files to 
SAGE_ROOT/devel/sage/build andSAGE_ROOT/local/lib/python/site-packages. It 
is very important that you *do not change files* in these directories 
directly! If you do that, then those files would get overwritten the next 
time you run sage -b.

The place where you do want to make changes are 
SAGE_ROOT/devel/sage-main/sage where SAGE_ROOT is the top-level directory of 
your Sage installation.

If you have any questions just post them here, I will go on a flight in 3 
hours so I might not respond as fast as I did earlier.

-- 
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: Possible to do quizzes and/or practice problems in notebook?

2011-08-29 Thread Maarten Derickx
I followed a course once on elliptic curves. Here there was no automated 
checking involved but it instead you had to share your worksheet with the 
people who grade homework. That also worked quite nice. The sad thing is 
that the sage server of our mathematics department 
(https://sage.math.leidenuniv.nl/) is down so I cannot show you how the file 
looked like. But what it basically did was to use the regular text in the 
worksheet to ask the questions, and after a piece of text you had an input 
field where you had to answer it.

I know this might not be advanced enough for you, but sometimes something is 
beter then nothing.

-- 
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: Bug in global_height

2011-08-29 Thread Maarten Derickx
Dear dkrumm,

Thanks for your very detailed bug report. I saw you also created a tract 
ticket for this at http://trac.sagemath.org/sage_trac/ticket/11758
Would you also be interested in writing a patch? The other possibility is to 
ask if someone here is nice enough to change the sage sourcecode and upload 
a patch, but then you have to wait till the next sage release till you can 
advantage of the correct code. And since you already exactly located the 
bug, you already did the hardest part of the debugging. If you are 
interested in trying to find out how the sage developement process works 
please let me know, so I can help you get started.

Thanks,
Maarten

-- 
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: Need to Express integers as 6 bit

2011-08-26 Thread Maarten Derickx
Dear Santanu,

I work myself with sage an google chrome to and it's working for me. See 
below for an example. Could you please tell me which version of Chrome you 
are running and on which operating system. The version of sage you are using 
(or the adress of the webserver). And could you also please tell if you 
experience the same problem in other browsers then chrome.

https://lh4.googleusercontent.com/-Lrtv1pNpb0c/TldVyWL_KeI/A2k/YppkHTiVRDA/tab_completion.jpg
 

-- 
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: Bug in the implementation of the Chinese remainder theorem with non-coprime moduli

2011-08-26 Thread Maarten Derickx
Thanks for the report. This is indeed a bug in sage. The problem is that for 
some reason the algorithm in sage is asuming the moduli are coprime. If you 
need the functionality now, here is an updated version of the function is 
sage.

def CRT_list(v, moduli):
if not isinstance(v,list) or not isinstance(moduli,list):
raise ValueError, Arguments to CRT_list should be lists
if len(v) != len(moduli):
raise ValueError, Arguments to CRT_list should be lists of the same 
length
if len(v) == 0:
return ZZ(0)
if len(v) == 1:
return moduli[0].parent()(v[0])
x = v[0]
m = moduli[0]
for i in range(1,len(v)):
x = CRT(x,v[i],m,moduli[i])
m=m.lcm(moduli[i])
return x%m

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


[sage-support] Re: Bug in the implementation of the Chinese remainder theorem with non-coprime moduli

2011-08-26 Thread Maarten Derickx
ps. if there are other sage-devs reading this. there is an easy to review (3 
lines changed) patch up 
at http://trac.sagemath.org/sage_trac/attachment/ticket/11750/

-- 
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: Inverse of a polynomial

2011-08-25 Thread Maarten Derickx
This is already implemented in the sage i'm running (4.7.2.alpha2)

sage:  P.x = GF(2^10,'z')[]
sage: p = P.random_element()
sage: q = P.random_element()
sage: p.inverse_mod(q)
(z^7 + z^6 + z^5 + z^4 + z^3 + z^2 + z)*x + z^2 + z

-- 
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: Need to Express integers as 6 bit

2011-08-25 Thread Maarten Derickx
Dear Santanu,

I noticed that you asked quite a few easy questions in the last few day. 
It might be usefull for you to walk trough a sage tutorial (to be found at 
http://www.sagemath.org/doc/tutorial/ as soon as the site is working again) 
 and a python tutorial (since everything you can do in python you can also 
do in sage). This might make it easier to come up with your own solutions.
The solution to this question is:

sage: a=4
sage: pad_zeros(a.binary(),6)
'000100'

Note that before reading your question I didn't know the awnser either. But 
sage has a few nice features to help you discover some features.

Suppose I want to do something with an integer I first do

sage: a=4

so a is an integer.

now I do

sage: a.

and the pres the tab key.

The result is

a.Na.is_idempotent   
 a.numerical_approx
a.abs  a.is_integral  a.ord
a.additive_order   a.is_irreducible   a.order
a.base_extend  a.is_nilpotent a.ordinal_str
a.base_ringa.is_norm  a.parent
a.binary   a.is_one   a.popcount
a.binomial a.is_perfect_power a.powermod
a.bits a.is_power a.powermodm_ui
a.cartesian_producta.is_power_of 
 a.prime_divisors
a.category a.is_prime 
a.prime_factors
a.ceil a.is_prime_power   
a.prime_to_m_part
a.conjugatea.is_pseudoprime   a.quo_rem
a.coprime_integers a.is_squarea.radical
a.crt  a.is_squarefree   
 a.rational_reconstruction
a.db   a.is_unit  a.real
a.degree   a.is_zero  a.rename
a.denominator  a.isqrta.reset_name
a.digits   a.jacobi   a.save
a.divide_knowing_divisible_by  a.kroneckera.sqrt
a.divides  a.lcm  a.sqrt_approx
a.divisors a.leading_coefficient  a.sqrtrem
a.dump a.list 
a.squarefree_part
a.dumpsa.log  a.str
a.exact_loga.mod  a.subs
a.exp  a.multifactorial   a.substitute
a.factor   a.multiplicative_order a.support
a.factoriala.na.test_bit
a.floora.nbits   
 a.trailing_zero_bits
a.gammaa.ndigits 
 a.trial_division
a.gcd  a.next_prime   a.val_unit
a.imag a.next_probable_prime  a.valuation
a.inverse_mod  a.nth_root a.version
a.inverse_of_unit  a.numeratora.xgcd


I scan the results for something that make a into something binary and 
indeed there is a .binary method.
Now I do

sage: a.binary?

to see what it does, an it almost does what I want.

I do

sage: l = a.binary()

and see then I want it to be of length 6 so I want to pad it with zero's.

I do

sage: l.pad

and press tab. To bad there is no such function so I try

sage: pad

and press tab and see that there is indeed a funtion which pads zero's.


-- 
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] Binary array to integer

2011-08-24 Thread Maarten Derickx
This is the most efficient way you can do it in sage right now without doing 
a lot of manual coding. If you want something faster you need to think about 
it and write it yourself (or find someone who cares enough to do it). The 
most efficient way to get this functionality in python would involve writing 
some cython code.

-- 
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: Is x (x) impossible with all implicit_multiplication levels? (Please help decode warning get.)

2011-08-21 Thread Maarten Derickx
I don't think your proposal will be an enhancement. For two reasons.

1. x (x) an x*(x) have the same amount of characters. 
2. currently the python and sage expressions are not white space dependant. 
Your suggestion would introduce such a whitespace dependancy and will be 
very unexpected for a lot of people if they just happen to do something like 
 sin (pi).

-- 
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: Hi!

2011-08-20 Thread Maarten Derickx
It seems from your message that you might want to just try out sage first 
before going trough the effort of installing it. You can make a free account 
on www.sagenb.org to try it out. There are quite some users on that server 
so it might not be as fast as having your own installation.

For the installation part. Sage doesn't work natively on windows yet. But 
for the windows users we did make an virtual server which you can download 
and use with the virtualisation software called virtual box. There is a step 
by step description in http://boxen.math.washington.edu/sage/win/README.txt 
on how to get this up and running. The .ova file mentioned in the README.txt 
file can be downloaded from any of the mirrors listed 
on http://www.sagemath.org/download-windows.html.

Note that the user interface of sage is webbased. This means that if you 
happen to have a machine running linux or OS X, you can just install sage on 
that machine and then you will still be able to use sage on your windows 
machine using Internet Explorer or any of the other browsers you have 
installed.

Please let us now if you run into difficulties.

-- 
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: Hi!

2011-08-20 Thread Maarten Derickx
By the way www.sagenb.org seems to be down now. Luckily there are more 
public sage servers wich you can try is sagenb.org is down such 
as http://nt.sagenb.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: Invariant Polynomes under group action

2011-08-16 Thread Maarten Derickx


On Tuesday, August 16, 2011 10:46:50 AM UTC+2, Johhannes wrote:

 Am 16.08.2011 03:06, schrieb Nils Bruin:
  On Aug 15, 2:54 pm, Johannes dajo...@web.de wrote:
  I'm sorry for unclear description of the problem.
  So once again, let R = C[x_1,\dots,x_n]$ be my basering.
  I'm looking for the group G, wich leaves a finite set S of polynomes
  invariant under its action. So the ideal I = S is invariant under the
  G-action too. And because every constant polynome is invariant under the
  action, I can look at the subring C[I] = C[S] \subset R instead of
  looking at I.
  
  These are not the same rings, though. If S={1} then I=R, so C[I]=R and
  C[S]=C.
 In my case S only contains monomes like \prod x_{i}^{a_i}


Pleas ask someone in your neighborhood to explain you the difference between 
the C[S] and the C[I] you defined. I think you will learn a lot from it.

-- 
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: 2D translate , rotate

2011-08-16 Thread Maarten Derickx
Currently (as the reference you gave already said) it is only implemented 
for 3d objects. Try the following for example:

sage: c=circle((1,1,1),1) 
sage: c.translate((1,3,4))
sage: c.rotateX(2)

-- 
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: Callable Symbolic Functions

2011-08-02 Thread Maarten Derickx
It's mainly because a lot of things like the following should also work and 
the authors didn't want to add an exception in the special case where all 
variables have been assigned an input.

sage: f=x^5
sage: f(x=f)
x^25
sage: var(y)
y
sage: g=x*y
sage: g(x=2)
2*y

Note that the most important use case of the == sign still works as 
expected:


sage: if f(x=2)==32: print yes
: 
yes
sage: if f(x=2)==31: print yes
: 
sage: 


-- 
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: subtraction of variables with same units should not make the unit disappear

2011-08-02 Thread Maarten Derickx
According to the documentation 
http://www.sagemath.org/doc/reference/sage/symbolic/units.html the unit 
behave like elements from the symbolic ring, in which x-x will be replaced 
by 0. I considder this a bug since clearly you can add two elements only if 
the have the same unit, and the result will again have the same unit. 
Currently within sage there is not a neat workaround, I guess you just need 
to use your brain as you did in your This works example.

-- 
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: subtraction of variables with same units should not make the unit disappear

2011-08-02 Thread Maarten Derickx
I thought a bit longer about it, and I actually think it's not really a big 
bug. It think the way the units system is meant to be used is like this:

sage: var(H_l, h_c,T_a,T_l)
(H_l, h_c, T_a, T_l)
sage: 
sol=solve([H_l*units.energy.calorie/units.length.centimeter^2/units.time.minute 
== h_c*((T_a - T_l)*units.temperature.kelvin)],h_c)
sage: sol
[h_c == H_l*calorie/(T_a*centimeter^2*kelvin*minute - 
T_l*centimeter^2*kelvin*minute)]

The interpretation of this should be that 2*units.length.meter should be 
read as 2 * (1 meter) etc. This interpretation works very well if you have 
to convert explicit values. Note that you indeed cannot divide by 1 kelvin - 
1 kelvin = 0 kelvin. The framework will give sensible answers if you fill in 
distinct values for T_a and T_l.

sage: sol[0](T_l=1,T_a=2,H_l=3)
h_c == 3*calorie/(centimeter^2*kelvin*minute)

-- 
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: Generating extension fields

2011-07-12 Thread Maarten Derickx
The way i'd expect it to work is not working as i'd expect.

sage: F.a=GF(25)
sage: F2.
Display all 114 possibilities? (y or n)
sage: F2.b=F.extension(x^12-a)
sage: F[b^4][b^6]
Univariate Quotient Polynomial Ring in a over Univariate Quotient Polynomial 
Ring in a over Finite Field in a of size 5^2 with modulus a^3 + 4*a with 
modulus a^2 + 4*a
sage: _.is_field()
---
NotImplementedError   Traceback (most recent call last)


Also something else I tried is not working:

sage: composite_field(F[b^4],F[b^6])
---
ValueErrorTraceback (most recent call last)

/Users/maarten/ipython console in module()

/Applications/sage-4.6.rc0/local/lib/python2.6/site-packages/sage/rings/misc.pyc
 
in composite_field(K, L)
 32 
 33 C = Sequence([K(0), L(0)]).universe()
 34 if not is_Field(C):
--- 35 raise ValueError, unable to find a common field
 36 return C

ValueError: unable to find a common field


A short search_src  on subfield also doesn't seem to give any usefull 
commands. All the things I found will only work with adding only one field 
element, not multiple.



It would be a nice feature to have tough.


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