11.3 Formal sums

Module: sage.structure.formal_sum

Formal sums

Author Log:

sage: A = FormalSum([(1, 2/3)]); A
2/3
sage: B = FormalSum([(3, 1/5)]); B
3*1/5
sage: -B
-3*1/5
sage: A + B
3*1/5 + 2/3 
sage: A - B
-3*1/5 + 2/3
sage: B*3
9*1/5
sage: 2*A
2*2/3
sage: list(2*A + A)
[(3, 2/3)]

Module-level Functions

FormalSums( R)

Class: FormalSum

class FormalSum
FormalSum( self, x, [parent=Abelian Group of all Formal Finite Sums over Integer Ring], [check=True], [reduce=True])

Functions: reduce

Special Functions: __cmp__,$  $ __getitem__,$  $ __init__,$  $ __iter__,$  $ __len__,$  $ _add_,$  $ _latex_,$  $ _lmul_,$  $ _neg_,$  $ _repr_,$  $ _rmul_

Class: FormalSums_generic

class FormalSums_generic
FormalSums_generic( self, [base=Integer Ring])

Functions: base_extend,$  $ base_extend_canonical_sym,$  $ get_action_impl

get_action_impl( self, other, op, self_is_left)

sage: A = FormalSums(RR).get_action(RR); A
Right scalar multiplication by Real Field with 53 bits of precision on
Abelian Group of all Formal Finite Sums over Real Field with 53 bits of
precision

sage: A = FormalSums(ZZ).get_action(QQ); A
Right scalar multiplication by Rational Field on Abelian Group of all
Formal Finite Sums over Rational Field
with precomposition on left by Coercion morphism:
  From: Abelian Group of all Formal Finite Sums over Integer Ring
  To:   Abelian Group of all Formal Finite Sums over Rational Field
sage: A = FormalSums(QQ).get_action(ZZ); A
Right scalar multiplication by Integer Ring on Abelian Group of all Formal
Finite Sums over Rational Field

Special Functions: __call__,$  $ __cmp__,$  $ __init__,$  $ _an_element_impl,$  $ _coerce_impl,$  $ _repr_

See About this document... for information on suggesting changes.