Seems to have made it one step further. Probably the issue is now libgap.LoadPackage("forms")
Error: Failed example:: Exception raised: <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:29>Traceback (most recent call last): <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:30> File "sage/libs/gap/libgap.pyx", line 684, in sage.libs.gap.libgap.Gap.__getattr__ <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:31> g = self.eval(name) <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:32> File "sage/libs/gap/libgap.pyx", line 399, in sage.libs.gap.libgap.Gap.eval <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:33> elem = make_any_gap_element(self, gap_eval(gap_command)) <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:34> File "sage/libs/gap/util.pyx", line 362, in sage.libs.gap.util.gap_eval <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:35> result = GAP_EvalString(cmd) <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:36>sage.libs.gap.util.GAPError: Error, Variable: 'BaseChangeToCanonical' must have a value <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:37> <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:38>During handling of the above exception, another exception occurred: <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:39> <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:40>Traceback (most recent call last): <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:41> File "/sage/src/sage/doctest/forker.py", line 716, in _run <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:42> self.compile_and_execute(example, compiler, test.globs) <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:43> File "/sage/src/sage/doctest/forker.py", line 1137, in compile_and_execute <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:44> exec(compiled, globs) <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:45> File "<doctest sage.combinat.symmetric_group_algebra.SymmetricGroupAlgebra_n._dft_unitary[6]>", line 1, in <module> <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:46> U = GF5S3._dft_unitary() <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:47> File "/sage/src/sage/combinat/symmetric_group_algebra.py", line 2212, in _dft_unitary <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:48> fourier_transform = [flatten([hat(delta(g),partition).list() for partition in Partitions(G.degree())]) for g in G] <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:49> File "/sage/src/sage/combinat/symmetric_group_algebra.py", line 2212, in <listcomp> <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:50> fourier_transform = [flatten([hat(delta(g),partition).list() for partition in Partitions(G.degree())]) for g in G] <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:51> File "/sage/src/sage/combinat/symmetric_group_algebra.py", line 2212, in <listcomp> <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:52> fourier_transform = [flatten([hat(delta(g),partition).list() for partition in Partitions(G.degree())]) for g in G] <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:53> File "/sage/src/sage/combinat/symmetric_group_algebra.py", line 2206, in hat <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:54> A = unitary_change_of_basis(U,q) <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:55> File "/sage/src/sage/combinat/symmetric_group_algebra.py", line 2200, in unitary_change_of_basis <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:56> return matrix(F,libgap.BaseChangeToCanonical(libgap([list(row) for row in U]).HermitianFormByMatrix(F))).inverse() <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:57> File "sage/libs/gap/libgap.pyx", line 686, in sage.libs.gap.libgap.Gap.__getattr__ <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:58> raise AttributeError(f'No such attribute: {name}.') <https://github.com/sagemath/sage/actions/runs/12189420625/job/34004520120?pr=38455#step:16:59>AttributeError: No such attribute: BaseChangeToCanonical. On Thursday, December 5, 2024 at 5:37:30 PM UTC-5 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/1db96119-3061-4978-ac45-21672c289ae2n%40googlegroups.com.