Re: [sage-devel] Re: using libgap in source

2024-12-05 Thread Michael Orlitzky
On 2024-12-05 20:31:40, Jackson Walters wrote:
> 
> It would be nice to just have these installed. This isn't something I can
> do, right? I should mention that locally this is all working in my
> installation, where I have installed `forms`.
> 

You could hold a vote to make "forms" a standard package and then
require it, but your new code would have to be pretty awesome for
that to be worth it.

Instead, I would suggest leaving it optional and marking the tests
with "# optional - gap_package_forms". People using the system GAP
would then be free to install forms (if it isn't installed already)
when they want to use your code. Adding forms to gap_packages is still
useful because it provides a way for the people who installed GAP via
sage to install forms. In particular, one of the people who install
GAP via sage is our CI.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/Z1Jd5ocv8CUTHCf9%40mertle.


[sage-devel] Re: using libgap in source

2024-12-05 Thread Jackson Walters
Seems to have made it one step further. Probably the issue is now 

libgap.LoadPackage("forms")

Error: Failed example:: Exception raised: 
Traceback
 
(most recent call last): 

 
File "sage/libs/gap/libgap.pyx", line 684, in 
sage.libs.gap.libgap.Gap.__getattr__ 

 
g = self.eval(name) 

 
File "sage/libs/gap/libgap.pyx", line 399, in sage.libs.gap.libgap.Gap.eval 

 
elem = make_any_gap_element(self, gap_eval(gap_command)) 

 
File "sage/libs/gap/util.pyx", line 362, in sage.libs.gap.util.gap_eval 

 
result = GAP_EvalString(cmd) 
sage.libs.gap.util.GAPError:
 
Error, Variable: 'BaseChangeToCanonical' must have a value 

 
During
 
handling of the above exception, another exception occurred: 

 
Traceback
 
(most recent call last): 

 
File "/sage/src/sage/doctest/forker.py", line 716, in _run 

 
self.compile_and_execute(example, compiler, test.globs) 

 
File "/sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute 

 
exec(compiled, globs) 

 
File "",
 
line 1, in  

 
U = GF5S3._dft_unitary() 

 
File "/sage/src/sage/combinat/symmetric_group_algebra.py", line 2212, in 
_dft_unitary 

 
fourier_transform = [flatten([hat(delta(g),partition).list() for partition 
in Partitions(G.degree())]) for g in G] 

 
File "/sage/src/sage/combinat/symmetric_group_algebra.py", line 2212, in 
 

 
fourier_transform = [flatten([hat(delta(g),partition).list() for partition 
in Partitions(G.degree())]) for g in G] 

 
File "/sage/src/sage/combinat/symmetric_group_algebra.py", line 2212, in 
 

 
fourier_transform = [flatten([hat(delta(g),partition).list() for partition 
in Partitions(G.degree())]) for g in G] 

 
File "/sage/src/sage/combinat/symmetric_group_algebra.py", line 2206, in 
hat 

 
A = unitary_change_of_basis(U,q) 

 
File "/sage/src/sage/combinat/symmetric_group_algebra.py", line 2200, in 
unitary_change_of_basis 

 
return matrix(F,libgap.BaseChangeToCanonical(libgap([list(row) for row in 
U]).HermitianFormByMatrix(F))).inverse() 

 
File "sage/libs/gap/libgap.pyx", line 686, in 
sage.libs.gap.libgap.Gap.__getattr__ 

 
raise AttributeError(f'No such attribute: {name}.') 


Re: [sage-devel] Re: using libgap in source

2024-12-05 Thread David Roe
Yep, that should work.  To find the right import statements, you can do
sage: import_statements(libgap)
from sage.libs.gap.libgap import libgap
David

On Thu, Dec 5, 2024 at 5:37 PM Jackson Walters 
wrote:

> Perhaps I can just use
>
> from sage.libs.gap.libgap import libgap
>
> On Thursday, December 5, 2024 at 5:34:45 PM UTC-5 Jackson Walters wrote:
>
>> Hi all,
>>
>> Probably pretty obvious, but I need to call libgap for the following
>> function:
>>
>> def unitary_change_of_basis(U,q):
>>if U.nrows() == 1 and U.ncols() == 1:
>>return matrix(F,[[factor_scalar(U[0,0])]])
>> libgap.LoadPackage("forms")
>> return matrix(F,libgap.BaseChangeToCanonical(libgap([list(row) for
>> row in U]).HermitianFormByMatrix(F))).inverse()
>>
>> It works perfectly fine in a Sage notebook, but throws errors when I try
>> to include it in a PR.
>>
>> What is the proper way to invoke libgap in, say,
>> symmetric_group_algebra.py? Should I go back to using libgap.eval?
>>
>> Thank you,
>> Jackson
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/sage-devel/63229f29-ccaa-4f40-aeef-5a7540afd72an%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/CAChs6_nVZZvXYOF_cYk_o5iaZHsO4yzKspfzxfGmHXjm64%3DScQ%40mail.gmail.com.


Re: [sage-devel] Re: using libgap in source

2024-12-05 Thread Jackson Walters

Ah, thank you. Any idea if loading packages via libgap.LoadPackage("forms") is 
expected to work?

Jackson
On Thursday, December 5, 2024 at 6:14:49 PM UTC-5 David Roe wrote:

> Yep, that should work.  To find the right import statements, you can do
> sage: import_statements(libgap)
> from sage.libs.gap.libgap import libgap
> David
>
> On Thu, Dec 5, 2024 at 5:37 PM Jackson Walters  
> wrote:
>
>> Perhaps I can just use 
>>
>> from sage.libs.gap.libgap import libgap
>>
>> On Thursday, December 5, 2024 at 5:34:45 PM UTC-5 Jackson Walters wrote:
>>
>>> Hi all,
>>>
>>> Probably pretty obvious, but I need to call libgap for the following 
>>> function:
>>>
>>> def unitary_change_of_basis(U,q):
>>>if U.nrows() == 1 and U.ncols() == 1:
>>>return matrix(F,[[factor_scalar(U[0,0])]])
>>> libgap.LoadPackage("forms")
>>> return matrix(F,libgap.BaseChangeToCanonical(libgap([list(row) for 
>>> row in U]).HermitianFormByMatrix(F))).inverse()
>>>
>>> It works perfectly fine in a Sage notebook, but throws errors when I try 
>>> to include it in a PR.
>>>
>>> What is the proper way to invoke libgap in, say, 
>>> symmetric_group_algebra.py? Should I go back to using libgap.eval?
>>>
>>> Thank you,
>>> Jackson
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+...@googlegroups.com.
>> To view this discussion visit 
>> https://groups.google.com/d/msgid/sage-devel/63229f29-ccaa-4f40-aeef-5a7540afd72an%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/643fca79-88f2-49ee-8e9c-05893da83a1fn%40googlegroups.com.


Re: [sage-devel] Re: using libgap in source

2024-12-05 Thread Michael Orlitzky
On 2024-12-05 15:23:35, Jackson Walters wrote:
> 
> Ah, thank you. Any idea if loading packages via libgap.LoadPackage("forms") 
> is 
> expected to work?

Yes, but only if the GAP package you're trying to load is
installed. The only ones that are guaranteed to be installed are
gapdoc, primgrp, smallgrp, and transgrp. All others (even "standard"
packages like polycyclic) are technically optional and the test suite
should pass if they are missing. You can just grep for "polycyclic"
and copy the existing examples for that.

The other problem is that the "forms" package isn't part of the sage
distribution, and may not be available on all linux distributions, so
the CI (not to mention normal users) will be unable to test it. The
first step towards remedying that would probably be to add "forms" to
the gap_packages SPKG.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/Z1JQYc7IN8WSTJc9%40mertle.


Re: [sage-devel] Re: using libgap in source

2024-12-05 Thread Jackson Walters
Right, confirmed separately from Travis:

So the Forms package is a GAP package that has been included since GAP
> v4.9, but it is not included by our default installation nor in
> gap_packages


We are debating whether to just implement the necessary methods in Sage.
I'm going to begin tomorrow.

 The first step towards remedying that would probably be to add "forms" to
> the gap_packages SPKG.


 It would be nice to just have these installed. This isn't something I can
do, right? I should mention that locally this is all working in my
installation, where I have installed `forms`.

On Thu, Dec 5, 2024 at 8:16 PM Michael Orlitzky 
wrote:

> On 2024-12-05 15:23:35, Jackson Walters wrote:
> >
> > Ah, thank you. Any idea if loading packages via
> libgap.LoadPackage("forms") is
> > expected to work?
>
> Yes, but only if the GAP package you're trying to load is
> installed. The only ones that are guaranteed to be installed are
> gapdoc, primgrp, smallgrp, and transgrp. All others (even "standard"
> packages like polycyclic) are technically optional and the test suite
> should pass if they are missing. You can just grep for "polycyclic"
> and copy the existing examples for that.
>
> The other problem is that the "forms" package isn't part of the sage
> distribution, and may not be available on all linux distributions, so
> the CI (not to mention normal users) will be unable to test it. The
> first step towards remedying that would probably be to add "forms" to
> the gap_packages SPKG.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/sage-devel/Z1JQYc7IN8WSTJc9%40mertle.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/CAGqtwVB8KG6yjdhoMsMhmth_WiDvesx0SLf%3Diy3GJc2%2B_%3DGM8Q%40mail.gmail.com.


[sage-devel] using libgap in source

2024-12-05 Thread Jackson Walters
Hi all,

Probably pretty obvious, but I need to call libgap for the following 
function:

def unitary_change_of_basis(U,q):
   if U.nrows() == 1 and U.ncols() == 1:
   return matrix(F,[[factor_scalar(U[0,0])]])
libgap.LoadPackage("forms")
return matrix(F,libgap.BaseChangeToCanonical(libgap([list(row) for row 
in U]).HermitianFormByMatrix(F))).inverse()

It works perfectly fine in a Sage notebook, but throws errors when I try to 
include it in a PR.

What is the proper way to invoke libgap in, say, 
symmetric_group_algebra.py? Should I go back to using libgap.eval?

Thank you,
Jackson

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/841bccf1-c5b7-46a5-b671-0f9c73f48729n%40googlegroups.com.


[sage-devel] Re: using libgap in source

2024-12-05 Thread Jackson Walters
Perhaps I can just use 

from sage.libs.gap.libgap import libgap

On Thursday, December 5, 2024 at 5:34:45 PM UTC-5 Jackson Walters wrote:

> Hi all,
>
> Probably pretty obvious, but I need to call libgap for the following 
> function:
>
> def unitary_change_of_basis(U,q):
>if U.nrows() == 1 and U.ncols() == 1:
>return matrix(F,[[factor_scalar(U[0,0])]])
> libgap.LoadPackage("forms")
> return matrix(F,libgap.BaseChangeToCanonical(libgap([list(row) for row 
> in U]).HermitianFormByMatrix(F))).inverse()
>
> It works perfectly fine in a Sage notebook, but throws errors when I try 
> to include it in a PR.
>
> What is the proper way to invoke libgap in, say, 
> symmetric_group_algebra.py? Should I go back to using libgap.eval?
>
> Thank you,
> Jackson
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/63229f29-ccaa-4f40-aeef-5a7540afd72an%40googlegroups.com.


Re: [sage-devel] Re: using libgap in source

2024-12-05 Thread Dima Pasechnik
On 5 December 2024 17:23:35 GMT-06:00, Jackson Walters
 wrote:
>
>Ah, thank you. Any idea if loading packages via libgap.LoadPackage("forms") is
>expected to work?

absolutely. As I said elsewhere, look at how things involving libgap
are done in e.g.  src/sage/graphs/.


>
>Jackson
>On Thursday, December 5, 2024 at 6:14:49 PM UTC-5 David Roe wrote:
>
>> Yep, that should work.  To find the right import statements, you can do
>> sage: import_statements(libgap)
>> from sage.libs.gap.libgap import libgap
>> David
>>
>> On Thu, Dec 5, 2024 at 5:37 PM Jackson Walters 
>> wrote:
>>
>>> Perhaps I can just use
>>>
>>> from sage.libs.gap.libgap import libgap
>>>
>>> On Thursday, December 5, 2024 at 5:34:45 PM UTC-5 Jackson Walters wrote:
>>>
 Hi all,

 Probably pretty obvious, but I need to call libgap for the following
 function:

 def unitary_change_of_basis(U,q):
if U.nrows() == 1 and U.ncols() == 1:
return matrix(F,[[factor_scalar(U[0,0])]])
 libgap.LoadPackage("forms")
 return matrix(F,libgap.BaseChangeToCanonical(libgap([list(row) for
 row in U]).HermitianFormByMatrix(F))).inverse()

 It works perfectly fine in a Sage notebook, but throws errors when I try
 to include it in a PR.

 What is the proper way to invoke libgap in, say,
 symmetric_group_algebra.py? Should I go back to using libgap.eval?

 Thank you,
 Jackson

>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "sage-devel" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to sage-devel+...@googlegroups.com.
>>> To view this discussion visit
>>> https://groups.google.com/d/msgid/sage-devel/63229f29-ccaa-4f40-aeef-5a7540afd72an%40googlegroups.com
>>> 
>>> .
>>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq1hpGNWbe6w2mVRKfsWEZ3tjMWnOm7Vmim%2BucdsiypN3A%40mail.gmail.com.


Re: [sage-devel] Sage 10.5 build failure on Sequoia 15.1.1

2024-12-05 Thread Dima Pasechnik
As you can see in the logs you attached:
[spkg-install] Compiling with an SDK that doesn't seem to exist:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk
[spkg-install] Please check your Xcode installation

You most probably should reinstall Xcode and Xcode command line tools

On Thu, Dec 5, 2024 at 6:25 PM Jon Higa  wrote:
>
> Steps:
>
> git checkout -f 10.5
> git clean -xdf
> brew upgrade
> source .homebrew-build-env
> make configure
> ./configure --prefix=/usr/local/sage/10.5 --disable-editable 
> --with-python=/opt/homebrew/bin/python3.11 --enable-database_odlyzko_zeta=yes 
> --enable-sage_numerical_backends_coin=yes
> make
>
> Computer: MacBook Pro
> macOS: Sequoia 15.1.1
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion visit 
> https://groups.google.com/d/msgid/sage-devel/0b8824df-d246-4bb2-8884-5c17beb24fe3n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq28%3D9uUPDB5ib1AB%3D8%2BZDPq9_-i6j5siga_9By9Kqo3ZA%40mail.gmail.com.