[sage-support] Re: Computational geometry in the plane: in Sage?

2014-04-24 Thread Dominique Laurain
I need same packages that Ed asked for.
Nowadays I do geometry coding myself basic functions in SAGE worksheets (to 
do intersection of lines etc).
I do this using the Rational Trigonometry philosophy :-)..see njwilderger 
youtube videos and book.
Previously I played a little with Tex tools (pst-tricks and 
pst-eucl)..check about pstricks too...at that time and until now, I
was interested with tilings.
In SAGE we have the basics tools (vectors,matplotlib...) but I feel there 
are not the intermediate tools : convex hull, rules and compass 
constructions, origami tools and so on.
I can code some (for example, convex hull: I know an algorithm paquet 
cadeau ...but everytime I feel to reinvent wheel.
What is not enough with Tex is that all is static : for example, you cannot 
have the generic solution of two lines AB and CD where A,B,C,D are 2D 
points with variables coordinates...because it is no more static geometry 
but symbolic computations (solving equations / inequations).




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


Re: [sage-support] Installing Python module in Sage (Ubuntu)

2014-04-24 Thread v_2e
  Hello!

On Wed, 23 Apr 2014 15:40:10 -0700
William Stein wst...@gmail.com wrote:

 
 0. Install the necessary devel libraries for Ubuntu:
 
 sudo apt-get install h5utils libhdf5-dev libhdf5-doc
 
 1. Install PIP:
 
 sage -sh
 wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py;
 python get-pip.py
 
 NOTE -- this step 1 is silly -- we should include pip with Sage; sorry
 we don't yet.
 
 2. Install hdf5 module, and a few other things you likely want :
 
 sage  # start up sage
 sage: os.environ['NETCDF4_DIR']='/usr/'; os.environ
 ['HDF5_DIR']='/usr/'; sage: [(s, os.system(pip install %s%s)) for s
 in 'pandas statsmodels h5py netcdf4'.split()]
 
I usually install the additional python packages this way:

1. wget 'http://python_package.tar.gz' 
2. tar xvf python_package.tar.gz
3. cd python_package
4. sage -python setup.py install

  Is this a correct method?

Thanks!
Vladimir

- 
 v...@ukr.net

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


Re: [sage-support] Re: Extension of a field extension

2014-04-24 Thread Irene
Ok! Thank you! Do you have some idea about the first question?

*I want to add to A1 the square root of theta^3+3*theta+5.*
*The problem is that when I consider the following:*

gamma2=theta^3+3*theta+5
AA1.xbar=PolynomialRing(A1)
AA.gamma=A1.extension(xbar^2-gamma2)
(xbar^2-gamma2).roots(AA,multiplicities=False)

it gives me a NotImplementedError. Any idea? Thank you in advance.
*Irene*


On Monday, April 21, 2014 3:52:53 PM UTC+2, John Cremona wrote:

 On 21 April 2014 13:58, Irene irene@gmail.com javascript: wrote: 
  I forgot to write what is repsq(): 

 You could use the builtin function power_mod: 

 sage: power_mod? 
 Type:   function 
 String Form:function power_mod at 0x1f78668 
 File:   
 /usr/local/sage/sage-6.1.1/local/lib/python2.7/site-packages/sage/rings/arith.py
  

 Definition: power_mod(a, n, m) 
 Docstring: 
The n-th power of a modulo the integer m. 


  #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 
  
  
  On Monday, April 21, 2014 11:48:10 AM UTC+2, Irene wrote: 
  
  Hello, 
  I have the following defined: 
  
  p=371 
  Fp=GF(p) 
  E=EllipticCurve([Fp(3),Fp(5)]) 
  j_inv=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 
  Fps=GF(repsq(p,s),'a') 
  a=Fps.gen() 
  Fpr=GF(repsq(p,r),'b') 
  b=Fpr.gen() 
  FFps.X=PolynomialRing(Fps) 
  FFpr.x=PolynomialRing(Fpr) 
  EP=x^6 + (973912*b + 2535329)*x^5 + (416282*b + 3608920)*x^4 + 
 (686636*b + 
  908282)*x^3 + (2100014*b + 2063451)*x^2 + (2563113*b + 751714)*x + 
 2687623*b 
  + 1658379 
  A1.theta=Fpr.extension(EP) 
  
  and now I want to add to A1 the square root of theta^3+3*theta+5. 
  The problem is that when I consider the following: 
  
  gamma2=theta^3+3*theta+5 
  AA1.xbar=PolynomialRing(A1) 
  AA.gamma=A1.extension(xbar^2-gamma2) 
  (xbar^2-gamma2).roots(AA,multiplicities=False) 
  
  it gives me a NotImplementedError. Any idea? Thank you in advance. 
  Irene 
  
  -- 
  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...@googlegroups.com javascript:. 
  To post to this group, send email to 
  sage-s...@googlegroups.comjavascript:. 

  Visit this group at http://groups.google.com/group/sage-support. 
  For more options, visit https://groups.google.com/d/optout. 


-- 
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: Installing Python module in Sage (Ubuntu)

2014-04-24 Thread Simon King
Hi!

On 2014-04-24, v...@ukr.net v...@ukr.net wrote:
 I usually install the additional python packages this way:

 1. wget 'http://python_package.tar.gz' 
 2. tar xvf python_package.tar.gz
 3. cd python_package
 4. sage -python setup.py install

   Is this a correct method?

Should work too, AFAIK. Usually, I do the same in a Sage shell, i.e.
  sage -sh
  python setup.py install
but what you do should be equivalent.

Nonetheless, having a dedicated tool such as pip seems good to me.

Best regards,
Simon

-- 
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: Installing Python module in Sage (Ubuntu)

2014-04-24 Thread leif

v...@ukr.net wrote:

 I usually install the additional python packages this way:

1. wget 'http://python_package.tar.gz'
2. tar xvf python_package.tar.gz
3. cd python_package
4. sage -python setup.py install

   Is this a correct method?


Steps 2 to 4 *used to be* equivalent to simply doing

$ sage -i /path/to/python_package.tar{,.gz,.bz2}


Don't know whether that still works.  (And IIRC, the name of the tarball 
had to match the top-level folder in it, but that's /usually/ the case. 
 If not, simply renaming the tarball should be sufficient.)



-leif

--
() The ASCII Ribbon Campaign
/\   Help Cure HTML E-Mail

--
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: Computational geometry in the plane: in Sage?

2014-04-24 Thread Volker Braun
We do have convex hull and lines. What would be lacking for your 
application are discs and their intersection with polyhedra.

sage: line = Polyhedron(vertices=[(0,-1)], lines=[(1,1)])
sage: (triangle  line).vertices()
(A vertex at (8/5, 3/5), A vertex at (3/2, 1/2))


On Thursday, April 24, 2014 7:02:21 AM UTC+1, Dominique Laurain wrote:

 I need same packages that Ed asked for.
 Nowadays I do geometry coding myself basic functions in SAGE worksheets 
 (to do intersection of lines etc).
 I do this using the Rational Trigonometry philosophy :-)..see 
 njwilderger youtube videos and book.
 Previously I played a little with Tex tools (pst-tricks and 
 pst-eucl)..check about pstricks too...at that time and until now, I
 was interested with tilings.
 In SAGE we have the basics tools (vectors,matplotlib...) but I feel there 
 are not the intermediate tools : convex hull, rules and compass 
 constructions, origami tools and so on.
 I can code some (for example, convex hull: I know an algorithm paquet 
 cadeau ...but everytime I feel to reinvent wheel.
 What is not enough with Tex is that all is static : for example, you 
 cannot have the generic solution of two lines AB and CD where A,B,C,D are 
 2D points with variables coordinates...because it is no more static 
 geometry but symbolic computations (solving equations / inequations).




-- 
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: wrong or nonexistent results for various infinite sums

2014-04-24 Thread kcrisman



  which, to me, is a very useful answer. But other sums are simply wrong. 
  
  k = var('k') 
  sum(x^(2*k)/factorial(2*k),k,0,oo) 

 I'm working with Maxima 5.33.0. I get 

   simplify_sum ('sum(x^(2*k)/factorial(2*k),k,0,inf)); 
 = sqrt(%pi)*bessel_i(-1/2,x)*sqrt(x)/sqrt(2) 

 which seems to be cosh(x). 

  sum(x^(3*k)/factorial(2*k),k,0,oo) 

 I get 

   simplify_sum ('sum(x^(3*k)/factorial(2*k),k,0,inf)); 
 = sqrt(%pi)*bessel_i(-1/2,x^(3/2))*x^(3/4)/sqrt(2) 


Yes, at the ticket in question Nils was able to diagnose it as what I 
suspected, an incorrect translation from Maxima to Sage.  Thanks! 

-- 
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] How to define a homomorphism between two algebras

2014-04-24 Thread Irene
I have defined two extensions A1 and A2 over a finite field Fp2 with 
generator b,

A1.theta=Fp2.extension(Ep)
A2.z=Fp2.extension(Q)

being Ep and Q polynomials.

Now I want to define a homomorphism between those algebras. I have already 
computed alpha, that is the element in A2 where theta is mapped, but Sage 
doesn't allow me to define it as:

A1.hom([alpha], A2)

Do you know how to do it?

Irene

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


Re: [sage-support] Re: Computational geometry in the plane: in Sage?

2014-04-24 Thread Ed Scheinerman
Glad to see this has gained some traction. Here is an illustration of the
immediate issue for which this would have been helpful. I wanted to produce
an illustration explaining lines in the hyperbolic plane using the Poincare
disk model. It's the arc of a circle whose end points are on a given circle
and the arc meets the given circle at right angles. (That's a lot to say
but a picture makes it so much easier.)

It took me a long time and a good deal of coding in Sage to get this how I
wanted. My gut tells me there's go to be a better way!


On Thu, Apr 24, 2014 at 9:31 AM, Volker Braun vbraun.n...@gmail.com wrote:

 We do have convex hull and lines. What would be lacking for your
 application are discs and their intersection with polyhedra.

 sage: line = Polyhedron(vertices=[(0,-1)], lines=[(1,1)])
 sage: (triangle  line).vertices()
 (A vertex at (8/5, 3/5), A vertex at (3/2, 1/2))


 On Thursday, April 24, 2014 7:02:21 AM UTC+1, Dominique Laurain wrote:

 I need same packages that Ed asked for.
 Nowadays I do geometry coding myself basic functions in SAGE worksheets
 (to do intersection of lines etc).
 I do this using the Rational Trigonometry philosophy :-)..see
 njwilderger youtube videos and book.
 Previously I played a little with Tex tools (pst-tricks and
 pst-eucl)..check about pstricks too...at that time and until now, I
 was interested with tilings.
 In SAGE we have the basics tools (vectors,matplotlib...) but I feel there
 are not the intermediate tools : convex hull, rules and compass
 constructions, origami tools and so on.
 I can code some (for example, convex hull: I know an algorithm paquet
 cadeau ...but everytime I feel to reinvent wheel.
 What is not enough with Tex is that all is static : for example, you
 cannot have the generic solution of two lines AB and CD where A,B,C,D are
 2D points with variables coordinates...because it is no more static
 geometry but symbolic computations (solving equations / inequations).


  --
 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/Y0t4ShFLXJ4/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/d/optout.




-- 
Ed Scheinerman (e...@scheinerman.net)

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


line-definition.pdf
Description: Adobe PDF document


[sage-support] Re: How to define a homomorphism between two algebras

2014-04-24 Thread Peter Bruin
Can you post a complete example?  The following (simple) example works for 
me (at least in 6.2.beta8):

sage: F=GF(5).extension(2)
sage: A1.y=F.extension(x^2+3)
sage: A2.z=F.extension(x^2+3)
sage: A1.hom([z],A2)
Ring morphism:
  From: Univariate Quotient Polynomial Ring in y over Finite Field in a of 
size 5^2 with modulus y^2 + 3
  To:   Univariate Quotient Polynomial Ring in z over Finite Field in a of 
size 5^2 with modulus z^2 + 3
  Defn: y |-- z

Peter


Op donderdag 24 april 2014 16:55:34 UTC+1 schreef Irene:

 I have defined two extensions A1 and A2 over a finite field Fp2 with 
 generator b,

 A1.theta=Fp2.extension(Ep)
 A2.z=Fp2.extension(Q)

 being Ep and Q polynomials.

 Now I want to define a homomorphism between those algebras. I have already 
 computed alpha, that is the element in A2 where theta is mapped, but Sage 
 doesn't allow me to define it as:

 A1.hom([alpha], A2)

 Do you know how to do it?

 Irene


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


Re: [sage-support] Re: Computational geometry in the plane: in Sage?

2014-04-24 Thread Peter Bruin
A certain amount of work on adding functionality for hyperbolic geometry to 
Sage has been done in recent years, see here:

http://trac.sagemath.org/ticket/9439

There seem to be several different implementations by different authors; I 
am not sure about the status of all this work and how much of it is 
relevant to what you want to do.

Peter


Op donderdag 24 april 2014 18:54:32 UTC+1 schreef Ed Scheinerman:

 Glad to see this has gained some traction. Here is an illustration of the 
 immediate issue for which this would have been helpful. I wanted to produce 
 an illustration explaining lines in the hyperbolic plane using the Poincare 
 disk model. It's the arc of a circle whose end points are on a given circle 
 and the arc meets the given circle at right angles. (That's a lot to say 
 but a picture makes it so much easier.) 

 It took me a long time and a good deal of coding in Sage to get this how I 
 wanted. My gut tells me there's go to be a better way!


 On Thu, Apr 24, 2014 at 9:31 AM, Volker Braun vbrau...@gmail.comjavascript:
  wrote:

 We do have convex hull and lines. What would be lacking for your 
 application are discs and their intersection with polyhedra.

 sage: line = Polyhedron(vertices=[(0,-1)], lines=[(1,1)])
 sage: (triangle  line).vertices()
 (A vertex at (8/5, 3/5), A vertex at (3/2, 1/2))


 On Thursday, April 24, 2014 7:02:21 AM UTC+1, Dominique Laurain wrote:

 I need same packages that Ed asked for.
 Nowadays I do geometry coding myself basic functions in SAGE worksheets 
 (to do intersection of lines etc).
 I do this using the Rational Trigonometry philosophy :-)..see 
 njwilderger youtube videos and book.
 Previously I played a little with Tex tools (pst-tricks and 
 pst-eucl)..check about pstricks too...at that time and until now, I
 was interested with tilings.
 In SAGE we have the basics tools (vectors,matplotlib...) but I feel 
 there are not the intermediate tools : convex hull, rules and compass 
 constructions, origami tools and so on.
 I can code some (for example, convex hull: I know an algorithm paquet 
 cadeau ...but everytime I feel to reinvent wheel.
 What is not enough with Tex is that all is static : for example, you 
 cannot have the generic solution of two lines AB and CD where A,B,C,D are 
 2D points with variables coordinates...because it is no more static 
 geometry but symbolic computations (solving equations / inequations).


  -- 
 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/Y0t4ShFLXJ4/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 sage-support...@googlegroups.com javascript:.
 To post to this group, send email to sage-s...@googlegroups.comjavascript:
 .
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Ed Scheinerman (e...@scheinerman.net javascript:) 


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