quadratic-modules (version $Id: quadratic-modules.sage,v 1.45 2007-11-30 13:50:28 nils Exp $)
index
/mnt/data1/debian/home/nils/finite-quadratic-modules/cn-group/quadratic-modules.py

# This file was *autogenerated* from the file quadratic-modules.sage.

 
Modules
       
sage.combinat.choose_nk
sage.combinat.combination
sage.combinat.composition
sage.calculus.desolvers
sage.structure.factorization
sage.graphs.graph_list
sage.groups.group
sage.rings.integer
sage.combinat.integer_list
sage.rings.integer_ring
sage.geometry.lattice_polytope
sage.combinat.lyndon_word
math
sage.misc.misc
sage.schemes.elliptic_curves.monsky_washnitzer
sage.crypto.mq
sage.combinat.multichoose_nk
sage.combinat.necklace
sage.libs.ntl.all
operator
os
sage.combinat.partition
sage.combinat.partitions
sage.combinat.permutation
sage.combinat.permutation_nk
sage.groups.perm_gps.permgroup
sage.structure.proof.all
sage.combinat.q_analogues
sage.combinat.ranker
resource
sage.combinat.ribbon
sage
sage.combinat.set_partition
sage.combinat.set_partition_ordered
signal
sage.combinat.skew_partition
sage.combinat.skew_tableau
sage.combinat.split_nk
sage.combinat.subset
sage.combinat.subword
sage.libs.symmetrica.all
sys
sage.combinat.tableau
sage.tests.all
weakref
sage.combinat.word

 
Classes
       
sage.groups.group.AbelianGroup(sage.groups.group.Group)
quad_module
quad_module_subgroup
sage.structure.element.AdditiveGroupElement(sage.structure.element.ModuleElement)
quad_module_element
sage.structure.sage_object.SageObject(__builtin__.object)
quad_module_subgroup_container

 
class quad_module(sage.groups.group.AbelianGroup)
    Describes a finite quadratic module $(A,Q)=(\ZZ^n/M\ZZ^n, x\mapsto G[x])$.
 
EXAMPLES
    sage: M = matrix(2,2,[2,1,1,2])
    sage: G = 1/4 * matrix(2,2,[1,1/2,1/2,1])^(-1)
    sage: phi = quad_module( M, G); phi
    Finite quadratic module ([3],1/3*x^2)
    sage: phi.order()
    3
 
    sage: phi0 = fqmodule([4])
    sage: phi1 = fqmodule([3])
    sage: phi2 = phi0 + phi1; phi2
    Finite quadratic module ([24, 2],7/48*x0^2 + 3/4*x1^2)
 
    sage: phi3 = fqmodule([5]); phi3
    Finite quadratic module ([10],1/20*x^2)
    sage: -phi3
    Finite quadratic module ([10],19/20*x^2)
    sage: phi3(17)
    Finite quadratic module ([10],17/20*x^2)
 
    sage: phi3 - phi3
    Finite quadratic module ([10, 10],1/20*x0^2 + 19/20*x1^2)
 
    sage: chi = fqmodule([11,33]);chi
    Finite quadratic module ([66, 22],1/132*x0^2 + 1/44*x1^2)
    sage: vals = chi.values()
    sage: for val,mult in vals.iteritems():
              if 1 == mult:
                  print "%s:%d" %(val,mult)
    3/4:1
    1/4:1
 
    sage: chi = fqmodule([11,33]); chi
    Finite quadratic module ([66, 22],1/132*x0^2 + 1/44*x1^2)
    sage: chi.tau_invariant(29)
    1
    sage: chi.tau_invariant(2)
    -1
 
 
Method resolution order:
quad_module
sage.groups.group.AbelianGroup
sage.groups.group.Group
sage.structure.parent_gens.ParentWithGens
sage.structure.parent_base.ParentWithBase
sage.structure.parent.Parent
sage.structure.sage_object.SageObject
__builtin__.object

Methods defined here:
B(self, x, y)
Return the value $B(x,y) = Q(x+y)-Q(x)-Q(y)$ reduced mod $\ZZ$.
 
INPUT
    x, y -- quad_module_elements of self
 
EXAMPLE
    sage: p=fqmodule([3,6,9]); p
    Finite quadratic module ([36, 6, 6], 5/72*x0^2 + 1/3*x0*x1 + 5/12*x1^2 + 1/12*x2^2)
    sage: (a,b,c) = p.gens()
    sage: p.B( a-b, a*2 + b*100)
    11/18
Q(self, x)
Return the value $Q(x)$ reduced mod $\ZZ$.
 
INPUT
    x -- an quad_module_element of self
         (e.g. x = self.0*17 )
EXAMPLE
    sage: p=fqmodule([2,4])
    sage: (a,b) = p.gens()
    sage: x = a*3 - b*5
    sage: p.Q(x)
    11/16
Witt_class(self)
Return the family $\{sigma( A_p)\}_p$ as dictionary,
where $A$ is this module, $A_p$ its $p$-part,
and $p$ is running through the divisors of the exponent of $A$.
__add__(self, phi)
Return the orthogonal sum of quadratic modules $self + \phi$.
__call__(self, object)
Coerce object into an appopriate child object
of self if possible.
 
EXAMPLES
    sage: p=fqmodule([2,4])
    sage: p.gens()
    (g0, g1)
    sage: z = p(0); z
    0
    sage: g1 + z
    g1
 
    sage: p([2,3])
    g0*2+g1*3
 
    sage: q = fqmodule([6,3]); q
    Finite quadratic module ([12, 6], 1/24*x0^2 + 1/12*x1^2)
    q( matrix(ZZ,2,2,[2,4,0,3]))
__init__(self, M, G, check=True, names=None)
INPUT
    M  -- an integral non-degenerate square matrix of size $n$
          representing the finite abelien group $\ZZ^n/M\ZZ^n$.
    G  -- a symmetric rational matrix of same size as $M$ and such
          that $M^tGM$ is half integral and $2*G*M$ is an integer matrix,
          representing the the quadatic
          form $x + M\ZZ^n \mapsto G[x] + \ZZ$.
 
 check -- True or False indicating whether M and G should be
          checked to be a valid set of data for the definition of
          a quadratic module.
 
NOTE
    Use fqmodule() for more flexibility when creating quad_module objects.
__neg__(self)
If self is the group $(A,Q)$, return $(A,-Q)$.
__sub__(self, phi)
Return the quadratic module $self + \phi(-1)$.
anisotropic_quotient(self)
canonical_gens(self)
If this module was initialized by an $n\times n$ matrix $M$, i.e. if $\ZZ^n/M\ZZ^n$ is its underlying
group, then return the canonical generators of $\ZZ^n/M\ZZ^n$ expressed in terms of its generators.
(The canonical canonical genarators are the elements $e_i+M\ZZ^n$ ($1\le i \le n$),
where $e_i$ is the column vector which has 1 as $i$-th
entry and zero entries otherwise.)
chi_invariant()
cyclic_factors(self)
Return the orders of the generators of the underlying group.
dual_group(self, U)
Return the dual subgroup
$U^\sharp = \{y \in A : B(y,x) = 0 \text{ for all } x \in U  \}$
of the subgroup $U$ of $self = (A,Q)$
 
NOTE
    If  the  dual  group  is  given  as $K\ZZ^n/M\ZZ^n$ then the
    columns of $K$ form a basis for the integral solutions  of
    $2H^tGx \in \ZZ$. We solve this  by the trick of augmenting
    $$2H^tGx$ by the unit matrix and solving the  corresonding
    system of linear equations over $\ZZ$
elements(self)
Returns a generator over every element of the set given by its generators in self.M.
 
OUTPUT:
    generator -- each element of self
 
The elements e are given as vector $e= ( e_1,\dots, e_n )$,
where n= (self.M.ncols() ) and $e_i \in \{0, \dots, g_i -1 \}$ and
$g_i$ is self.M[i][i].
 
EXAMPLES:
    for x in Q.enumerate_elements():
        do_something_with(x)
enumerate_subgroups(self)
# after subgroups() works, this method will be deleted
# at the moment it is used for debugging
# Or is the complete set of subgroups in the container useful?
# Perhaps subgroups() should return everything if d is None
exponent(self)
Return the exponent of this module.
gen(self, i=0)
The $i$-th generator of the abelian group.
 
EXAMPLE
    sage: r = fqmodule( [2, 4, 8]); r
    Finite quadratic module ([16, 8, 4], 1/32*x0^2 + 1/16*x1^2 + 1/8*x2^2)
    sage: r.gens()
    (g0, g1, g2)
group(self)
is_Witt_equivalent(self, psi)
Return True or False accordingly as this quadratic module
is Witt_equivalent to $\psi$ or not.
is_isomorphic(self, psi)
Return True or False accordingly as this quadratic module
is isomorphic to $\psi$ or not.
is_multiplicative(self)
Overides the method inherited from class AbelianGroup.
is_nondegenerate(self)
Return True or False accordingly if $self$ is
non degenerate or not.
isotropic_elements(self)
Return the list of isotropic elements, e.g. the x with $Q( x ) = 0$
 
EXAMPLES:
    sage: T=fqmodule([3,5])
    sage: T.isotropic_elements()
    [(0, 0), (15, 0)]
isotropic_subgroups(self)
Return a list of all isotropic subgroups of self.
 
NOTES:
    Subgroups are represented  by lower triangular matrices $N$
    in Hermite normal form dividing $M$.  Note that $N$ defines
    an isotropic subgroups if $N^tGN$ is half integral.
kernel(self)
Return the dual subgroup of the undelying group of this,
i.e. return $\{y \in A : B(y,x) = 0 \text{ for all } x \in A  \}$,
for this module $(A,Q)$.
level(self)
local_component(self, p)
Return the p-part of quadratic module $self$, where p is a prime number.
ngens(self)
The number of generators of the underlying abelian group.
 
EXAMPLE
    sage: F = matrix( QQ, 3, 3, [ 1, 1/2, 5/2, 1/2, 17, 19/2, 5/2, 19/2, 3]); F
 
    [   1  1/2  5/2]
    [ 1/2   17 19/2]
    [ 5/2 19/2    3]
    sage: q = fqmodule( F); q
    Finite quadratic module ([980], 157/1960*x^2)
    sage: q.ngens()
    1
order(self)
If self is the quadratic module $(A,Q)$, return the order of $A$.
orthogonal_group(self)
Returns the orthogonal group of this
quadratic module.
quotient(self, U)
Return the quotient module $self/U$ for the isotropic subgroup
$H$ of self. If $H$ is not isotropic an excepion is thrown.
sigma_invariant(self)
If this QM equals $(M,Q)$, return
$\sqrt{|M|}^{-1}\sum_{x\in M} \exp(-2\pi i Q(x))$
 
TODO
    Much too slow for big modules.
    Needs profiling.
    Guess: problem with sqrt().
subgroup(self, list)
subgroups(self, d=None)
Return a list of all subgroups of $A$ of index $d$, where $A$
is the underlying group of self.
 
INPUT:
    d -- integer the index or None, if None then every subgroups is returned
 
OUTPUT:
    generator -- the subgroups of index d
 
NOTES:
    Subgroups are  internally represented by lower triangular
    matrices in Hermite normal form dividing $M$.
 
    Any   subgroup  $U$   of  $\ZZ^n/M\ZZ^n$   is  of   the  form
    $N\ZZ^n/M\ZZ^n$,  where  $N$  is  a regular  integral  square
    matrix of  size $n$ such  that $N$ divides $M$,  (i.e. such
    that  $N^{-1}M$  is  an   integer  matrix).  The  coset  $N
    GL(n,\ZZ)$ is  uniquely determined by $U$.   Recall that any
    such  coset contains  exactly one lower triangular matrix
    $(h_[ij})$  in Hermite  normal formr  (i.e.  $h_{ii}>0$ and
    $0\le h_{ij}$ < h_{ii}$ for $j < i$).
tau_invariant(self, p=None)
Return +1  or -1 accordingly  as the $|A|$ (resp.  the largest
power of $p$ dividing $|A|$) is a perfect square or not, where
$A$ is the undelying group  of  this.  We do not check whether
$p$ is a prime.
twist(self, a)
If self is the quadratic module $(A,Q)$, return the twisted module $(A,a*G)$.
values(self)
If this is $(A,Q)$, return the values of $Q( x)$ ($x \in A$) as a dictionary d.
 
OUTPUT:
    dictionary -- the mapping x -> Q(x)
 
For every possible $x$, $v= Q( x )$ is evaluated.
The dictionary-entry d[ v ] tells how many elements x
have Q( x ) == v.
 
EXAMPLES:
    vals= values()
 
    for v in vals:
        multiplicity= vals[v]
        print multiplicity * val
 
    # or
 
    for value, multiplicity in vals.iteritems():
        print multiplicity * val
zero_subspace(self)

Data descriptors defined here:
G
G represents the quadatic form $x + M\ZZ^n \mapsto G[x] + \ZZ$.
M
M represents the finite abelian group $\ZZ^n/M\ZZ^n$.
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from sage.groups.group.AbelianGroup:
is_abelian(...)
File: sage/groups/group.pyx (starting at line 114)
 
Return True.

Data and other attributes inherited from sage.groups.group.AbelianGroup:
__new__ = <built-in method __new__ of type object at 0x2b509a8a4100>
T.__new__(S, ...) -> a new object with type S, a subtype of T
__pyx_vtable__ = <PyCObject object at 0xa9dbe8>

Methods inherited from sage.groups.group.Group:
__contains__(...)
x.__contains__(y) <==> y in x
__hash__(...)
x.__hash__() <==> hash(x)
category(...)
File: sage/groups/group.pyx (starting at line 53)
 
The category of all groups
is_atomic_repr(...)
File: sage/groups/group.pyx (starting at line 60)
 
True if the elements of this group have atomic string
representations.  For example, integers are atomic but
polynomials are not.
is_finite(...)
File: sage/groups/group.pyx (starting at line 81)
 
Returns True if this group is finite.
random_element(...)
File: sage/groups/group.pyx (starting at line 98)
 
Return a random element of this group.

Methods inherited from sage.structure.parent_gens.ParentWithGens:
__getitem__(...)
File: sage/structure/parent_gens.pyx (starting at line 211)
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__getstate__(...)
File: sage/structure/parent_gens.pyx (starting at line 413)
__len__(...)
x.__len__() <==> len(x)
__setstate__(...)
File: sage/structure/parent_gens.pyx (starting at line 433)
gens(...)
File: sage/structure/parent_gens.pyx (starting at line 271)
 
Return a tuple whose entries are the generators for this
object, in order.
gens_dict(...)
File: sage/structure/parent_gens.pyx (starting at line 287)
 
Return a dictionary whose entries are \code{{var_name:variable,...}}.
hom(...)
File: sage/structure/parent_gens.pyx (starting at line 462)
 
Return the unique homomorphism from self to codomain that
sends \code{gens()} to the entries of \code{im_gens}.
Raises a TypeError if there is no such homomorphism.
 
INPUT:
    im_gens -- the images in the codomain of the generators of
               this object under the homomorphism
    codomain -- the codomain of the homomorphism
    check -- whether to verify that the images of generators extend
             to define a map (using only canonical coercisions).
 
OUTPUT:
    a homomorphism self --> codomain
 
\note{As a shortcut, one can also give an object X instead of
\code{im_gens}, in which case return the (if it exists)
natural map to X.}
 
EXAMPLE: Polynomial Ring
We first illustrate construction of a few homomorphisms
involving a polynomial ring.
 
    sage: R.<x> = PolynomialRing(ZZ)
    sage: f = R.hom([5], QQ)
    sage: f(x^2 - 19)
    6
 
    sage: R.<x> = PolynomialRing(QQ)
    sage: f = R.hom([5], GF(7))
    Traceback (most recent call last):
    ...
    TypeError: images do not define a valid homomorphism
 
    sage: R.<x> = PolynomialRing(GF(7))
    sage: f = R.hom([3], GF(49,'a'))
    sage: f
    Ring morphism:
      From: Univariate Polynomial Ring in x over Finite Field of size 7
      To:   Finite Field in a of size 7^2
      Defn: x |--> 3
    sage: f(x+6)
    2
    sage: f(x^2+1)
    3
 
EXAMPLE: Natural morphism
    sage: f = ZZ.hom(GF(5))
    sage: f(7)
    2
    sage: f
    Ring Coercion morphism:
      From: Integer Ring
      To:   Finite Field of size 5
 
There might not be a natural morphism, in which case a TypeError exception is raised. 
    sage: QQ.hom(ZZ)
    Traceback (most recent call last):
    ...
    TypeError: Natural coercion morphism from Rational Field to Integer Ring not defined.
inject_variables(...)
File: sage/structure/parent_gens.pyx (starting at line 333)
 
Inject the generators of self with their names into the
namespace of the Python code from which this function is
called.  Thus, e.g., if the generators of self are labeled
'a', 'b', and 'c', then after calling this method the
variables a, b, and c in the current scope will be set
equal to the generators of self.
 
NOTE: If Foo is a constructor for a SAGE object with
generators, and Foo is defined in Pyrex, then it would
typically call inject_variables() on the object it
creates.  E.g., PolyomialRing(QQ, 'y') does this so that the
variable y is the generator of the polynomial ring.
injvar(...)
File: sage/structure/parent_gens.pyx (starting at line 358)
 
This is a synonym for inject_variables(...)
<<<sage.structure.parent_gens.ParentWithGens.inject_variables>>>
latex_name(...)
File: sage/structure/parent_gens.pyx (starting at line 405)
latex_variable_names(...)
File: sage/structure/parent_gens.pyx (starting at line 379)
 
Returns the list of variable names suitable for latex output.
 
All '_SOMETHING' substrings are replaced by '_{SOMETHING}' recursively
so that subscripts of subscripts work.
 
EXAMPLES:
    sage: R, x = PolynomialRing(QQ,'x',12).objgens()
    sage: x
    (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)
    sage: print R.latex_variable_names ()
    ['x_{0}', 'x_{1}', 'x_{2}', 'x_{3}', 'x_{4}', 'x_{5}', 'x_{6}', 'x_{7}', 'x_{8}', 'x_{9}', 'x_{10}', 'x_{11}']
    sage: f = x[0]^3 + 15/3 * x[1]^10
    sage: print latex(f)
    5 x_{1}^{10} + x_{0}^{3}
list(...)
File: sage/structure/parent_gens.pyx (starting at line 220)
 
Return a list of all elements in this object, if possible (the
object must define an iterator).
objgen(...)
File: sage/structure/parent_gens.pyx (starting at line 251)
 
Return self and the generator of self.
 
INPUT:
    names -- tuple or string
 
OUTPUT:
    self  -- this object
    an object -- gen()
 
EXAMPLES:
    sage: R, x = PolynomialRing(QQ,'x').objgen()
    sage: R
    Univariate Polynomial Ring in x over Rational Field
    sage: x
    x
objgens(...)
File: sage/structure/parent_gens.pyx (starting at line 231)
 
Return self and the generators of self as a tuple.
 
INPUT:
    names -- tuple or string
 
OUTPUT:
    self  -- this object
    tuple -- gens()
 
EXAMPLES:
    sage: R, vars = MPolynomialRing(QQ,3, 'x').objgens()
    sage: R
    Multivariate Polynomial Ring in x0, x1, x2 over Rational Field
    sage: vars
    (x0, x1, x2)
variable_name(...)
File: sage/structure/parent_gens.pyx (starting at line 402)
variable_names(...)
File: sage/structure/parent_gens.pyx (starting at line 374)

Methods inherited from sage.structure.parent_base.ParentWithBase:
Hom(...)
File: sage/structure/parent_base.pyx (starting at line 360)
 
Hom(codomain, cat=None):
 
Return the homspace \code{Hom(self, codomain, cat)} of all
homomorphisms from self to codomain in the category cat.  The
default category is \code{category()}.
 
EXAMPLES:
    sage: R.<x,y> = PolynomialRing(QQ, 2)
    sage: R.Hom(QQ)
    Set of Homomorphisms from Multivariate Polynomial Ring in x, y over Rational Field to Rational Field
 
Homspaces are defined for very general \sage objects, even elements of familiar rings.
    sage: n = 5; Hom(n,7)
    Set of Morphisms from 5 to 7 in Category of elements of Integer Ring
    sage: z=(2/3); Hom(z,8/1)
    Set of Morphisms from 2/3 to 8 in Category of elements of Rational Field
 
This example illustrates the optional third argument:
    sage: QQ.Hom(ZZ, Sets())
    Set of Morphisms from Rational Field to Integer Ring in Category of sets
base(...)
File: sage/structure/parent_base.pyx (starting at line 75)
base_extend(...)
File: sage/structure/parent_base.pyx (starting at line 71)
base_extend_canonical(...)
File: sage/structure/parent_base.pyx (starting at line 79)
 
Returns canonical base extension.
NOTE: this function should not be extended.
AUTHOR: Gonzalo Tornaria (2007-06-20)
base_extend_canonical_sym(...)
File: sage/structure/parent_base.pyx (starting at line 264)
 
Symmetric version of base_extend_canonical()
NOTE: this function should not be extended.
AUTHOR: Gonzalo Tornaria (2007-06-20)
base_extend_recursive(...)
File: sage/structure/parent_base.pyx (starting at line 305)
 
Returns recursive base extension.
NOTE: this function should not be extended.
AUTHOR: Gonzalo Tornaria (2007-06-20)
base_ring(...)
File: sage/structure/parent_base.pyx (starting at line 67)

Methods inherited from sage.structure.parent.Parent:
coerce_map_from(...)
File: sage/structure/parent.pyx (starting at line 131)
coerce_map_from_impl(...)
File: sage/structure/parent.pyx (starting at line 165)
construction(...)
File: sage/structure/parent.pyx (starting at line 335)
 
Returns a pair (functor, parent) such that functor(parent) return self. 
If this ring does not have a functorial construction, return None.
get_action(...)
File: sage/structure/parent.pyx (starting at line 197)
get_action_impl(...)
File: sage/structure/parent.pyx (starting at line 218)
has_coerce_map_from(...)
File: sage/structure/parent.pyx (starting at line 418)
has_coerce_map_from_impl(...)
File: sage/structure/parent.pyx (starting at line 442)
init_coerce(...)
File: sage/structure/parent.pyx (starting at line 87)

Methods inherited from sage.structure.sage_object.SageObject:
__repr__(...)
File: sage/structure/sage_object.pyx (starting at line 83)
db(...)
File: sage/structure/sage_object.pyx (starting at line 166)
 
Dumps self into the SAGE database.  Use db(name) by itself to
reload.  
 
The database directory is \code{\$HOME/.sage/db}
dump(...)
File: sage/structure/sage_object.pyx (starting at line 147)
 
Same as save(filename, compress)
dumps(...)
File: sage/structure/sage_object.pyx (starting at line 153)
 
Dump self to a string s, which can later be reconstituted
as self using loads(s).
plot(...)
File: sage/structure/sage_object.pyx (starting at line 90)
rename(...)
File: sage/structure/sage_object.pyx (starting at line 31)
 
Change self so it prints as x, where x is a string.
 
\note{This is \emph{only} supported for Python classes that derive
from SageObject.}
 
EXAMPLES:
    sage: x = PolynomialRing(QQ,'x').gen()
    sage: g = x^3 + x - 5
    sage: g
    x^3 + x - 5
    sage: g.rename('a polynomial')
    sage: g
    a polynomial
    sage: g + x
    x^3 + 2*x - 5
    sage: h = g^100
    sage: str(h)[:20]
    'x^300 + 100*x^298 - '
    sage: h.rename('x^300 + ...')
    sage: h
    x^300 + ...
 
Real numbers are not Python classes, so rename is not supported:
    sage: a = 3.14
    sage: type(a)
    <type 'sage.rings.real_mpfr.RealNumber'>
    sage: a.rename('pi')
    Traceback (most recent call last):
    ...
    NotImplementedError: object does not support renaming: 3.14000000000000
 
\note{The reason C-extension types are not supported is if
they were then every single one would have to carry around an
extra attribute, which would be slower and waste a lot of
memory.}
reset_name(...)
File: sage/structure/sage_object.pyx (starting at line 78)
save(...)
File: sage/structure/sage_object.pyx (starting at line 125)
 
Save self to the given filename.
 
EXAMPLES:
    sage: f = x^3 + 5
    sage: f.save(SAGE_TMP + '/file')
    sage: load(SAGE_TMP + '/file.sobj')
    x^3 + 5
version(...)
File: sage/structure/sage_object.pyx (starting at line 108)
 
The version of \sage.
 
Call this to save the version of \sage in this object.
If you then save and load this object it will know in what
version of \sage it was created.
 
This only works on Python classes that derive from SageObject.

 
class quad_module_element(sage.structure.element.AdditiveGroupElement)
    Describes an element of a quadratic module.
(Code partly grabbed from sage.structure.element.AbelianGroupElement.)
 
EXAMPLES
    sage: p = fqmodule([3,3])
    sage: g0,g1 = p.gens()
    sage: x = g0 + g1*5; x
    g0 + g1*5
    sage: -x
    g0*5 + g1
    sage: x*1001 + g1
    g0*5 + g1*2
    sage: p.Q(x)
    1/6
 
 
Method resolution order:
quad_module_element
sage.structure.element.AdditiveGroupElement
sage.structure.element.ModuleElement
sage.structure.element.Element
sage.structure.sage_object.SageObject
__builtin__.object

Methods defined here:
__cmp__(self, other)
__init__(self, phi, x)
Create the element of the quad_module phi whose coordinates
are given by the list x (or the zero element if $x=0$)
 
EXAMPLES
    sage: q = fqmodule( [2,4])
    sage: x = quad_module_element( q, [1,1])
    sage: x
    g0 + g1
__mul__(self, _n)
requires that len(invs) = n
__neg__(self)
__sub__(self, x)
class_repr(self)
Express this element as vector representing its residue class in
$\ZZ^n/M\ZZ^n$, where $M$ is the matrix used for creating the parent.
 
REMARK
    We return the unique representative in the fundamental mesh given by
    $0 \le x \le M(1,1,\dots,1)^t$.
dot(self, h)
list(self)
norm(self)
order(self)
Returns the order of this element.
 
EXAMPLE

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from sage.structure.element.AdditiveGroupElement:
__invert__(...)
File: sage/structure/element.pyx (starting at line 1159)

Data and other attributes inherited from sage.structure.element.AdditiveGroupElement:
__new__ = <built-in method __new__ of type object at 0x2b5090169500>
T.__new__(S, ...) -> a new object with type S, a subtype of T
__pyx_vtable__ = <PyCObject object at 0x2b5088f4ea58>

Methods inherited from sage.structure.element.ModuleElement:
__add__(...)
File: sage/structure/element.pyx (starting at line 691)
 
Top-level addition operator for ModuleElements.
 
See extensive documentation at the top of element.pyx.
__iadd__(...)
File: sage/structure/element.pyx (starting at line 754)
__imul__(...)
File: sage/structure/element.pyx (starting at line 897)
__isub__(...)
File: sage/structure/element.pyx (starting at line 825)
__radd__(...)
x.__radd__(y) <==> y+x
__rmul__(...)
x.__rmul__(y) <==> y*x
__rsub__(...)
x.__rsub__(y) <==> y-x
additive_order(...)
File: sage/structure/element.pyx (starting at line 1049)
 
Return the additive order of self.

Methods inherited from sage.structure.element.Element:
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__le__(...)
x.__le__(y) <==> x<=y
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__nonzero__(...)
x.__nonzero__() <==> x != 0
__reduce__(...)
File: sage/structure/element.pyx (starting at line 294)
__rxor__(...)
x.__rxor__(y) <==> y^x
__xor__(...)
File: sage/structure/element.pyx (starting at line 474)
base_base_extend(...)
File: sage/structure/element.pyx (starting at line 322)
base_base_extend_canonical_sym(...)
File: sage/structure/element.pyx (starting at line 357)
base_extend(...)
File: sage/structure/element.pyx (starting at line 319)
base_extend_canonical(...)
File: sage/structure/element.pyx (starting at line 339)
base_extend_canonical_sym(...)
File: sage/structure/element.pyx (starting at line 348)
base_extend_recursive(...)
File: sage/structure/element.pyx (starting at line 331)
base_ring(...)
File: sage/structure/element.pyx (starting at line 360)
 
Returns the base ring of this element's parent (if that makes sense).
category(...)
File: sage/structure/element.pyx (starting at line 366)
is_zero(...)
File: sage/structure/element.pyx (starting at line 519)
 
Return True if self equals parent()(0). The default
implementation is to fall back to 'not self.__nonzero__'.
 
NOTE: Do not re-implement this method in your subclass but
implement __nonzero__ instead.
n(...)
File: sage/structure/element.pyx (starting at line 427)
 
Return a numerical approximation of x with at least prec bits of
precision.
 
EXAMPLES:
    sage: (2/3).n()
    0.666666666666667
    sage: a = 2/3
    sage: pi.n(digits=10)
    3.141592654
    sage: pi.n(prec=20)   # 20 bits
    3.1416
parent(...)
File: sage/structure/element.pyx (starting at line 370)
 
Returns parent of this element; or, if the optional argument x is
supplied, the result of coercing x into the parent of this element.
subs(...)
File: sage/structure/element.pyx (starting at line 381)
 
Substitutes given generators with given values while not touching 
other generators. This is a generic wrapper around __call__.
The syntax is meant to be compatible with the corresponding method
for symbolic expressions.
 
INPUT:
    in_dict -- (optional) dictionary of inputs
    **kwds  -- named parameters
 
OUTPUT:
    new object if substitution is possible, otherwise self.
 
EXAMPLES:
    sage: x, y = MPolynomialRing(ZZ,2,'xy').gens()  
    sage: f = x^2 + y + x^2*y^2 + 5
    sage: f((5,y))
    25*y^2 + y + 30
    sage: f.subs({x:5})
    25*y^2 + y + 30
    sage: f.subs(x=5)
    25*y^2 + y + 30
    sage: (1/f).subs(x=5)
    1/(25*y^2 + y + 30)
    sage: Integer(5).subs(x=4)
    5
substitute(...)
File: sage/structure/element.pyx (starting at line 444)
 
This is an alias for subs().
 
INPUT:
    in_dict -- (optional) dictionary of inputs
    **kwds  -- named parameters
 
OUTPUT:
    new object if substitution is possible, otherwise self.
 
EXAMPLES:
    sage: x, y = MPolynomialRing(ZZ,2,'xy').gens()  
    sage: f = x^2 + y + x^2*y^2 + 5
    sage: f((5,y))
    25*y^2 + y + 30
    sage: f.substitute({x:5})
    25*y^2 + y + 30
    sage: f.substitute(x=5)
    25*y^2 + y + 30
    sage: (1/f).substitute(x=5)
    1/(25*y^2 + y + 30)
    sage: Integer(5).substitute(x=4)
    5

Methods inherited from sage.structure.sage_object.SageObject:
__repr__(...)
File: sage/structure/sage_object.pyx (starting at line 83)
db(...)
File: sage/structure/sage_object.pyx (starting at line 166)
 
Dumps self into the SAGE database.  Use db(name) by itself to
reload.  
 
The database directory is \code{\$HOME/.sage/db}
dump(...)
File: sage/structure/sage_object.pyx (starting at line 147)
 
Same as save(filename, compress)
dumps(...)
File: sage/structure/sage_object.pyx (starting at line 153)
 
Dump self to a string s, which can later be reconstituted
as self using loads(s).
plot(...)
File: sage/structure/sage_object.pyx (starting at line 90)
rename(...)
File: sage/structure/sage_object.pyx (starting at line 31)
 
Change self so it prints as x, where x is a string.
 
\note{This is \emph{only} supported for Python classes that derive
from SageObject.}
 
EXAMPLES:
    sage: x = PolynomialRing(QQ,'x').gen()
    sage: g = x^3 + x - 5
    sage: g
    x^3 + x - 5
    sage: g.rename('a polynomial')
    sage: g
    a polynomial
    sage: g + x
    x^3 + 2*x - 5
    sage: h = g^100
    sage: str(h)[:20]
    'x^300 + 100*x^298 - '
    sage: h.rename('x^300 + ...')
    sage: h
    x^300 + ...
 
Real numbers are not Python classes, so rename is not supported:
    sage: a = 3.14
    sage: type(a)
    <type 'sage.rings.real_mpfr.RealNumber'>
    sage: a.rename('pi')
    Traceback (most recent call last):
    ...
    NotImplementedError: object does not support renaming: 3.14000000000000
 
\note{The reason C-extension types are not supported is if
they were then every single one would have to carry around an
extra attribute, which would be slower and waste a lot of
memory.}
reset_name(...)
File: sage/structure/sage_object.pyx (starting at line 78)
save(...)
File: sage/structure/sage_object.pyx (starting at line 125)
 
Save self to the given filename.
 
EXAMPLES:
    sage: f = x^3 + 5
    sage: f.save(SAGE_TMP + '/file')
    sage: load(SAGE_TMP + '/file.sobj')
    x^3 + 5
version(...)
File: sage/structure/sage_object.pyx (starting at line 108)
 
The version of \sage.
 
Call this to save the version of \sage in this object.
If you then save and load this object it will know in what
version of \sage it was created.
 
This only works on Python classes that derive from SageObject.

 
class quad_module_subgroup(sage.groups.group.AbelianGroup)
    A subgroup of the underlying group of an ambient quadratic
module.
 
 
EXAMPLES
    sage: p=fqmodule([2,3,10])
    sage: U = quad_module_subgroup( [p.0*30])
    sage: U.is_isotropic()
    True
    sage: p1 = U.quotient(); p1
    Finite quadratic module ([30, 2, 2], 7/30*x0^2 + 1/2*x0*x1 + 1/2*x1^2 + 1/4*x2^2)
 
    sage: V = p1( matrix( ZZ, 3, 2, range(6))); V
    Subgroup generated by [g0 + g1 + g2] of  Finite quadratic module ([30, 2, 2], 7/30*x0^2 + 1/2*x0*x1 + 1/2*x1^2 + 1/4*x2^2) with generators (g0, g1, g2)
    W = V.dual(); W
    Subgroup generated by [g0*15 + g2, g1 + g2] of  Finite quadratic module ([30, 2, 2], 7/30*x0^2 + 1/2*x0*x1 + 1/2*x1^2 + 1/4*x2^2) with generators (g0, g1, g2)
    V.order(), W.order(), p1.order()
    sage: V.order(), W.order(), p1.order()
    (30, 4, 120)
 
 
Method resolution order:
quad_module_subgroup
sage.groups.group.AbelianGroup
sage.groups.group.Group
sage.structure.parent_gens.ParentWithGens
sage.structure.parent_base.ParentWithBase
sage.structure.parent.Parent
sage.structure.sage_object.SageObject
__builtin__.object

Methods defined here:
__add__(self, other)
__eq__(self, other)
__ge__(self, other)
__gt__(self, other)
__init__(self, gens)
Construct the subgroup generated by the list gens of
elements of the quadratic module ambient.
__le__(self, other)
__lt__(self, other)
__ne__(self, other)
__repr__(self)
ambient_quad_module(self)
divides(self, B)
Return True, if self divides B.
dual(self)
hnfGens(self)
is_isotropic(self)
order(self)
quotient(self)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from sage.groups.group.AbelianGroup:
is_abelian(...)
File: sage/groups/group.pyx (starting at line 114)
 
Return True.

Data and other attributes inherited from sage.groups.group.AbelianGroup:
__new__ = <built-in method __new__ of type object at 0x2b509a8a4100>
T.__new__(S, ...) -> a new object with type S, a subtype of T
__pyx_vtable__ = <PyCObject object at 0xa9dbe8>

Methods inherited from sage.groups.group.Group:
__call__(...)
File: sage/groups/group.pyx (starting at line 37)
 
Coerce x into this group.
__contains__(...)
x.__contains__(y) <==> y in x
__hash__(...)
x.__hash__() <==> hash(x)
category(...)
File: sage/groups/group.pyx (starting at line 53)
 
The category of all groups
is_atomic_repr(...)
File: sage/groups/group.pyx (starting at line 60)
 
True if the elements of this group have atomic string
representations.  For example, integers are atomic but
polynomials are not.
is_finite(...)
File: sage/groups/group.pyx (starting at line 81)
 
Returns True if this group is finite.
is_multiplicative(...)
File: sage/groups/group.pyx (starting at line 87)
 
Returns True if the group operation is given by * (rather than +).
 
Override for additive groups.
random_element(...)
File: sage/groups/group.pyx (starting at line 98)
 
Return a random element of this group.

Methods inherited from sage.structure.parent_gens.ParentWithGens:
__getitem__(...)
File: sage/structure/parent_gens.pyx (starting at line 211)
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__getstate__(...)
File: sage/structure/parent_gens.pyx (starting at line 413)
__len__(...)
x.__len__() <==> len(x)
__setstate__(...)
File: sage/structure/parent_gens.pyx (starting at line 433)
gen(...)
File: sage/structure/parent_gens.pyx (starting at line 208)
gens(...)
File: sage/structure/parent_gens.pyx (starting at line 271)
 
Return a tuple whose entries are the generators for this
object, in order.
gens_dict(...)
File: sage/structure/parent_gens.pyx (starting at line 287)
 
Return a dictionary whose entries are \code{{var_name:variable,...}}.
hom(...)
File: sage/structure/parent_gens.pyx (starting at line 462)
 
Return the unique homomorphism from self to codomain that
sends \code{gens()} to the entries of \code{im_gens}.
Raises a TypeError if there is no such homomorphism.
 
INPUT:
    im_gens -- the images in the codomain of the generators of
               this object under the homomorphism
    codomain -- the codomain of the homomorphism
    check -- whether to verify that the images of generators extend
             to define a map (using only canonical coercisions).
 
OUTPUT:
    a homomorphism self --> codomain
 
\note{As a shortcut, one can also give an object X instead of
\code{im_gens}, in which case return the (if it exists)
natural map to X.}
 
EXAMPLE: Polynomial Ring
We first illustrate construction of a few homomorphisms
involving a polynomial ring.
 
    sage: R.<x> = PolynomialRing(ZZ)
    sage: f = R.hom([5], QQ)
    sage: f(x^2 - 19)
    6
 
    sage: R.<x> = PolynomialRing(QQ)
    sage: f = R.hom([5], GF(7))
    Traceback (most recent call last):
    ...
    TypeError: images do not define a valid homomorphism
 
    sage: R.<x> = PolynomialRing(GF(7))
    sage: f = R.hom([3], GF(49,'a'))
    sage: f
    Ring morphism:
      From: Univariate Polynomial Ring in x over Finite Field of size 7
      To:   Finite Field in a of size 7^2
      Defn: x |--> 3
    sage: f(x+6)
    2
    sage: f(x^2+1)
    3
 
EXAMPLE: Natural morphism
    sage: f = ZZ.hom(GF(5))
    sage: f(7)
    2
    sage: f
    Ring Coercion morphism:
      From: Integer Ring
      To:   Finite Field of size 5
 
There might not be a natural morphism, in which case a TypeError exception is raised. 
    sage: QQ.hom(ZZ)
    Traceback (most recent call last):
    ...
    TypeError: Natural coercion morphism from Rational Field to Integer Ring not defined.
inject_variables(...)
File: sage/structure/parent_gens.pyx (starting at line 333)
 
Inject the generators of self with their names into the
namespace of the Python code from which this function is
called.  Thus, e.g., if the generators of self are labeled
'a', 'b', and 'c', then after calling this method the
variables a, b, and c in the current scope will be set
equal to the generators of self.
 
NOTE: If Foo is a constructor for a SAGE object with
generators, and Foo is defined in Pyrex, then it would
typically call inject_variables() on the object it
creates.  E.g., PolyomialRing(QQ, 'y') does this so that the
variable y is the generator of the polynomial ring.
injvar(...)
File: sage/structure/parent_gens.pyx (starting at line 358)
 
This is a synonym for inject_variables(...)
<<<sage.structure.parent_gens.ParentWithGens.inject_variables>>>
latex_name(...)
File: sage/structure/parent_gens.pyx (starting at line 405)
latex_variable_names(...)
File: sage/structure/parent_gens.pyx (starting at line 379)
 
Returns the list of variable names suitable for latex output.
 
All '_SOMETHING' substrings are replaced by '_{SOMETHING}' recursively
so that subscripts of subscripts work.
 
EXAMPLES:
    sage: R, x = PolynomialRing(QQ,'x',12).objgens()
    sage: x
    (x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11)
    sage: print R.latex_variable_names ()
    ['x_{0}', 'x_{1}', 'x_{2}', 'x_{3}', 'x_{4}', 'x_{5}', 'x_{6}', 'x_{7}', 'x_{8}', 'x_{9}', 'x_{10}', 'x_{11}']
    sage: f = x[0]^3 + 15/3 * x[1]^10
    sage: print latex(f)
    5 x_{1}^{10} + x_{0}^{3}
list(...)
File: sage/structure/parent_gens.pyx (starting at line 220)
 
Return a list of all elements in this object, if possible (the
object must define an iterator).
ngens(...)
File: sage/structure/parent_gens.pyx (starting at line 204)
objgen(...)
File: sage/structure/parent_gens.pyx (starting at line 251)
 
Return self and the generator of self.
 
INPUT:
    names -- tuple or string
 
OUTPUT:
    self  -- this object
    an object -- gen()
 
EXAMPLES:
    sage: R, x = PolynomialRing(QQ,'x').objgen()
    sage: R
    Univariate Polynomial Ring in x over Rational Field
    sage: x
    x
objgens(...)
File: sage/structure/parent_gens.pyx (starting at line 231)
 
Return self and the generators of self as a tuple.
 
INPUT:
    names -- tuple or string
 
OUTPUT:
    self  -- this object
    tuple -- gens()
 
EXAMPLES:
    sage: R, vars = MPolynomialRing(QQ,3, 'x').objgens()
    sage: R
    Multivariate Polynomial Ring in x0, x1, x2 over Rational Field
    sage: vars
    (x0, x1, x2)
variable_name(...)
File: sage/structure/parent_gens.pyx (starting at line 402)
variable_names(...)
File: sage/structure/parent_gens.pyx (starting at line 374)

Methods inherited from sage.structure.parent_base.ParentWithBase:
Hom(...)
File: sage/structure/parent_base.pyx (starting at line 360)
 
Hom(codomain, cat=None):
 
Return the homspace \code{Hom(self, codomain, cat)} of all
homomorphisms from self to codomain in the category cat.  The
default category is \code{category()}.
 
EXAMPLES:
    sage: R.<x,y> = PolynomialRing(QQ, 2)
    sage: R.Hom(QQ)
    Set of Homomorphisms from Multivariate Polynomial Ring in x, y over Rational Field to Rational Field
 
Homspaces are defined for very general \sage objects, even elements of familiar rings.
    sage: n = 5; Hom(n,7)
    Set of Morphisms from 5 to 7 in Category of elements of Integer Ring
    sage: z=(2/3); Hom(z,8/1)
    Set of Morphisms from 2/3 to 8 in Category of elements of Rational Field
 
This example illustrates the optional third argument:
    sage: QQ.Hom(ZZ, Sets())
    Set of Morphisms from Rational Field to Integer Ring in Category of sets
base(...)
File: sage/structure/parent_base.pyx (starting at line 75)
base_extend(...)
File: sage/structure/parent_base.pyx (starting at line 71)
base_extend_canonical(...)
File: sage/structure/parent_base.pyx (starting at line 79)
 
Returns canonical base extension.
NOTE: this function should not be extended.
AUTHOR: Gonzalo Tornaria (2007-06-20)
base_extend_canonical_sym(...)
File: sage/structure/parent_base.pyx (starting at line 264)
 
Symmetric version of base_extend_canonical()
NOTE: this function should not be extended.
AUTHOR: Gonzalo Tornaria (2007-06-20)
base_extend_recursive(...)
File: sage/structure/parent_base.pyx (starting at line 305)
 
Returns recursive base extension.
NOTE: this function should not be extended.
AUTHOR: Gonzalo Tornaria (2007-06-20)
base_ring(...)
File: sage/structure/parent_base.pyx (starting at line 67)

Methods inherited from sage.structure.parent.Parent:
coerce_map_from(...)
File: sage/structure/parent.pyx (starting at line 131)
coerce_map_from_impl(...)
File: sage/structure/parent.pyx (starting at line 165)
construction(...)
File: sage/structure/parent.pyx (starting at line 335)
 
Returns a pair (functor, parent) such that functor(parent) return self. 
If this ring does not have a functorial construction, return None.
get_action(...)
File: sage/structure/parent.pyx (starting at line 197)
get_action_impl(...)
File: sage/structure/parent.pyx (starting at line 218)
has_coerce_map_from(...)
File: sage/structure/parent.pyx (starting at line 418)
has_coerce_map_from_impl(...)
File: sage/structure/parent.pyx (starting at line 442)
init_coerce(...)
File: sage/structure/parent.pyx (starting at line 87)

Methods inherited from sage.structure.sage_object.SageObject:
db(...)
File: sage/structure/sage_object.pyx (starting at line 166)
 
Dumps self into the SAGE database.  Use db(name) by itself to
reload.  
 
The database directory is \code{\$HOME/.sage/db}
dump(...)
File: sage/structure/sage_object.pyx (starting at line 147)
 
Same as save(filename, compress)
dumps(...)
File: sage/structure/sage_object.pyx (starting at line 153)
 
Dump self to a string s, which can later be reconstituted
as self using loads(s).
plot(...)
File: sage/structure/sage_object.pyx (starting at line 90)
rename(...)
File: sage/structure/sage_object.pyx (starting at line 31)
 
Change self so it prints as x, where x is a string.
 
\note{This is \emph{only} supported for Python classes that derive
from SageObject.}
 
EXAMPLES:
    sage: x = PolynomialRing(QQ,'x').gen()
    sage: g = x^3 + x - 5
    sage: g
    x^3 + x - 5
    sage: g.rename('a polynomial')
    sage: g
    a polynomial
    sage: g + x
    x^3 + 2*x - 5
    sage: h = g^100
    sage: str(h)[:20]
    'x^300 + 100*x^298 - '
    sage: h.rename('x^300 + ...')
    sage: h
    x^300 + ...
 
Real numbers are not Python classes, so rename is not supported:
    sage: a = 3.14
    sage: type(a)
    <type 'sage.rings.real_mpfr.RealNumber'>
    sage: a.rename('pi')
    Traceback (most recent call last):
    ...
    NotImplementedError: object does not support renaming: 3.14000000000000
 
\note{The reason C-extension types are not supported is if
they were then every single one would have to carry around an
extra attribute, which would be slower and waste a lot of
memory.}
reset_name(...)
File: sage/structure/sage_object.pyx (starting at line 78)
save(...)
File: sage/structure/sage_object.pyx (starting at line 125)
 
Save self to the given filename.
 
EXAMPLES:
    sage: f = x^3 + 5
    sage: f.save(SAGE_TMP + '/file')
    sage: load(SAGE_TMP + '/file.sobj')
    x^3 + 5
version(...)
File: sage/structure/sage_object.pyx (starting at line 108)
 
The version of \sage.
 
Call this to save the version of \sage in this object.
If you then save and load this object it will know in what
version of \sage it was created.
 
This only works on Python classes that derive from SageObject.

 
class quad_module_subgroup_container(sage.structure.sage_object.SageObject)
    A container class, which contains subgroups of a quad_module.
 
Access by different methods is possible.
 
EXAMPLES:
EXAMPLES:
    sage: T= fqmodule([6,3] )
    sage: C=T.enumerate_subgroups()
    sage: type(C)
    <class '__main__.quad_module_subgroup_container'>
    sage: U=C.get_sub_groups_with_det(6)[1]
    sage: C.get_subgroups_dividing(U)
 
    [Subgroup generated by [g0, g1] of the Finite quadratic module ([12, 6], 1/24*x0^2 + 1/12*x1^2) with generators (g0, g1).,
    Subgroup generated by [g0 + g1, g1*2] of the Finite quadratic module ([12, 6], 1/24*x0^2 + 1/12*x1^2) with generators (g0, g1).,
    Subgroup generated by [g0 + g1, g1*3] of the Finite quadratic module ([12, 6], 1/24*x0^2 + 1/12*x1^2) with generators (g0, g1).,
    Subgroup generated by [g0 + g1] of the Finite quadratic module ([12, 6], 1/24*x0^2 + 1/12*x1^2) with generators (g0, g1).]
 
 
Method resolution order:
quad_module_subgroup_container
sage.structure.sage_object.SageObject
__builtin__.object

Methods defined here:
__init__(self, ambient, subgroupGenerator)
Initialize Container with a generator or a list of the subgroups of ambient.
 
INPUT:
    ambient -- <quad_module> The quadratic module whose subgroups are given by the list L.
    subgroupGenerator -- <generator or list>   the subgroups.
 
EXAMPLES:
__iter__(self)
__repr__(self)
debug(self)
get_sub_groups_with_det(self, d=None)
Return a list of subgroups with determinant d.
 
INPUT:
    d -- integer (default: None) the determinant.
OUTPUT:
    list or dictionary -- If d is ommitted return a dictionary D
                          with D[d] contains the list of subgroups
                          with determinant d.
                          Returns an empty list, if there is no
                          subgroup with determinant d.
get_subgroups_divided_by(self, H)
Return a list of subgroups divided by H.
 
INPUT:
    H -- quad_module_subgroup the dividing subgroup.
 
OUTPUT:
    list -- a list of quad_module_subgroup
get_subgroups_dividing(self, H)
Return a list of subgroups dividing H.
 
INPUT:
    H -- quad_module_subgroup the subgroup, which should be divided by the output.
 
 
OUTPUT:
    list -- a list of quad_module_subgroup

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from sage.structure.sage_object.SageObject:
__hash__(...)
x.__hash__() <==> hash(x)
category(...)
File: sage/structure/sage_object.pyx (starting at line 195)
db(...)
File: sage/structure/sage_object.pyx (starting at line 166)
 
Dumps self into the SAGE database.  Use db(name) by itself to
reload.  
 
The database directory is \code{\$HOME/.sage/db}
dump(...)
File: sage/structure/sage_object.pyx (starting at line 147)
 
Same as save(filename, compress)
dumps(...)
File: sage/structure/sage_object.pyx (starting at line 153)
 
Dump self to a string s, which can later be reconstituted
as self using loads(s).
plot(...)
File: sage/structure/sage_object.pyx (starting at line 90)
rename(...)
File: sage/structure/sage_object.pyx (starting at line 31)
 
Change self so it prints as x, where x is a string.
 
\note{This is \emph{only} supported for Python classes that derive
from SageObject.}
 
EXAMPLES:
    sage: x = PolynomialRing(QQ,'x').gen()
    sage: g = x^3 + x - 5
    sage: g
    x^3 + x - 5
    sage: g.rename('a polynomial')
    sage: g
    a polynomial
    sage: g + x
    x^3 + 2*x - 5
    sage: h = g^100
    sage: str(h)[:20]
    'x^300 + 100*x^298 - '
    sage: h.rename('x^300 + ...')
    sage: h
    x^300 + ...
 
Real numbers are not Python classes, so rename is not supported:
    sage: a = 3.14
    sage: type(a)
    <type 'sage.rings.real_mpfr.RealNumber'>
    sage: a.rename('pi')
    Traceback (most recent call last):
    ...
    NotImplementedError: object does not support renaming: 3.14000000000000
 
\note{The reason C-extension types are not supported is if
they were then every single one would have to carry around an
extra attribute, which would be slower and waste a lot of
memory.}
reset_name(...)
File: sage/structure/sage_object.pyx (starting at line 78)
save(...)
File: sage/structure/sage_object.pyx (starting at line 125)
 
Save self to the given filename.
 
EXAMPLES:
    sage: f = x^3 + 5
    sage: f.save(SAGE_TMP + '/file')
    sage: load(SAGE_TMP + '/file.sobj')
    x^3 + 5
version(...)
File: sage/structure/sage_object.pyx (starting at line 108)
 
The version of \sage.
 
Call this to save the version of \sage in this object.
If you then save and load this object it will know in what
version of \sage it was created.
 
This only works on Python classes that derive from SageObject.

Data and other attributes inherited from sage.structure.sage_object.SageObject:
__new__ = <built-in method __new__ of type object at 0x2b508d175b60>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
Functions
       
ComplexDoubleField(...)
File: sage/rings/complex_double.pyx (starting at line 1590)
 
Returns the field of double precision complex numbers.
 
EXAMPLE:
    sage: ComplexDoubleField()
    Complex Double Field
    sage: ComplexDoubleField() is CDF
    True
ComplexNumber = create_ComplexNumber(...)
File: sage/rings/complex_number.pyx (starting at line 889)
 
Return the complex number defined by the strings s_real and s_imag as an element of
\code{ComplexField(prec=n)}, where n potentially has slightly more
(controlled by pad) bits than given by s.
 
INPUT:
    s_real -- a string that defines a real number (or something whose
              string representation defines a number)
    s_imag -- a string that defines a real number (or something whose
              string representation defines a number)             
    pad -- an integer >= 0.
    min_prec -- number will have at least this many bits of precision, no matter what.
 
EXAMPLES:
    sage: ComplexNumber('2.3')
    2.30000000000000
    sage: ComplexNumber('2.3','1.1')
    2.30000000000000 + 1.10000000000000*I
    sage: ComplexNumber(10)
    10.0000000000000
    sage: ComplexNumber(10,10)
    10.0000000000000 + 10.0000000000000*I
    sage: ComplexNumber(1.000000000000000000000000000,2)
    1.000000000000000000000000000 + 2.000000000000000000000000000*I
    sage: ComplexNumber(1,2.000000000000000000000)
    1.000000000000000000000 + 2.000000000000000000000*I
DWT = WaveletTransform(...)
File: sage/gsl/dwt.pyx (starting at line 33)
 
This function initializes an GSLDoubleArray of length n which
can perform a discrete wavelet transform. 
 
INPUT:
    n --  a power of 2.
    T -- the data in the GSLDoubleArray must be real. 
    wavelet_type -- the name of the type of wavelet, 
                    valid choices are: 
                     'daubechies','daubechies_centered',
                     'haar','haar_centered','bspline', and 
                     'bspline_centered'. 
 
For daubechies wavelets, wavelet_k specifies a daubechie wavelet 
with k/2 vanishing moments. k = 4,6,...,20 for k even are the 
only ones implemented. 
For Haar wavelets, wavelet_k must be 2. 
For bspline wavelets, wavelet_k = 103,105,202,204,206,208,301,305,
307,309 will give biorthogonal B-spline wavelets of order (i,j) where
wavelet_k=100*i+j. 
The wavelet transfrom uses J=log_2(n) levels.
 
OUTPUT:
    An array of the form 
     (s_{-1,0},d_{0,0},d_{1,0},d_{1,1}, d_{2,0}...,d_{J-1,2^{J-1}-1}) 
    for d_{j,k} the detail coefficients of level j.
    The centered forms align the coefficients of the sub-bands on edges.
 
EXAMPLES:
    sage: a = WaveletTransform(128,'daubechies',4)
    sage: for i in range(1, 11):
    ...    a[i] = 1
    ...    a[128-i] = 1
    sage: a.plot().show(ymin=0)
    sage: a.forward_transform()
    sage: a.plot().show()
    sage: a = WaveletTransform(128,'haar',2)
    sage: for i in range(1, 11): a[i] = 1; a[128-i] = 1
    sage: a.forward_transform()
    sage: a.plot().show(ymin=0)
    sage: a = WaveletTransform(128,'bspline_centered',103)
    sage: for i in range(1, 11): a[i] = 1; a[100+i] = 1
    sage: a.forward_transform()
    sage: a.plot().show(ymin=0)
 
This example gives a simple example of wavelet compression.
    sage: a = DWT(2048,'daubechies',6)
    sage: for i in range(2048): a[i]=float(sin((i*5/2048)**2))
    sage: a.plot().show()
    sage: a.forward_transform()
    sage: for i in range(1800): a[2048-i-1] = 0
    sage: a.backward_transform()
    sage: a.plot().show()
FFT = FastFourierTransform(...)
File: sage/gsl/fft.pyx (starting at line 34)
 
EXAMPLES:
    sage: a = FastFourierTransform(128)
    sage: for i in range(1, 11):
    ...    a[i] = 1
    ...    a[128-i] = 1
    sage: a.plot().show(ymin=0)
    sage: a.forward_transform()
    sage: a.plot().show()
FastFourierTransform(...)
File: sage/gsl/fft.pyx (starting at line 34)
 
EXAMPLES:
    sage: a = FastFourierTransform(128)
    sage: for i in range(1, 11):
    ...    a[i] = 1
    ...    a[128-i] = 1
    sage: a.plot().show(ymin=0)
    sage: a.forward_transform()
    sage: a.plot().show()
ForgetfulFunctor(...)
File: sage/categories/functor.pyx (starting at line 135)
 
Construct the forgetful function from one category to another.
 
EXAMPLES:
    sage: rings = Rings()
    sage: abgrps = AbelianGroups()
    sage: F = ForgetfulFunctor(rings, abgrps)
    sage: F
    The forgetful functor from Rings to AbelianGroups
HeilbronnCremonaList(...)
File: sage/modular/modsym/heilbronn.pyx (starting at line 44)
 
The Heilbronn matrices of determinant p, as defined by Cremona.
HeilbronnMerelList(...)
File: sage/modular/modsym/heilbronn.pyx (starting at line 77)
 
Set of Heilbronn matrices of determinant n, as defined by Merel.
IdentityFunctor(...)
File: sage/categories/functor.pyx (starting at line 132)
IntegerMod(...)
File: sage/rings/integer_mod.pyx (starting at line 102)
 
Create an integer modulo $n$ with the given parent.
 
This is mainly for internal use.
IntegerRing(...)
File: sage/rings/integer_ring.pyx (starting at line 646)
Mod(...)
File: sage/rings/integer_mod.pyx (starting at line 75)
 
Return the equivalence class of n modulo m as an element of
$\Z/m\Z$.
 
EXAMPLES:
    sage: x = Mod(12345678, 32098203845329048)
    sage: x
    12345678
    sage: x^100
    1017322209155072
 
You can also use the lowercase version:
    sage: mod(12,5)
    2
PowComputer(...)
File: sage/rings/padics/pow_computer.pyx (starting at line 275)
 
Returns a PowComputer that caches the values $1, m, m^2, \ldots, m^cache_limit$.
 
Once you create a PowComputer, merely call it to get values out.
You can input any integer, even if it's outside of the precomputed range.
 
INPUT:
m -- An integer, the base that you want to exponentiate.
cache_limit -- A positive integer that you want to cache powers up to.
 
EXAMPLES:
sage: PC = PowComputer(3, 5, 10)
sage: PC(4)
81
sage: PC(6)
729
sage: PC(-1)
1/3
RealDoubleField(...)
File: sage/rings/real_double.pyx (starting at line 1517)
RealInterval(...)
File: sage/rings/real_mpfi.pyx (starting at line 2765)
 
Return the real number defined by the string s as an element of
\code{RealIntervalField(prec=n)}, where n potentially has slightly more
(controlled by pad) bits than given by s.
 
INPUT:
    s -- a string that defines a real number (or something whose
         string representation defines a number)
    upper -- (default: None) -- upper endpoint of interval if given, in
         which case s is the lower endpoint. 
    base -- an integer between 2 and 36
    pad -- an integer >= 0.
    min_prec -- number will have at least this many bits of
                precision, no matter what.
 
EXAMPLES:
    sage: RealInterval('2.3')
    [2.2999999999999998 .. 2.3000000000000003]
    sage: RealInterval(10)
    [10.000000000000000 .. 10.000000000000000]
    sage: RealInterval('1.0000000000000000000000000000000000')
    [1.000000000000000000000000000000000000 .. 1.000000000000000000000000000000000000]
    sage: RealInterval(29308290382930840239842390482, 3^20)
    [3486784401.00000000000000000000 .. 29308290382930840239842390482.0]
RealNumber = create_RealNumber(...)
File: sage/rings/real_mpfr.pyx (starting at line 2963)
 
Return the real number defined by the string s as an element of
\code{RealField(prec=n)}, where n potentially has slightly more
(controlled by pad) bits than given by s.
 
INPUT:
    s -- a string that defines a real number (or something whose
         string representation defines a number)
    base -- an integer between 2 and 36
    pad -- an integer >= 0.
    rnd -- rounding mode: RNDN, RNDZ, RNDU, RNDD
    min_prec -- number will have at least this many bits of precision, no matter what.
 
EXAMPLES:
    sage: RealNumber('2.3')
    2.30000000000000
    sage: RealNumber(10)
    10.0000000000000
    sage: RealNumber('1.0000000000000000000000000000000000')
    1.0000000000000000000000000000000000
RealQuadDoubleField(...)
File: sage/rings/real_rqdf.pyx (starting at line 1735)
WaveletTransform(...)
File: sage/gsl/dwt.pyx (starting at line 33)
 
This function initializes an GSLDoubleArray of length n which
can perform a discrete wavelet transform. 
 
INPUT:
    n --  a power of 2.
    T -- the data in the GSLDoubleArray must be real. 
    wavelet_type -- the name of the type of wavelet, 
                    valid choices are: 
                     'daubechies','daubechies_centered',
                     'haar','haar_centered','bspline', and 
                     'bspline_centered'. 
 
For daubechies wavelets, wavelet_k specifies a daubechie wavelet 
with k/2 vanishing moments. k = 4,6,...,20 for k even are the 
only ones implemented. 
For Haar wavelets, wavelet_k must be 2. 
For bspline wavelets, wavelet_k = 103,105,202,204,206,208,301,305,
307,309 will give biorthogonal B-spline wavelets of order (i,j) where
wavelet_k=100*i+j. 
The wavelet transfrom uses J=log_2(n) levels.
 
OUTPUT:
    An array of the form 
     (s_{-1,0},d_{0,0},d_{1,0},d_{1,1}, d_{2,0}...,d_{J-1,2^{J-1}-1}) 
    for d_{j,k} the detail coefficients of level j.
    The centered forms align the coefficients of the sub-bands on edges.
 
EXAMPLES:
    sage: a = WaveletTransform(128,'daubechies',4)
    sage: for i in range(1, 11):
    ...    a[i] = 1
    ...    a[128-i] = 1
    sage: a.plot().show(ymin=0)
    sage: a.forward_transform()
    sage: a.plot().show()
    sage: a = WaveletTransform(128,'haar',2)
    sage: for i in range(1, 11): a[i] = 1; a[128-i] = 1
    sage: a.forward_transform()
    sage: a.plot().show(ymin=0)
    sage: a = WaveletTransform(128,'bspline_centered',103)
    sage: for i in range(1, 11): a[i] = 1; a[100+i] = 1
    sage: a.forward_transform()
    sage: a.plot().show(ymin=0)
 
This example gives a simple example of wavelet compression.
    sage: a = DWT(2048,'daubechies',6)
    sage: for i in range(2048): a[i]=float(sin((i*5/2048)**2))
    sage: a.plot().show()
    sage: a.forward_transform()
    sage: for i in range(1800): a[2048-i-1] = 0
    sage: a.backward_transform()
    sage: a.plot().show()
add = sum(...)
sum(sequence, start=0) -> value
 
Returns the sum of a sequence of numbers (NOT strings) plus the value
of parameter 'start'.  When the sequence is empty, returns start.
allocatemem(...)
File: sage/libs/pari/gen.pyx (starting at line 5943)
 
Double the \emph{PARI} stack.
bernoulli_mod_p(...)
File: sage/rings/bernoulli_mod_p.pyx (starting at line 85)
 
Returns the bernoulli numbers $B_0, B_2, ... B_{p-3}$ modulo $p$.
 
INPUT:
    p -- integer, a prime
 
OUTPUT:
    list -- Bernoulli numbers modulo $p$ as a list
            of integers [B(0), B(2), ... B(p-3)].
 
ALGORITHM:
    Described in accompanying latex file.
 
PERFORMANCE:
    Should be complexity $O(p \log p)$.
 
EXAMPLES:
Check the results against PARI's C-library implemention (that
computes exact rationals) for $p = 37$:
 
    sage: bernoulli_mod_p(37)
     [1, 31, 16, 15, 16, 4, 17, 32, 22, 31, 15, 15, 17, 12, 29, 2, 0, 2]
    sage: [bernoulli(n) % 37 for n in xrange(0, 36, 2)]
     [1, 31, 16, 15, 16, 4, 17, 32, 22, 31, 15, 15, 17, 12, 29, 2, 0, 2]
 
Boundary case:
    sage: bernoulli_mod_p(3)
     [1]
    
AUTHOR:
    -- David Harvey (2006-08-06)
bernoulli_mod_p_single(...)
File: sage/rings/bernoulli_mod_p.pyx (starting at line 211)
 
Returns the bernoulli number $B_k$ mod $p$.
 
INPUT:
    p -- integer, a prime
    k -- even integer in the range $0 \leq k \leq p-3$
 
OUTPUT:
    The $k$-th bernoulli number mod $p$.
 
ALGORITHM:
    Uses the identity
      $$ (1-g^k) B_k/k = 2\sum_{r=1}^{(p-1)/2} g^{r(k-1)} ( [g^r/p] - g [g^(r-1)/p] + (g-1)/2 ), $$
    where $g$ is a primitive root mod $p$, and where square brackets
    denote the fractional part. This identity can be derived from
    Theorem 2.3, chapter 2 of Lang's book "Cyclotomic fields".
 
PERFORMANCE:
    Linear in $p$. In particular the running time doesn't depend on k.
    
    It's much faster than computing *all* bernoulli numbers by using
    bernoulli_mod_p(). For p = 1000003, the latter takes about 3s on my
    laptop, whereas this function takes only 0.06s.
    
    It may or may not be faster than computing literally bernoulli(k) % p,
    depending on how big k and p are relative to each other. For example on
    my laptop, computing bernoulli(2000) % p only takes 0.01s. But
    computing bernoulli(100000) % p takes 40s, whereas this function still
    takes only 0.06s.
 
EXAMPLES:
    sage: bernoulli_mod_p_single(1009, 48)
    628
    sage: bernoulli(48) % 1009
    628
    
    sage: bernoulli_mod_p_single(1, 5)
    Traceback (most recent call last):
    ...
    ValueError: p (=1) must be a prime >= 3
    
    sage: bernoulli_mod_p_single(100, 4)
    Traceback (most recent call last):
    ...
    ValueError: p (=100) must be a prime
    
    sage: bernoulli_mod_p_single(19, 5)
    Traceback (most recent call last):
    ...
    ValueError: k (=5) must be even
    
    sage: bernoulli_mod_p_single(19, 18)
    Traceback (most recent call last):
    ...
    ValueError: k (=18) must be non-negative, and at most p-3
    
    sage: bernoulli_mod_p_single(19, -4)
    Traceback (most recent call last):
    ...
    ValueError: k (=-4) must be non-negative, and at most p-3
 
Check results against bernoulli_mod_p:
 
    sage: bernoulli_mod_p(37)
     [1, 31, 16, 15, 16, 4, 17, 32, 22, 31, 15, 15, 17, 12, 29, 2, 0, 2]
    sage: [bernoulli_mod_p_single(37, n) % 37 for n in xrange(0, 36, 2)]
     [1, 31, 16, 15, 16, 4, 17, 32, 22, 31, 15, 15, 17, 12, 29, 2, 0, 2]
 
    sage: bernoulli_mod_p(31)
     [1, 26, 1, 17, 1, 9, 11, 27, 14, 23, 13, 22, 14, 8, 14]
    sage: [bernoulli_mod_p_single(31, n) % 31 for n in xrange(0, 30, 2)]
     [1, 26, 1, 17, 1, 9, 11, 27, 14, 23, 13, 22, 14, 8, 14]
 
    sage: bernoulli_mod_p(3)
     [1]
    sage: [bernoulli_mod_p_single(3, n) % 3 for n in xrange(0, 2, 2)]
     [1]
 
    sage: bernoulli_mod_p(5)
     [1, 1]
    sage: [bernoulli_mod_p_single(5, n) % 5 for n in xrange(0, 4, 2)]
     [1, 1]
 
    sage: bernoulli_mod_p(7)
     [1, 6, 3]
    sage: [bernoulli_mod_p_single(7, n) % 7 for n in xrange(0, 6, 2)]
     [1, 6, 3]
     
AUTHOR:
    -- David Harvey (2007-08-31)
bin_op(...)
File: sage/structure/element.pyx (starting at line 2643)
canonical_coercion(...)
File: sage/structure/element.pyx (starting at line 2622)
 
canonical_coercion(x,y) is what is called before doing an
arithmetic operation between x and y.  It returns a pair (z,w)
such that z is got from x and w from y via canonical coercion and
the parents of z and w are identical.
 
EXAMPLES:
    sage: A = Matrix([[0,1],[1,0]])
    sage: canonical_coercion(A,1)
    ([0 1]
    [1 0], [1 0]
    [0 1])
clear_vars(...)
File: sage/calculus/var.pyx (starting at line 113)
 
Delete all 1-letter symbolic variables that are predefined at
startup of SAGE.  Any one-letter global variables that are not
symbolic variables are not cleared.
 
EXAMPLES:
    sage: var('x y z')
    (x, y, z)
    sage: (x+y)^z
    (y + x)^z
    sage: k = 15
    sage: clear_vars()
    sage: (x+y)^z
    Traceback (most recent call last):
    ...
    NameError: name 'x' is not defined
    sage: expand((e + i)^2)
    2*e*I + e^2 - 1
    sage: k
    15
crt_basis(...)
File: sage/rings/integer_ring.pyx (starting at line 658)
 
Compute and return a Chinese Remainder Theorem basis for the list
X of coprime integers.
 
INPUT:
    X -- a list of Integers that are coprime in pairs
OUTPUT:
    E -- a list of Integers such that E[i] = 1 (mod X[i])
         and E[i] = 0 (mod X[j]) for all j!=i.
 
The E[i] have the property that if A is a list of objects, e.g.,
integers, vectors, matrices, etc., where A[i] is moduli X[i], then
a CRT lift of A is simply
                   sum E[i] * A[i].
 
ALGORITHM:
To compute E[i], compute integers s and t such that
 
            s * X[i] + t * (prod over i!=j of X[j]) = 1.   (*)
 
Then E[i] = t * (prod over i!=j of X[j]).  Notice that equation
(*) implies that E[i] is congruent to 1 modulo X[i] and to 0
modulo the other X[j] for j!=i.
 
COMPLEXITY: We compute len(X) extended GCD's.
 
EXAMPLES:
    sage: X = [11,20,31,51]
    sage: E = crt_basis([11,20,31,51])
    sage: E[0]%X[0]; E[1]%X[0]; E[2]%X[0]; E[3]%X[0]
    1
    0
    0
    0
    sage: E[0]%X[1]; E[1]%X[1]; E[2]%X[1]; E[3]%X[1]
    0
    1
    0
    0
    sage: E[0]%X[2]; E[1]%X[2]; E[2]%X[2]; E[3]%X[2]
    0
    0
    1
    0
    sage: E[0]%X[3]; E[1]%X[3]; E[2]%X[3]; E[3]%X[3]
    0
    0
    0
    1
cython(...)
File: sage/misc/cython_c.pyx (starting at line 4)
 
Given a block of CYTHON (SAGE's variant of Pyrex) code (as a text
string), this function compiles it using your C compiler, and
includes it into the global scope of the module that called this
function.
 
WARNING: Only use this from Python code, not from extension code,
since from extension code you would change the global scope (i.e.,
of the SAGE interpreter). And it would be stupid, since you're
already writing Cython!
 
Also, never use this in the standard SAGE library.  Any code that
uses this can only run on a system that has a C compiler
installed, and we want to avoid making that assumption for casual
SAGE usage.  Also, any code that uses this in the library would
greatly slow down startup time, since currently there is no
caching.
 
AUTHOR: William Stein, 2006-10-31
 
TODO: Need to create a clever caching system so code only gets
compiled once.
dumps(...)
File: sage/structure/sage_object.pyx (starting at line 488)
 
dumps(obj):
 
Dump obj to a string s.  To recover obj, use loads(s).
 
EXAMPLES:
    sage: a = 2/3
    sage: s = dumps(a)
    sage: print len(s)
    49
    sage: loads(s)
    2/3
expnums(...)
File: sage/combinat/expnums.pyx (starting at line 17)
 
Compute the first $n$ exponential numbers around $aa$, starting
with the zero-th.
 
INPUT:
     n -- C machine int
     aa -- C machine int
 
OUTPUT:
     A list of length $n$.
 
ALGORITHM: We use the same integer addition algorithm as GAP.
This is an extension of Bell's triangle to the general case of
exponential numbers.  The recursion performs $O(n^2)$ additions,
but the running time is dominated by the cost of the last integer
addition, because the growth of the integer results of partial
computations is exponential in $n$.  The algorithm stores $O(n)$
integers, but each is exponential in $n$.
 
EXAMPLES:
    sage: expnums(10, 1)
    [1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147]
 
    sage: expnums(10, -1)
    [1, -1, 0, 1, 1, -2, -9, -9, 50, 267]
 
    sage: expnums(1, 1)
    [1]
    sage: expnums(0, 1)
    []
    sage: expnums(-1, 0)
    []
 
AUTHOR:
    -- Nick Alexander
fqmodule(arg0=None, arg1=None, **args)
Create an instance of the class quad_module.
 
INPUT
Supported formats
    1. fgmodule():
           the trivial quadratic module
 
    2. fgmodule( list):
          discriminant module constructed from the diagonal matrix
          with the integers in list on its diagonal.
 
    3. fgmodule( matrix):
           discriminant   module   constructed   from  a   regular
           symmetric half integral matrix.
 
    4. fgmodule( list_of_orders, list_of_coeffs):
           for a list of orders $[e_i]$  of size $n$ and a list of
           coeficients $[a_{ij}]$, the quadratic module
           $(\ZZ/e_1\times\cdots\times\ZZ/e_n,class(x)\mapsto\sum_{i\le j} a_{ij} x_i x_j)$.
 
    5. fgmodule( list_of_orders, Gram_matrix):
           for  a  list  of  orders  $[e_i]$ of  size  $n$  and  a
           symmetric matric $G$, the quadratic module
           $(\ZZ/e_1 \times \cdots \times \ZZ/e_n, class(x) \mapsto G[x] + \ZZ)$.
 
    6. fgmodule( matrix, list_of_coeffs):
           for a matrix $M$ of  size $n$ and a list of coeficients
           $[a_{ij}]$, the quadratic module
           $(\ZZ^n/M\ZZ^n, x+M\ZZ^n \mapsto \sum_{i\le j} a_{ij} x_i x_j)$.
 
    7. fgmodule( matrix, Gram_matrix):
           for  a  matrix $M$  and  a  symmetric  matric $G$,  the
           quadratic module $(\ZZ^n/M\ZZ^n, x+M\ZZ^n \mapsto G[x] + \ZZ)$.
 
    ( --- Hatice: ---
    8. fgmodule( number_field_element)
           For a nonzero $\omega$ in a numberfield $K$,
           the quadratic module $(\ZZ_K/A, x+A \mapsto tr( \omega x^2) + \ZZ)$,
           where $A$ is determined by
           $\omega D^{-1} = B/A$ with relatively prime ideals $A$, $B$,
           and with $D$ denoting the different of $K$.
    )
 
EXAMPLES
    sage: phi0 = fqmodule(); phi0
    Finite quadratic module ([1],0)
 
    sage: phi1 = fqmodule([2,5]); phi1
    Finite quadratic module ([20, 2],7/40*x0^2 + 1/2*x0*x1 + 1/4*x1^2)
 
    sage: F=matrix(3,3,[1,1/2,3/2,1/2,2,1/2,3/2,1/2,1]); F
 
    [  1 1/2 3/2]
    [1/2   2 1/2]
    [3/2 1/2   1]
    sage: phi2 = fqmodule(F); phi2
    Finite quadratic module ([18],29/36*x^2)
 
    sage: phi3 = fqmodule([3,4,30],[1/3,0,1/3,1/8,5/2,7/60]); phi3
    Finite quadratic module ([60, 6],49/120*x0^2 + 1/3*x0*x1 + 11/12*x1^2)
free_module_element = vector(...)
File: sage/modules/free_module_element.pyx (starting at line 100)
 
Return a vector over R with given entries.
 
CALL FORMATS:
    1. vector(object)
    2. vector(ring, object)
    3. vector(object, ring)
    4. vector(numpy_array)
 
In each case, give sparse=[True|False] as an option.
    
INPUT:
    elts -- entries of a vector (either a list or dict).
    R -- ring
    sparse -- optional
    
OUTPUT:
    An element of the free module over R of rank len(elts). 
 
EXAMPLES:
    sage: v = vector([1,2,3]); v
    (1, 2, 3)
    sage: v.parent()
    Ambient free module of rank 3 over the principal ideal domain Integer Ring
    sage: v = vector([1,2,3/5]); v
    (1, 2, 3/5)
    sage: v.parent()
    Vector space of dimension 3 over Rational Field
 
All entries must \emph{canonically} coerce to some common ring:
    sage: v = vector([17, GF(11)(5), 19/3]); v
    Traceback (most recent call last):
    ...
    TypeError: unable to find a common ring for all elements
    
    sage: v = vector([17, GF(11)(5), 19]); v
    (6, 5, 8)
    sage: v.parent()
    Vector space of dimension 3 over Finite Field of size 11
    sage: v = vector([17, GF(11)(5), 19], QQ); v
    (17, 5, 19)
    sage: v.parent()
    Vector space of dimension 3 over Rational Field
    sage: v = vector((1,2,3), QQ); v
    (1, 2, 3)
    sage: v.parent()
    Vector space of dimension 3 over Rational Field
    sage: v = vector(QQ, (1,2,3)); v
    (1, 2, 3)
    sage: v.parent()
    Vector space of dimension 3 over Rational Field
    sage: v = vector(vector([1,2,3])); v
    (1, 2, 3)
    sage: v.parent()
    Ambient free module of rank 3 over the principal ideal domain Integer Ring
 
You can also use \code{free_module_element}, which is the same as \code{vector}.
    sage: free_module_element([1/3, -4/5])
    (1/3, -4/5)
 
Make a vector mod 3 out of a vector over ZZ:
    sage: vector(vector([1,2,3]), GF(3))
    (1, 2, 0)
 
Any 1 dimensional numpy array of type float or complex may be passed to vector. The result
will vector in the appropriate dimensional vector space over the real double field or the
complex double field. The data in the array must be contiguous so columnwise slices of numpy matrices
will rase an exception.
 
sage: import numpy
sage: x=numpy.random.randn(10)
sage: y=vector(x)
sage: v=numpy.random.randn(10)*numpy.complex(0,1)
sage: w=vector(v)
function(...)
File: sage/calculus/var.pyx (starting at line 62)
 
Create a formal symbolic function with the name \emph{s}.
 
INPUT:
    s -- a string, either a single variable name,
         or a space or comma separated list of
         variable names.
 
NOTE: The new function is both returned and automatically injected
into the global namespace.  If you use var in library code, it is
better to use sage.calculus.calculus.function, since it won't
touch the global namespace.
 
EXAMPLES:
We create a formal function called supersin.
    sage: f = function('supersin', x)
    sage: f
    supersin(x)
 
We can immediately use supersin in symbolic expressions:
    sage: y, z, A = var('y z A')
    sage: supersin(y+z) + A^3
    A^3 + supersin(z + y)
 
We can define other functions in terms of supersin.
    sage: g(x,y) = supersin(x)^2 + sin(y/2)
    sage: g
    (x, y) |--> sin(y/2) + supersin(x)^2
    sage: g.diff(y)
    (x, y) |--> cos(y/2)/2
    sage: g.diff(x)
    (x, y) |--> 2*supersin(x)*diff(supersin(x), x, 1)
    sage: k = g.diff(x); k
    (x, y) |--> 2*supersin(x)*diff(supersin(x), x, 1)
    sage: k.substitute(supersin=sin)
    2*cos(x)*sin(x)
getrandbits(...)
getrandbits(k) -> x.  Generates a long int with k random bits.
inject_off(...)
File: sage/ext/interactive_constructors_c.pyx (starting at line 84)
inject_on(...)
File: sage/ext/interactive_constructors_c.pyx (starting at line 15)
 
Replace several constructors by versions that inject their
variables into the global namespace.
 
INPUT:
    verbose -- (default: True) if True, print which constructors
               become interactive, and also print variables as
               they are implicitly defined.
 
EXAMPLES:
    sage: inject_on(verbose=True)
    Redefining: Frac FreeMonoid GF FractionField FiniteField PolynomialRing quotient NumberField LaurentSeriesRing quo 
    sage: GF(9,'b')
    Defining b
    Finite Field in b of size 3^2
    sage: b^3
    2*b + 1
    sage: inject_off()
    sage: GF(9,'c')
    Finite Field in c of size 3^2
    sage: c^3
    Traceback (most recent call last):
    ...
    NameError: name 'c' is not defined
    sage: inject_on(verbose=False)
    sage: GF(9,'c')
    Finite Field in c of size 3^2
    sage: c^3
            2*c + 1
 
ROLL YOUR OWN: If a constructor you would like to auto inject
variables isn't made to do so by running this command your options
are:
     (1) Make your own constructor (factory function) using the explicit
         inject_variables() method.  This is *very* easy:
         
            sage: def poly(*args, **kwds):
            ...    R = PolynomialRing(*args, **kwds)
            ...    R.inject_variables()
            ...    return R
            sage: R = poly(QQ, 'z')
            Defining z
            sage: z^3 + 3
            z^3 + 3
 
     (2) Add code to do it to devel/sage/sage/ext/interactive_constructors_c.pyx,
         rebuild SAGE (with sage -br), and send William Stein a patch :-).
integral_numerical = numerical_integral(...)
File: sage/gsl/integration.pyx (starting at line 59)
 
Returns the numerical integral of the function on the interval
from xmin to xmax and an error bound. 
 
EXAMPLES:
   To integrate the function $x^2$ from 0 to 1, we do
       sage: numerical_integral(lambda x: x^2, 0, 1, max_points=100)
       (0.33333333333333331, 3.7007434154171879e-15)
 
   To integrate the function $\sin(x)^3 + \sin(x)$ we do
      sage: numerical_integral(lambda x: sin(x)^3 + sin(x),  0, pi)
      (3.333333333333333, 3.7007434154171883e-14)
 
   We check this with a symbolic integration:
      sage: (sin(x)^3+sin(x)).integral(x,0,pi)
      10/3
 
INPUT:
   -- a, b: The interval of integration, specified as two numbers
            or a as a tuple/list with the first element the lower bound
            and the second element the upper bound.  Use
            '+inf' and '-inf' for plus or minus infinity.
   -- algorithm: valid choices are
                 'qag' -- for an adaptive integration
                 'qng' -- for a non-adaptive gauss kronrod (samples at a maximum of 87pts)
   -- max_points: sets the maximum number of sample points
   -- params: used to pass parameters to your function
   -- eps_abs, eps_rel: absolute and relative error tolerances
   -- rule: This controls the Gauss-Kronrod rule used in the adaptive integration
            rule=1: 15 pt rule
            rule=2: 21 pt rule
            rule=3: 31 pt rule
            rule=4: 41 pt rule
            rule=5: 51 pt rule
            rule=6: 61 pt rule
      Higher key values are more accurate for smooth functions but lower
      key values deal better with discontinuities.
 
OUTPUT:
    numerical_integral returns a tuple whose first component is
    the answer and whose second component is an error estimate.
 
REMARK:
    There is also a method \code{nintegral} on symbolic expressions
    that implements numerical integration using Maxima.  It is potentially
    very useful for symbolic expressions.
 
 
MORE EXAMPLES:
If we want to change the error tolerances and gauss rule used
    sage: f = lambda x: x^2
    sage: numerical_integral(f, 0, 1, max_points=200, eps_abs=1e-7, eps_rel=1e-7, rule=4)
    (0.33333333333333331, 3.7007434154171879e-15)
 
For a Python function with parameters:
   sage: f = lambda x, a:1.0/(a[0]+x**2)
   sage: [numerical_integral(f, 1, 2, max_points=100, params=[n]) for n in range(10)]   # slightly random output (architecture and os dependent)
   [(0.49999999999998657, 5.5511151231256336e-15),
    (0.32175055439664557, 3.5721487367706477e-15),
    (0.24030098317249229, 2.6678768435816325e-15),
    (0.19253082576711697, 2.1375215571674764e-15),
    (0.16087527719832367, 1.7860743683853337e-15),
    (0.13827545676349412, 1.5351659583939151e-15),
    (0.12129975935702741, 1.3466978571966261e-15),
    (0.10806674191683065, 1.1997818507228991e-15),
    (0.09745444625548845, 1.0819617008493815e-15),
    (0.088750683050217577, 9.8533051773561173e-16)]       
 
Note the parameters are always a tuple even if they have one component.
 
It is possible to perform on infinite intervals as well by using
'inf' or '-inf' in the interval argument. For example,
    sage: f = lambda x: float(exp(RR(-x)))
    sage: numerical_integral(f, 0, 'inf')       # slightly random output
    (0.99999999999957279, 1.8429811298996553e-07)
    
Note the coercion to the real field RR, which prevents underflow.
 
    sage: f = lambda x: float(exp(RR(-x**2)))
    sage: numerical_integral(f,'-inf', 'inf')           # slightly random output
    (1.7724538509060035, 3.4295192165889879e-08)
 
One can integrate any real-valued callable function:
    sage: numerical_integral(lambda x: abs(zeta(x)), [1.1,1.5])           # slightly random output
    (1.8488570602160455, 2.052643677492633e-14)
 
We can also numerically integrate symbolic expressions using either this
function (which uses GSL) or the native integration (which uses Maxima):
    sage: exp(-1/x).nintegral(x, 1, 2)   # via maxima
    (0.50479221787318396, 5.6043194293440752e-15, 21, 0)
    sage: numerical_integral(exp(-1/x), 1, 2)
    (0.50479221787318407, 5.6043194293440744e-15)
    
IMPLEMENTATION NOTES:
    Uses calls to the GSL -- the GNU Scientific Library -- C library.
 
AUTHORS:
    -- Josh Kantor
    -- William Stein
is_AdditiveGroupElement(...)
File: sage/structure/element.pyx (starting at line 1143)
 
Return True if x is of type AdditiveGroupElement.
is_AlgebraElement(...)
File: sage/structure/element.pyx (starting at line 2580)
 
Return True if x is of type AlgebraElement.
is_CommutativeAlgebraElement(...)
File: sage/structure/element.pyx (starting at line 2589)
 
Return True if x is of type CommutativeAlgebraElement.
is_CommutativeRingElement(...)
File: sage/structure/element.pyx (starting at line 1601)
 
Return True if x is of type CommutativeRingElement.
is_ComplexDoubleElement(...)
File: sage/rings/complex_double.pyx (starting at line 348)
is_ComplexNumber(...)
File: sage/rings/complex_number.pyx (starting at line 39)
is_DedekindDomainElement(...)
File: sage/structure/element.pyx (starting at line 2127)
 
Return True if x is of type DedekindDomainElement.
is_Element(...)
File: sage/structure/element.pyx (starting at line 247)
 
Return True if x is of type Element.
 
EXAMPLES:
    sage: is_Element(2/3)
    True
    sage: is_Element(QQ^3)
    False
is_EuclideanDomainElement(...)
File: sage/structure/element.pyx (starting at line 2176)
 
Return True if x is of type EuclideanDomainElement.
is_Field(...)
File: sage/rings/ring.pyx (starting at line 963)
 
Return True if x is a field.
 
EXAMPLES:
    sage: is_Field(QQ)
    True
    sage: is_Field(ZZ)
    False
    sage: is_Field(pAdicField(2))
    True
    sage: is_Field(5)
    False
is_FieldElement(...)
File: sage/structure/element.pyx (starting at line 2238)
 
Return True if x is of type FieldElement.
is_FiniteField(...)
File: sage/rings/ring.pyx (starting at line 1572)
 
Return True if x is of type finite field, and False otherwise.
 
EXAMPLES:
    sage: is_FiniteField(GF(9,'a'))
    True
    sage: is_FiniteField(GF(next_prime(10^10)))
    True
 
Note that the integers modulo n are not of type finite field,
so this function returns False:
    sage: is_FiniteField(Integers(7))
    False
is_FreeModuleElement(...)
File: sage/modules/free_module_element.pyx (starting at line 97)
is_Functor(...)
File: sage/categories/functor.pyx (starting at line 76)
is_InfinityElement(...)
File: sage/structure/element.pyx (starting at line 2598)
 
Return True if x is of type InfinityElement.
is_Integer(...)
File: sage/rings/integer.pyx (starting at line 165)
 
Return true if x is of the SAGE integer type.
 
EXAMPLES:
    sage: is_Integer(2)
    True
    sage: is_Integer(2/1)
    False
    sage: is_Integer(int(2))
    False
    sage: is_Integer(long(2))
    False
    sage: is_Integer('5')
    False
is_IntegerMod(...)
File: sage/rings/integer_mod.pyx (starting at line 128)
 
Return try if and only if x is an integer modulo n.
 
EXAMPLES:
    sage: is_IntegerMod(5)
    False
    sage: is_IntegerMod(Mod(5,10))
    True
is_IntegralDomainElement(...)
File: sage/structure/element.pyx (starting at line 2116)
 
Return True if x is of type IntegralDomainElement.
is_LaurentSeries(...)
File: sage/rings/laurent_series_ring_element.pyx (starting at line 61)
is_MPolynomialRing(...)
File: sage/rings/polynomial/multi_polynomial_ring_generic.pyx (starting at line 13)
is_Matrix(...)
File: sage/structure/element.pyx (starting at line 2113)
is_Module(...)
File: sage/modules/module.pyx (starting at line 65)
 
Return True if x is a module.
 
EXAMPLES:
    sage: M = FreeModule(RationalField(),30)
    sage: is_Module(M)
    True
    sage: is_Module(10)
    False
is_ModuleElement(...)
File: sage/structure/element.pyx (starting at line 666)
 
Return True if x is of type ModuleElement.
 
This is even faster than using isinstance inline. 
 
EXAMPLES:
    sage: is_ModuleElement(2/3)
    True
    sage: is_ModuleElement((QQ^3).0)
    True
    sage: is_ModuleElement('a')
    False
is_MonoidElement(...)
File: sage/structure/element.pyx (starting at line 1059)
 
Return True if x is of type MonoidElement.
is_Morphism(...)
File: sage/categories/morphism.pyx (starting at line 42)
is_MultiplicativeGroupElement(...)
File: sage/structure/element.pyx (starting at line 1176)
 
Return True if x is of type MultiplicativeGroupElement.
is_NumberField(...)
File: sage/rings/number_field/number_field_base.pyx (starting at line 10)
 
Return True if x is of number field type.
 
EXAMPLES:
    sage: is_NumberField(NumberField(x^2+1,'a'))
    True
    sage: is_NumberField(QuadraticField(-97,'theta'))
    True
    sage: is_NumberField(CyclotomicField(97))
    True
 
Note that the rational numbers QQ are a number field. 
    sage: is_NumberField(QQ)
    True
    sage: is_NumberField(ZZ)
    False
is_NumberFieldElement(...)
File: sage/rings/number_field/number_field_element.pyx (starting at line 71)
 
Return True if x is of type NumberFieldElement, i.e., an
element of a number field.
 
EXAMPLES:
    sage: is_NumberFieldElement(2)
    False
    sage: k.<a> = NumberField(x^7 + 17*x + 1)
    sage: is_NumberFieldElement(a+1)
    True
is_Parent(...)
File: sage/structure/parent.pyx (starting at line 33)
 
Return True if x is a parent object, i.e., derives from
sage.structure.parent.Parent and False otherwise.
 
EXAMPLES:
    sage: is_Parent(2/3)
    False
    sage: is_Parent(ZZ)
    True
    sage: is_Parent(Primes())
    True
is_ParentWithAdditiveAbelianGens(...)
File: sage/structure/parent_gens.pyx (starting at line 81)
 
Return True if x is a parent object with additive abelian
generators, i.e., derives from
sage.structure.parent.ParentWithAdditiveAbelianGens and False
otherwise.
 
EXAMPLES:
    sage: is_ParentWithAdditiveAbelianGens(QQ)
    False
    sage: is_ParentWithAdditiveAbelianGens(QQ^3)
    True
is_ParentWithBase(...)
File: sage/structure/parent_base.pyx (starting at line 36)
 
Return True if x is a parent object with base.
is_ParentWithGens(...)
File: sage/structure/parent_gens.pyx (starting at line 66)
 
Return True if x is a parent object with generators, i.e., derives
from sage.structure.parent.ParentWithGens and False otherwise.
 
EXAMPLES:
    sage: is_ParentWithGens(QQ['x'])
    True
    sage: is_ParentWithGens(CC)
    True
    sage: is_ParentWithGens(Primes())
    False
is_ParentWithMultiplicativeAbelianGens(...)
File: sage/structure/parent_gens.pyx (starting at line 96)
 
Return True if x is a parent object with additive abelian
generators, i.e., derives from
sage.structure.parent.ParentWithMultiplicativeAbelianGens and False
otherwise.
 
EXAMPLES:
    sage: is_ParentWithMultiplicativeAbelianGens(QQ)
    False
    sage: is_ParentWithMultiplicativeAbelianGens(DirichletGroup(11))
    True
is_Polynomial(...)
File: sage/rings/polynomial/polynomial_element.pyx (starting at line 67)
is_PowerSeries(...)
File: sage/rings/power_series_ring_element.pyx (starting at line 111)
is_PrincipalIdealDomainElement(...)
File: sage/structure/element.pyx (starting at line 2136)
 
Return True if x is of type PrincipalIdealDomainElement.
is_RealDoubleElement(...)
File: sage/rings/real_double.pyx (starting at line 1522)
is_RealField(...)
File: sage/rings/real_mpfr.pyx (starting at line 3008)
is_RealIntervalField(...)
File: sage/rings/real_mpfi.pyx (starting at line 2803)
is_RealIntervalFieldElement(...)
File: sage/rings/real_mpfi.pyx (starting at line 2806)
is_RealNumber(...)
File: sage/rings/real_mpfr.pyx (starting at line 3011)
 
Return True if x is of type RealNumber, meaning that it is an
element of the MPFR real field with some precision.
 
EXAMPLES:
    sage: is_RealNumber(2.5)
    True
    sage: is_RealNumber(float(2.3))
    False
    sage: is_RealNumber(RDF(2))
    False
    sage: is_RealNumber(pi)
    False
is_Ring(...)
File: sage/rings/ring.pyx (starting at line 1624)
 
Return true if x is a ring.
 
EXAMPLES:
    sage: is_Ring(ZZ)
    True
is_RingElement(...)
File: sage/structure/element.pyx (starting at line 1231)
 
Return True if x is of type RingElement.
is_RingHomomorphism(...)
File: sage/rings/morphism.pyx (starting at line 338)
is_Vector(...)
File: sage/structure/element.pyx (starting at line 1917)
is_VectorSpace(...)
File: sage/modules/module.pyx (starting at line 78)
 
Return True if x is a vector space.
 
EXAMPLES:
    sage: M = FreeModule(RationalField(),30)
    sage: is_VectorSpace(M)
    True
    sage: M = FreeModule(IntegerRing(),30)
    sage: is_Module(M)
    True
    sage: is_VectorSpace(M)
    False
jumpahead(...)
jumpahead(int) -> None.  Create new state from existing state and integer.
lift_to_sl2z(...)
File: sage/modular/modsym/p1list.pyx (starting at line 617)
 
Return a list of Python ints [a,b,c',d'] that are the entries of a
2x2 matrix with determinant 1 and lower two entries congruent to
c,d modulo N.
 
EXAMPLES:
    sage: lift_to_sl2z(2,3,6)
    [1, 1, 2, 3]
    sage: lift_to_sl2z(15,6,24)
    [-2, -17, 15, 126]
    sage: lift_to_sl2z(15,6,2400000)
    [-2L, -320001L, 15L, 2400006L]
lift_to_sl2z_int(...)
File: sage/modular/modsym/p1list.pyx (starting at line 507)
 
Lift a pair (c, d) to an element of SL(2, Z)
 
(c,d) is assumed to be an element of P1(Z/NZ).  This function
computes and returns a list [a, b, c', d'] that defines a 2x2
matrix, with determinant 1 and integer entries, such that
c=c'(mod N) and d=d'(mod N).
 
EXAMPLES
    sage: lift_to_sl2z_int(2,6,11)
    [1, 8, 2, 17]
    sage: m=Matrix(Integers(),2,2,lift_to_sl2z_int(2,6,11))
    sage: m
    [ 1  8]
    [ 2 17]
 
AUTHOR:
    -- Justin Walker
lift_to_sl2z_llong(...)
File: sage/modular/modsym/p1list.pyx (starting at line 562)
 
Lift a pair (c, d) to an element of SL(2, Z)
 
(c,d) is assumed to be an element of P1(Z/NZ).  This function
computes and returns a list [a, b, c', d'] that defines a 2x2
matrix, with determinant 1 and integer entries, such that
c=c'(mod N) and d=d'(mod N).
 
EXAMPLES
    sage: lift_to_sl2z_llong(2,6,11)
    [1L, 8L, 2L, 17L]
    sage: m=Matrix(Integers(),2,2,lift_to_sl2z_llong(2,6,11))
    sage: m
    [ 1  8]
    [ 2 17]
 
AUTHOR:
    -- Justin Walker
load(...)
File: sage/structure/sage_object.pyx (starting at line 397)
 
load(filename):
 
Load \sage object from the file with name filename, which will
have an .sobj extension added if it doesn't have one.
 
NOTE: There is also a special SAGE command (that is not
available in Python) called load that you use by typing
 
            sage: load filename.sage           # not tested
            
The documentation below is not for that command.  The documentation
for load is almost identical to that for attach.  Type attach? for
help on attach.
 
This also loads a ".sobj" file over a network by specifying the full URL.
(Setting "verbose = False" suppresses the loading progress indicator.)    
 
EXAMPLE:
    sage: u = 'http://sage.math.washington.edu/home/was/db/test.sobj'  # optional
    sage: s = load(u)                                                  # optional
    Attempting to load remote file: http://sage.math.washington.edu/home/was/db/test.sobj
    Loading: [.]        
    sage: s                                                            # optional
    'hello SAGE'
loads(...)
File: sage/structure/sage_object.pyx (starting at line 510)
 
Recover an object x that has been dumped to a string s
using s = dumps(x).
 
EXAMPLES:
    sage: a = matrix(2, [1,2,3,-4/3])
    sage: s = dumps(a)
    sage: loads(s)
    [   1    2]
    [   3 -4/3]
mod = Mod(...)
File: sage/rings/integer_mod.pyx (starting at line 75)
 
Return the equivalence class of n modulo m as an element of
$\Z/m\Z$.
 
EXAMPLES:
    sage: x = Mod(12345678, 32098203845329048)
    sage: x
    12345678
    sage: x^100
    1017322209155072
 
You can also use the lowercase version:
    sage: mod(12,5)
    2
mul = prod(...)
File: sage/misc/misc_c.pyx (starting at line 24)
 
Return the product of the elements in the list x.  If optional
argument z is not given, start the product with the first element
of the list, otherwise use z.  The empty product is the int 1 if z
is not specified, and is z if given.
 
This assumes that your multiplication is associative; we don't promise 
which end of the list we start at.
 
EXAMPLES:
    sage: prod([1,2,34])
    68
    sage: prod([2,3], 5)
    30
    sage: prod((1,2,3), 5)
    30
    sage: F = factor(-2006); F
    -1 * 2 * 17 * 59
    sage: prod(F)
    -2006
 
AUTHORS:
    Joel B. Mohler (2007-10-03 -- Reimplemented in Cython and optimized)
    Robert Bradshaw (2007-10-26) -- Balanced product tree, other optimizations, (lazy) generator support
mwrank_initprimes = initprimes(...)
File: sage/libs/mwrank/mwrank.pyx (starting at line 102)
 
mwrank_initprimes(filename, verb=False):
 
INPUT:
    filename -- (string) the name of a file of primes
    verb -- (bool: default False) verbose or not?
 
EXAMPLES:
    sage: file= SAGE_TMP + '/PRIMES'
    sage: open(file,'w').write(' '.join([str(p) for p in prime_range(10^6)]))
    sage: mwrank_initprimes(file, verb=False)
    sage: mwrank_initprimes("x" + file, True)
    Traceback (most recent call last):
    ...
    IOError: No such file or directory: ...
numerical_integral(...)
File: sage/gsl/integration.pyx (starting at line 59)
 
Returns the numerical integral of the function on the interval
from xmin to xmax and an error bound. 
 
EXAMPLES:
   To integrate the function $x^2$ from 0 to 1, we do
       sage: numerical_integral(lambda x: x^2, 0, 1, max_points=100)
       (0.33333333333333331, 3.7007434154171879e-15)
 
   To integrate the function $\sin(x)^3 + \sin(x)$ we do
      sage: numerical_integral(lambda x: sin(x)^3 + sin(x),  0, pi)
      (3.333333333333333, 3.7007434154171883e-14)
 
   We check this with a symbolic integration:
      sage: (sin(x)^3+sin(x)).integral(x,0,pi)
      10/3
 
INPUT:
   -- a, b: The interval of integration, specified as two numbers
            or a as a tuple/list with the first element the lower bound
            and the second element the upper bound.  Use
            '+inf' and '-inf' for plus or minus infinity.
   -- algorithm: valid choices are
                 'qag' -- for an adaptive integration
                 'qng' -- for a non-adaptive gauss kronrod (samples at a maximum of 87pts)
   -- max_points: sets the maximum number of sample points
   -- params: used to pass parameters to your function
   -- eps_abs, eps_rel: absolute and relative error tolerances
   -- rule: This controls the Gauss-Kronrod rule used in the adaptive integration
            rule=1: 15 pt rule
            rule=2: 21 pt rule
            rule=3: 31 pt rule
            rule=4: 41 pt rule
            rule=5: 51 pt rule
            rule=6: 61 pt rule
      Higher key values are more accurate for smooth functions but lower
      key values deal better with discontinuities.
 
OUTPUT:
    numerical_integral returns a tuple whose first component is
    the answer and whose second component is an error estimate.
 
REMARK:
    There is also a method \code{nintegral} on symbolic expressions
    that implements numerical integration using Maxima.  It is potentially
    very useful for symbolic expressions.
 
 
MORE EXAMPLES:
If we want to change the error tolerances and gauss rule used
    sage: f = lambda x: x^2
    sage: numerical_integral(f, 0, 1, max_points=200, eps_abs=1e-7, eps_rel=1e-7, rule=4)
    (0.33333333333333331, 3.7007434154171879e-15)
 
For a Python function with parameters:
   sage: f = lambda x, a:1.0/(a[0]+x**2)
   sage: [numerical_integral(f, 1, 2, max_points=100, params=[n]) for n in range(10)]   # slightly random output (architecture and os dependent)
   [(0.49999999999998657, 5.5511151231256336e-15),
    (0.32175055439664557, 3.5721487367706477e-15),
    (0.24030098317249229, 2.6678768435816325e-15),
    (0.19253082576711697, 2.1375215571674764e-15),
    (0.16087527719832367, 1.7860743683853337e-15),
    (0.13827545676349412, 1.5351659583939151e-15),
    (0.12129975935702741, 1.3466978571966261e-15),
    (0.10806674191683065, 1.1997818507228991e-15),
    (0.09745444625548845, 1.0819617008493815e-15),
    (0.088750683050217577, 9.8533051773561173e-16)]       
 
Note the parameters are always a tuple even if they have one component.
 
It is possible to perform on infinite intervals as well by using
'inf' or '-inf' in the interval argument. For example,
    sage: f = lambda x: float(exp(RR(-x)))
    sage: numerical_integral(f, 0, 'inf')       # slightly random output
    (0.99999999999957279, 1.8429811298996553e-07)
    
Note the coercion to the real field RR, which prevents underflow.
 
    sage: f = lambda x: float(exp(RR(-x**2)))
    sage: numerical_integral(f,'-inf', 'inf')           # slightly random output
    (1.7724538509060035, 3.4295192165889879e-08)
 
One can integrate any real-valued callable function:
    sage: numerical_integral(lambda x: abs(zeta(x)), [1.1,1.5])           # slightly random output
    (1.8488570602160455, 2.052643677492633e-14)
 
We can also numerically integrate symbolic expressions using either this
function (which uses GSL) or the native integration (which uses Maxima):
    sage: exp(-1/x).nintegral(x, 1, 2)   # via maxima
    (0.50479221787318396, 5.6043194293440752e-15, 21, 0)
    sage: numerical_integral(exp(-1/x), 1, 2)
    (0.50479221787318407, 5.6043194293440744e-15)
    
IMPLEMENTATION NOTES:
    Uses calls to the GSL -- the GNU Scientific Library -- C library.
 
AUTHORS:
    -- Josh Kantor
    -- William Stein
p1_normalize(...)
File: sage/modular/modsym/p1list.pyx (starting at line 295)
p1_normalize_int(...)
File: sage/modular/modsym/p1list.pyx (starting at line 91)
 
p1_normalize_int(N, u, v):
 
Computes the canonical representative of $\PP^1(\Z/N\Z)$ equivalent
to $(u,v)$ along with a transforming scalar. 
 
INPUT:
    N -- an integer
    u -- an integer
    v -- an integer
    
OUTPUT:
    If gcd(u,v,N) = 1, then returns
         uu -- an integer
         vv -- an integer
         ss -- an integer
         such that (ss*uu, ss*vv) is equivalent to (u,v) mod N
    and if gcd(u,v,N) != 1, returns
         0, 0, 0
p1_normalize_llong(...)
File: sage/modular/modsym/p1list.pyx (starting at line 235)
 
p1_normalize_llong(N, u, v):
 
Computes the canonical representative of $\PP^1(\Z/N\Z)$ equivalent
to $(u,v)$ along with a transforming scalar. 
 
INPUT:
    N -- an integer
    u -- an integer
    v -- an integer
OUTPUT:
    If gcd(u,v,N) = 1, then returns
         uu -- an integer
         vv -- an integer
         ss -- an integer
         such that (ss*uu, ss*vv) is equivalent to (u,v) mod N
    and if gcd(u,v,N) != 1, returns
         0, 0, 0
p1list(...)
File: sage/modular/modsym/p1list.pyx (starting at line 287)
p1list_int(...)
File: sage/modular/modsym/p1list.pyx (starting at line 116)
 
p1list_int(int N):
 
Make a list of the normalized elements of $\PP^1(\Z/N\Z)$.
p1list_llong(...)
File: sage/modular/modsym/p1list.pyx (starting at line 259)
 
p1list_llong(int N):
 
Make a list of the normalized elements of $\PP^1(\Z/N\Z)$.
pmem_malloc(...)
File: sage/rings/memory.pyx (starting at line 20)
 
Use our own memory manager for for GMP memory management.
 
 
WARNING: Call this before the integer initialization or evil
things might happen.
prod(...)
File: sage/misc/misc_c.pyx (starting at line 24)
 
Return the product of the elements in the list x.  If optional
argument z is not given, start the product with the first element
of the list, otherwise use z.  The empty product is the int 1 if z
is not specified, and is z if given.
 
This assumes that your multiplication is associative; we don't promise 
which end of the list we start at.
 
EXAMPLES:
    sage: prod([1,2,34])
    68
    sage: prod([2,3], 5)
    30
    sage: prod((1,2,3), 5)
    30
    sage: F = factor(-2006); F
    -1 * 2 * 17 * 59
    sage: prod(F)
    -2006
 
AUTHORS:
    Joel B. Mohler (2007-10-03 -- Reimplemented in Cython and optimized)
    Robert Bradshaw (2007-10-26) -- Balanced product tree, other optimizations, (lazy) generator support
pyrex = cython(...)
File: sage/misc/cython_c.pyx (starting at line 4)
 
Given a block of CYTHON (SAGE's variant of Pyrex) code (as a text
string), this function compiles it using your C compiler, and
includes it into the global scope of the module that called this
function.
 
WARNING: Only use this from Python code, not from extension code,
since from extension code you would change the global scope (i.e.,
of the SAGE interpreter). And it would be stupid, since you're
already writing Cython!
 
Also, never use this in the standard SAGE library.  Any code that
uses this can only run on a system that has a C compiler
installed, and we want to avoid making that assumption for casual
SAGE usage.  Also, any code that uses this in the library would
greatly slow down startup time, since currently there is no
caching.
 
AUTHOR: William Stein, 2006-10-31
 
TODO: Need to create a clever caching system so code only gets
compiled once.
random(...)
random() -> x in the interval [0, 1).
reset(...)
File: sage/misc/reset.pyx (starting at line 3)
 
Delete all user defined variables, reset all globals variables
back to their default state, and reset all interfaces to other
computer algebra systems.
 
If vars is specified, just restore the value of vars and leave
all other variables alone (i.e., call restore).
 
INPUT:
    vars -- (default: None), a list, or space or comma separated
    string.
 
EXAMPLES:
    sage: x = 5
    sage: reset()
    sage: x
    x
restore(...)
File: sage/misc/reset.pyx (starting at line 37)
 
Restore predefined global variables to their default values.
 
INPUT:
   vars -- string or list (default: None) if not None, restores
           just the given variables to the default value.
 
EXAMPLES:
    sage: x = 10; y = 15/3; QQ='red'
    sage: QQ
    'red'
    sage: restore('QQ')
    sage: QQ
    Rational Field
    sage: x
    10
    sage: y = var('y')
    sage: restore('x y')
    sage: x
    x
    sage: y
    Traceback (most recent call last):
    ...
    NameError: name 'y' is not defined
    sage: x = 10; y = 15/3; QQ='red'
    sage: ww = 15
    sage: restore()
    sage: x, QQ, ww
    (x, Rational Field, 15)
    sage: restore('ww')
    sage: ww
    Traceback (most recent call last):
    ...
    NameError: name 'ww' is not defined
sagex = cython(...)
File: sage/misc/cython_c.pyx (starting at line 4)
 
Given a block of CYTHON (SAGE's variant of Pyrex) code (as a text
string), this function compiles it using your C compiler, and
includes it into the global scope of the module that called this
function.
 
WARNING: Only use this from Python code, not from extension code,
since from extension code you would change the global scope (i.e.,
of the SAGE interpreter). And it would be stupid, since you're
already writing Cython!
 
Also, never use this in the standard SAGE library.  Any code that
uses this can only run on a system that has a C compiler
installed, and we want to avoid making that assumption for casual
SAGE usage.  Also, any code that uses this in the library would
greatly slow down startup time, since currently there is no
caching.
 
AUTHOR: William Stein, 2006-10-31
 
TODO: Need to create a clever caching system so code only gets
compiled once.
save(...)
File: sage/structure/sage_object.pyx (starting at line 452)
 
save(obj, filename=None):
 
Save obj to the file with name filename, which will 
have an .sobj extension added if it doesn't have one.
This will \emph{replace} the contents of filename.
 
EXAMPLES:
    sage: a = matrix(2, [1,2,3,-5/2])
    sage: save(a, 'test.sobj')
    sage: load('test.sobj')
    [   1    2]
    [   3 -5/2]
    sage: E = EllipticCurve([-1,0])
    sage: P = plot(E)
    sage: save(P, 'test.sobj')
    sage: save(P, filename="sage.png", xmin=-2)
    sage: load('test.sobj')
    Graphics object consisting of 2 graphics primitives
search(...)
File: sage/misc/search.pyx (starting at line 28)
 
Return (True,i) where i is such that v[i] == x if there is such an i,
or (False,j) otherwise, where j is the position that a should be inserted
so that v remains sorted.
 
INPUT:
    v -- a list, which is assumed sorted
    x -- Python object
OUTPUT:
    bool, int
sleep(...)
sleep(seconds)
 
Delay execution for a given number of seconds.  The argument may be
a floating point number for subsecond precision.
var(...)
File: sage/calculus/var.pyx (starting at line 3)
 
Create a symbolic variable with the name \emph{s}.
 
INPUT:
    s -- a string, either a single variable name,
         or a space or comma separated list of
         variable names.
 
NOTE: The new variable is both returned and automatically injected
into the global namespace.  If you use var in library code, it is
better to use sage.calculus.calculus.var, since it won't touch the
global namespace.
 
EXAMPLES:
We define some symbolic variables:
    sage: var('n xx yy zz')
    (n, xx, yy, zz)
 
Then we make an algebraic expression out of them.
    sage: f = xx^n + yy^n + zz^n; f
    zz^n + yy^n + xx^n
 
We can substitute a new variable name for n.
    sage: f(n = var('sigma'))
    zz^sigma + yy^sigma + xx^sigma
 
If you make an important builtin variable into a symbolic variable,
you can get back the original value using restore:
    sage: var('QQ RR')
    (QQ, RR)
    sage: QQ
    QQ
    sage: restore('QQ')
    sage: QQ
    Rational Field
 
We make two new variables separated by commas:
    sage: var('theta, gamma')
    (theta, gamma)
    sage: theta^2 + gamma^3
    gamma^3 + theta^2
 
The new variables are of type SymbolicVariable, and belong
to the symbolic expression ring:
    sage: type(theta)
    <class 'sage.calculus.calculus.SymbolicVariable'>
    sage: parent(theta)
    Symbolic Ring
vecsmall_to_intlist(...)
File: sage/libs/pari/gen.pyx (starting at line 6478)
 
INPUT:
    v -- a gen of type Vecsmall
OUTPUT:
    a Python list of Python ints
vector(...)
File: sage/modules/free_module_element.pyx (starting at line 100)
 
Return a vector over R with given entries.
 
CALL FORMATS:
    1. vector(object)
    2. vector(ring, object)
    3. vector(object, ring)
    4. vector(numpy_array)
 
In each case, give sparse=[True|False] as an option.
    
INPUT:
    elts -- entries of a vector (either a list or dict).
    R -- ring
    sparse -- optional
    
OUTPUT:
    An element of the free module over R of rank len(elts). 
 
EXAMPLES:
    sage: v = vector([1,2,3]); v
    (1, 2, 3)
    sage: v.parent()
    Ambient free module of rank 3 over the principal ideal domain Integer Ring
    sage: v = vector([1,2,3/5]); v
    (1, 2, 3/5)
    sage: v.parent()
    Vector space of dimension 3 over Rational Field
 
All entries must \emph{canonically} coerce to some common ring:
    sage: v = vector([17, GF(11)(5), 19/3]); v
    Traceback (most recent call last):
    ...
    TypeError: unable to find a common ring for all elements
    
    sage: v = vector([17, GF(11)(5), 19]); v
    (6, 5, 8)
    sage: v.parent()
    Vector space of dimension 3 over Finite Field of size 11
    sage: v = vector([17, GF(11)(5), 19], QQ); v
    (17, 5, 19)
    sage: v.parent()
    Vector space of dimension 3 over Rational Field
    sage: v = vector((1,2,3), QQ); v
    (1, 2, 3)
    sage: v.parent()
    Vector space of dimension 3 over Rational Field
    sage: v = vector(QQ, (1,2,3)); v
    (1, 2, 3)
    sage: v.parent()
    Vector space of dimension 3 over Rational Field
    sage: v = vector(vector([1,2,3])); v
    (1, 2, 3)
    sage: v.parent()
    Ambient free module of rank 3 over the principal ideal domain Integer Ring
 
You can also use \code{free_module_element}, which is the same as \code{vector}.
    sage: free_module_element([1/3, -4/5])
    (1/3, -4/5)
 
Make a vector mod 3 out of a vector over ZZ:
    sage: vector(vector([1,2,3]), GF(3))
    (1, 2, 0)
 
Any 1 dimensional numpy array of type float or complex may be passed to vector. The result
will vector in the appropriate dimensional vector space over the real double field or the
complex double field. The data in the array must be contiguous so columnwise slices of numpy matrices
will rase an exception.
 
sage: import numpy
sage: x=numpy.random.randn(10)
sage: y=vector(x)
sage: v=numpy.random.randn(10)*numpy.complex(0,1)
sage: w=vector(v)

 
Data
        AA = Algebraic Field
CC = Complex Field with 53 bits of precision
CDF = Complex Double Field
CFF = Field of all continued fractions
Cusps = Set P^1(QQ) of all cusps
DOT_SAGE = '/home/nils/.sage/'
DSAGE_DIR = '/home/nils/.sage/dsage'
ExtendedIntegerRing = Extended Integer Ring
ExtendedRationalField = Extended Rational Field
FunctionRing = Ring of Mathematical Functions
I = I
Infinity = +Infinity
InfinityRing = The Infinity Ring
NaN = NaN
QQ = Rational Field
RDF = Real Double Field
RIF = Real Interval Field with 53 bits of precision
RQDF = Real Quad Double Field
RR = Real Field with 53 bits of precision
SAGE_DB = '/home/nils/.sage//db'
SAGE_ROOT = '/usr/local/share/sage'
SAGE_TMP = '/home/nils/.sage//temp/freya/3521/'
SAGE_URL = 'http://sage.math.washington.edu/sage/'
SR = Symbolic Ring
SloaneEncyclopedia = Sloane Online Encyclopedia of Integer Sequences
UnsignedInfinityRing = The Unsigned Infinity Ring
ZZ = Integer Ring
__version__ = '$Id: quadratic-modules.sage,v 1.45 2007-11-30 13:50:28 nils Exp $'
abs_symbolic = abs
acos = acos
acosh = acosh
airy_ai = airy_ai
airy_bi = airy_bi
arrow = <sage.plot.plot.ArrowFactory instance at 0x2b5089109c68>
asin = asin
asinh = asinh
atan = atan
atanh = atanh
attach = Attach a file to a running instance of SAGE...d automatically reloads it when it changes.
axiom = Axiom
bar_chart = <sage.plot.plot.BarChartFactory instance at 0x2b5089109cb0>
brun = brun
catalan = catalan
ceil = ceil
circle = <sage.plot.plot.CircleFactory instance at 0x2b5089109cf8>
contour_plot = <sage.plot.plot.ContourPlotFactory instance at 0x2b5089109d40>
copying = Type license() to see the full license text.
copyright = Type license() to see the full license text.
cos = cos
cosh = cosh
cot = cot
coth = coth
csc = csc
csch = csch
disk = <sage.plot.plot.DiskFactory instance at 0x2b5089109e60>
dsage = <sage.dsage.dsage.DistributedSage object at 0x245e7d0>
e = e
ecm = <sage.interfaces.ecm.ECM instance at 0xc24638>
elliptic_curves = <sage.schemes.elliptic_curves.ec_database.EllipticCurves instance at 0x1c3efc8>
erf = erf
euler_gamma = euler_gamma
exit = 'Use Ctrl-D (i.e. EOF), %Exit, or %Quit to exit without confirmation.'
exp = exp
false = False
floor = floor
gap = Gap
genus2reduction = Genus 2 reduction program
gfan = <sage.interfaces.gfan.Gfan instance at 0xb3af80>
gnuplot = Interface to Gnuplot
golden_ratio = golden_ratio
gp = GP/PARI interpreter
graphs = <sage.graphs.graph_generators.GraphGenerators instance at 0x1cdd7e8>
hg_doc = Hg repository 'SAGE Documentation' in directory /usr/local/share/sage/devel/doc
hg_extcode = Hg repository 'SAGE External System Code (e.g., ...' in directory /usr/local/share/sage/data/extcode
hg_sage = Hg repository 'SAGE Library Source Code' in directory /usr/local/share/sage/devel/sage
hg_scripts = Hg repository 'SAGE Scripts' in directory /usr/local/share/sage/local/bin
i = I
iglob = set(['In', 'InteractiveShell', 'Out', '_', '__', '__IP', ...])
infinity = +Infinity
interfaces = ['gap', 'gp', 'mathematica', 'gnuplot', 'kash', 'magma', 'macaulay2', 'maple', 'maxima', 'mathematica', 'mwrank', 'octave', 'singular', 'sage0', 'sage']
is_32_bit = False
is_64_bit = True
kash = Kash
khinchin = khinchin
lcalc = Rubinsteins L-function Calculator
license = Type license() to see the full license text.
lie = LiE Interpreter
line = <sage.plot.plot.LineFactory instance at 0x2b5089109d88>
line3d = <sage.plot.plot3dmatplotlib.Line3dFactory instance at 0x2b5089127290>
ln = log
log2 = log2
macaulay2 = Macaulay2
magma = Magma
magma_free = <sage.interfaces.magma_free.MagmaFree instance at 0xbd0ef0>
maple = Maple
mathematica = Mathematica
matlab = Matlab
matrix_plot = <sage.plot.plot.MatrixPlotFactory instance at 0x2b5089109dd0>
maxima = Maxima
maxima_calculus = Maxima
merten = merten
moebius = The Moebius function
mupad = Mupad
mwrank = Mwrank
notebook = <sage.server.notebook.notebook_object.NotebookObject instance at 0x24571b8>
octave = Octave
oo = +Infinity
pari = Interface to the PARI C library
pi = pi
plot = <sage.plot.plot.PlotFactory instance at 0x2b5089109f38>
plot_vector_field = <sage.plot.plot.PlotFieldFactory instance at 0x2b5089109e18>
point = <sage.plot.plot.PointFactory instance at 0x2b5089109ea8>
point3d = <sage.plot.plot3dmatplotlib.Point3dFactory instance at 0x2b5089127248>
points = <sage.plot.plot.PointFactory instance at 0x2b5089109ea8>
polygon = <sage.plot.plot.PolygonFactory instance at 0x2b5089109ef0>
polymake = Object that makes polytopes.
povray = POV-Ray The Persistence of Vision Ray Tracer
prime_pi = Function that counts the number of primes up to x
quit = 'Use Ctrl-D (i.e. EOF), %Exit, or %Quit to exit without confirmation.'
sage0 = Sage
sage_mode = 'cmdline'
sec = sec
sech = sech
sh = <sage.misc.sh.Sh instance at 0xaabe60>
sin = sin
singular = Singular
sinh = sinh
sloane = <class 'sage.combinat.sloane_functions.Sloane'>
sqrt = sqrt
sympow = Watkins Symmetric Power L-function Calculator
tachyon_rt = John Stone's Tachyon Ray Tracer
tan = tan
tanh = tanh
text = <sage.plot.plot.TextFactory instance at 0x2b5089109f80>
true = True
twinprime = twinprime
unsigned_infinity = Infinity
with_statement = _Feature((2, 5, 0, 'alpha', 1), (2, 6, 0, 'alpha', 0), 32768)
x = x