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, 06 May 2011 13:24:34 +0200How can I construct modules as quotient algebras?https://ask.sagemath.org/question/8061/how-can-i-construct-modules-as-quotient-algebras/I would like to do the following: given a field k and an ideal I of A = k[x1,...,x_n], I would like to construct the k-module A/I and, when A/I is finite as a k-module, compute its rank. Is this possible in Sage?Thu, 05 May 2011 16:24:53 +0200https://ask.sagemath.org/question/8061/how-can-i-construct-modules-as-quotient-algebras/Answer by benjaminfjones for <p>I would like to do the following: given a field k and an ideal I of A = k[x1,...,x_n], I would like to construct the k-module A/I and, when A/I is finite as a k-module, compute its rank. Is this possible in Sage?</p>
https://ask.sagemath.org/question/8061/how-can-i-construct-modules-as-quotient-algebras/?answer=12336#post-id-12336It is easy to compute what you want in Sage if you have a specific field `k` and specific number of generators. The method you want is the `vector_space_dimension` method of the ideal I. Here is an example from the [documentation](http://www.sagemath.org/doc/reference/sage/rings/polynomial/multi_polynomial_ideal.html?highlight=vector_space_dimension) for that method that involves the field `QQ` (rational numbers) and two generators `u, v`:
sage: R.<u,v> = PolynomialRing(QQ)
sage: g = u^4 + v^4 + u^3 + v^3
sage: I = ideal(g) + ideal(g.gradient())
sage: I
Ideal (u^4 + v^4 + u^3 + v^3, 4*u^3 + 3*u^2, 4*v^3 + 3*v^2) of Multivariate Polynomial Ring in u, v over Rational Field
sage: I.dimension()
0
sage: I.vector_space_dimension()
4
Fri, 06 May 2011 13:24:34 +0200https://ask.sagemath.org/question/8061/how-can-i-construct-modules-as-quotient-algebras/?answer=12336#post-id-12336