[sage-support] Re: Sage Crash Report

2023-05-31 Thread Matthias Goerner
I am focusing on the Sage 9.8 issue of the missing symbol 
__ZN6FFPACK8CharPolyIN6Givaro8Poly1DomINS1_7ModularIddvEENS1_5DenseERNT_7ElementERKS7_S9_mNS7_8Domain_t11Element_ptrEmRNSC_8RandIterENS_19FFPACK_CHARPOLY_TAGEm

Demangled with c++filt, the missing symbol is:
Givaro::Poly1Dom, 
Givaro::Dense>::Element& 
FFPACK::CharPoly, 
Givaro::Dense> >(Givaro::Poly1Dom, 
Givaro::Dense> const&, Givaro::Poly1Dom, Givaro::Dense>::Element&, unsigned long, 
Givaro::Poly1Dom, 
Givaro::Dense>::Domain_t::Element_ptr, unsigned long, 
Givaro::Poly1Dom, 
Givaro::Dense>::Domain_t::RandIter&, FFPACK::FFPACK_CHARPOLY_TAG, unsigned 
long)

I expect this to be in ffpack, so I made sure that ffpack is indeed picked 
up from the dedicated conda environment:

lsof -p 70202 | grep -i ffpack
python3.1 70202 matthias  txt  REG   1,15  1132624 5917685 
/Users/matthias/anaconda3/envs/sage98-py311/lib/libffpack.1.dylib

I then looked whether similar symbols are available in ffpack with the 
following command:
nm /Users/matthias/anaconda3/envs/sage98-py311/lib/libffpack.1.dylib | grep 
__ZN6FFPACK8CharPolyIN6Givaro8Poly1DomINS1_7ModularIddvEENS1_5DenseERNT_7ElementERKS7_S9_mNS7_8Domain_t11Element_ptrEm

Which gave:
0004f17c T 
__ZN6FFPACK8CharPolyIN6Givaro8Poly1DomINS1_7ModularIddvEENS1_5DenseERNT_7ElementERKS7_S9_mNS7_8Domain_t11Element_ptrEmNS_19FFPACK_CHARPOLY_TAGEm
0004ec10 T 
__ZN6FFPACK8CharPolyIN6Givaro8Poly1DomINS1_7ModularIddvEENS1_5DenseERNT_7ElementERKS7_S9_mNS7_8Domain_t11Element_ptrEmRNS7_8Domain_t8RandIterENS_19FFPACK_CHARPOLY_TAGEm

which demangled gives:
Givaro::Poly1Dom, 
Givaro::Dense>::Element& 
FFPACK::CharPoly, 
Givaro::Dense> >(Givaro::Poly1Dom, 
Givaro::Dense> const&, Givaro::Poly1Dom, Givaro::Dense>::Element&, unsigned long, 
Givaro::Poly1Dom, 
Givaro::Dense>::Domain_t::Element_ptr, unsigned long, 
FFPACK::FFPACK_CHARPOLY_TAG, unsigned long)
Givaro::Poly1Dom, 
Givaro::Dense>::Element& 
FFPACK::CharPoly, 
Givaro::Dense> >(Givaro::Poly1Dom, 
Givaro::Dense> const&, Givaro::Poly1Dom, Givaro::Dense>::Element&, unsigned long, 
Givaro::Poly1Dom, 
Givaro::Dense>::Domain_t::Element_ptr, unsigned long, 
Givaro::Poly1Dom, 
Givaro::Dense>::Domain_t::RandIter&, FFPACK::FFPACK_CHARPOLY_TAG, unsigned 
long)

And then I got confused: the latter demangled method has the same signature 
as the missing one.

In other words: from a C++ perspective, the missing method is there, it is 
just that the way the name and signature get mangled is different 
between linbox_flint_interface.cpython-311-darwin.so and libffpack.1.dylib

So it seems it is an ABI problem where we get two different managled names 
for the same function signature.

I am not sure what to make out of this and have only two explanations:
1. It is a bug in the C++ compiler.
2. The two libraries were compiled with different C++ compilers or with 
different compiler options.

On Wednesday, May 31, 2023 at 11:01:20 AM UTC-7 Matthias Goerner wrote:

Sorry for the late reply. Here are the details about my conda environment. 
I am not exactly sure what other information is useful to debug this. I am 
familiar with the linux tools, but am struggling with otool and vmmap to 
figure out what is going on here and see whether I am picking up any 
library from something that is not in the dedicated conda environment.

On Friday, May 26, 2023 at 8:05:04 AM UTC-7 Matthias Koeppe wrote:

config.log please

On Wednesday, May 24, 2023 at 3:16:25 PM UTC-7 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

[sage-support] Re: Sage Crash Report

2023-05-31 Thread Matthias Goerner
Sorry for the late reply. Here are the details about my conda environment. 
I am not exactly sure what other information is useful to debug this. I am 
familiar with the linux tools, but am struggling with otool and vmmap to 
figure out what is going on here and see whether I am picking up any 
library from something that is not in the dedicated conda environment.

On Friday, May 26, 2023 at 8:05:04 AM UTC-7 Matthias Koeppe wrote:

> config.log please
>
> On Wednesday, May 24, 2023 at 3:16:25 PM UTC-7 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
>>
>

[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': 

[sage-support] Re: Segfault with conda installation of SageMath-9.3 and 9.4 on Mac OS X

2022-01-30 Thread Matthias Goerner
I now have repro steps that do not require SnapPy at all:

Rx = PolynomialRing(RationalField(), 'x')
R  = PolynomialRing(Rx, 'y')
R('-y^2 + x^2 - x + 1').resultant(R('(2*x - 1)*y'))

On Saturday, January 29, 2022 at 11:19:38 PM UTC-8 Matthias Goerner wrote:

> I am getting a crash when I am running SnapPy's 
> https://github.com/3-manifolds/SnapPy test suite against SageMath with 
> the stack trace below.
> I created several different conda environments, all with python 3.9.9, on 
> Mac OS 11.5.2 x86_64 and it seems to be related to the (cy)pari version. 
> That is, I can fix the crash or recreate the crash by changing the 
> environment with "conda install pari==2.11.4" or "conda install 2.13.2". 
> Those commands change the packages as follows:
>
>   added / updated specs:
> - pari==2.11.4
>
>
> The following packages will be DOWNGRADED:
>
>   cypari2  2.1.2-py39hbeebeb8_3 --> 
> 2.1.2-py39he58a9ab_0
>   cysignals   1.11.2-py39h7972417_0 --> 
> 1.10.3-py39h520947a_0
>   eclib 20210503-h06317ce_2 --> 
> 20210503-h5af3530_0
>   giac  1.6.0.47-h3e19eb6_2 --> 
> 1.6.0.47-h5514456_0
>   lcalc  1.23-he3dd645_1006 --> 
> 1.23-h3e22c04_1004
>   pari2.13.2-h491590d_1_pthread --> 
> 2.11.4-h797e938_2
>   sagelib9.3-py39hf07016b_5 --> 
> 9.3-py39h2a6771f_4
>
> l also tried Marc Culler's Sage releases (
> https://github.com/3-manifolds/Sage_macOS/releases), version 9.4 and 9.5 
> prerelease. The crash didn't happen in either version. I think those use 
> pari 2.13.1 and 2.13.3.
>
> Hmmm... I noted that the downgrading that fixed the crash removed 
> "_pthread" from the pari version. So maybe pthread support causes the crash.
>
> Here is the stacktrace:
>
> * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
>   * frame #0: 0x7fff203b84c2 libsystem_kernel.dylib`__kill + 10
> frame #1: 0x00010ffd40ac libpari-gmp-tls.dylib`pari_err + 4940
> frame #2: 0x00010fca26ec libpari-gmp-tls.dylib`_gtopoly + 172
> frame #3: 0x0001169ec422 
> gen.cpython-39-darwin.so`__pyx_pf_7cypari2_3gen_8Gen_base_14Polrev 
> + 178
> frame #4: 0x00010f7b450c 
> signals.cpython-39-darwin.so`__Pyx_CyFunction_CallAsMethod 
> + 92
> frame #5: 0x000118534c77 
> polynomial_element.cpython-39-darwin.so`__Pyx_PyObject_Call2Args 
> + 215
> frame #6: 0x0001185972cf 
> polynomial_element.cpython-39-darwin.so`__pyx_pw_4sage_5rings_10polynomial_18polynomial_element_10Polynomial_221_pari_with_name
>  
> + 1071
> frame #7: 0x00010f0b1f24 python`cfunction_call + 52
> frame #8: 0x000118534ea3 
> polynomial_element.cpython-39-darwin.so`__Pyx_PyObject_CallOneArg 
> + 339
> frame #9: 0x0001185967a2 
> polynomial_element.cpython-39-darwin.so`__pyx_pw_4sage_5rings_10polynomial_18polynomial_element_10Polynomial_217__pari__
>  
> + 386
> frame #10: 0x000118535904 
> polynomial_element.cpython-39-darwin.so`__Pyx_PyObject_CallNoArg 
> + 132
> frame #11: 0x000118598497 
> polynomial_element.cpython-39-darwin.so`__pyx_pw_4sage_5rings_10polynomial_18polynomial_element_10Polynomial_231resultant
>  
> + 551
> frame #12: 0x00010f060bd5 python`method_vectorcall_O + 117
> frame #13: 0x0001108491d4 
> element.cpython-39-darwin.so`__pyx_pw_4sage_9structure_7element_12coerce_binop_1new_method
>  
> + 1208
> frame #14: 0x00010f051288 python`_PyObject_MakeTpCall + 136
> frame #15: 0x00010f055d9e python`method_vectorcall + 686
> frame #16: 0x00010f186e4f python`call_function + 175
> frame #17: 0x00010f184940 python`_PyEval_EvalFrameDefault + 44816
> frame #18: 0x00010f1781e4 python`_PyEval_EvalCode + 548
> frame #19: 0x00010f05272b python`_PyFunction_Vectorcall + 427
> frame #20: 0x00010f186e4f python`call_function + 175
> frame #21: 0x00010f184972 python`_PyEval_EvalFrameDefault + 44866
> frame #22: 0x00010f1781e4 python`_PyEval_EvalCode + 548
> frame #23: 0x00010f05272b python`_PyFunction_Vectorcall + 427
> frame #24: 0x00010f186e4f python`call_function + 175
> frame #25: 0x00010f184972 python`_PyEval_EvalFrameDefault + 44866
> frame #26: 0x00010f1781e4 python`_PyEval_EvalCode + 548
> frame #27: 0x00010f05272b python`_PyFunction_Vectorcall + 427
> frame #28: 0x00010f186e4f python`call_function + 175
> frame #29: 0x00010f184972 python`_PyEval_EvalFrameDefault + 44866
> frame #30: 0x0

[sage-support] Segfault with conda installation of SageMath-9.3 and 9.4 on Mac OS X

2022-01-29 Thread Matthias Goerner
I am getting a crash when I am running 
SnapPy's https://github.com/3-manifolds/SnapPy test suite against SageMath 
with the stack trace below.
I created several different conda environments, all with python 3.9.9, on 
Mac OS 11.5.2 x86_64 and it seems to be related to the (cy)pari version. 
That is, I can fix the crash or recreate the crash by changing the 
environment with "conda install pari==2.11.4" or "conda install 2.13.2". 
Those commands change the packages as follows:

  added / updated specs:
- pari==2.11.4


The following packages will be DOWNGRADED:

  cypari2  2.1.2-py39hbeebeb8_3 --> 
2.1.2-py39he58a9ab_0
  cysignals   1.11.2-py39h7972417_0 --> 
1.10.3-py39h520947a_0
  eclib 20210503-h06317ce_2 --> 
20210503-h5af3530_0
  giac  1.6.0.47-h3e19eb6_2 --> 
1.6.0.47-h5514456_0
  lcalc  1.23-he3dd645_1006 --> 
1.23-h3e22c04_1004
  pari2.13.2-h491590d_1_pthread --> 
2.11.4-h797e938_2
  sagelib9.3-py39hf07016b_5 --> 
9.3-py39h2a6771f_4

l also tried Marc Culler's Sage releases 
(https://github.com/3-manifolds/Sage_macOS/releases), version 9.4 and 9.5 
prerelease. The crash didn't happen in either version. I think those use 
pari 2.13.1 and 2.13.3.

Hmmm... I noted that the downgrading that fixed the crash removed 
"_pthread" from the pari version. So maybe pthread support causes the crash.

Here is the stacktrace:

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x7fff203b84c2 libsystem_kernel.dylib`__kill + 10
frame #1: 0x00010ffd40ac libpari-gmp-tls.dylib`pari_err + 4940
frame #2: 0x00010fca26ec libpari-gmp-tls.dylib`_gtopoly + 172
frame #3: 0x0001169ec422 
gen.cpython-39-darwin.so`__pyx_pf_7cypari2_3gen_8Gen_base_14Polrev 
+ 178
frame #4: 0x00010f7b450c 
signals.cpython-39-darwin.so`__Pyx_CyFunction_CallAsMethod 
+ 92
frame #5: 0x000118534c77 
polynomial_element.cpython-39-darwin.so`__Pyx_PyObject_Call2Args 
+ 215
frame #6: 0x0001185972cf 
polynomial_element.cpython-39-darwin.so`__pyx_pw_4sage_5rings_10polynomial_18polynomial_element_10Polynomial_221_pari_with_name
 
+ 1071
frame #7: 0x00010f0b1f24 python`cfunction_call + 52
frame #8: 0x000118534ea3 
polynomial_element.cpython-39-darwin.so`__Pyx_PyObject_CallOneArg 
+ 339
frame #9: 0x0001185967a2 
polynomial_element.cpython-39-darwin.so`__pyx_pw_4sage_5rings_10polynomial_18polynomial_element_10Polynomial_217__pari__
 
+ 386
frame #10: 0x000118535904 
polynomial_element.cpython-39-darwin.so`__Pyx_PyObject_CallNoArg 
+ 132
frame #11: 0x000118598497 
polynomial_element.cpython-39-darwin.so`__pyx_pw_4sage_5rings_10polynomial_18polynomial_element_10Polynomial_231resultant
 
+ 551
frame #12: 0x00010f060bd5 python`method_vectorcall_O + 117
frame #13: 0x0001108491d4 
element.cpython-39-darwin.so`__pyx_pw_4sage_9structure_7element_12coerce_binop_1new_method
 
+ 1208
frame #14: 0x00010f051288 python`_PyObject_MakeTpCall + 136
frame #15: 0x00010f055d9e python`method_vectorcall + 686
frame #16: 0x00010f186e4f python`call_function + 175
frame #17: 0x00010f184940 python`_PyEval_EvalFrameDefault + 44816
frame #18: 0x00010f1781e4 python`_PyEval_EvalCode + 548
frame #19: 0x00010f05272b python`_PyFunction_Vectorcall + 427
frame #20: 0x00010f186e4f python`call_function + 175
frame #21: 0x00010f184972 python`_PyEval_EvalFrameDefault + 44866
frame #22: 0x00010f1781e4 python`_PyEval_EvalCode + 548
frame #23: 0x00010f05272b python`_PyFunction_Vectorcall + 427
frame #24: 0x00010f186e4f python`call_function + 175
frame #25: 0x00010f184972 python`_PyEval_EvalFrameDefault + 44866
frame #26: 0x00010f1781e4 python`_PyEval_EvalCode + 548
frame #27: 0x00010f05272b python`_PyFunction_Vectorcall + 427
frame #28: 0x00010f186e4f python`call_function + 175
frame #29: 0x00010f184972 python`_PyEval_EvalFrameDefault + 44866
frame #30: 0x00010f052672 python`_PyFunction_Vectorcall + 242
frame #31: 0x00010f186e4f python`call_function + 175
frame #32: 0x00010f184972 python`_PyEval_EvalFrameDefault + 44866
frame #33: 0x00010f052672 python`_PyFunction_Vectorcall + 242
frame #34: 0x00010f186e4f python`call_function + 175
frame #35: 0x00010f184972 python`_PyEval_EvalFrameDefault + 44866
frame #36: 0x00010f1781e4 python`_PyEval_EvalCode + 548
frame #37: 0x00010f05272b python`_PyFunction_Vectorcall + 427
frame #38: 0x00010f186e4f python`call_function + 175
frame #39: 0x00010f184a2b python`_PyEval_EvalFrameDefault + 45051
frame #40: 0x00010f1781e4 python`_PyEval_EvalCode + 548
frame #41: 0x00010f05272b 

[sage-support] Re: Automatic Differentiation in Sage?

2018-06-23 Thread Matthias Goerner
Exactly! That's it, mathematically speaking!

However, when I try 
sage: sin(2 / (A((0.99, 1.01)) + dx + 3*dy))
ValueError: Can only apply sin to formal power series with zero constant 
term.

And, I get
sage: A((0.99,1.01))
1.0?
but
sage: sage: A(RIF(0.99,1.01))
1.0? + O(dx, dy)^53

Shouldn't that give the same?

-- 
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: Automatic Differentiation in Sage?

2018-06-23 Thread Matthias Goerner
Sorry, I meant "Symbolic differentiation is not automatic differentiation", 
see the link to the wikipedia article 
.

Thanks for the links to the libraries they do similar things to what I want 
to do, but not quiet since they don't seem to support interval arithmetic.

Also, I was thinking about this in terms of types, e.g., if I define a 
function such as
def f(x, y):
return (x/y).cos()
in sage and I give it elements of RDF, it will return me numbers, but if I 
give it elements in RIF, I get intervals. And I was hoping there would be a 
"AutomaticDifferentiationField" so that if I pass suitable elements as 
inputs to f, I automatically obtain the derivatives.

It wouldn't be fancy: an element in an AutomaticDifferentiationField for 
one variable would be just a pair (value, derivative) with addition as (v, 
d) + (v', d') = (v+v', d+d'), multiplication as (v, d) * (v', d') = (v * 
v', v * d' + v' * d), division as (v, d) / (v', d') = (v/v', (d * v' - v * 
d')/v'^2), and so on.
An AutomaticDifferentiationField should probably be in sage's category of 
fields and have a base_field() (similar to PolynomialRing has a 
base_ring()), probably subclass from Algebra, elements allow coercion from 
elements in the base_field(). It is essentially like PolynomialRing where 
the base ring needs to be a field and where you discard higher monomials 
when multiplying. But it also would support division, sin, cos, ... 
according to how you would ordinarily differentiation using, e.g., chain 
rule.
For several variables, it would be a tuple (value, 
derivativeWithRespectToFirstDim, ..., derivativeWithRespectToLastDim).

Does something like that exist in SageMath?

-- 
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: Automatic Differentiation in Sage?

2018-06-22 Thread Matthias Goerner
The function might be much more complicated than that so that symbolic 
differentiation won't scale unlike automatic differentiation.

It might also be that I can't write down the function as a symbolic 
expression without going through a lot of extra work. The application I 
have in mind is applying a bunch of functions, additions and 
multiplications on intervals assigned to vertices and edges of a 
triangulation. This would be really easy to do with automatic 
differentiation (in fact, I already did an ad-hoc implementation).

Symbolic integration and automatic differentiation are two different 
things! And there really are applications for the latter.

On Friday, June 22, 2018 at 1:14:17 PM UTC-7, Matthias Goerner wrote:
>
> I have a function such as cos(x/y) and values for x and y and want to use 
> automatic differentiation (a la wikipedia article 
> <https://en.wikipedia.org/wiki/Automatic_differentiation#Automatic_differentiation_using_dual_numbers>)
>  
> to find the value and derivatives with respect to x and y. Can this be done 
> easily in Sage, preferably using interval arithmetic?
>
> I was hoping for an object that I could use something like this:
>
> sage: A. = AutomaticDifferentiationField(RDF, 2)
> sage: x = 2.0 + dx
> sage: y = 3.0 + dy
> sage: f = cos(x,y)
> sage: f
> 0.785887260776948 -0.303099142275227 * dx + 0.137415511793275 * dy
> sage: f.value()
> 0.785887260776948
> sage: f.derivatives()
> [-0.303099142275227, 0.137415511793275]
>
> And replacing RDF by RIF and setting x = RIF(1.99, 2.01) + dx, y = ... 
> would do it over interval arithmetic then.
>

-- 
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] Automatic Differentiation in Sage?

2018-06-22 Thread Matthias Goerner
I have a function such as cos(x/y) and values for x and y and want to use 
automatic differentiation (a la wikipedia article 
)
 
to find the value and derivatives with respect to x and y. Can this be done 
easily in Sage, preferably using interval arithmetic?

I was hoping for an object that I could use something like this:

sage: A. = AutomaticDifferentiationField(RDF, 2)
sage: x = 2.0 + dx
sage: y = 3.0 + dy
sage: f = cos(x,y)
sage: f
0.785887260776948 -0.303099142275227 * dx + 0.137415511793275 * dy
sage: f.value()
0.785887260776948
sage: f.derivatives()
[-0.303099142275227, 0.137415511793275]

And replacing RDF by RIF and setting x = RIF(1.99, 2.01) + dx, y = ... 
would do it over interval arithmetic then.

-- 
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] sage-7.4-Ubuntu_15.10-x86_64.tar.bz2 crashes

2016-12-06 Thread Matthias Goerner
I just tried to run sage-7.4-Ubuntu_15.10-x86_64.tar.bz2 but it crashes 
with SIGILL (also attached CPU info):

┌┐
│ SageMath version 7.4, Release Date: 2016-10-18 │
│ Type "notebook()" for the browser-based notebook interface.│
│ Type "help()" for help.│
└┘

/home/matthias/mathSoftware/sage-7.4/local/lib/python2.7/site-packages/cysignals/signals.so(+0x45a8)[0x7faaca5ca5a8]
/home/matthias/mathSoftware/sage-7.4/local/lib/python2.7/site-packages/cysignals/signals.so(+0x4615)[0x7faaca5ca615]
/home/matthias/mathSoftware/sage-7.4/local/lib/python2.7/site-packages/cysignals/signals.so(+0x716b)[0x7faaca5cd16b]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10d10)[0x7faad2b13d10]
/home/matthias/mathSoftware/sage-7.4/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_libsingular.so(+0x2701c)[0x7f9b4686001c]
/home/matthias/mathSoftware/sage-7.4/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_element.so(+0x18a2e)[0x7f9b53341a2e]
/home/matthias/mathSoftware/sage-7.4/local/lib/python2.7/site-packages/sage/rings/polynomial/polynomial_element.so(+0x3286d)[0x7f9b5335b86d]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(+0xbfddf)[0x7faad2de0ddf]
/home/matthias/mathSoftware/sage-7.4/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_libsingular.so(+0x2cf06)[0x7f9b46865f06]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(+0xbfddf)[0x7faad2de0ddf]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7faad2d74a83]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x39d4)[0x7faad2e2ac04]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7faad2e2db8c]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5be4)[0x7faad2e2ce14]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7faad2e2db8c]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5be4)[0x7faad2e2ce14]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7faad2e2db8c]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(+0x85a3c)[0x7faad2da6a3c]
/home/matthias/mathSoftware/sage-7.4/local/lib/python2.7/site-packages/sage/structure/parent.so(+0x1695b)[0x7faac355e95b]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x3268)[0x7faad2e2a498]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7faad2e2db8c]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x19)[0x7faad2e2dca9]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyImport_ExecCodeModuleEx+0x8c)[0x7faad2e4116c]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(+0x120508)[0x7faad2e41508]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(+0x121580)[0x7faad2e42580]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyImport_ImportModuleLevel+0x284)[0x7faad2e434e4]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(+0x103fd8)[0x7faad2e24fd8]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7faad2d74a83]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyObject_CallFunctionObjArgs+0x16f)[0x7faad2d7569f]
/home/matthias/mathSoftware/sage-7.4/local/lib/python2.7/site-packages/sage/rings/real_arb.so(+0xd924)[0x7f9b438a1924]
/home/matthias/mathSoftware/sage-7.4/local/lib/python2.7/site-packages/sage/rings/real_arb.so(+0x2e1f3)[0x7f9b438c21f3]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7faad2d74a83]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(+0x6553c)[0x7faad2d8653c]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7faad2d74a83]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(+0xc14ad)[0x7faad2de24ad]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(+0xbfddf)[0x7faad2de0ddf]
/home/matthias/mathSoftware/sage-7.4/local/lib/python2.7/site-packages/sage/misc/classcall_metaclass.so(+0x519f)[0x7faac2ac019f]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5ce3)[0x7faad2e2cf13]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x81c)[0x7faad2e2db8c]
/home/matthias/mathSoftware/sage-7.4/local/lib/libpython2.7.so.1.0(+0x85b25)[0x7faad2da6b25]

[sage-support] How to convert sage finitely presented group to magma?

2016-08-24 Thread Matthias Goerner
I have a finitely presented group in sage, how do I convert it to a magma 
object?

We tried the following, but it failed. Is this a bug?

sage: L=FreeGroup(1)
Free Group on generators {x}
sage: S=L/[L.0^3]
sage: magma(S)
/opt/sage6/local/lib/python2.7/site-packages/sage/interfaces/magma.pyc in 
__call__(self, x, gens)
756 pass
757
--> 758 A = Expect.__call__(self, x)
759 if has_cache:
760 x._magma_cache[self] = A

...

ypeError: Error evaluating Magma code.
IN:_sage_[5]:=Finitely presented group < x | x^3 >;
OUT:

> _sage_[5]:=Finitely presented group < x | x^3 >;
>>
>^
User error: bad syntax

-- 
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: Error in Building Sage (particularly ecm-6.4)

2016-02-09 Thread Matthias Goerner
I get a similar error, this time the instruction is

Error: no such instruction: `shrx %eax,108(%rsp),%r9d'

and I am compiling on

gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC)

with SAGE_INSTALL_GCC=yes.

It seems to me this is due to sage using its own version of "gcc" but the 
system's version of "as" which does not understand some of the assembly 
instructions of a newer compiler.


I keep running into this problem on old Linux'es and Mac's. Should sage 
also offer to provide its own "as"?


On Monday, January 12, 2015 at 10:41:05 PM UTC-8, Shadab Zafar wrote:
>
> I am trying to build Sage from the current master branch but it errors in 
> installing ecm.
>
> The ending part of the log is:
>
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./x86_64 
> -I/home/dufferzafar/dev/sage/local/include 
> -I/home/dufferzafar/dev/sage/local/include -march=native -g -O3 -fPIC -MT 
> libecm_la-pp1.lo -MD -MP -MF .deps/libecm_la-pp1.Tpo -c pp1.c -o 
> libecm_la-pp1.o
> mv -f .deps/libecm_la-pp1.Tpo .deps/libecm_la-pp1.Plo
> /bin/bash ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  
> -I./x86_64 -I/home/dufferzafar/dev/sage/local/include 
> -I/home/dufferzafar/dev/sage/local/include  -march=native -g -O3  -fPIC -MT 
> libecm_la-getprime.lo -MD -MP -MF .deps/libecm_la-getprime.Tpo -c -o 
> libecm_la-getprime.lo `test -f 'getprime.c' || echo './'`getprime.c
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./x86_64 
> -I/home/dufferzafar/dev/sage/local/include 
> -I/home/dufferzafar/dev/sage/local/include -march=native -g -O3 -fPIC -MT 
> libecm_la-getprime.lo -MD -MP -MF .deps/libecm_la-getprime.Tpo -c 
> getprime.c -o libecm_la-getprime.o
> /tmp/ccp6Wox5.s: Assembler messages:
> /tmp/ccp6Wox5.s:137: Error: no such instruction: `vfmadd312sd 
> offset(%rip),%xmm0,%xmm3'
> /tmp/ccp6Wox5.s:713: Error: no such instruction: `vfmadd312sd 
> .LC12(%rip),%xmm0,%xmm2'
> make[5]: *** [libecm_la-getprime.lo] Error 1
> make[5]: Leaving directory 
> `/home/dufferzafar/dev/sage/local/var/tmp/sage/build/ecm-6.4.4/src'
> make[4]: *** [all-recursive] Error 1
> make[4]: Leaving directory 
> `/home/dufferzafar/dev/sage/local/var/tmp/sage/build/ecm-6.4.4/src'
> make[3]: *** [all] Error 2
> make[3]: Leaving directory 
> `/home/dufferzafar/dev/sage/local/var/tmp/sage/build/ecm-6.4.4/src'
> Error building GMP-ECM.
>
>
> I have also attached the complete log file.
>
> System Info:
>
> Linux version 3.5.0-57-generic (buildd@tipua) (gcc version 4.6.3 
> (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #84~precise1-Ubuntu SMP
>

-- 
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.
Found local metadata for ecm-6.4.4
Using cached file /projects/snapreg/sage-6.9/upstream/ecm-6.4.4.tar.bz2
ecm-6.4.4

Setting up build directory for ecm-6.4.4
Finished set up

Host system:
Linux math31184.math.gatech.edu 2.6.32-573.12.1.el6.x86_64 #1 SMP Mon Nov 23 
12:55:32 EST 2015 x86_64 x86_64 x86_64 GNU/Linux

C compiler: gcc
C compiler version:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/projects/snapreg/sage-6.9/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../src/configure --prefix=/projects/snapreg/sage-6.9/local 
--with-local-prefix=/projects/snapreg/sage-6.9/local 
--with-gmp=/projects/snapreg/sage-6.9/local 
--with-mpfr=/projects/snapreg/sage-6.9/local 
--with-mpc=/projects/snapreg/sage-6.9/local --with-system-zlib 
--disable-multilib --disable-nls --enable-languages=c,c++,fortran 
--disable-libitm  
Thread model: posix
gcc version 4.9.2 (GCC) 

patching file x86_64/mulredc10.asm
patching file x86_64/mulredc11.asm
patching file x86_64/mulredc12.asm
patching file x86_64/mulredc13.asm
patching file x86_64/mulredc14.asm
patching file x86_64/mulredc15.asm
patching file x86_64/mulredc16.asm
patching file x86_64/mulredc17.asm
patching file x86_64/mulredc18.asm
patching file x86_64/mulredc19.asm
patching file x86_64/mulredc1_10.asm
patching file x86_64/mulredc1_11.asm
patching file x86_64/mulredc1_12.asm
patching file x86_64/mulredc1_13.asm
patching file x86_64/mulredc1_14.asm
patching file x86_64/mulredc1_15.asm
patching file x86_64/mulredc1_16.asm
patching file x86_64/mulredc1_17.asm
patching file x86_64/mulredc1_18.asm
patching file x86_64/mulredc1_19.asm
patching file x86_64/mulredc1_2.asm
patching file x86_64/mulredc1_20.asm
patching file x86_64/mulredc1_3.asm
patching file x86_64/mulredc1_4.asm
patching file 

[sage-support] Re: Regression from sage 6.7 to sage 6.10 when factoring polynomial over number field

2016-01-14 Thread Matthias Goerner
That answers it perfectly!

On Thursday, January 14, 2016 at 1:00:00 PM UTC-8, Nils Bruin wrote:
>
> On Thursday, January 14, 2016 at 12:36:32 PM UTC-8, Matthias Goerner wrote:
>>
>>
>> # Lift polynomial back to Q[x][y]
>> lifted = factor.map_coefficients(lambda c:Rx(c.lift()), Rxy)
>>
>> Are you sure this is what you want and what you did before? The 
> documentation of map_coefficients says that the second argument is to be 
> the new *base ring*. Indeed, with your code I get:
>
> sage: parent(lifted)
> Univariate Polynomial Ring in y over Univariate Polynomial Ring in y over 
> Univariate Polynomial Ring in x over Rational Field
>
> i.e., an element in the polynomial ring QQ[x][y][Y], where "Y" is really 
> "y", (which is difficult to distinguish from the previous "y" visually , 
> but sage does distinguish them). 
>
> Hence:
>
> sage: parent(val)
> Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over 
> Real Interval Field with 53 bits of precision
>
> (who knows which y was substituted or was used before ... You could figure 
> it out if you wanted).
>
> If instead you do:
>
> sage: lifted=factor.map_coefficients(lambda c:Rx(c.lift()), Rx)
> sage: val = lifted.substitute(x = RIF(-2.67512520581, -2.67512520582), y = 
> RIF(.1, 1.2))
> sage: type(val)
> 
>
> I don't think there are any issues.
>
> Incidentally, the whole "x=var('x')" thing is making things unnecessarily 
> complicated. You'd be better off setting them to the appropriate values 
> right away:
>
> Rx.=PolynomialRing(RationalField(),'x')
> Rxy.=PolynomialRing(Rx,'y')
>
> Or you could use
>
> x=Rx.0
> y=Rxy.0
>
>
>> Something has changed. Was I using it incorrectly and this improved or is 
>> this a regression?
>>
>
> Yes, according to the documentation (which presumably hasn't changed 
> between your old version an 6.10), you were using something that shouldn't 
> result in what you apparently were trying to obtain. 
>

-- 
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] Regression from sage 6.7 to sage 6.10 when factoring polynomial over number field

2016-01-14 Thread Matthias Goerner
I have given a polynomial in two variables y^10+10 * y^8 * x^3 + 1 in 
Q[x][y] and a polynomial defining a number field such as x^5 + 137.
I want to factor the polynomial over the number field and then evaluate it 
given numerical interval values for x and y.

I used to do the following:

Rx=PolynomialRing(RationalField(),'x')
Rxy=PolynomialRing(Rx,'y')
x = var('x')
y = var('y')

# Polynomial in Q[x][y]
poly = Rxy(y^10+10 * y^8 * x^3 + 1)
nf = NumberField(x^5 + 137, 'x')

#polynomial in Q(a)[y] where a is a "root" of nf
poly_nf = poly.change_ring(nf)
factors = poly_nf.factor()

#pick first factor
factor, multiplicity = factors[0]

# Lift polynomial back to Q[x][y]
lifted = factor.map_coefficients(lambda c:Rx(c.lift()), Rxy)

# Evaluate
val = lifted.substitute(x = RIF(-2.67512520581, -2.67512520582), y = 
RIF(1.1, 1.2))

# We expect this to be an interval
type(val)


But in sage 6.10, this now gives as result:



Something has changed. Was I using it incorrectly and this improved or is 
this a regression?

-- 
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] Wrong NumberField.composite_field when embeddings are complex-conjugate roots of the same polynomial

2015-04-15 Thread Matthias Goerner
The NumberField containing both embeddings should be larger. The morphisms 
also clearly show that something is going wrong:

sage: nf = NumberField(x^8 - 3*x^7 + 61/3*x^6 - 9*x^5 + 298*x^4 + 458*x^3 + 
1875*x^2 + 4293*x + 3099, 'z', embedding=-1.18126721294295 + 
3.02858651117832j)
sage: nf2 = NumberField(x^8 - 3*x^7 + 61/3*x^6 - 9*x^5 + 298*x^4 + 458*x^3 
+ 1875*x^2 + 4293*x + 3099, 'z', embedding=-1.18126721294295 - 
3.02858651117832j) 
sage: nf.composite_fields(nf2,both_maps = True) 
[(Number Field in z with defining polynomial x^8 - 3*x^7 + 61/3*x^6 - 9*x^5 
+ 298*x^4 + 458*x^3 + 1875*x^2 + 4293*x + 3099, 
Ring endomorphism of Number Field in z with defining polynomial x^8 - 3*x^7 
+ 61/3*x^6 - 9*x^5 + 298*x^4 + 458*x^3 + 1875*x^2 + 4293*x + 3099 
Defn: z |-- z, 
Ring morphism: 
From: Number Field in z with defining polynomial x^8 - 3*x^7 + 61/3*x^6 - 
9*x^5 + 298*x^4 + 458*x^3 + 1875*x^2 + 4293*x + 3099 
To: Number Field in z with defining polynomial x^8 - 3*x^7 + 61/3*x^6 - 
9*x^5 + 298*x^4 + 458*x^3 + 1875*x^2 + 4293*x + 3099 
Defn: z |-- z, 
 +Infinity)]

I couldn't find a bug on trac for it. I think there should be one filed.

-- 
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] Bug in primary decomposition of (1) ideal: the primary decomposition should be empty

2013-12-19 Thread Matthias Goerner
Ideal(PolynomialRing(RationalField(),['x','y']),-1).primary_decomposition()
returns [] as expected but
Ideal(PolynomialRing(RationalField(),['x','y']),1).primary_decomposition()
returns [Ideal (1) of Multivariate Polynomial Ring in x, y over Rational Field].

Clearly the ideals are identical, so they should have the same primary 
decomposition (independent of the unit it is generated by). Either, both should 
return [] or [Ideal(1)].
One would also expect the output of primary decomposition to not include (1) 
similarly to the prime factorization of a natural number not including 1, e.g., 
list(factor(1)) returns [].

-- 
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: Bug in primary decomposition of (1) ideal: the primary decomposition should be empty

2013-12-19 Thread Matthias Goerner
Version:
'Sage Version 5.2, Release Date: 2012-07-25'
OS:
Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; 
root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64

On Wednesday, December 18, 2013 10:58:31 PM UTC-8, Matthias Goerner wrote:

 Ideal(PolynomialRing(RationalField(),['x','y']),-1).primary_decomposition()
 returns [] as expected but
 Ideal(PolynomialRing(RationalField(),['x','y']),1).primary_decomposition()
 returns [Ideal (1) of Multivariate Polynomial Ring in x, y over Rational 
 Field].

 Clearly the ideals are identical, so they should have the same primary 
 decomposition (independent of the unit it is generated by). Either, both 
 should return [] or [Ideal(1)].
 One would also expect the output of primary decomposition to not include 
 (1) similarly to the prime factorization of a natural number not including 
 1, e.g., list(factor(1)) returns [].


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