[sage-support] Multiple Exceptions and SegFault When repeated calls to FinteGroup Module

2022-06-16 Thread dus...@merrimack.edu
I'm getting multiple exception errors resulting in a segfault when trying 
to control how long SageMath spends on structure_description() of a finite 
group. I'll attach a MWE and traceback, but basically what I'm doing is:

creating a Finite Group with ~10-20 generators and ~half that relations.

Setting an alarm...
running structure_description() with three possible outcomes of 
try...except:
* it works, tell me the result
* it fails, GAP knows why and I take over
* It fails because of the alarm timeout

Running this code in a loop eventually results in a segfault, probably with 
some conflict between the alarm and GAP exceptions, but the traceback 
suggests it's a problem in the free_group module...anyone have any thoughts?

[running code resulting in crash]

Group Type is: --
20 [[9, 6, 2, 8], [8, 8], [10], [7, 2, 14, 4], [8], [14, 2, 6], [2, 10], 
[7, 9, 2], [10, 6, 8, 2], [13, 6, 11, 8], [3], [3]]
Finitely presented group < x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, 
x11, x12, x13, x14 | x8*x5*x1*x7, x7^2, x9, x6*x1*x13*x3, x7, x13*x1*x5, 
x1*x9, x6*x8*x1, x9*x5*x7*x1, x12*x5*x10*x7, x2, x2 >
Some Unhandled exception!
Group Type is: --
21 [[5, 11, 6, 11], [1], [7, 11, 12], [14, 4], [7], [1], [10, 4], [14], [8, 
11, 10, 1], [10, 10, 4], [10, 12], [12, 10, 14, 10]]
Traceback (most recent call last):
  File 
"/home/cduston/Downloads/SageMath/local/lib/python3.7/site-packages/sage/groups/free_group.py",
 
line 881, in _element_constructor_
P = x.parent()
AttributeError: 'list' object has no attribute 'parent'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "MWE.sage.py", line 39, in 
G=H/[H(Y[i]) for i in range(g*V)]
  File "MWE.sage.py", line 39, in 
G=H/[H(Y[i]) for i in range(g*V)]
  File "sage/structure/parent.pyx", line 900, in 
sage.structure.parent.Parent.__call__ 
(build/cythonized/sage/structure/parent.c:9218)
  File "sage/structure/coerce_maps.pyx", line 156, in 
sage.structure.coerce_maps.DefaultConvertMap_unique._call_ 
(build/cythonized/sage/structure/coerce_maps.c:4448)
  File 
"/home/cduston/Downloads/SageMath/local/lib/python3.7/site-packages/sage/groups/free_group.py",
 
line 883, in _element_constructor_
return self.element_class(self, x, **kwds)
  File 
"/home/cduston/Downloads/SageMath/local/lib/python3.7/site-packages/sage/groups/free_group.py",
 
line 230, in __init__
AbstractWordTietzeWord = libgap.eval('AbstractWordTietzeWord')
  File "sage/libs/gap/libgap.pyx", line 400, in 
sage.libs.gap.libgap.Gap.eval (build/cythonized/sage/libs/gap/libgap.c:4205)
  File "sage/libs/gap/util.pyx", line 395, in sage.libs.gap.util.gap_eval 
(build/cythonized/sage/libs/gap/util.c:5990)
cysignals.signals.SignalError: Segmentation fault


-- 
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/36aed71a-552b-4e09-a3ab-172a50d90547n%40googlegroups.com.
"""
This script will try to replicate the multiple exception call
errors I am getting without all the excess baggage associated with
the Fox Algorithm.
"""
g=3 # Covers, but this is just a multiplicative factor here
E=5 # edges in the graph
V=4 # Sides in the graph (relations)
W=5 # Max word size for the relations

H=FreeGroup(E*g)

N=1000
ExCases = 0 # To keep track of exceptional cases
for i in range(N):

# Randomly create some relations
Y = []
for j in range(V*g):
YY = []
for k in range(randrange(1,W)):
num = randrange(1,g*E)
sign = randrange(1,2) # positive or negative
if sign == 1:
YY.append(num)
elif sign == 2:
YY.append(-num)
#print(YY)
Y.append(YY)
print(i,Y)

# Now calculate the structure of the group
G=H/[H(Y[i]) for i in range(g*V)]
print(G)

alarm(5)
try:
grpstr = str(G.structure_description())
except ValueError:
if G.simplified().relations() == ():
grpstr = "F" + str(G.simplified().ngens())
else:
grpstr = "--"
ExCases += 1
pass
except AlarmInterrupt:
grpstr = "--"
ExCases += 1
pass
except:
print("Some Unhandled exception!")
cancel_alarm()

print("Group Type is:",grpstr)
print("Exceptional cases:",ExCases)


[sage-support] Re: Installing Error

2022-06-16 Thread Eric Gourgoulhon
Hi, 

Which version of Ubuntu are you using ? 

Maybe it is worth to install from source instead of using the Ubuntu 
package. This is usually very easy for Ubuntu: visit
https://sagemanifolds.obspm.fr/install_ubuntu.html

Best wishes,

Eric. 

Le mardi 14 juin 2022 à 20:53:48 UTC+2, scal...@gmail.com a écrit :

> Hi all. I am relatively new to linux and I am trying to install sagemath 
> on ubuntu instead of using co-calc. I am attempting to install sage (and 
> hopefully make it communicable with emacs) on my new computer.  After 
> running 
>
> sudo apt update 
> sudo apt install sagemath 
> sage 
>
> I get the following error. Does anyone know how to read this and figure 
> out what I missed in trying to install sage? 
>
>
>

-- 
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/97ea05f2-541b-45af-8126-e051c3c717efn%40googlegroups.com.


Re: [sage-support] Krawtchouk Polynomials

2022-06-16 Thread David Joyner
On Thu, Jun 16, 2022 at 8:03 AM Syedafariha Bukhari
 wrote:
>
> Dear Representative,
> I am having trouble for Krawtchouk Polynomials my jupyter notebook is giving 
> error that Krawtchouk is not defined. why it is so?
>

So we can better help, can you please give an example of the syntax you tried?

I'm no expert on those polynomials, nor on the jupyter notebook, but
when I followed
https://doc.sagemath.org/html/en/reference/coding/sage/coding/delsarte_bounds.html
on the command line, I got this output:

sage: codes.bounds.krawtchouk(24,2,5,x)
-4/15*(x - 1)*(x - 2)*(x - 3)*(x - 4)*x + 40/3*(x - 1)*(x - 2)*(x -
3)*x - 280*(x - 1)*(x - 2)*x + 3080*(x - 1)*x - 17710*x + 42504

Does that work for you?

> --
> 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/8e8c9cc3-e088-4969-b036-38d04a0eb282n%40googlegroups.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/CAEQuuAXW6spjxqcR_emVXxr9Pjc%2BFzRcv75ZH33rktoCwEi40w%40mail.gmail.com.


[sage-support] Krawtchouk Polynomials

2022-06-16 Thread Syedafariha Bukhari
Dear Representative,
I am having trouble for Krawtchouk Polynomials my jupyter notebook is 
giving error that Krawtchouk is not defined. why it is so?

-- 
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/8e8c9cc3-e088-4969-b036-38d04a0eb282n%40googlegroups.com.