[sage-support] Error occurs when using print_strings() for twisted type D affine algebras

2023-01-05 Thread Ameilia
Hi all,

Does anyone have any idea why the following codes don't work?

Lambda = 
RootSystem(['D',3,2]).weight_lattice(extended=true).fundamental_weights()
V = IntegrableRepresentation(Lambda[2])
V.print_strings(depth=5)

It gives "AssertionError: m: error - failed to compute m(1, 1, 1)".

I believe that the same code works for any other type of root systems 
except for $$D_{n+1}^{(2)}$$...

Many thanks,
Ameilia

-- 
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/2e2efe96-af58-4609-a9b3-b406ef9a9b6an%40googlegroups.com.


Re: [sage-support] Re: Sage 9.8 build error

2023-01-05 Thread Alex
Thank you, Matthias. I was indeed able to build sage after passing 
"--without-system-singular" to "./configure". Still working on figuring out 
how to merge the branch of the ticket you suggested.

Best,
Alex

On Thursday, January 5, 2023 at 10:54:13 AM UTC-8 Matthias Koeppe wrote:

> I see the following error in sagelib-*.log:
>
> 
> #define LOCAL_HIREMAINDER register ulong hiremainder
>   ^
> sage/rings/polynomial/multi_polynomial_libsingular.cpp:35068:120: 
> error: use of undeclared identifier 'pTakeOutComp1'; did you mean 
> 'pTakeOutComp'?
>   __pyx_t_1 = ((PyObject 
> *)__pyx_f_4sage_5rings_10polynomial_28multi_polynomial_libsingular_new_MP(__pyx_v_parent,
>  
> pTakeOutComp1((&(__pyx_v_res->m[__pyx_v_i])), __pyx_v_j))); if (
> 
>
> This is caused by a too new version of Singular installed in the system.
>
> We have a fix (and upgrade of Singular) in 
> https://trac.sagemath.org/ticket/34851; you can fetch and merge the 
> branch of that ticket.
>
> Alternatively, as a workaround, you can pass "--without-system-singular" 
> as an option to "./configure"
>
>
>
>
> On Wednesday, January 4, 2023 at 11:23:09 PM UTC-8 alexcha...@gmail.com 
> wrote:
>
>> I tried running 'make' again but am getting stuck at the same spot.
>>
>> I did not pass any arguments to configure. I don't have a good idea of 
>> how this process works so i did not deviate from the instructions in 
>> README.md (as far as I know). 
>>
>> I did indeed run source .homebrew-build-env before configure and make. 
>>
>> On Wed, Jan 4, 2023, 10:27 PM John H Palmieri  
>> wrote:
>>
>>> Some observations:
>>>
>>> - It's showing a different error now.
>>> - I find it unusual that more packages haven't been built before it 
>>> tries to build sagelib. You could try "make" again and see how far it gets.
>>> - config.log says 
>>>
>>> Invocation command line was
>>>
>>>   $ ./configure 
>>> PKG_CONFIG_PATH=/opt/homebrew/opt/sqlite/lib/pkgconfig:/opt/homebrew/opt/readline/lib/pkgconfig:/opt/homebrew/opt/openblas/lib/pkgconfig:/opt/homebrew/lib/pkgconfig:
>>>  
>>> --no-create --no-recursion
>>>
>>> Did you pass these arguments to ./configure?
>>>
>>> - Did you "source .homebrew-build-env" before running "./configure" and 
>>> "make"?
>>>
>>>
>>> On Wednesday, January 4, 2023 at 2:59:01 PM UTC-8 alexcha...@gmail.com 
>>> wrote:
>>>
 After following all of the suggestions, I am still getting the error

 """
 Error building Sage.

 The following package(s) may have failed to build (not necessarily
 during this run of 'make all-start'):

 * package: sagelib-9.8.beta6
   last build time: Jan 4 14:45
   log file:   
  /Users/alexchandler/Documents/GitHub/sage/logs/pkgs/sagelib-9.8.beta6.log

 It is safe to delete any log files and build directories, but they
 contain information that is helpful for debugging build problems.
 WARNING: If you now run 'make' again, the build directory of the
 same version of the package will, by default, be deleted. Set the
 environment variable SAGE_KEEP_BUILT_SPKGS=yes to prevent this.

 make[1]: *** [all-start] Error 1
 make: *** [all] Error 2
 """

 This time there are only four packages with errors pointed out when I 
 run

 grep -li "^Error" logs/pkgs/*

 so this is an improvement, but I am still unable to proceed. Any idea 
 how to fix the issue? I have attached logs, config.log, and a text file 
 with the 4 packages with errors.

 Thank you!
 Alex

 On Wednesday, January 4, 2023 at 11:35:39 AM UTC-8 John H Palmieri 
 wrote:

> Many of the errors are discussed at 
> https://trac.sagemath.org/ticket/34838. You can probably avoid those 
> by running "make typing_extensions" before running "make".
>
> The most recent error seems to be for sagelib:
>
> ld: library not found for -lopenblas
>
> I assume that you followed the directions at the end of ./configure? 
> It is possible that some homebrew package got updated after running 
> ./configure, and now Sage is looking for the old one and can't find it. 
> Maybe you need to start over by running "make distclean"? Re-run 
> "./configure", then "make typing_extension", then "make".
>
>
> On Tuesday, January 3, 2023 at 10:56:01 PM UTC-8 alexcha...@gmail.com 
> wrote:
>
>> Hello,
>>
>> I am trying to build Sage 9.8 from source on a 2021 Apple M1 laptop. 
>> I have attached the logs for each attempt and also the packages with 
>> errors 
>> as indicated by running 
>>
>> grep -li "^Error" logs/pkgs/*
>>
>> Thank you,
>> Alex
>>
>>
>> -- 
>>> 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] Re: Matrix_generic_dense.det() is quite slow compared to Numpy

2023-01-05 Thread John H Palmieri
One way to speed it up might be to work with RDF or QQ or RLF. The 
documentation for the generic determinant method says, "Note that for 
matrices over most rings, more sophisticated algorithms can be used." 

sage: %time ones_matrix(RDF, 600, 600).determinant()
CPU times: user 78.6 ms, sys: 7.6 ms, total: 86.2 ms
Wall time: 77.9 ms
0.0
sage: %time ones_matrix(QQ, 600, 600).determinant()
CPU times: user 280 ms, sys: 36.3 ms, total: 317 ms
Wall time: 325 ms
0
sage: %time ones_matrix(RLF, 600, 600).determinant()
CPU times: user 32.7 s, sys: 183 ms, total: 32.9 s
Wall time: 40.3 s
0


On Thursday, January 5, 2023 at 1:26:12 AM UTC-8 ivana...@gmail.com wrote:

> I am doing a numerical analysis which needs to calculate many determinants 
> of "huge" dense matrices. The sizes of the matrix are less than 100*100.
>
> I found the computation of the determinant is quite slow with 
> Matrix_generic_dense. I followed the method on What is the time 
> complexity of numpy.linalg.det? 
> 
>  
> and made minor modifications to the script to benchmark for Sagemath.
> 1. np.arange(1,10001, 100) => np.arange(1, 292, 10) because the speed is 
> too slow, I have to reduce the testing range to make the script finish 
> within a reasonable time.
> 2. np.ones((size, size))  => ones_matrix(RR, size, size)
> 3. timeit('np.linalg.det(A)', globals={'np':np, 'A':A}, number=1) => 
> timeit('A.det(algorithm="df")', globals={'A': A}, number=1)
>
> Here is the full script I used.
>
> from timeit import timeit
>
> import matplotlib.pyplot as plt
> import numpy as np
> from sage.rings.real_mpfr import RR
> from sklearn.linear_model import LinearRegression
> from sklearn.preprocessing import PolynomialFeatures
>
> sizes = np.arange(1, 292, 10)
> times = []
>
> for size in sizes:
> A = ones_matrix(RR, size, size)
> time = timeit('A.det(algorithm="df")', globals={'A': A}, number=1)
> times.append(time)
> print(size, time)
>
> sizes = sizes.reshape(-1, 1)
> times = np.array(times).reshape(-1, 1)
>
> quad_sizes = PolynomialFeatures(degree=2).fit_transform(sizes)
> quad_times = LinearRegression().fit(quad_sizes, times).predict(quad_sizes)
> cubic_sizes = PolynomialFeatures(degree=3).fit_transform(sizes)
> cubic_times = LinearRegression().fit(cubic_sizes, 
> times).predict(cubic_sizes)
> quartic_sizes = PolynomialFeatures(degree=4).fit_transform(sizes)
> quartic_times = LinearRegression().fit(quartic_sizes,
>times).predict(quartic_sizes)
>
> plt.scatter(sizes, times, label='Data', color='k', alpha=0.5)
> plt.plot(sizes, quad_times, label='Quadratic', color='r')
> plt.plot(sizes, cubic_times, label='Cubic', color='g')
> plt.plot(sizes, quartic_times, label='Quartic', color='b')
> plt.xlabel('Matrix Dimension n')
> plt.ylabel('Time (seconds)')
> plt.legend()
> plt.show()
>
> This is the time complexity diagram on the linked post. The data from the 
> testing with Numpy. It only took about 20 seconds to calculate a 
> 1*1 matrix.
> [image: numpy.png]This is the testing with matrix(RR) with the df 
> algorithm.
> [image: df.png]
> I also tested with the "hessenberg" algorithm which got worse.
> [image: df.png]
> Compared to Numpy, Sagemath spent 800 seconds calculating a 300*300 
> matrix. It seems that Sagemath still runs the algorithm under O(n^3) (the 
> curves of the cubic model and the quartic model overlap) but with a large 
> constant. Why Sagemath is so slow? Is it possible to speed up?
>
>

-- 
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/6c5c2d95-7521-4548-8335-2a3064e180ben%40googlegroups.com.


Re: [sage-support] Re: Sage 9.8 build error

2023-01-05 Thread Matthias Koeppe
I see the following error in sagelib-*.log:


#define LOCAL_HIREMAINDER register ulong hiremainder
  ^
sage/rings/polynomial/multi_polynomial_libsingular.cpp:35068:120: 
error: use of undeclared identifier 'pTakeOutComp1'; did you mean 
'pTakeOutComp'?
  __pyx_t_1 = ((PyObject 
*)__pyx_f_4sage_5rings_10polynomial_28multi_polynomial_libsingular_new_MP(__pyx_v_parent,
 
pTakeOutComp1((&(__pyx_v_res->m[__pyx_v_i])), __pyx_v_j))); if (


This is caused by a too new version of Singular installed in the system.

We have a fix (and upgrade of Singular) in 
https://trac.sagemath.org/ticket/34851; you can fetch and merge the branch 
of that ticket.

Alternatively, as a workaround, you can pass "--without-system-singular" as 
an option to "./configure"




On Wednesday, January 4, 2023 at 11:23:09 PM UTC-8 alexcha...@gmail.com 
wrote:

> I tried running 'make' again but am getting stuck at the same spot.
>
> I did not pass any arguments to configure. I don't have a good idea of how 
> this process works so i did not deviate from the instructions in README.md 
> (as far as I know). 
>
> I did indeed run source .homebrew-build-env before configure and make. 
>
> On Wed, Jan 4, 2023, 10:27 PM John H Palmieri  wrote:
>
>> Some observations:
>>
>> - It's showing a different error now.
>> - I find it unusual that more packages haven't been built before it tries 
>> to build sagelib. You could try "make" again and see how far it gets.
>> - config.log says 
>>
>> Invocation command line was
>>
>>   $ ./configure 
>> PKG_CONFIG_PATH=/opt/homebrew/opt/sqlite/lib/pkgconfig:/opt/homebrew/opt/readline/lib/pkgconfig:/opt/homebrew/opt/openblas/lib/pkgconfig:/opt/homebrew/lib/pkgconfig:
>>  
>> --no-create --no-recursion
>>
>> Did you pass these arguments to ./configure?
>>
>> - Did you "source .homebrew-build-env" before running "./configure" and 
>> "make"?
>>
>>
>> On Wednesday, January 4, 2023 at 2:59:01 PM UTC-8 alexcha...@gmail.com 
>> wrote:
>>
>>> After following all of the suggestions, I am still getting the error
>>>
>>> """
>>> Error building Sage.
>>>
>>> The following package(s) may have failed to build (not necessarily
>>> during this run of 'make all-start'):
>>>
>>> * package: sagelib-9.8.beta6
>>>   last build time: Jan 4 14:45
>>>   log file:   
>>>  /Users/alexchandler/Documents/GitHub/sage/logs/pkgs/sagelib-9.8.beta6.log
>>>
>>> It is safe to delete any log files and build directories, but they
>>> contain information that is helpful for debugging build problems.
>>> WARNING: If you now run 'make' again, the build directory of the
>>> same version of the package will, by default, be deleted. Set the
>>> environment variable SAGE_KEEP_BUILT_SPKGS=yes to prevent this.
>>>
>>> make[1]: *** [all-start] Error 1
>>> make: *** [all] Error 2
>>> """
>>>
>>> This time there are only four packages with errors pointed out when I run
>>>
>>> grep -li "^Error" logs/pkgs/*
>>>
>>> so this is an improvement, but I am still unable to proceed. Any idea 
>>> how to fix the issue? I have attached logs, config.log, and a text file 
>>> with the 4 packages with errors.
>>>
>>> Thank you!
>>> Alex
>>>
>>> On Wednesday, January 4, 2023 at 11:35:39 AM UTC-8 John H Palmieri wrote:
>>>
 Many of the errors are discussed at 
 https://trac.sagemath.org/ticket/34838. You can probably avoid those 
 by running "make typing_extensions" before running "make".

 The most recent error seems to be for sagelib:

 ld: library not found for -lopenblas

 I assume that you followed the directions at the end of ./configure? It 
 is possible that some homebrew package got updated after running 
 ./configure, and now Sage is looking for the old one and can't find it. 
 Maybe you need to start over by running "make distclean"? Re-run 
 "./configure", then "make typing_extension", then "make".


 On Tuesday, January 3, 2023 at 10:56:01 PM UTC-8 alexcha...@gmail.com 
 wrote:

> Hello,
>
> I am trying to build Sage 9.8 from source on a 2021 Apple M1 laptop. I 
> have attached the logs for each attempt and also the packages with errors 
> as indicated by running 
>
> grep -li "^Error" logs/pkgs/*
>
> Thank you,
> Alex
>
>
> -- 
>> 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.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-support/be9c7509-cba6-4fa2-9619-173161896767n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe