Re: [sage-support] for those who can appreciate

2023-05-24 Thread Henri Girard
I forget to say : I have done it with the windows version installers 9.2 
and I compiled sage-10-1 dev because on ubuntu (sage-dev 10.1 compiled 
but not 10.0 a problem with giac on wsl2), which is a good proof of the 
facility to get sage working !


Le 25/05/2023 à 00:32, William Stein a écrit :

Thanks for sharing that!

Right now on https://www.phind.com/ if you click on "Use Best Model 
(slow)" and include "using sagemath" in your question,
it will combine the sagemath docs, web searches, and GPT-4 to answer 
your question.  This might result in better answers
in some cases than just using chatgpt.   I don't know how long 
https://www.phind.com will be free or if it is globally available

or what, but it is fun to play with right now.

 -- William



On Wed, May 24, 2023 at 2:45 PM Henri Girard  
wrote:


I was trying chatgpt and noticed I was able things I couldn't do
myself alone, I think it can help in learning sage because it's a
good tool (i am making advert for it lol)

I needed some times to obtain what I wanted and as it gives python
sometimes there are mistakes with sage, in graphic I prefer sage
libs because I know them better than matplotlib with numpy

from sage.all import *

vertices = [(0, 0), (0, 1), (1, 1), (1, 0)]
p = polygon(vertices, fill=False)

def rotate_point(point, angle):
    rot = matrix([[cos(angle), sin(angle)],
  [-sin(angle), cos(angle)]])
    return rot * vector(point)

theta1 = pi / 4
theta2 = pi / 2

rotated_vertices1 = [rotate_point(vertex, theta1) for vertex in
vertices]
rotated_vertices2 = [rotate_point(vertex, theta2) for vertex in
vertices]

# Carré en bas à droite
square_bottom_right = [rotate_point((x + 1, y), theta2) +
vector([1, 1]) for x, y in vertices]

# Carré en haut à droite
square_top_right = [rotate_point((x + 1, y + 1), theta2) +
vector([0, 2]) for x, y in vertices]

# Centrer le losange
center = vector([0.05, 0.05])
offset = vector([0.245, -0.05])  # Ajuster l'offset selon les besoins
rotated_vertices_centered = [vertex + center + offset for vertex
in rotated_vertices1]

show(p + polygon(rotated_vertices_centered, fill=False, color='red') +
 polygon(rotated_vertices2, fill=False, color='blue') +
 polygon(square_bottom_right, fill=False, color='green') +
 polygon(square_top_right, fill=False, color='purple'),
 gridlines="major", axes=False, figsize=5)

-- 
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/eccafd8a-9c02-2c65-1275-73f5531cd106%40gmail.com

.



--
William (http://wstein.org)
--
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/CACLE5GBRFXDSBtzDpZoN7Ai7%2BvaNojpHS2O1pHXrCyg%3DEhydhg%40mail.gmail.com 
.


--
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/90305f45-bdde-f423-7ed2-f89d9e05eda3%40gmail.com.


Re: [sage-support] for those who can appreciate

2023-05-24 Thread Henri Girard
Thanks for appreciating and doing it on cocalc ! I will send few others 
I have done all over these  years (since the beginning of sage) with the 
help of the list ! But first I must find them back !


best

Henri

Le 25/05/2023 à 00:32, William Stein a écrit :

Thanks for sharing that!

Right now on https://www.phind.com/ if you click on "Use Best Model 
(slow)" and include "using sagemath" in your question,
it will combine the sagemath docs, web searches, and GPT-4 to answer 
your question.  This might result in better answers
in some cases than just using chatgpt.   I don't know how long 
https://www.phind.com will be free or if it is globally available

or what, but it is fun to play with right now.

 -- William



On Wed, May 24, 2023 at 2:45 PM Henri Girard  
wrote:


I was trying chatgpt and noticed I was able things I couldn't do
myself alone, I think it can help in learning sage because it's a
good tool (i am making advert for it lol)

I needed some times to obtain what I wanted and as it gives python
sometimes there are mistakes with sage, in graphic I prefer sage
libs because I know them better than matplotlib with numpy

from sage.all import *

vertices = [(0, 0), (0, 1), (1, 1), (1, 0)]
p = polygon(vertices, fill=False)

def rotate_point(point, angle):
    rot = matrix([[cos(angle), sin(angle)],
  [-sin(angle), cos(angle)]])
    return rot * vector(point)

theta1 = pi / 4
theta2 = pi / 2

rotated_vertices1 = [rotate_point(vertex, theta1) for vertex in
vertices]
rotated_vertices2 = [rotate_point(vertex, theta2) for vertex in
vertices]

# Carré en bas à droite
square_bottom_right = [rotate_point((x + 1, y), theta2) +
vector([1, 1]) for x, y in vertices]

# Carré en haut à droite
square_top_right = [rotate_point((x + 1, y + 1), theta2) +
vector([0, 2]) for x, y in vertices]

# Centrer le losange
center = vector([0.05, 0.05])
offset = vector([0.245, -0.05])  # Ajuster l'offset selon les besoins
rotated_vertices_centered = [vertex + center + offset for vertex
in rotated_vertices1]

show(p + polygon(rotated_vertices_centered, fill=False, color='red') +
 polygon(rotated_vertices2, fill=False, color='blue') +
 polygon(square_bottom_right, fill=False, color='green') +
 polygon(square_top_right, fill=False, color='purple'),
 gridlines="major", axes=False, figsize=5)

-- 
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/eccafd8a-9c02-2c65-1275-73f5531cd106%40gmail.com

.



--
William (http://wstein.org)
--
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/CACLE5GBRFXDSBtzDpZoN7Ai7%2BvaNojpHS2O1pHXrCyg%3DEhydhg%40mail.gmail.com 
.


--
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/827f30ff-6abc-8524-17c0-af3c6b75a58f%40gmail.com.


Re: [sage-support] for those who can appreciate

2023-05-24 Thread William Stein
Thanks for sharing that!

Right now on https://www.phind.com/  if you click on "Use Best Model
(slow)" and include "using sagemath" in your question,
it will combine the sagemath docs, web searches, and GPT-4 to answer your
question.  This might result in better answers
in some cases than just using chatgpt.   I don't know how long
https://www.phind.com will be free or if it is globally available
or what, but it is fun to play with right now.

 -- William



On Wed, May 24, 2023 at 2:45 PM Henri Girard  wrote:

> I was trying chatgpt and noticed I was able things I couldn't do myself
> alone, I think it can help in learning sage because it's a good tool (i am
> making advert for it lol)
>
> I needed some times to obtain what I wanted and as it gives python
> sometimes there are mistakes with sage, in graphic I prefer sage libs
> because I know them better than matplotlib with numpy
>
> from sage.all import *
>
> vertices = [(0, 0), (0, 1), (1, 1), (1, 0)]
> p = polygon(vertices, fill=False)
>
> def rotate_point(point, angle):
> rot = matrix([[cos(angle), sin(angle)],
>   [-sin(angle), cos(angle)]])
> return rot * vector(point)
>
> theta1 = pi / 4
> theta2 = pi / 2
>
> rotated_vertices1 = [rotate_point(vertex, theta1) for vertex in vertices]
> rotated_vertices2 = [rotate_point(vertex, theta2) for vertex in vertices]
>
> # Carré en bas à droite
> square_bottom_right = [rotate_point((x + 1, y), theta2) + vector([1, 1])
> for x, y in vertices]
>
> # Carré en haut à droite
> square_top_right = [rotate_point((x + 1, y + 1), theta2) + vector([0, 2])
> for x, y in vertices]
>
> # Centrer le losange
> center = vector([0.05, 0.05])
> offset = vector([0.245, -0.05])  # Ajuster l'offset selon les besoins
> rotated_vertices_centered = [vertex + center + offset for vertex in
> rotated_vertices1]
>
> show(p + polygon(rotated_vertices_centered, fill=False, color='red') +
>  polygon(rotated_vertices2, fill=False, color='blue') +
>  polygon(square_bottom_right, fill=False, color='green') +
>  polygon(square_top_right, fill=False, color='purple'),
>  gridlines="major", axes=False, figsize=5)
>
> --
> 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/eccafd8a-9c02-2c65-1275-73f5531cd106%40gmail.com
> 
> .
>


-- 
William (http://wstein.org)

-- 
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/CACLE5GBRFXDSBtzDpZoN7Ai7%2BvaNojpHS2O1pHXrCyg%3DEhydhg%40mail.gmail.com.


[sage-support] Re: Sage Crash Report

2023-05-24 Thread Matthias Goerner
9.7 with python 3.10 seems to work on Ventura 13.3 on a M2.

On Wed, May 24, 2023 at 3:16 PM Matthias Goerner  wrote:

> Hi!
>
> I can't get sage to work when installing it with conda on a new MacBook
> Pro with M2 chip and Ventura 13.3.
>
> I tried
> conda -n sage create sage=9.X python=3.Y
> for (X,Y) = (5,10), (8,10), (8,11).
> With Sage 9.5, I get the attached crash report.
> With Sage 9.8, I get the following linking error below.
>
> Cheers,
> Matthias
>
> (sage-py310) matthias@matthiass-air-2 ~ % sage
> ┌┐
> │ SageMath version 9.8, Release Date: 2023-02-11 │
> │ Using Python 3.10.11. Type "help()" for help.  │
> └┘
> ┏┓
> ┃ Warning: sage.all is not available; this is a limited REPL.┃
> ┗┛
> sage: import sage.all
> ---
> ImportError   Traceback (most recent call last)
> Cell In[1], line 1
> > 1 import sage.all
>
> File
> ~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/all.py:168
> 166 from sage.modules.allimport *
> 167 from sage.monoids.allimport *
> --> 168 from sage.algebras.all   import *
> 169 from sage.modular.allimport *
> 170 from sage.sat.allimport *
>
> File
> ~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/algebras/all.py:21
>   5
> #*
>   6 #   Copyright (C) 2005 William Stein 
>   7 #
>(...)
>  17 #  http://www.gnu.org/licenses/
>  18
> #*
>  19 from sage.misc.lazy_import import lazy_import
> ---> 21 import sage.algebras.catalog as algebras
>  23 from .quatalg.all import *
>  24 from .steenrod.all import *
>
> File
> ~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/algebras/catalog.py:84
>   1 r"""
>   2 Catalog of Algebras
>   3
>(...)
>  80   `
>  81 """
>  83 from sage.algebras.free_algebra import FreeAlgebra as Free
> ---> 84 from sage.algebras.quatalg.quaternion_algebra import
> QuaternionAlgebra as Quaternion
>  85 from sage.algebras.steenrod.steenrod_algebra import
> SteenrodAlgebra as Steenrod
>  86 from
> sage.algebras.finite_dimensional_algebras.finite_dimensional_algebra import
> FiniteDimensionalAlgebra as FiniteDimensional
>
> File
> ~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/algebras/quatalg/quaternion_algebra.py:68
>  61 from operator import itemgetter
>  63 from .quaternion_algebra_element import (
>  64 QuaternionAlgebraElement_abstract,
>  65 QuaternionAlgebraElement_generic,
>  66 QuaternionAlgebraElement_rational_field,
>  67 QuaternionAlgebraElement_number_field)
> ---> 68 from . import quaternion_algebra_cython
>  70 from sage.modular.modsym.p1list import P1List
>  72 from sage.misc.cachefunc import cached_method
>
> File
> ~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/algebras/quatalg/quaternion_algebra_cython.pyx:1,
> in init sage.algebras.quatalg.quaternion_algebra_cython
> (build/cythonized/sage/algebras/quatalg/quaternion_algebra_cython.cpp:6484)()
> > 1 # distutils: language = c++
>   2 # distutils: libraries = gmp m NTL_LIBRARIES
>   3 # distutils: extra_compile_args = NTL_CFLAGS
>
> File
> ~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/matrix/matrix_integer_dense.pyx:1,
> in init sage.matrix.matrix_integer_dense
> (build/cythonized/sage/matrix/matrix_integer_dense.cpp:59322)()
> > 1 # -*- coding: utf-8 -*-
>   2 # distutils: extra_compile_args = NTL_CFLAGS M4RI_CFLAGS
>   3 # distutils: libraries = iml NTL_LIBRARIES gmp m CBLAS_LIBRARIES
>
> ImportError:
> dlopen(/Users/matthias/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/libs/linbox/
> linbox_flint_interface.cpython-310-darwin.so, 0x0002): symbol not found
> in flat namespace
> '__ZN6FFPACK8CharPolyIN6Givaro8Poly1DomINS1_7ModularIddvEENS1_5DenseERNT_7ElementERKS7_S9_mNS7_8Domain_t11Element_ptrEmRNSC_8RandIterENS_19FFPACK_CHARPOLY_TAGEm'
>

-- 
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/CALB88e_PNuw90EAx82nPA21EJakeRFQFEsYvKLBNpVi72OgGjA%40mail.gmail.com.


[sage-support] Sage Crash Report

2023-05-24 Thread Matthias Goerner
Hi!

I can't get sage to work when installing it with conda on a new MacBook Pro
with M2 chip and Ventura 13.3.

I tried
conda -n sage create sage=9.X python=3.Y
for (X,Y) = (5,10), (8,10), (8,11).
With Sage 9.5, I get the attached crash report.
With Sage 9.8, I get the following linking error below.

Cheers,
Matthias

(sage-py310) matthias@matthiass-air-2 ~ % sage
┌┐
│ SageMath version 9.8, Release Date: 2023-02-11 │
│ Using Python 3.10.11. Type "help()" for help.  │
└┘
┏┓
┃ Warning: sage.all is not available; this is a limited REPL.┃
┗┛
sage: import sage.all
---
ImportError   Traceback (most recent call last)
Cell In[1], line 1
> 1 import sage.all

File
~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/all.py:168
166 from sage.modules.allimport *
167 from sage.monoids.allimport *
--> 168 from sage.algebras.all   import *
169 from sage.modular.allimport *
170 from sage.sat.allimport *

File
~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/algebras/all.py:21
  5
#*
  6 #   Copyright (C) 2005 William Stein 
  7 #
   (...)
 17 #  http://www.gnu.org/licenses/
 18
#*
 19 from sage.misc.lazy_import import lazy_import
---> 21 import sage.algebras.catalog as algebras
 23 from .quatalg.all import *
 24 from .steenrod.all import *

File
~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/algebras/catalog.py:84
  1 r"""
  2 Catalog of Algebras
  3
   (...)
 80   `
 81 """
 83 from sage.algebras.free_algebra import FreeAlgebra as Free
---> 84 from sage.algebras.quatalg.quaternion_algebra import
QuaternionAlgebra as Quaternion
 85 from sage.algebras.steenrod.steenrod_algebra import SteenrodAlgebra
as Steenrod
 86 from
sage.algebras.finite_dimensional_algebras.finite_dimensional_algebra import
FiniteDimensionalAlgebra as FiniteDimensional

File
~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/algebras/quatalg/quaternion_algebra.py:68
 61 from operator import itemgetter
 63 from .quaternion_algebra_element import (
 64 QuaternionAlgebraElement_abstract,
 65 QuaternionAlgebraElement_generic,
 66 QuaternionAlgebraElement_rational_field,
 67 QuaternionAlgebraElement_number_field)
---> 68 from . import quaternion_algebra_cython
 70 from sage.modular.modsym.p1list import P1List
 72 from sage.misc.cachefunc import cached_method

File
~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/algebras/quatalg/quaternion_algebra_cython.pyx:1,
in init sage.algebras.quatalg.quaternion_algebra_cython
(build/cythonized/sage/algebras/quatalg/quaternion_algebra_cython.cpp:6484)()
> 1 # distutils: language = c++
  2 # distutils: libraries = gmp m NTL_LIBRARIES
  3 # distutils: extra_compile_args = NTL_CFLAGS

File
~/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/matrix/matrix_integer_dense.pyx:1,
in init sage.matrix.matrix_integer_dense
(build/cythonized/sage/matrix/matrix_integer_dense.cpp:59322)()
> 1 # -*- coding: utf-8 -*-
  2 # distutils: extra_compile_args = NTL_CFLAGS M4RI_CFLAGS
  3 # distutils: libraries = iml NTL_LIBRARIES gmp m CBLAS_LIBRARIES

ImportError:
dlopen(/Users/matthias/anaconda3/envs/sage-py310/lib/python3.10/site-packages/sage/libs/linbox/
linbox_flint_interface.cpython-310-darwin.so, 0x0002): symbol not found in
flat namespace
'__ZN6FFPACK8CharPolyIN6Givaro8Poly1DomINS1_7ModularIddvEENS1_5DenseERNT_7ElementERKS7_S9_mNS7_8Domain_t11Element_ptrEmRNSC_8RandIterENS_19FFPACK_CHARPOLY_TAGEm'

-- 
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/CALB88e892xzZ_wBXqofXRP0cRQFc75jYt3vVo-hfTFr%3Dbh5Rmw%40mail.gmail.com.
***

IPython post-mortem report

{'commit_hash': 'fd4cac190',
 'commit_source': 'installation',
 'default_encoding': 'utf-8',
 'ipython_path': 
'/Users/matthias/anaconda3/envs/sage/lib/python3.10/site-packages/IPython',
 'ipython_version': '7.33.0',
 'os_name': 'posix',
 'platform': 'macOS-13.3-arm64-arm-64bit',
 'sys_executable': '/Users/matthias/anaco

[sage-support] for those who can appreciate

2023-05-24 Thread Henri Girard
I was trying chatgpt and noticed I was able things I couldn't do myself 
alone, I think it can help in learning sage because it's a good tool (i 
am making advert for it lol)


I needed some times to obtain what I wanted and as it gives python 
sometimes there are mistakes with sage, in graphic I prefer sage libs 
because I know them better than matplotlib with numpy


from sage.all import *

vertices = [(0, 0), (0, 1), (1, 1), (1, 0)]
p = polygon(vertices, fill=False)

def rotate_point(point, angle):
    rot = matrix([[cos(angle), sin(angle)],
  [-sin(angle), cos(angle)]])
    return rot * vector(point)

theta1 = pi / 4
theta2 = pi / 2

rotated_vertices1 = [rotate_point(vertex, theta1) for vertex in vertices]
rotated_vertices2 = [rotate_point(vertex, theta2) for vertex in vertices]

# Carré en bas à droite
square_bottom_right = [rotate_point((x + 1, y), theta2) + vector([1, 1]) 
for x, y in vertices]


# Carré en haut à droite
square_top_right = [rotate_point((x + 1, y + 1), theta2) + vector([0, 
2]) for x, y in vertices]


# Centrer le losange
center = vector([0.05, 0.05])
offset = vector([0.245, -0.05])  # Ajuster l'offset selon les besoins
rotated_vertices_centered = [vertex + center + offset for vertex in 
rotated_vertices1]


show(p + polygon(rotated_vertices_centered, fill=False, color='red') +
 polygon(rotated_vertices2, fill=False, color='blue') +
 polygon(square_bottom_right, fill=False, color='green') +
 polygon(square_top_right, fill=False, color='purple'),
 gridlines="major", axes=False, figsize=5)

--
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/eccafd8a-9c02-2c65-1275-73f5531cd106%40gmail.com.