Unit groups of finite flat algebras

Unit groups of finite flat algebras

dual_pairs.unit_group.roots_of_unity(A, n)

Return the group of n-th roots of unity of A.

EXAMPLES:

sage: from dual_pairs import FiniteFlatAlgebra
sage: from dual_pairs.unit_group import roots_of_unity
sage: R.<x> = QQ[]
sage: A = FiniteFlatAlgebra(QQ, [x, x^2 + x + 1])
sage: mu, gens, exp_mu, log_mu = roots_of_unity(A, 6)
sage: mu
Multiplicative Abelian group isomorphic to C2 x C6
sage: gens
[(-1, 1), (1, a1 + 1)]
dual_pairs.unit_group.unit_group(A, S)

Return the S-unit group of A.

This is a version for étale algebras of the method NumberField.S_unit_group().

EXAMPLES:

sage: from dual_pairs import FiniteFlatAlgebra
sage: from dual_pairs.unit_group import unit_group
sage: R.<x> = QQ[]
sage: A = FiniteFlatAlgebra(QQ, [x, x^2 + 23])
sage: S = [5]
sage: U, gens, from_U, to_U = unit_group(A, S)
sage: U
Multiplicative Abelian group isomorphic to C2 x Z x C2 x Z
sage: gens
[(-1, 1), (5, 1), (1, -1), (1, 5)]
sage: u = U([1, 4, 1, 6])
sage: v = from_U(u)
sage: to_U(v) == u
True