ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 09 Apr 2021 17:40:06 +0200RecursionError long listshttps://ask.sagemath.org/question/56572/recursionerror-long-lists/ I am working with long lists, and getting the error "RecursionError: maximum recursion depth exceeded in comparison".
The maximum recursion limit is 3000, if I try increasing it the kernel dies.
My first list has only about 10,000 elements, representing 5 dimensional simplices. There are 6 different "face maps" I want to apply to each element in the list. If a face map applied to an element of the list is not in my list of 4 dimensional simplices, I want to append it to my list of 4 dimensional simplices.
The list of 4 dimensional simplices has length nearly 6 times that of my list of 5 dimensional simplices.
Similarly when generating the list of 3 dimensional simplices, this will have length nearly 30,000. Etc. down to the list of 1 dimensional simplices. The numbers don't quite increase multiplicatively, as there are identifications, but the numbers are big enough that I would really rather not compute in steps of 3000.
Is there any way around this? The manipulations I want to do to the lists aren't computation intensive, I don't understand why this is such a problem.
Fri, 09 Apr 2021 05:53:19 +0200https://ask.sagemath.org/question/56572/recursionerror-long-lists/Comment by slelievre for <p>I am working with long lists, and getting the error "RecursionError: maximum recursion depth exceeded in comparison".
The maximum recursion limit is 3000, if I try increasing it the kernel dies.
My first list has only about 10,000 elements, representing 5 dimensional simplices. There are 6 different "face maps" I want to apply to each element in the list. If a face map applied to an element of the list is not in my list of 4 dimensional simplices, I want to append it to my list of 4 dimensional simplices.
The list of 4 dimensional simplices has length nearly 6 times that of my list of 5 dimensional simplices.
Similarly when generating the list of 3 dimensional simplices, this will have length nearly 30,000. Etc. down to the list of 1 dimensional simplices. The numbers don't quite increase multiplicatively, as there are identifications, but the numbers are big enough that I would really rather not compute in steps of 3000.
Is there any way around this? The manipulations I want to do to the lists aren't computation intensive, I don't understand why this is such a problem.</p>
https://ask.sagemath.org/question/56572/recursionerror-long-lists/?comment=56574#post-id-56574Providing a toy example with a few simplices instead
of 10,000 would make the question concrete.Fri, 09 Apr 2021 10:01:06 +0200https://ask.sagemath.org/question/56572/recursionerror-long-lists/?comment=56574#post-id-56574Comment by FrédéricC for <p>I am working with long lists, and getting the error "RecursionError: maximum recursion depth exceeded in comparison".
The maximum recursion limit is 3000, if I try increasing it the kernel dies.
My first list has only about 10,000 elements, representing 5 dimensional simplices. There are 6 different "face maps" I want to apply to each element in the list. If a face map applied to an element of the list is not in my list of 4 dimensional simplices, I want to append it to my list of 4 dimensional simplices.
The list of 4 dimensional simplices has length nearly 6 times that of my list of 5 dimensional simplices.
Similarly when generating the list of 3 dimensional simplices, this will have length nearly 30,000. Etc. down to the list of 1 dimensional simplices. The numbers don't quite increase multiplicatively, as there are identifications, but the numbers are big enough that I would really rather not compute in steps of 3000.
Is there any way around this? The manipulations I want to do to the lists aren't computation intensive, I don't understand why this is such a problem.</p>
https://ask.sagemath.org/question/56572/recursionerror-long-lists/?comment=56573#post-id-56573Without code and traceback, we cannot help.Fri, 09 Apr 2021 08:40:32 +0200https://ask.sagemath.org/question/56572/recursionerror-long-lists/?comment=56573#post-id-56573Answer by Ingrid for <p>I am working with long lists, and getting the error "RecursionError: maximum recursion depth exceeded in comparison".
The maximum recursion limit is 3000, if I try increasing it the kernel dies.
My first list has only about 10,000 elements, representing 5 dimensional simplices. There are 6 different "face maps" I want to apply to each element in the list. If a face map applied to an element of the list is not in my list of 4 dimensional simplices, I want to append it to my list of 4 dimensional simplices.
The list of 4 dimensional simplices has length nearly 6 times that of my list of 5 dimensional simplices.
Similarly when generating the list of 3 dimensional simplices, this will have length nearly 30,000. Etc. down to the list of 1 dimensional simplices. The numbers don't quite increase multiplicatively, as there are identifications, but the numbers are big enough that I would really rather not compute in steps of 3000.
Is there any way around this? The manipulations I want to do to the lists aren't computation intensive, I don't understand why this is such a problem.</p>
https://ask.sagemath.org/question/56572/recursionerror-long-lists/?answer=56575#post-id-56575I have found the problem. Sorry for wasting your time everyone. The lists themselves were not too long. There was a freak coincidence, which caused random elements of the list to be a 10,000 deep nested sequence of lists.
Fri, 09 Apr 2021 13:33:48 +0200https://ask.sagemath.org/question/56572/recursionerror-long-lists/?answer=56575#post-id-56575Comment by slelievre for <p>I have found the problem. Sorry for wasting your time everyone. The lists themselves were not too long. There was a freak coincidence, which caused random elements of the list to be a 10,000 deep nested sequence of lists.</p>
https://ask.sagemath.org/question/56572/recursionerror-long-lists/?comment=56579#post-id-56579Nice. Accept your own answer to mark the question as solved.Fri, 09 Apr 2021 17:40:06 +0200https://ask.sagemath.org/question/56572/recursionerror-long-lists/?comment=56579#post-id-56579