Ask Your Question

ARG's profile - activity

2024-04-22 00:03:35 +0200 received badge  Notable Question (source)
2024-04-22 00:03:35 +0200 received badge  Popular Question (source)
2024-04-21 19:43:37 +0200 asked a question Finding sup[er]groups of a group

Finding sup[er]groups of a group Is there any implemented algorithm [or any algortihm which is not too slow or hard to i

2024-04-21 18:41:11 +0200 marked best answer How to stop code after a given time

My question is the following: sometimes a computation runs too long, and I would rather for it to stop automatically, and move on to the next computation (in the best possible world keep a list of the cases that were skipped).

So I wanted to implement the solution to this (essentially) identical question:

https://stackoverflow.com/questions/1...

However in my case the function "foo" uses some functionalities of GAP. This apparently causes a crash:

** Gap crashed or quit executing '__SAGE_LAST__:="__SAGE_LAST__";;AllSmallGroups(\$sage1);;' **
Restarting Gap and trying again

The crash happens immediately on the first call of the GAP function. Is there any way to avoid this?

EDIT

The suggestion with alarm did not work for me (maybe it has to with my implementation). Basically the first interruption works correctly (after 20 seconds), then follows five minutes where nothing happens, after these five minutes the second iteration of the for loop begins, this second iteration is

from cysignals.alarm import alarm, AlarmInterrupt, cancel_alarm

for i in range(0,10):
    try:
        alarm(20)    
        print("Began computation at", time.localtime())
        foo(i)
    except AlarmInterrupt:      
        print("Timed out with ", i, "at", time.localtime())
        cancel_alarm()  ## the presence or absence of this line does not change anything
    else:
        print("Completed with", i, "at", time.localtime())
        cancel_alarm()

2024-04-21 18:40:56 +0200 commented question How to stop code after a given time

I still get an error with alarm(0) but only if I import it with from cysignals.alarm import alarm. If the import is from

2024-04-11 14:49:41 +0200 commented question How to stop code after a given time

@Max Alekseyev thanks for the forking method, I think it will work (could not check yet). As for alarm() I get the error

2024-04-10 10:40:18 +0200 edited question How to stop code after a given time

How to stop code after a given time My question is the following: sometimes a computation runs too long, and I would rat

2024-04-10 10:03:49 +0200 commented question How to stop code after a given time

@tolga I tried it and it doesn't work. After the first alarm() all further alarms are ignored. Also the kernel died afte

2024-04-10 07:42:43 +0200 commented question How to stop code after a given time

@tolga thanks for the suggestion, but this used to cause strange dumps which eventually led to kernel death and stops th

2024-04-09 19:13:42 +0200 asked a question How to stop code after a given time

How to stop code after a given time My question is the following: sometimes a computation runs too long, and I would rat

2024-04-03 18:07:22 +0200 marked best answer Listing subgroups of given index

I need to consider subgroups of a given index to a group. So far I used the .conjugacy_classes_subgroups() method but this takes too much time (and memory), since it computes all subgroups. For example I used:

G = PrimitiveGroup(81,146);
ConjClassList = G..conjugacy_classes_subgroups()

then the computer runs out of memory. But there might be only a few subgroups with a given index. Is there a relatviely efficient way to do so?

2024-04-03 12:14:17 +0200 asked a question Listing subgroups of given index

Listing subgroups of given index I need to consider subgroups of a given index to a group. So far I used the .conjugacy_

2020-07-13 12:21:38 +0200 commented answer Edge isoperimetric number

Sure. In my actual example, it was way more easier to code the vertices as lists (to define the adjacency relation). I just wanted to point it out. Theoretically, one could implement that sage defines his own label (in the command Graph when it notices the vertices are given as lists. But that's not a high priority thing and it's messy. Perhaps just give a warning to the user?

2020-07-12 22:33:12 +0200 received badge  Commentator
2020-07-12 22:33:12 +0200 commented answer Edge isoperimetric number

Here is a "minimum bugging example":

vert = [ Sequence([i,i^2],immutable=True) for i in range(0,3)];
dico = dict([ [vert[0],[vert[1],vert[2]]], [vert[1],[vert[0],vert[2]]], [vert[2],[vert[1],vert[0]]], ]);
G = Graph(dico);
G.is_connected()

2020-07-12 22:20:51 +0200 commented answer Edge isoperimetric number

where should I post it? it's probably too long for a comment... Basically, I think the problem is that the name of my vertices is a list (e.g. [0,1,1,0]) which is then gone through a Sequence(TheList,immutable=True)

2020-07-12 01:51:22 +0200 received badge  Nice Question (source)
2020-07-11 23:23:00 +0200 received badge  Editor (source)
2020-07-11 23:20:55 +0200 received badge  Scholar (source)
2020-07-11 23:20:39 +0200 commented answer Edge isoperimetric number

Compiled and tested, many thanks again. Just a little "bug": the is_connected() function (which the Cheeger functions use) gave an error because it did not like how the vertices of my graph were labeled. After I ran G.relabel() everything went fine.

2020-07-11 13:15:05 +0200 commented answer Edge isoperimetric number

git remote add trac git@trac.sagemath.org:sage.git -t master printed out fatal: remote trac already exists. But then git pull trac public/ticket/21942 worked, many thanks! I still need to compile ...

2020-07-11 12:35:48 +0200 commented answer Edge isoperimetric number

Thanks for pointing me in the right direction. At the moment, I get the error:

git_trac.trac_error.TracAuthenticationError: Authentication with trac server failed.

if I try git trac config --user=myusername --pass=mypasswd with my (usual) github usernames and passwords. Then I get the error

fatal: Couldn't find remote ref public/ticket/21942

upon doing git pull origin public/ticket/21942 ...

2020-07-11 12:30:40 +0200 received badge  Supporter (source)
2020-07-11 10:21:40 +0200 commented question Edge isoperimetric number

So far... I :

git clone git://github.com/sagemath/sage.git

but when I tried to do either

git fetch trac u/vdelecroix/21942

or

git pull u/vdelecroix/21942

or

git checkout 7880791d25423e16db76c5f855998818c3c8c45e

or many other numbers in the checkout. But it always returns a error message.

2020-07-11 09:49:02 +0200 commented question Edge isoperimetric number

Actually how does one pull this branch? I don't know how to use the commit number 9a0062d887faa15d6e694f7143bd37514f31d790

2020-07-11 09:36:23 +0200 commented question Edge isoperimetric number

Thanks...I've never done that before: what is the merge conflict (or how does one fix such a conflict)?

2020-07-10 22:37:08 +0200 received badge  Student (source)
2020-07-10 22:04:04 +0200 asked a question Edge isoperimetric number

This is probably a very silly question. How does one get the edge isoperimetric number of a graph?

As seen under here there should be an algorithm for it, but when I define a graph (say H), then

edge_isoperimetric_number(H)

returns "name 'edge_isoperimetric_number' is not defined"

and

H.edge_isoperimetric_number()

returns "'Graph' object has no attribute 'edge_isoperimetric_number'"

(while

edge_isoperimetric_number?

returns "Object edge_isoperimetric_number not found."

So how do I load said algorithm for use?

2020-04-25 10:35:57 +0200 commented answer Package for Ubuntu 19.10

The link with prerequisites is has expired. I found https://doc.sagemath.org/html/en/installation/source.html#prerequisites (this) list (but did not try it).

2019-08-31 11:08:58 +0200 commented answer SageTeX UnicodeDecodeError

Thanks, this fixed the problem for me too. I had multiple sagetex.py lying around in my filesystem, and I needed to change it in only one of them (the others were still with the correct "m.update(line)"