Ask Your Question

Johannes Schmitt's profile - activity

2023-05-23 09:06:23 +0200 received badge  Popular Question (source)
2023-05-19 22:56:42 +0200 received badge  Nice Question (source)
2023-05-18 14:45:17 +0200 commented question Code for guessing formula for integer sequence

Thanks a lot, this is really helpful, and an impressive library! Also there are associated papers with more references.

2023-05-18 12:01:34 +0200 commented answer Code for guessing formula for integer sequence

Thanks a lot for pointing this out, I agree that sequences from linear recurrences are very important examples! Also, I

2023-05-17 16:27:15 +0200 asked a question Code for guessing formula for integer sequence

Code for guessing formula for integer sequence Hey everyone, I was wondering if there already exists some code in SageMa

2023-03-04 21:49:08 +0200 received badge  Famous Question (source)
2020-04-19 12:05:21 +0200 received badge  Good Question (source)
2020-04-17 22:46:25 +0200 received badge  Nice Question (source)
2020-04-17 22:31:48 +0200 received badge  Student (source)
2020-04-17 21:18:47 +0200 asked a question Error with rational input in IntegerVectors

I discovered the following unexpected behavior of IntegerVectors:

sage: IntegerVectors(2,3).list()
[[2, 0, 0], [1, 1, 0], [1, 0, 1], [0, 2, 0], [0, 1, 1], [0, 0, 2]]
sage: IntegerVectors(2,3/1).list()
[[2, 0, 0], [1, 1, 0]]

The relevant code block in the implementation of IntegerVectors seems to be the following:

    try:
        return IntegerVectors_nnondescents(n, tuple(k))
    except TypeError:
        pass

    return IntegerVectors_nk(n, k)

For k=3/1 one has that tuple(k) does not give a TypeError (as opposed to tuple(3)) and thus the code never tries to interpret k as an integer.

2020-01-20 05:36:59 +0200 received badge  Notable Question (source)
2017-09-12 16:00:05 +0200 received badge  Popular Question (source)
2014-01-27 09:39:44 +0200 received badge  Supporter (source)
2014-01-27 07:12:44 +0200 asked a question Linear subspace of polynomial ring

I am trying to compute a QQ-linear subspace W of a polynomial ring R over QQ. However, R does not seem to have a method like subspace. So what I would like to do is

R=PolynomialRing(QQ,'x',3)
x=R.gens()
W=R.subspace([x[0]^2,3*x[1]+x[0]])

For further purposes I still want to apply functions defined on the ring R to elements of W but also apply linear algebra methods (linear maps, eigenspaces, ...) to W.

I am sorry to bother you with this, it should be very easy, but I did not find a way to do it.