2024-01-20 22:08:57 +0200 | received badge | ● Notable Question (source) |
2024-01-20 22:08:57 +0200 | received badge | ● Popular Question (source) |
2023-11-21 06:05:58 +0200 | commented answer | Is there a bug with the "parts" input in VectorPartitions? Thanks! Manually inputting the minimum vector to be zeros does appear to work in some further examples I tried. As you i |
2023-11-21 06:00:49 +0200 | commented answer | Is there a bug with the "parts" input in VectorPartitions? Thanks! Manually inputting the minimum vector to be zeros does appear to work in some further examples I tried. As you i |
2023-11-21 02:55:33 +0200 | asked a question | Is there a bug with the "parts" input in VectorPartitions? Is there a bug with the "parts" input in VectorPartitions? Using Sagemath 10.1 if I run the code: VectorPartitions([2,2 |
2023-11-13 21:22:55 +0200 | marked best answer | Efficient way to compute all possible permutations that sort a list I'm looking for a good way to compute all the possible permutations that sort a list. For example, if the list is [3,4,3,2,4] I would want the permutations to be: [4,1,3,2,5], [4,1,3,5,2], [4,3,1,2,5], [4,3,1,5,2]. I'm well aware of how to get a permutation that sorts the list, one can use argsort or standard_permutation(), but neither of these will return all such permutations. I can also, of course, come up with something stupid myself, but I worry it won't be efficient and I wish to do this for a largeish number of arrays. Edit: Here is my best attempt to code this. Essentially, I find one permutation using the standard 'sorted' python function, and then find all permutations that preserve the sorted list, and then multiply the two permutations. I just feel like this is a really stupid way to do this that will slow my program down. Especially if the list is long, this is going to involve checking a bunch of unnecessary permutations. The output is indeed [[4, 1, 3, 2, 5], [4, 1, 3, 5, 2], [4, 3, 1, 2, 5], [4, 3, 1, 5, 2]], as I want. |
2023-11-13 21:22:51 +0200 | commented answer | Efficient way to compute all possible permutations that sort a list Yep, looks like it works now; I'll accept this answer. Thanks for helping me out. |
2023-11-13 20:29:04 +0200 | edited answer | Efficient way to compute all possible permutations that sort a list This is a corrected version of the thought process provided by Max Alekseyev (it copies some of his code as well). I did |
2023-11-13 20:22:49 +0200 | commented answer | Efficient way to compute all possible permutations that sort a list After looking it up, I realised I missed the most obvious set of generators, namely (1 2), (2 3),...(n-1 n). I edited it |
2023-11-13 20:21:55 +0200 | edited answer | Efficient way to compute all possible permutations that sort a list This is a corrected version of the thought process provided by Max Alekseyev (it copies some of his code as well). I did |
2023-11-13 19:50:25 +0200 | commented answer | Efficient way to compute all possible permutations that sort a list After looking it up, I realised I missed the most obvious set of generators, namely (1 2), (2 3),...(n-1 n). I'll edit t |
2023-11-13 18:58:05 +0200 | commented answer | Efficient way to compute all possible permutations that sort a list I'm not overly comfortable with itertools.groupby() (hence I didn't use it), but I agree it seems more elegant. The pr |
2023-11-13 18:55:09 +0200 | commented answer | Efficient way to compute all possible permutations that sort a list I'm not overly comfortable with itertools.groupby() (hence I didn't use it), but I agree it seems more elegant. The pr |
2023-11-13 01:14:04 +0200 | answered a question | Efficient way to compute all possible permutations that sort a list This is a corrected version of the thought process provided by Max Alekseyev (it copies some of his code as well). I did |
2023-11-13 01:14:02 +0200 | commented answer | Efficient way to compute all possible permutations that sort a list Thanks for the reply! However, this algorithm does not work. For example, one can choose dP = [1,1,1] and it will only g |
2023-11-11 00:39:32 +0200 | commented answer | Efficient way to compute all possible permutations that sort a list Thanks a lot! This is (in concept) similar to what I was thinking in my code, but it is vastly superior in execution. In |
2023-11-10 22:31:55 +0200 | edited question | Efficient way to compute all possible permutations that sort a list Efficient way to compute all possible permutations that sort a list I'm looking for a good way to compute all the possib |
2023-11-10 22:31:26 +0200 | edited question | Efficient way to compute all possible permutations that sort a list Efficient way to compute all possible permutations that sort a list I'm looking for a good way to compute all the possib |
2023-11-10 22:30:12 +0200 | edited question | Efficient way to compute all possible permutations that sort a list Efficient way to compute all possible permutations that sort a list I'm looking for a good way to compute all the possib |
2023-11-10 22:29:51 +0200 | edited question | Efficient way to compute all possible permutations that sort a list Efficient way to compute all possible permutations that sort a list I'm looking for a good way to compute all the possib |
2023-11-10 21:08:48 +0200 | edited question | Efficient way to compute all possible permutations that sort a list Efficient way to compute all possible permutations that sort a list I'm looking for a good way to compute all the possib |
2023-11-10 21:08:20 +0200 | asked a question | Efficient way to compute all possible permutations that sort a list Efficient way to compute all possible permutations that sort a list I'm looking for a good way to compute all the possib |
2023-11-10 20:54:41 +0200 | received badge | ● Notable Question (source) |
2022-11-28 00:09:58 +0200 | edited question | Cryptic Cython Error Message Cryptic Cython Error Message I have been coding a basic algorithm to compute infinite dimensional path integrals in cyth |
2022-11-27 23:41:56 +0200 | edited question | Cryptic Cython Error Message Cryptic Cython Error Message I have been coding a basic algorithm to compute infinite dimensional path integrals in cyth |
2022-11-27 23:41:02 +0200 | edited question | Cryptic Cython Error Message Cryptic Cython Error Message I have been coding a basic algorithm to compute infinite dimensional path integrals in cyth |
2022-11-27 23:41:02 +0200 | received badge | ● Editor (source) |
2022-11-27 23:40:19 +0200 | asked a question | Cryptic Cython Error Message Cryptic Cython Error Message I have been coding a basic algorithm to compute infinite dimensional path integrals in cyth |
2022-11-27 23:05:44 +0200 | received badge | ● Popular Question (source) |
2020-04-30 23:08:28 +0200 | asked a question | ode_solver throwing ValueError: error solving So I've been trying to solve a system of ode's with the class ode_solver. My code looks something like this: Whenever I try to run it sage throws me the very unhelpful error of ValueError: error solving. I'm just not sure what could going wrong? It throws me the same error even if I reduce to t_span to only go to [0,1] so it has nothing to do with dividing by zero in the jacobian. For reference the error thrown is: |
2018-06-08 21:20:34 +0200 | received badge | ● Scholar (source) |
2018-06-08 21:20:20 +0200 | commented answer | Computing Roots of Large Polynomials Thanks a lot! That's closer to what I was expecting when I went out to code the graph. I should have figured dividing by all those really huge numbers and then using numerical algorithms to pinpoint the roots would result in some massive errors. |
2018-06-08 18:18:51 +0200 | received badge | ● Supporter (source) |
2018-06-08 18:18:42 +0200 | commented answer | Computing Roots of Large Polynomials Thanks for the reply. I tried CDF and like you said it was a lot faster but a bunch of the roots also disappeared. The trouble is I'm not getting the picture I think I should. I think I should see one root converging to 1 and all the other ones going to infinity as for large N the series becomes increasingly close to z*exp(-z). I would be interested to see the picture you get using exact computation to see if it would be closer to my intuition but your code seems to give me the error 'Algebraic Field is not a valid variable'. |
2018-06-08 11:13:10 +0200 | received badge | ● Good Question (source) |
2018-06-07 08:48:33 +0200 | received badge | ● Nice Question (source) |
2018-06-07 08:04:58 +0200 | received badge | ● Student (source) |
2018-06-07 07:57:28 +0200 | asked a question | Computing Roots of Large Polynomials Hey, I'm looking to compute the roots of very large polynomials (as in polynomials of degree 500+) and am looking for the most efficient method to do so. This my code so far (I tried a different method with the commented out code) and it works great for about anything with N<=200ish and then starts to take a really long time: Thanks. |