This is NCAlgebra.info, produced by Macaulay2, version 1.20

NCAlgebra
*********

Description
===========

This package is used to define and manipulate noncommutative algebras.  Many of
the commands contain calls to the existing noncommutative algebra package
Bergman.

Detailed instructions for installing Bergman, as well as the NCAlgebra system,
can be found in the file installNCAlgebra.txt file contained in the NCAlgebra
package directory. It may also be found at
https://github.com/Macaulay2/M2/blob/master/M2/Macaulay2/packages/NCAlgebra/
installNCAlgebra.txt.

Authors
=======

  * Frank Moore (see http://www.math.wfu.edu/Faculty/Moore.html )
    <moorewf@wfu.edu>
  * Andrew Conner (see http://www.stmarys-ca.edu/math-and-computer-science/
    faculty?facid=142546 ) <abc12@stmarys-ca.edu>
  * Courtney Gibbons (see http://people.hamilton.edu/cgibbons/index.html )
    <crgibbon@hamilton.edu>

Version
=======

This documentation describes version 1.0 of NCAlgebra.

Source code
===========

The source code from which this documentation is derived is in the file
NCAlgebra.m2 (see common/share/Macaulay2/NCAlgebra.m2 ). The auxiliary files
accompanying it are in the directory NCAlgebra/ (see
common/share/Macaulay2/NCAlgebra/ ).

Exports
=======

  * Types
      * NCGroebnerBasis -- Type of a Groebner basis for
        an NCIdeal in an NCRing.
      * NCIdeal -- Type of a two-sided ideal in a
        noncommutative ring
      * NCLeftIdeal -- Type of a left ideal in a
        noncommutative ring
      * NCMatrix -- Type of a matrix over a noncommutative
        ring
      * NCPolynomialRing -- Type of a noncommutative
        polynomial ring
      * NCQuotientRing -- Type of a noncommutative ring
      * NCRightIdeal -- Type of a right ideal in a
        noncommutative ring
      * NCRing -- Type of a noncommutative ring
      * NCRingElement -- Type of an element in a
        noncommutative ring
      * NCRingMap -- Type of a map to or from a
        noncommutative ring.
      * "NCChainComplex" -- see resolution(NCMatrix),
        -- Compute the resolution of coker M as a map
        of free right modules
  * Functions and commands
      * assignDegrees -- Weights entries of a matrix to
        make associated map of free modules graded
      * centralElements -- Finds central elements in a
        given degree
      * coordinates -- Computes coordinates relative to a
        given basis
      * endomorphismRing -- Methods for creating
        endomorphism rings of modules over a commutative ring
      * envelopingAlgebra -- Create the enveloping
        algebra
      * fourDimSklyanin -- Defines a four-dimensional
        Sklyanin with given parameters
      * freeProduct -- Define the free product of two
        algebras
      * gbFromOutputFile -- Read in a NCGroebnerBasis
        from a Bergman output file.
      * gddKernel -- Computes a homogeneous generating set of
        the kernel of a ring map.
      * hilbertBergman -- Calls Bergman to compute the
        Hilbert series of an NCQuotientRing
      * homogDual -- Computes the dual of a pure homogeneous
        ideal
      * isCentral -- Determines if an element is central
      * "isExterior" -- see isCommutative(NCRing),
        -- Returns whether an NCRing is commutative
      * isLeftRegular -- Determines if a given
        (homogeneous) element is regular in a given degree
      * "isRightRegular" -- see isLeftRegular, --
        Determines if a given (homogeneous) element is regular in a given
        degree
      * kernelComponent -- Computes a basis of the
        kernel of a ring map in a specified degree.
      * leftMultiplicationMap -- Computes a
        matrix for left or right multiplication by a homogeneous element
      * "rightMultiplicationMap" -- see leftMultiplicationMap,
        -- Computes a matrix for left or right
        multiplication by a homogeneous element
      * minimizeRelations -- Minimizes a list of
        NCRingElements
      * ncGroebnerBasis -- Compute a noncommutative
        Groebner basis.
      * ncIdeal -- Define a two-sided ideal in a noncommutative
        ring
      * ncLeftIdeal -- Define a left ideal in a
        noncommutative ring
      * ncMap -- Make a map to or from an NCRing
      * ncMatrix -- Create an NCMatrix
      * ncRightIdeal -- Define a right ideal in a
        noncommutative ring
      * normalAutomorphism -- Computes the
        automorphism determined by a normal homogeneous element
      * normalElements -- Finds normal elements
      * normalFormBergman -- Calls Bergman for a
        normal form calculation
      * oppositeRing -- Creates the opposite ring of a
        noncommutative ring
      * oreExtension -- Creates an Ore extension of a
        noncommutative ring
      * oreIdeal -- Creates the defining ideal of an Ore
        extension of a noncommutative ring
      * qTensorProduct -- Define the (q-)commuting
        tensor product
      * quadraticClosure -- Creates the subideal
        generated by quadratic elements of a given ideal
      * rightKernel -- Method for computing kernels of
        matrices over noncommutative rings in a given degree without using
        Bergman
      * rightKernelBergman -- Methods for computing
        kernels of matrices over noncommutative rings using Bergman
      * setWeights -- Set a nonstandard grading for a
        NCRing.
      * skewPolynomialRing -- Defines a skew
        polynomial ring via a skewing matrix
      * sparseCoeffs -- Converts ring elements into
        vectors over the coefficient ring
      * threeDimSklyanin -- Defines a
        three-dimensional Sklyanin with given parameters
      * toM2Ring -- Compute the abelianization of an NCRing
        and returns a Ring.
      * toNCRing -- Converts a Ring to an NCRing
      * twoSidedNCGroebnerBasisBergman,
        -- Calls Bergman to compute a two sided noncommutative Groebner Basis.
  * Methods
      * - NCMatrix -- Negates NCMatrices
      * ambient(NCQuotientRing) -- Ambient
        ring of an NCQuotientRing
      * ambient(NCRingMap) -- Extends an
        NCRingMap to the ambient ring of the source.
      * "assignDegrees(NCMatrix)" -- see assignDegrees, --
        Weights entries of a matrix to make associated map of free modules
        graded
      * "assignDegrees(NCMatrix,List,List)" -- see assignDegrees,
        -- Weights entries of a matrix to make associated map of
        free modules graded
      * baseName(NCRingElement) -- Returns
        the base name of a generator of an NCRing
      * basis(ZZ,NCIdeal) -- Returns a basis of
        an NCIdeal in a particular degree.
      * basis(ZZ,NCLeftIdeal) -- Returns a
        basis of an NCLeftIdeal in a particular degree.
      * basis(ZZ,NCRightIdeal) -- Returns
        a basis of an NCRightIdeal in a particular degree.
      * basis(ZZ,NCRing) -- Returns a basis of
        an NCRing in a particular degree.
      * "centralElements(NCRing,ZZ)" -- see centralElements,
        -- Finds central elements in a given degree
      * coefficientRing(NCRing) -- Returns
        the base ring of an NCRing
      * "coordinates(List)" -- see coordinates, -- Computes
        coordinates relative to a given basis
      * "coordinates(NCRingElement)" -- see coordinates, --
        Computes coordinates relative to a given basis
      * degree(NCRingElement) -- Returns the
        degree of an NCRingElement
      * "endomorphismRing(Module,Symbol)" -- see endomorphismRing,
        -- Methods for creating endomorphism rings of modules
        over a commutative ring
      * entries(NCMatrix) -- Returns the entries
        of the NCMatrix
      * "envelopingAlgebra(NCRing,Symbol)" -- see envelopingAlgebra,
        -- Create the enveloping algebra
      * "fourDimSklyanin(Ring,List)" -- see fourDimSklyanin,
        -- Defines a four-dimensional Sklyanin with given
        parameters
      * "fourDimSklyanin(Ring,List,List)" -- see fourDimSklyanin,
        -- Defines a four-dimensional Sklyanin with given
        parameters
      * "freeProduct(NCRing,NCRing)" -- see freeProduct, --
        Define the free product of two algebras
      * "gbFromOutputFile(NCPolynomialRing,String)" -- see
        gbFromOutputFile, -- Read in a NCGroebnerBasis from a
        Bergman output file.
      * "gddKernel(ZZ,NCRingMap)" -- see gddKernel, --
        Computes a homogeneous generating set of the kernel of a ring map.
      * generators(NCGroebnerBasis), --
        The list of algebra generators of an NCGroebnerBasis
      * generators(NCIdeal) -- Returns the
        generators of an NCIdeal
      * generators(NCLeftIdeal) -- Returns
        the generators of an NCLeftIdeal
      * generators(NCRightIdeal), --
        Returns the generators of an NCRightIdeal
      * generators(NCRing) -- The list of
        algebra generators of an NCRing
      * "hilbertBergman(NCQuotientRing)" -- see hilbertBergman,
        -- Calls Bergman to compute the Hilbert series of an
        NCQuotientRing
      * hilbertSeries(NCRing) -- Computes the
        Hilbert series of an NCRing
      * Hom(ZZ,NCMatrix,NCMatrix), --
        Compute a graded component of Hom(M,N)
      * "homogDual(NCIdeal)" -- see homogDual, -- Computes the
        dual of a pure homogeneous ideal
      * "homogDual(NCQuotientRing)" -- see homogDual, --
        Computes the dual of a pure homogeneous ideal
      * "homogDual(Ring)" -- see homogDual, -- Computes the
        dual of a pure homogeneous ideal
      * ideal(NCPolynomialRing) -- The
        defining ideal of an NCPolynomialRing
      * ideal(NCQuotientRing) -- Defining
        ideal of an NCQuotientRing in its ambient ring
      * "isCentral(NCRingElement)" -- see isCentral, --
        Determines if an element is central
      * "isCentral(NCRingElement,NCGroebnerBasis)" -- see isCentral,
        -- Determines if an element is central
      * isCommutative(NCRing) -- Returns
        whether an NCRing is commutative
      * "isExterior(NCRing)" -- see isCommutative(NCRing),
        -- Returns whether an NCRing is commutative
      * "isExterior(Ring)" -- see isCommutative(NCRing),
        -- Returns whether an NCRing is commutative
      * isConstant(NCRingElement), --
        Returns whether the NCRingElement is constant
      * isHomogeneous(NCIdeal) -- Determines
        whether the input defines a homogeneous object
      * "isHomogeneous(NCLeftIdeal)" -- see isHomogeneous(NCIdeal),
        -- Determines whether the input defines a
        homogeneous object
      * "isHomogeneous(NCMatrix)" -- see isHomogeneous(NCIdeal),
        -- Determines whether the input defines a
        homogeneous object
      * "isHomogeneous(NCRightIdeal)" -- see isHomogeneous(NCIdeal),
        -- Determines whether the input defines a
        homogeneous object
      * "isHomogeneous(NCRing)" -- see isHomogeneous(NCIdeal),
        -- Determines whether the input defines a
        homogeneous object
      * "isHomogeneous(NCRingElement)" -- see isHomogeneous(NCIdeal),
        -- Determines whether the input defines a
        homogeneous object
      * isHomogeneous(NCRingMap), --
        Determines if an NCRingMap preserves the natural grading
      * "isLeftRegular(NCRingElement,ZZ)" -- see isLeftRegular,
        -- Determines if a given (homogeneous) element is
        regular in a given degree
      * "isRightRegular(NCRingElement,ZZ)" -- see isLeftRegular,
        -- Determines if a given (homogeneous) element is
        regular in a given degree
      * isNormal(NCRingElement), --
        Determines if a given NCRingElement is normal
      * isWellDefined(NCRingMap), --
        Determines if an NCRingMap is well-defined.
      * "kernelComponent(ZZ,NCRingMap)" -- see kernelComponent,
        -- Computes a basis of the kernel of a ring map in a
        specified degree.
      * leadCoefficient(NCRingElement)
        -- Returns the lead monomial of an
        NCRingElement
      * leadMonomial(NCRingElement), --
        Returns the lead monomial of an NCRingElement
      * leadTerm(NCRingElement) -- Returns
        the lead term of an NCRingElement
      * "leftMultiplicationMap(NCRingElement,List,List)" -- see
        leftMultiplicationMap, -- Computes a matrix for
        left or right multiplication by a homogeneous element
      * "leftMultiplicationMap(NCRingElement,ZZ)" -- see
        leftMultiplicationMap, -- Computes a matrix for
        left or right multiplication by a homogeneous element
      * "leftMultiplicationMap(NCRingElement,ZZ,ZZ)" -- see
        leftMultiplicationMap, -- Computes a matrix for
        left or right multiplication by a homogeneous element
      * "rightMultiplicationMap(NCRingElement,List,List)" -- see
        leftMultiplicationMap, -- Computes a matrix for
        left or right multiplication by a homogeneous element
      * "rightMultiplicationMap(NCRingElement,ZZ)" -- see
        leftMultiplicationMap, -- Computes a matrix for
        left or right multiplication by a homogeneous element
      * "rightMultiplicationMap(NCRingElement,ZZ,ZZ)" -- see
        leftMultiplicationMap, -- Computes a matrix for
        left or right multiplication by a homogeneous element
      * lift(NCMatrix) -- Lifts an NCMatrix
      * List * NCRingElement -- Scales a list by
        an NCRingElement on the right
      * List / NCRingMap -- Applies an NCRingMap to
        each element of a list
      * Matrix * NCMatrix -- Product of NCMatrices
      * matrix(NCRingMap) -- An NCMatrix
        associated to an NCRingMap.
      * "minimizeRelations(List)" -- see minimizeRelations,
        -- Minimizes a list of NCRingElements
      * monomials(NCRingElement), --
        Returns the monomials appearing in the NCRingElement
      * "ncGroebnerBasis(List)" -- see ncGroebnerBasis,
        -- Compute a noncommutative Groebner basis.
      * "ncGroebnerBasis(NCIdeal)" -- see ncGroebnerBasis,
        -- Compute a noncommutative Groebner basis.
      * "ncIdeal(List)" -- see ncIdeal, -- Define a two-sided
        ideal in a noncommutative ring
      * "ncIdeal(NCRingElement)" -- see ncIdeal, -- Define a
        two-sided ideal in a noncommutative ring
      * NCIdeal + NCIdeal -- Sum of NCIdeals
      * "ncLeftIdeal(List)" -- see ncLeftIdeal, -- Define a
        left ideal in a noncommutative ring
      * "ncLeftIdeal(NCRingElement)" -- see ncLeftIdeal, --
        Define a left ideal in a noncommutative ring
      * NCLeftIdeal + NCLeftIdeal -- Sum of
        NCLeftIdeals
      * "ncMap(NCRing,NCRing,List)" -- see ncMap, -- Make a map to
        or from an NCRing
      * "ncMap(NCRing,Ring,List)" -- see ncMap, -- Make a map to
        or from an NCRing
      * "ncMap(Ring,NCRing,List)" -- see ncMap, -- Make a map to
        or from an NCRing
      * "ncMatrix(List)" -- see ncMatrix, -- Create an NCMatrix
      * "ncMatrix(NCRing,List,List)" -- see ncMatrix, -- Create
        an NCMatrix
      * NCMatrix % NCGroebnerBasis, --
        Reduces the entries of an NCMatrix with respect to an NCGroebnerBasis
      * NCMatrix * Matrix -- Product of NCMatrices
      * NCMatrix * NCMatrix -- Product of
        NCMatrices
      * NCMatrix * NCRingElement -- Product
        of NCMatrices
      * NCMatrix * QQ -- Product of NCMatrices
      * NCMatrix * RingElement -- Product of
        NCMatrices
      * NCMatrix * ZZ -- Product of NCMatrices
      * NCMatrix + NCMatrix -- Add NCMatrices
      * NCMatrix - NCMatrix -- Subtract NCMatrices
      * NCMatrix // NCMatrix -- Factor one map
        through another
      * NCMatrix == NCMatrix -- Test equality of
        matrices
      * "NCMatrix == ZZ" -- see NCMatrix == NCMatrix,
        -- Test equality of matrices
      * "ZZ == NCMatrix" -- see NCMatrix == NCMatrix,
        -- Test equality of matrices
      * NCMatrix ^ List -- Select some rows of an
        NCMatrix
      * NCMatrix ^ ZZ -- Exponentiate an NCMatrix
      * NCMatrix _ List -- Select some columns of an
        NCMatrix
      * NCMatrix _ ZZ -- Induced map in homogeneous
        degree n
      * NCMatrix | NCMatrix -- Join NCMatrices
        horizontally
      * NCMatrix || NCMatrix -- Join NCMatrices
        vertically
      * NCMatrix Array -- Graded shift of an NCMatrix.
      * NCPolynomialRing / NCIdeal, --
        Construct a NCQuotientRing
      * "ncRightIdeal(List)" -- see ncRightIdeal, -- Define
        a right ideal in a noncommutative ring
      * "ncRightIdeal(NCRingElement)" -- see ncRightIdeal,
        -- Define a right ideal in a noncommutative ring
      * NCRightIdeal + NCRightIdeal -- Sum
        of NCRightIdeals
      * NCRingElement % NCGroebnerBasis,
        -- Reduces a NCRingElement by a NCGroebnerBasis
      * "QQ % NCGroebnerBasis" -- see NCRingElement % NCGroebnerBasis,
        -- Reduces a NCRingElement by a
        NCGroebnerBasis
      * "ZZ % NCGroebnerBasis" -- see NCRingElement % NCGroebnerBasis,
        -- Reduces a NCRingElement by a
        NCGroebnerBasis
      * NCRingElement * List -- Scales a list by
        an NCRingElement on the left
      * NCRingElement * NCMatrix -- Product
        of NCMatrices
      * NCRingMap + NCRingMap -- Basic operations
        with NCRingMaps
      * "NCRingMap ^ ZZ" -- see NCRingMap + NCRingMap,
        -- Basic operations with NCRingMaps
      * "QQ * NCRingMap" -- see NCRingMap + NCRingMap,
        -- Basic operations with NCRingMaps
      * "RingElement * NCRingMap" -- see NCRingMap + NCRingMap,
        -- Basic operations with NCRingMaps
      * "ZZ * NCRingMap" -- see NCRingMap + NCRingMap,
        -- Basic operations with NCRingMaps
      * NCRingMap @@ NCRingMap -- Compose two
        NCRingMaps
      * NCRingMap _ ZZ -- Matrix of one homogeneous
        component of an NCRingMap
      * "NCRingMap NCGroebnerBasis" -- see NCRingMap NCIdeal,
        -- Apply a ring map to the generators of an ideal
      * NCRingMap NCIdeal -- Apply a ring map to the
        generators of an ideal
      * "NCRingMap NCMatrix" -- see NCRingMap NCRingElement,
        -- Apply an NCRingMap to an element or matrix
      * NCRingMap NCRingElement -- Apply an
        NCRingMap to an element or matrix
      * "NCRingMap RingElement" -- see NCRingMap NCRingElement,
        -- Apply an NCRingMap to an element or matrix
      * "normalAutomorphism(NCRingElement)" -- see normalAutomorphism,
        -- Computes the automorphism determined by a normal
        homogeneous element
      * "normalElements(NCQuotientRing,ZZ,Symbol,Symbol)" -- see
        normalElements, -- Finds normal elements
      * normalElements(NCRingMap,ZZ),
        -- Finds elements normalized by a ring map
      * "normalFormBergman(List,NCGroebnerBasis)" -- see
        normalFormBergman, -- Calls Bergman for a normal
        form calculation
      * "normalFormBergman(NCRingElement,NCGroebnerBasis)" -- see
        normalFormBergman, -- Calls Bergman for a normal
        form calculation
      * numgens(NCRing) -- The number of algebra
        generators of an NCRing
      * "oppositeRing(NCRing)" -- see oppositeRing, --
        Creates the opposite ring of a noncommutative ring
      * "oreExtension(NCRing,NCRingMap,NCRingElement)" -- see
        oreExtension, -- Creates an Ore extension of a
        noncommutative ring
      * "oreExtension(NCRing,NCRingMap,NCRingMap,NCRingElement)" -- see
        oreExtension, -- Creates an Ore extension of a
        noncommutative ring
      * "oreExtension(NCRing,NCRingMap,NCRingMap,Symbol)" -- see
        oreExtension, -- Creates an Ore extension of a
        noncommutative ring
      * "oreExtension(NCRing,NCRingMap,Symbol)" -- see oreExtension,
        -- Creates an Ore extension of a noncommutative ring
      * "oreIdeal(NCRing,NCRingMap,NCRingElement)" -- see oreIdeal,
        -- Creates the defining ideal of an Ore extension of a
        noncommutative ring
      * "oreIdeal(NCRing,NCRingMap,NCRingMap,NCRingElement)" -- see
        oreIdeal, -- Creates the defining ideal of an Ore extension
        of a noncommutative ring
      * "oreIdeal(NCRing,NCRingMap,NCRingMap,Symbol)" -- see oreIdeal,
        -- Creates the defining ideal of an Ore extension of a
        noncommutative ring
      * "oreIdeal(NCRing,NCRingMap,Symbol)" -- see oreIdeal, --
        Creates the defining ideal of an Ore extension of a noncommutative ring
      * QQ * NCMatrix -- Product of NCMatrices
      * "NCRing ** NCRing" -- see qTensorProduct, --
        Define the (q-)commuting tensor product
      * "qTensorProduct(NCRing,NCRing,QQ)" -- see qTensorProduct,
        -- Define the (q-)commuting tensor product
      * "qTensorProduct(NCRing,NCRing,RingElement)" -- see
        qTensorProduct, -- Define the (q-)commuting tensor
        product
      * "qTensorProduct(NCRing,NCRing,ZZ)" -- see qTensorProduct,
        -- Define the (q-)commuting tensor product
      * "quadraticClosure(NCIdeal)" -- see quadraticClosure,
        -- Creates the subideal generated by quadratic
        elements of a given ideal
      * "quadraticClosure(NCQuotientRing)" -- see quadraticClosure,
        -- Creates the subideal generated by quadratic
        elements of a given ideal
      * "betti(NCChainComplex)" -- see resolution(NCMatrix),
        -- Compute the resolution of coker M as a map
        of free right modules
      * resolution(NCMatrix) -- Compute the
        resolution of coker M as a map of free right modules
      * "rightKernel(NCMatrix,ZZ)" -- see rightKernel, --
        Method for computing kernels of matrices over noncommutative rings in a
        given degree without using Bergman
      * "rightKernelBergman(NCMatrix)" -- see rightKernelBergman,
        -- Methods for computing kernels of matrices over
        noncommutative rings using Bergman
      * "ring(NCGroebnerBasis)" -- see ring(NCIdeal),
        -- Returns the ring of an NCIdeal or NCGroebnerBasis
      * ring(NCIdeal) -- Returns the ring of an
        NCIdeal or NCGroebnerBasis
      * ring(NCLeftIdeal) -- Returns the ring of
        an NCLeftIdeal
      * ring(NCMatrix) -- Gives the ring of the
        NCMatrix
      * ring(NCRightIdeal) -- Returns the ring
        of an NCRightIdeal
      * ring(NCRingElement) -- Returns the
        NCRing of an NCRingElement
      * RingElement * NCMatrix -- Product of
        NCMatrices
      * "setWeights(NCRing,List)" -- see setWeights, -- Set a
        nonstandard grading for a NCRing.
      * size(NCRingElement) -- Returns the
        number of terms of an NCRingElement
      * "skewPolynomialRing(Ring,Matrix,List)" -- see skewPolynomialRing,
        -- Defines a skew polynomial ring via a skewing
        matrix
      * "skewPolynomialRing(Ring,QQ,List)" -- see
        skewPolynomialRing(Ring,RingElement,List),
        -- Defines a skew
        polynomial ring via a scaling factor
      * skewPolynomialRing(Ring,RingElement,List)
        -- Defines a skew
        polynomial ring via a scaling factor
      * "skewPolynomialRing(Ring,ZZ,List)" -- see
        skewPolynomialRing(Ring,RingElement,List),
        -- Defines a skew
        polynomial ring via a scaling factor
      * source(NCRingMap) -- Source of a map
      * "sparseCoeffs(List)" -- see sparseCoeffs, --
        Converts ring elements into vectors over the coefficient ring
      * "sparseCoeffs(NCRingElement)" -- see sparseCoeffs,
        -- Converts ring elements into vectors over the coefficient ring
      * support(NCRingElement) -- Returns
        the variables appearing in the NCRingElement
      * target(NCRingMap) -- Target of a map
      * terms(NCRingElement) -- Returns the
        terms of an NCRingElement
      * "threeDimSklyanin(Ring,List)" -- see threeDimSklyanin,
        -- Defines a three-dimensional Sklyanin with given
        parameters
      * "threeDimSklyanin(Ring,List,List)" -- see threeDimSklyanin,
        -- Defines a three-dimensional Sklyanin with given
        parameters
      * "toM2Ring(NCRing)" -- see toM2Ring, -- Compute the
        abelianization of an NCRing and returns a Ring.
      * "toNCRing(Ring)" -- see toNCRing, -- Converts a Ring to
        an NCRing
      * toString(NCRingElement) -- Converts
        an NCRingElement to a string
      * transpose(NCMatrix) -- Transposes an
        NCMatrix
      * "twoSidedNCGroebnerBasisBergman(List)" -- see
        twoSidedNCGroebnerBasisBergman, --
        Calls Bergman to compute a two sided noncommutative Groebner Basis.
      * "twoSidedNCGroebnerBasisBergman(NCIdeal)" -- see
        twoSidedNCGroebnerBasisBergman, --
        Calls Bergman to compute a two sided noncommutative Groebner Basis.
      * use(NCRing) -- Brings the variables of a
        particular NCRing in scope
      * ZZ * NCMatrix -- Product of NCMatrices
  * Symbols
      * "endomorphismRingGens" -- see endomorphismRing,
        -- Methods for creating endomorphism rings of modules over a
        commutative ring
      * "rightKernelDegreeLimit" -- see rightKernelBergman,
        -- Methods for computing kernels of matrices over
        noncommutative rings using Bergman

For the programmer
==================

The object NCAlgebra, is a package (Macaulay2Doc).

Basic operations on noncommutative algebras
*******************************************

The NCAlgebra package contains a number of methods for studying noncommutative
rings - primarily graded rings. The following three extended examples highlight
the capabilities of the package. For a detailed account of the Groebner basis
calculations underlying nearly all of these methods, see Using the Bergman interface.

Our first example concerns a three-dimensional Sklyanin algebra. This example
is a PI-ring. We define the ring as a quotient of the tensor algebra on three
generators by the two-sided ideal generated by the three elements listed.

+---------------------+
|i1 : A = QQ{x,y,z}   |
|                     |
|o1 = A               |
|                     |
|o1 : NCPolynomialRing|
+---------------------+

Users familiar with Macaulay2 will recognize the notation for a ring of
noncommutative polynomials is identical to that for local rings, see Ring List (Macaulay2Doc).
Thus the previous line does not generate an
error if you forget to load the NCAlgebra package.

+---------------------------------------+
|i2 : f = y*z + z*y - x^2               |
|                                       |
|            2                          |
|o2 = zy+yz-x                           |
|                                       |
|o2 : A                                 |
+---------------------------------------+
|i3 : g = x*z + z*x - y^2               |
|                                       |
|         2                             |
|o3 = zx-y +xz                          |
|                                       |
|o3 : A                                 |
+---------------------------------------+
|i4 : h = z^2 - x*y - y*x               |
|                                       |
|      2                                |
|o4 = z -yx-xy                          |
|                                       |
|o4 : A                                 |
+---------------------------------------+
|i5 : B = A/ncIdeal{f,g,h}              |
|--Calling Bergman for NCGB calculation.|
|Complete!                              |
|                                       |
|o5 = B                                 |
|                                       |
|o5 : NCQuotientRing                    |
+---------------------------------------+

It is known that this algebra has a unique (up to rescaling) central element of
degree 3. We can verify this claim computationally using centralElements,
and check that the element is regular to a given degree. See
isLeftRegular.

+-------------------------------------+
|i6 : centralElements(B,3)            |
|                                     |
|o6 = | y^3-y*x*z+x*y*z-x^3 |         |
|                                     |
|o6 : NCMatrix                        |
+-------------------------------------+
|i7 : j = y^3+x*y*z-y*x*z-x^3         |
|                                     |
|      3          3                   |
|o7 = y -yxz+xyz-x                    |
|                                     |
|o7 : B                               |
+-------------------------------------+
|i8 : isCentral j                     |
|                                     |
|o8 = true                            |
+-------------------------------------+
|i9 : apply(5,i->isLeftRegular(j,i+1))|
|                                     |
|o9 = {true, true, true, true, true}  |
|                                     |
|o9 : List                            |
+-------------------------------------+

In fact, we can see that j is (up to scaling) the only normal element of degree
3. See the discussion above for interpreting the output of
normalElements.

+-----------------------------------------------------------------------------+
|i10 : normalElements(B,3,n,o)                                                |
|Normal monomials of degree 3:                                                |
|none                                                                         |
|Components of the normal variety, excluding normal monomials:                |
|                                                                             |
|o10 = {| n_(y^2*z) n_(y*x*z)+n_(x*y*z) n_(x^2*z) n_(y^3)-n_(x*y*z) n_(x*y^2) |
|      -----------------------------------------------------------------------|
|      n_(y*x*y) n_(x^2*y) n_(x*y*x) n_(x^3)+n_(x*y*z) |}                     |
|                                                                             |
|o10 : List                                                                   |
+-----------------------------------------------------------------------------+
|i11 : basis(3,B)                                                             |
|                                                                             |
|o11 = | x^3 x*y*x x^2*y y*x*y x*y^2 y^3 x^2*z y*x*z x*y*z y^2*z |            |
|                                                                             |
|o11 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+

Recently, we studied noncommutative matrix factorizations over noncommutative
hypersurfaces. Here is a simple example. The hypersurface is B/(j). However,
iterated quotients are not yet implemented, so we define this ring as a
quotient of the tensor algebra. Note the use of "promote" to ensure j is
thought of as an element of the tensor algebra.

+----------------------------------------------------+
|i12 : use A                                         |
|                                                    |
|o12 = A                                             |
|                                                    |
|o12 : NCPolynomialRing                              |
+----------------------------------------------------+
|i13 : I = B.ideal                                   |
|                                                    |
|                              2      2      2       |
|o13 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                                    |
|o13 : NCIdeal                                       |
+----------------------------------------------------+
|i14 : J = ncIdeal promote(j,A)                      |
|                                                    |
|                        3          3                |
|o14 = Two-sided ideal {y -yxz+xyz-x }               |
|                                                    |
|o14 : NCIdeal                                       |
+----------------------------------------------------+
|i15 : B' = A/(I+J)                                  |
|--Calling Bergman for NCGB calculation.             |
|Complete!                                           |
|                                                    |
|o15 = B'                                            |
|                                                    |
|o15 : NCQuotientRing                                |
+----------------------------------------------------+

As in the commutative case, any minimal free resolution of a finitely generated
module over a noncommutative hypersurface is eventually given by a matrix
factorization. We resolve the trivial module for B' by expressing it as the
cokernel of a homogeneous matrix.

+-------------------------------------------------+
|i16 : k = ncMatrix {gens B'}                     |
|                                                 |
|o16 = | x y z |                                  |
|                                                 |
|o16 : NCMatrix                                   |
+-------------------------------------------------+
|i17 : M = rightKernelBergman rightKernelBergman k|
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|                                                 |
|o17 = | -z y*z     -y^2    -y*x-2*x*y |          |
|      | x  y*x+x*y y*z+x^2 -y^2+3*x*z |          |
|      | y  -x*z    -x*y    x^2        |          |
|      | 0  -2*y    -2*x    -2*z       |          |
|                                                 |
|o17 : NCMatrix                                   |
+-------------------------------------------------+
|i18 : N = rightKernelBergman M                   |
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|                                                 |
|o18 = | 0  2*y*x 2*y^2-2*x*z -y*x*z-x^3 |        |
|      | -z x     y           -y^2+x*z   |        |
|      | x  y     -z          -y*z+x^2   |        |
|      | -y -z    -x          0          |        |
|                                                 |
|o18 : NCMatrix                                   |
+-------------------------------------------------+

As discussed in Using the Bergman interface,
the method rightKernelBergman, only
computes the kernel of a module map to a certain homogeneous degree. Applying a
theorem of Cassidy and Shelton, we can be sure the matrices in any minimal
graded free resolution of the trivial module of B' will have entries of
homogeneous degree at most 3. Thus we conclude M is the third syzygy module and
N is the fourth. If we lift these matrices we see that M and N are nearly a
factorization of the central element j.

+-----------------------------------------------------------------------------+
|i19 : BprimeToB = ncMap(B,B',gens B)                                         |
|                                                                             |
|o19 = NCRingMap B <--- B'                                                    |
|                                                                             |
|o19 : NCRingMap                                                              |
+-----------------------------------------------------------------------------+
|i20 : liftM = BprimeToB M                                                    |
|                                                                             |
|o20 = | -z y*z     -y^2    -y*x-2*x*y |                                      |
|      | x  y*x+x*y y*z+x^2 -y^2+3*x*z |                                      |
|      | y  -x*z    -x*y    x^2        |                                      |
|      | 0  -2*y    -2*x    -2*z       |                                      |
|                                                                             |
|o20 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+
|i21 : liftN = BprimeToB N                                                    |
|                                                                             |
|o21 = | 0  2*y*x 2*y^2-2*x*z -y*x*z-x^3 |                                    |
|      | -z x     y           -y^2+x*z   |                                    |
|      | x  y     -z          -y*z+x^2   |                                    |
|      | -y -z    -x          0          |                                    |
|                                                                             |
|o21 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+
|i22 : liftM*liftN                                                            |
|                                                                             |
|o22 = | 0                           2*y^3-2*y*x*z+2*x*y*z-2*x^3              |
|      | 2*y^3-2*y*x*z+2*x*y*z-2*x^3 0                                        |
|      | 0                           0                                        |
|      | 0                           0                                        |
|                                                                             |
|o22 : NCMatrix                                                               |
|-----------------------------------------------------------------------------|
|0                           0                           |                    |
|0                           0                           |                    |
|2*y^3-2*y*x*z+2*x*y*z-2*x^3 0                           |                    |
|0                           2*y^3-2*y*x*z+2*x*y*z-2*x^3 |                    |
+-----------------------------------------------------------------------------+

It appears that a change of basis will produce a matrix factorization. In
general, Bergman returns a generating set for the kernel, but it need not have
any nice properties. Here the NCAlgebra package can help by factoring a map. We
would like M*M' = M'*M = j*I where I is the identity matrix.

+-----------------------------------------------------------------------------+
|i23 : jId = promote(j,B)*(ncMatrix applyTable(entries id_(ZZ^4), i -> promote|
|                                                                             |
|o23 = | y^3-y*x*z+x*y*z-x^3 0                   0                   0        |
|      | 0                   y^3-y*x*z+x*y*z-x^3 0                   0        |
|      | 0                   0                   y^3-y*x*z+x*y*z-x^3 0        |
|      | 0                   0                   0                   y^3-y*x*z|
|                                                                             |
|o23 : NCMatrix                                                               |
|-----------------------------------------------------------------------------|
|(i,B)))                                                                      |
|                                                                             |
|           |                                                                 |
|           |                                                                 |
|           |                                                                 |
|+x*y*z-x^3 |                                                                 |
+-----------------------------------------------------------------------------+
|i24 : assignDegrees(jId,{2,2,2,3},{5,5,5,6});                                |
+-----------------------------------------------------------------------------+

The matrix jId is diagonal, and we have assigned degrees to make it compatible
with M. Now we factor the lift of M through jId.

+--------------------------------------------------+
|i25 : M' = jId // liftM                           |
|--Calling Bergman for NCGB calculation.           |
|Complete!                                         |
|                                                  |
|o25 = | y*x    0      y^2-x*z -1/2*y*x*z-1/2*x^3 ||
|      | 1/2*x  -1/2*z 1/2*y   -1/2*y^2+1/2*x*z   ||
|      | 1/2*y  1/2*x  -1/2*z  -1/2*y*z+1/2*x^2   ||
|      | -1/2*z -1/2*y -1/2*x  0                  ||
|                                                  |
|o25 : NCMatrix                                    |
+--------------------------------------------------+
|i26 : N                                           |
|                                                  |
|o26 = | 0  2*y*x 2*y^2-2*x*z -y*x*z-x^3 |         |
|      | -z x     y           -y^2+x*z   |         |
|      | x  y     -z          -y*z+x^2   |         |
|      | -y -z    -x          0          |         |
|                                                  |
|o26 : NCMatrix                                    |
+--------------------------------------------------+

We see that M' and N describe the same submodule and we check that the
factorization worked:

+-----------------------------------------------------------------------------+
|i27 : liftM*M'                                                               |
|                                                                             |
|o27 = | y^3-y*x*z+x*y*z-x^3 0                   0                            |
|      | 0                   y^3-y*x*z+x*y*z-x^3 0                            |
|      | 0                   0                   y^3-y*x*z+x*y*z-x^3          |
|      | 0                   0                   0                            |
|                                                                             |
|o27 : NCMatrix                                                               |
|-----------------------------------------------------------------------------|
|0                   |                                                        |
|0                   |                                                        |
|0                   |                                                        |
|y^3-y*x*z+x*y*z-x^3 |                                                        |
+-----------------------------------------------------------------------------+
|i28 : M'*liftM                                                               |
|                                                                             |
|o28 = | y^3-y*x*z+x*y*z-x^3 0                   0                            |
|      | 0                   y^3-y*x*z+x*y*z-x^3 0                            |
|      | 0                   0                   y^3-y*x*z+x*y*z-x^3          |
|      | 0                   0                   0                            |
|                                                                             |
|o28 : NCMatrix                                                               |
|-----------------------------------------------------------------------------|
|0                   |                                                        |
|0                   |                                                        |
|0                   |                                                        |
|y^3-y*x*z+x*y*z-x^3 |                                                        |
+-----------------------------------------------------------------------------+

The user can create noncommutative rings in ways other than specifying a
presentation. For our second example, consider a skew polynomial ring on four
generators, where generators skew-commute (but are not nilpotent). See
skewPolynomialRing, for more details.

+--------------------------------------------------+
|i29 : C = skewPolynomialRing(QQ,(-1)_QQ,{x,y,z,w})|
|--Calling Bergman for NCGB calculation.           |
|Complete!                                         |
|                                                  |
|o29 = C                                           |
|                                                  |
|o29 : NCQuotientRing                              |
+--------------------------------------------------+

Let us briefly note that the user can also define a skew polynomial ring with
coefficients in a commutative ring.

+-------------------------------------------+
|i30 : R = QQ[q]/ideal{q^4+q^3+q^2+q+1}     |
|                                           |
|o30 = R                                    |
|                                           |
|o30 : QuotientRing                         |
+-------------------------------------------+
|i31 : B = skewPolynomialRing(R,q,{x,y,z,w})|
|                                           |
|o31 = B                                    |
|                                           |
|o31 : NCQuotientRing                       |
+-------------------------------------------+
|i32 : x*y == q*y*x                         |
|                                           |
|o32 = true                                 |
+-------------------------------------------+

Returning to the main example, we can define a graded Ore extension of C by
specifying an automorphism. The function ncMap, is used to define
a ring map. Note that ring maps are linear and multiplicative by definition but
are not assumed to be  well-defined.

+----------------------------------+
|i33 : use C                       |
|                                  |
|o33 = C                           |
|                                  |
|o33 : NCQuotientRing              |
+----------------------------------+
|i34 : sigma = ncMap(C,C,{y,z,w,x})|
|                                  |
|o34 = NCRingMap C <--- C          |
|                                  |
|o34 : NCRingMap                   |
+----------------------------------+
|i35 : isWellDefined sigma         |
|                                  |
|o35 = true                        |
+----------------------------------+

We form the Ore extension of C by sigma. See oreExtension.

+---------------------------------------+
|i36 : D = oreExtension(C,sigma,a)      |
|--Calling Bergman for NCGB calculation.|
|Complete!                              |
|                                       |
|o36 = D                                |
|                                       |
|o36 : NCQuotientRing                   |
+---------------------------------------+

The new generator a is normal and regular in D. Regularity (on the left or
right) can be checked one homogeneous degree at a time. See
isLeftRegular. Thus a determines a graded automorphism f:D->D
via a*r=f(r)*a.

+---------------------------------------+
|i37 : isNormal a                       |
|                                       |
|o37 = true                             |
+---------------------------------------+
|i38 : apply(5,i-> isLeftRegular(a,i+1))|
|                                       |
|o38 = {true, true, true, true, true}   |
|                                       |
|o38 : List                             |
+---------------------------------------+
|i39 : sigmaD = normalAutomorphism a    |
|                                       |
|o39 = NCRingMap D <--- D               |
|                                       |
|o39 : NCRingMap                        |
+---------------------------------------+

Given an automorphism, one can check to see which elements it normalizes in any
given degree.

+------------------------------+
|i40 : normalElements(sigmaD,1)|
|                              |
|o40 = | a |                   |
|                              |
|o40 : NCMatrix                |
+------------------------------+
|i41 : normalElements(sigmaD,2)|
|                              |
|o41 = 0                       |
|                              |
|               1              |
|o41 : Matrix QQ  <--- 0       |
+------------------------------+

One can check for the presence of normal elements more generally. In our
example, since a is normal, a^2 will also be normal. It is the only normal
monomial of degree 2. A complete description of the normal elements in a given
degree is given by normalElements.

+-----------------------------------------------------------------------------+
|i42 : normalElements(D,2,P,Q)                                                |
|Normal monomials of degree 2:                                                |
| 2                                                                           |
|a                                                                            |
|Components of the normal variety, excluding normal monomials:                |
|                                                                             |
|o42 = {| P_(w*a) P_(z*a) P_(y*a) P_(x*a) P_(z*w) P_(y*w) P_(x*w) P_(y*z)     |
|      -----------------------------------------------------------------------|
|      P_(x*z) P_(x*y) P_(z^2)^2-P_(y^2)P_(w^2) P_(y^2)P_(z^2)-P_(x^2)P_(w^2) |
|      -----------------------------------------------------------------------|
|      P_(x^2)P_(z^2)-P_(w^2)^2 P_(y^2)^2-P_(w^2)^2                           |
|      -----------------------------------------------------------------------|
|      P_(x^2)P_(y^2)-P_(z^2)P_(w^2) P_(x^2)^2-P_(y^2)P_(w^2) |}              |
|                                                                             |
|o42 : List                                                                   |
+-----------------------------------------------------------------------------+

Each component of the "normal variety" is a set of polynomial equations which
must be satisfied by the coefficients of the monomial basis for an element
expressed in that basis to be normal. In this case, the basis of D in degree 2
is

+---------------------------------------------------------------------+
|i43 : basis(2,D)                                                     |
|                                                                     |
|o43 = | x^2 x*y y^2 x*z y*z z^2 x*w y*w z*w w^2 x*a y*a z*a w*a a^2 ||
|                                                                     |
|o43 : NCMatrix                                                       |
+---------------------------------------------------------------------+

The output of normalElements tells us that in order for a degree 2 element of D
to be normal, it must be an expresison in powers of the generators. The
coefficients of these powers must satisfy the six equations listed.

+--------------------------------+
|i44 : isNormal (x^2+z^2-y^2-w^2)|
|                                |
|o44 = true                      |
+--------------------------------+

In Macaulay2, the user can define a polynomial ring to be commutative or
skew-commutative (the exterior algebra). The user can convert these rings (and
their quotients) to a type compatible with the NCAlgebra package using
toNCRing.

+--------------------------------------------------+
|i45 : E' = QQ[x,y,z,w,SkewCommutative=>true]      |
|                                                  |
|o45 = E'                                          |
|                                                  |
|o45 : PolynomialRing, 4 skew commutative variables|
+--------------------------------------------------+
|i46 : E = toNCRing E'                             |
|--Calling Bergman for NCGB calculation.           |
|Complete!                                         |
|                                                  |
|o46 = E                                           |
|                                                  |
|o46 : NCQuotientRing                              |
+--------------------------------------------------+
|i47 : f = ncMap(E,C,gens E)                       |
|                                                  |
|o47 = NCRingMap E <--- C                          |
|                                                  |
|o47 : NCRingMap                                   |
+--------------------------------------------------+
|i48 : f x^2                                       |
|                                                  |
|o48 = 0                                           |
|                                                  |
|o48 : E                                           |
+--------------------------------------------------+
|i49 : use C                                       |
|                                                  |
|o49 = C                                           |
|                                                  |
|o49 : NCQuotientRing                              |
+--------------------------------------------------+
|i50 : x^2 == 0                                    |
|                                                  |
|o50 = false                                       |
+--------------------------------------------------+

Conversely, the user can convert an NCRing to a (quotient of a) polynomial ring
in the usual sense of Macaulay2 using toM2Ring. This method
works on any NCRing - the result is the abelianization or "exterior-ization" of
the given ring. For example, if we abelianize the skew polynomial ring C, we
get a ring in which only powers of the generators are nonzero. On the other
hand, if we "exterior-ize" C, we get the exterior algebra.

+--------------------------------------------------+
|i51 : C' = toM2Ring C                             |
|                                                  |
|o51 = C'                                          |
|                                                  |
|o51 : QuotientRing                                |
+--------------------------------------------------+
|i52 : x*y                                         |
|                                                  |
|o52 = 0                                           |
|                                                  |
|o52 : C'                                          |
+--------------------------------------------------+
|i53 : x*x                                         |
|                                                  |
|       2                                          |
|o53 = x                                           |
|                                                  |
|o53 : C'                                          |
+--------------------------------------------------+
|i54 : C'' = toM2Ring(C,SkewCommutative=>true)     |
|                                                  |
|o54 = C''                                         |
|                                                  |
|o54 : PolynomialRing, 4 skew commutative variables|
+--------------------------------------------------+
|i55 : y*x                                         |
|                                                  |
|o55 = -x*y                                        |
|                                                  |
|o55 : C''                                         |
+--------------------------------------------------+
|i56 : y*y                                         |
|                                                  |
|o56 = 0                                           |
|                                                  |
|o56 : C''                                         |
+--------------------------------------------------+

Finally, we can construct the opposite ring. The opposite ring of D will be the
Ore extension by the inverse of sigma. See oppositeRing.

+---------------------------------------+
|i57 : Dop = oppositeRing D             |
|--Calling Bergman for NCGB calculation.|
|Complete!                              |
|                                       |
|o57 = Dop                              |
|                                       |
|o57 : NCQuotientRing                   |
+---------------------------------------+
|i58 : a*x == w*a                       |
|                                       |
|o58 = true                             |
+---------------------------------------+
|i59 : use D                            |
|                                       |
|o59 = D                                |
|                                       |
|o59 : NCQuotientRing                   |
+---------------------------------------+
|i60 : a*w == x*a                       |
|                                       |
|o60 = true                             |
+---------------------------------------+

Our last extended example illustrates how to obtain a presentation for the
endomorphism ring of a module over a commutative ring. First we define a
hypersurface ring and a high syzygy module.

+-----------------------------------------------+
|i61 : Q = QQ[a,b,c]                            |
|                                               |
|o61 = Q                                        |
|                                               |
|o61 : PolynomialRing                           |
+-----------------------------------------------+
|i62 : R = Q/ideal{a*b-c^2}                     |
|                                               |
|o62 = R                                        |
|                                               |
|o62 : QuotientRing                             |
+-----------------------------------------------+
|i63 : kRes = res(coker vars R, LengthLimit=>7);|
+-----------------------------------------------+
|i64 : M = coker kRes.dd_5                      |
|                                               |
|o64 = cokernel {4} | 0  -a 0  -c |             |
|               {4} | -b 0  -c 0  |             |
|               {4} | c  0  a  0  |             |
|               {4} | 0  c  0  b  |             |
|                                               |
|                             4                 |
|o64 : R-module, quotient of R                  |
+-----------------------------------------------+

The endomorphism ring is computed using endomorphismRing.
This method computes a presentation, but the presentation is
typically not minimal. We see from the following calcuation that X_3 = X_0X_2.

+-----------------------------------------------------------------------------+
|i65 : B = endomorphismRing(M,X);                                             |
+-----------------------------------------------------------------------------+
|i66 : gensI = gens ideal B                                                   |
|                                                                             |
|                                                                             |
|o66 = {X X +-X , -X +X X , -X +X X , X X , X X , X X +-X , X X , X X +-X ,   |
|        0 1   0    3  0 2    2  1 2   0 3   1 3   2 3   2   1 0   2 0   1    |
|      -----------------------------------------------------------------------|
|                                    2    2        2    2                     |
|      X X , X X +-X , X X , X X , X  , X  +-X , X  , X  +-X }                |
|       2 1   3 0   0   3 1   3 2   0    1    1   2    3    3                 |
|                                                                             |
|o66 : List                                                                   |
+-----------------------------------------------------------------------------+

To eliminate redundant generators and relations, use minimizeRelations.
This method makes several passes through the presentation,
and stops if no minimization occurs.

+-------------------------------------------------------+
|i67 : gensIMin = minimizeRelations(gensI, Verbosity=>1)|
|Eliminating variable X                                 |
|                      1                                |
|Eliminating variable X                                 |
|                      3                                |
|Reducing X_0*X_2*X_0+-X_0                              |
|  (1 of 12)                                            |
|  (Pass 1)                                             |
|Reducing X_2*X_0*X_2+-X_2                              |
|  (2 of 12)                                            |
|  (Pass 1)                                             |
|Reducing X_0^2*X_2                                     |
|  (3 of 12)                                            |
|  (Pass 1)                                             |
|Reducing X_2*X_0^2*X_2                                 |
|  (4 of 12)                                            |
|  (Pass 1)                                             |
|Reducing X_2*X_0^2                                     |
|  (5 of 12)                                            |
|  (Pass 1)                                             |
|Reducing X_2^2*X_0                                     |
|  (6 of 12)                                            |
|  (Pass 1)                                             |
|Reducing X_0*X_2^2*X_0                                 |
|  (7 of 12)                                            |
|  (Pass 1)                                             |
|Reducing X_0*X_2^2                                     |
|  (8 of 12)                                            |
|  (Pass 1)                                             |
|Reducing X_0^2                                         |
|  (9 of 12)                                            |
|  (Pass 1)                                             |
|Reducing X_2*X_0*X_2*X_0+-X_2*X_0                      |
|  (10 of 12)                                           |
|  (Pass 1)                                             |
|Reducing X_2^2                                         |
|  (11 of 12)                                           |
|  (Pass 1)                                             |
|Reducing X_0*X_2*X_0*X_2+-X_0*X_2                      |
|  (12 of 12)                                           |
|  (Pass 1)                                             |
|Reducing X_0*X_2*X_0+-X_0                              |
|  (1 of 4)                                             |
|  (Pass 2)                                             |
|Reducing X_2*X_0*X_2+-X_2                              |
|  (2 of 4)                                             |
|  (Pass 2)                                             |
|Reducing X_0^2                                         |
|  (3 of 4)                                             |
|  (Pass 2)                                             |
|Reducing X_2^2                                         |
|  (4 of 4)                                             |
|  (Pass 2)                                             |
|Reducing X_0*X_2*X_0+-X_0                              |
|  (1 of 4)                                             |
|  (Pass 1)                                             |
|Reducing X_2*X_0*X_2+-X_2                              |
|  (2 of 4)                                             |
|  (Pass 1)                                             |
|Reducing X_0^2                                         |
|  (3 of 4)                                             |
|  (Pass 1)                                             |
|Reducing X_2^2                                         |
|  (4 of 4)                                             |
|  (Pass 1)                                             |
|                                                       |
|                                 2    2                |
|o67 = {X X X +-X , X X X +-X , X  , X  }               |
|        0 2 0   0   2 0 2   2   0    2                 |
|                                                       |
|o67 : List                                             |
+-------------------------------------------------------+

We see a substantial reduction in the number of relations and that X_1 and X_3
are redundant generators. The endomorphisms themselves are cached, and can be
accessed via endomorphismRingGens. As an example, we
explicitly verify that X_3 is redundant.

+--------------------------------------------------------------------------+
|i68 : maps = B.cache.endomorphismRingGens                                 |
|                                                                          |
|o68 = {{4} | 0 0 1 0 |, {4} | 0 0 0 0 |, {4} | 0 0 0 0 |, {4} | 1 0 0 0 |}|
|       {4} | 0 0 0 0 |  {4} | 0 1 0 0 |  {4} | 0 0 0 1 |  {4} | 0 0 0 0 | |
|       {4} | 0 0 0 0 |  {4} | 0 0 1 0 |  {4} | 1 0 0 0 |  {4} | 0 0 0 0 | |
|       {4} | 0 1 0 0 |  {4} | 0 0 0 0 |  {4} | 0 0 0 0 |  {4} | 0 0 0 1 | |
|                                                                          |
|o68 : List                                                                |
+--------------------------------------------------------------------------+
|i69 : maps#3 == maps#0*maps#2                                             |
|                                                                          |
|o69 = true                                                                |
+--------------------------------------------------------------------------+

General setup information
*************************

We recommend using the NCAlgebra package with the most recent version of
Macaulay2.

Many of the methods in the NCAlgebra package rely on J. Backelin's
noncommutative Groebner basis program Bergman. In the future, we may add
support for other programs which compute Groebner bases, but for now, users
must have Bergman installed.

Detailed instructions for installing Bergman, as well as the NCAlgebra system,
can be found in the file installNCAlgebra.txt file contained in the NCAlgebra
package directory. It may also be found at
https://github.com/Macaulay2/M2/blob/master/M2/Macaulay2/packages/NCAlgebra/
installNCAlgebra.txt.

See also
========

  * Using the Bergman interface

Using the Bergman interface
***************************

Bergman is a software package for computing Groebner bases for ideals in both
commutative and noncommutative polynomial rings with coefficients in Q or Z/p.
Bergman was created by J. Backelin (U. of Stockholm) and its capabilities were
extended by V. Ufnarovski, S. Cojacaru, and A. Podoplelov.

Though Bergman is limited in terms of the coefficients it can handle and the
choice of orderings it offers, it is a very efficient (especially in terms of
memory usage) open source program for computing noncommutative Groebner bases.
(In the future we may add support for other Groebner basis software.) Rather
than re-inventing this wheel, the NCAlgebra package makes extensive use of
Bergman calls for noncommutative Groebner basis calculations. The following
examples illustrate some common calculations which involve a call to Bergman.
Our goal is to provide a more intuitive user experience with minimal
compromises to efficiency.

Typically, the user begins by defining a noncommutative polynomial ring. By
default, the ring is graded with generators in degree 1. Other gradings can be
defined, see setWeights.

+---------------------+
|i1 : A = QQ{x,y,z}   |
|                     |
|o1 = A               |
|                     |
|o1 : NCPolynomialRing|
+---------------------+

Implicit in this definition is a choice of ordering for Groebner basis
calculations: the ordering is degree-lexicographic with the generator symbols
listed in order from smallest to largest. Ring elements are displayed with the
high term listed first.

+------------------------+
|i2 : p = y*z + z*y - x^2|
|                        |
|            2           |
|o2 = zy+yz-x            |
|                        |
|o2 : A                  |
+------------------------+

One can try to compute Groebner bases for both homogeneous and inhomogeneous
ideals. We cannot ensure Bergman computes any other than the homogeneous case
correctly. We consider only homogeneous examples, the inhomogeneous case being
similar.

+---------------------------------------------------+
|i3 : q = x*z + z*x - y^2                           |
|                                                   |
|         2                                         |
|o3 = zx-y +xz                                      |
|                                                   |
|o3 : A                                             |
+---------------------------------------------------+
|i4 : r = z^2 - x*y - y*x                           |
|                                                   |
|      2                                            |
|o4 = z -yx-xy                                      |
|                                                   |
|o4 : A                                             |
+---------------------------------------------------+
|i5 : I = ncIdeal {p,q,r}                           |
|                                                   |
|                             2      2      2       |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                                   |
|o5 : NCIdeal                                       |
+---------------------------------------------------+

NCAlgebra has three methods pertaining to  noncommutative Groebner bases. One
is twoSidedNCGroebnerBasisBergman. This
command runs Bergman to compute a noncommutative Groebner basis to a certain
degree. The user will recall that unlike the commutative case, noncommutative
Groebner bases need not be finite, and may grow rapidly. For unfamiliar
examples, we recommend initially setting a relatively low degree threshold
(say, n=5). In our example, we know from experience the Groebner basis is
finite so we do not specify a degree limit.

+-------------------------------------------+
|i6 : Igb = twoSidedNCGroebnerBasisBergman I|
|--Calling Bergman for NCGB calculation.    |
|Complete!                                  |
|                                           |
|      2    2                2              |
|o6 = y x-xy ; Lead Term = (y x, 1)         |
|       2  2                  2             |
|     yx -x y; Lead Term = (yx , 1)         |
|         2                                 |
|     zx-y +xz; Lead Term = (zx, 1)         |
|            2                              |
|     zy+yz-x ; Lead Term = (zy, 1)         |
|      2                      2             |
|     z -yx-xy; Lead Term = (z , 1)         |
|                                           |
|o6 : NCGroebnerBasis                       |
+-------------------------------------------+

One an NCGroebner basis has been calculated, it is cached for later use. This
option can be disabled. See twoSidedNCGroebnerBasisBergman,
for more on options. We note that
twoSidedNCGroebnerBasisBergman is called automatically any time the user
attempts to create an NCQuotientRing.

Another method related to Groebner bases is ncGroebnerBasis.
This method creates the NCGroebnerBasis,
object. By default, this method also calls Bergman for a
noncommutative Groebner basis calculation. However, by setting the option
InstallGB to true, the user instructs Macaulay2 to bypass the Bergman call and
accept the input list as a Groebner basis without checking it is one. This can
be useful when the coefficient ring is not QQ (Macaulay2Doc), or a
finite prime field.

+----------------------------------------------+
|i7 : Igb2 = ncGroebnerBasis(I,InstallGB=>true)|
|                                              |
|      2                      2                |
|o7 = z -yx-xy; Lead Term = (z , 1)            |
|         2                                    |
|     zx-y +xz; Lead Term = (zx, 1)            |
|            2                                 |
|     zy+yz-x ; Lead Term = (zy, 1)            |
|                                              |
|o7 : NCGroebnerBasis                          |
+----------------------------------------------+

As mentioned above, noncommutative Groebner bases can grow rapidly both in the
number and size of the terms. In some cases, it takes days to calculate a
Groebner basis to the desired degree. So as not to repeat this calculation more
than once, users might have a Groebner basis saved in a file. The method
gbFromOutputFile, enables the user to load the Groebner basis
from a file. The file should contain nothing besides a list of noncommutative
polynomials in Macaulay2 readable form. (One exception: Bergman output files
contain lines beginning with the "%" symbol. gbFromOutputFile ignores lines
beginning with a "%".) Bergman users: you need not alter the output file from
ncpbhgroebner in any way prior to calling gbFromOutputFile. See
gbFromOutputFile, for an example.

Once a Groebner basis is computed, many methods become available. The most
basic calculation is to return the normal form of a given element relative to
the known Groebner basis. The NCAlgebra package also provides multiple options
for this calculation.

Generally speaking, Bergman is the most efficient way to reduce a ring element
to normal form. Behind the scenes, the NCAlgebra package creates a
Bergman-readable input file, runs a Bergman session, and interprets the output,
which it displays to the user. This takes time, especially when the Groebner
basis is large. The NCAlgebra package has its own normal form reduction
algorithm. It is considerably slower than Bergman, but it can be faster than
the time required to execute the Bergman call.

The file NCAlgebra.m2 contains two environment variables: MAXDEG and MAXSIZE.
If the element to be reduced has degree less than MAXDEG and fewer than MAXSIZE
terms (or if the coefficient ring is not Q or Z/p), the NCAlgebra package calls
its own normal form reduction method. Otherwise, it calls
normalFormBergman. The user can force a Bergman call using
this method.

+-----------------------------------------------------------------------------+
|i8 : z^17 % Igb                                                              |
|                                                                             |
|                                           2             2    3           3  |
|o8 = yxyxyxyxyxyxyxyxz+xyxyxyxyxyxyxyxyz+8x yxyxyxyxyxyxy z+8x yxyxyxyxyxy z+|
|                                                                             |
|o8 : A                                                                       |
|-----------------------------------------------------------------------------|
|   4         4     5       5     6     6     7   7     8 8                   |
|28x yxyxyxyxy z+28x yxyxyxy z+56x yxyxy z+56x yxy z+70x y z                  |
+-----------------------------------------------------------------------------+
|i9 : normalFormBergman(z^17,Igb)                                             |
|--Calling Bergman for NF calculation for 1 elements.                         |
|Complete!                                                                    |
|Writing bergman input file.                                                  |
|Writing bergman init file.                                                   |
|                                                                             |
|                                           2             2    3           3  |
|o9 = yxyxyxyxyxyxyxyxz+xyxyxyxyxyxyxyxyz+8x yxyxyxyxyxyxy z+8x yxyxyxyxyxy z+|
|                                                                             |
|o9 : A                                                                       |
|-----------------------------------------------------------------------------|
|   4         4     5       5     6     6     7   7     8 8                   |
|28x yxyxyxyxy z+28x yxyxyxy z+56x yxyxy z+56x yxy z+70x y z                  |
+-----------------------------------------------------------------------------+

Normal form calculations are performed automatically in an
NCQuotientRing.

+-----------------------------------------------------------------------------+
|i10 : B = A/I                                                                |
|                                                                             |
|o10 = B                                                                      |
|                                                                             |
|o10 : NCQuotientRing                                                         |
+-----------------------------------------------------------------------------+
|i11 : z^17                                                                   |
|                                                                             |
|                                      2               2 2               2    |
|o11 = yxyxyxyxyxyxyxyxz+yxyxyxyxyxyxyx yz+yxyxyxyxyxyx y xz+yxyxyxyxyxyx yxyz|
|                                                                             |
|o11 : B                                                                      |
|-----------------------------------------------------------------------------|
|           2 2               2 2 2             2   2             2           |
|+yxyxyxyxyx y xyxz+yxyxyxyxyx y x yz+yxyxyxyxyx yxy xz+yxyxyxyxyx yxyxyz+    |
|-----------------------------------------------------------------------------|
|        2 2               2 2   2           2 2 2 2           2 2 2          |
|yxyxyxyx y xyxyxz+yxyxyxyx y xyx yz+yxyxyxyx y x y xz+yxyxyxyx y x yxyz+     |
|-----------------------------------------------------------------------------|
|        2   2             2   2 2           2     2           2              |
|yxyxyxyx yxy xyxz+yxyxyxyx yxy x yz+yxyxyxyx yxyxy xz+yxyxyxyx yxyxyxyz+     |
|-----------------------------------------------------------------------------|
|      2 2               2 2     2         2 2   2 2         2 2   2          |
|yxyxyx y xyxyxyxz+yxyxyx y xyxyx yz+yxyxyx y xyx y xz+yxyxyx y xyx yxyz+     |
|-----------------------------------------------------------------------------|
|      2 2 2 2           2 2 2 2 2         2 2 2   2         2 2 2            |
|yxyxyx y x y xyxz+yxyxyx y x y x yz+yxyxyx y x yxy xz+yxyxyx y x yxyxyz+     |
|-----------------------------------------------------------------------------|
|      2   2             2   2   2         2   2 2 2         2   2 2          |
|yxyxyx yxy xyxyxz+yxyxyx yxy xyx yz+yxyxyx yxy x y xz+yxyxyx yxy x yxyz+     |
|-----------------------------------------------------------------------------|
|      2     2           2     2 2         2       2         2               2|
|yxyxyx yxyxy xyxz+yxyxyx yxyxy x yz+yxyxyx yxyxyxy xz+yxyxyx yxyxyxyxyz+yxyx |
|-----------------------------------------------------------------------------|
| 2               2 2       2       2 2     2 2       2 2     2         2 2   |
|y xyxyxyxyxz+yxyx y xyxyxyx yz+yxyx y xyxyx y xz+yxyx y xyxyx yxyz+yxyx y xyx|
|-----------------------------------------------------------------------------|
|2 2         2 2   2 2 2       2 2   2   2       2 2   2           2 2 2 2    |
| y xyxz+yxyx y xyx y x yz+yxyx y xyx yxy xz+yxyx y xyx yxyxyz+yxyx y x y     |
|-----------------------------------------------------------------------------|
|           2 2 2 2   2       2 2 2 2 2 2       2 2 2 2 2         2 2 2   2   |
|xyxyxz+yxyx y x y xyx yz+yxyx y x y x y xz+yxyx y x y x yxyz+yxyx y x yxy    |
|-----------------------------------------------------------------------------|
|         2 2 2   2 2       2 2 2     2       2 2 2             2   2         |
|xyxz+yxyx y x yxy x yz+yxyx y x yxyxy xz+yxyx y x yxyxyxyz+yxyx yxy xyxyxyxz+|
|-----------------------------------------------------------------------------|
|    2   2     2       2   2   2 2       2   2   2         2   2 2 2         2|
|yxyx yxy xyxyx yz+yxyx yxy xyx y xz+yxyx yxy xyx yxyz+yxyx yxy x y xyxz+yxyx |
|-----------------------------------------------------------------------------|
|   2 2 2 2       2   2 2   2       2   2 2           2     2           2     |
|yxy x y x yz+yxyx yxy x yxy xz+yxyx yxy x yxyxyz+yxyx yxyxy xyxyxz+yxyx yxyxy|
|-----------------------------------------------------------------------------|
|2   2       2     2 2 2       2     2 2         2       2         2       2 2|
| xyx yz+yxyx yxyxy x y xz+yxyx yxyxy x yxyz+yxyx yxyxyxy xyxz+yxyx yxyxyxy x |
|-----------------------------------------------------------------------------|
|       2         2       2               2 2               2 2         2     |
|yz+yxyx yxyxyxyxy xz+yxyx yxyxyxyxyxyz+yx y xyxyxyxyxyxz+yx y xyxyxyxyx yz+yx|
|-----------------------------------------------------------------------------|
|2 2       2 2     2 2       2       2 2     2 2       2 2     2 2 2     2 2  |
| y xyxyxyx y xz+yx y xyxyxyx yxyz+yx y xyxyx y xyxz+yx y xyxyx y x yz+yx y   |
|-----------------------------------------------------------------------------|
|     2   2     2 2     2         2 2   2 2         2 2   2 2   2     2 2   2 |
|xyxyx yxy xz+yx y xyxyx yxyxyz+yx y xyx y xyxyxz+yx y xyx y xyx yz+yx y xyx y|
|-----------------------------------------------------------------------------|
|2 2 2     2 2   2 2 2       2 2   2   2       2 2   2   2 2     2 2   2     2|
| x y xz+yx y xyx y x yxyz+yx y xyx yxy xyxz+yx y xyx yxy x yz+yx y xyx yxyxy |
|-----------------------------------------------------------------------------|
|     2 2   2           2 2 2 2           2 2 2 2     2     2 2 2 2   2 2     |
|xz+yx y xyx yxyxyxyz+yx y x y xyxyxyxz+yx y x y xyxyx yz+yx y x y xyx y xz+yx|
|-----------------------------------------------------------------------------|
|2 2 2 2   2       2 2 2 2 2 2       2 2 2 2 2 2 2     2 2 2 2 2   2     2 2 2|
| y x y xyx yxyz+yx y x y x y xyxz+yx y x y x y x yz+yx y x y x yxy xz+yx y x |
|-----------------------------------------------------------------------------|
| 2 2         2 2 2   2         2 2 2   2   2     2 2 2   2 2 2     2 2 2   2 |
|y x yxyxyz+yx y x yxy xyxyxz+yx y x yxy xyx yz+yx y x yxy x y xz+yx y x yxy x|
|-----------------------------------------------------------------------------|
|2       2 2 2     2       2 2 2     2 2     2 2 2       2     2 2 2          |
| yxyz+yx y x yxyxy xyxz+yx y x yxyxy x yz+yx y x yxyxyxy xz+yx y x yxyxyxyxyz|
|-----------------------------------------------------------------------------|
|   2   2             2   2       2     2   2     2 2     2   2     2       2 |
|+yx yxy xyxyxyxyxz+yx yxy xyxyxyx yz+yx yxy xyxyx y xz+yx yxy xyxyx yxyz+yx  |
|-----------------------------------------------------------------------------|
|   2   2 2       2   2   2 2 2     2   2   2   2     2   2   2         2   2 |
|yxy xyx y xyxz+yx yxy xyx y x yz+yx yxy xyx yxy xz+yx yxy xyx yxyxyz+yx yxy x|
|-----------------------------------------------------------------------------|
|2 2         2   2 2 2   2     2   2 2 2 2 2     2   2 2 2 2       2   2 2   2|
| y xyxyxz+yx yxy x y xyx yz+yx yxy x y x y xz+yx yxy x y x yxyz+yx yxy x yxy |
|-----------------------------------------------------------------------------|
|       2   2 2   2 2     2   2 2     2     2   2 2           2     2         |
|xyxz+yx yxy x yxy x yz+yx yxy x yxyxy xz+yx yxy x yxyxyxyz+yx yxyxy xyxyxyxz+|
|-----------------------------------------------------------------------------|
|  2     2     2     2     2   2 2     2     2   2       2     2 2 2       2  |
|yx yxyxy xyxyx yz+yx yxyxy xyx y xz+yx yxyxy xyx yxyz+yx yxyxy x y xyxz+yx   |
|-----------------------------------------------------------------------------|
|     2 2 2 2     2     2 2   2     2     2 2         2       2         2     |
|yxyxy x y x yz+yx yxyxy x yxy xz+yx yxyxy x yxyxyz+yx yxyxyxy xyxyxz+yx      |
|-----------------------------------------------------------------------------|
|       2   2     2       2 2 2     2       2 2       2         2       2     |
|yxyxyxy xyx yz+yx yxyxyxy x y xz+yx yxyxyxy x yxyz+yx yxyxyxyxy xyxz+yx      |
|-----------------------------------------------------------------------------|
|         2 2     2           2     2                 2                 2     |
|yxyxyxyxy x yz+yx yxyxyxyxyxy xz+yx yxyxyxyxyxyxyz+xy xyxyxyxyxyxyxz+xy      |
|-----------------------------------------------------------------------------|
|           2     2         2 2     2         2       2       2 2       2     |
|xyxyxyxyxyx yz+xy xyxyxyxyx y xz+xy xyxyxyxyx yxyz+xy xyxyxyx y xyxz+xy      |
|-----------------------------------------------------------------------------|
|       2 2 2     2       2   2     2       2         2     2 2         2     |
|xyxyxyx y x yz+xy xyxyxyx yxy xz+xy xyxyxyx yxyxyz+xy xyxyx y xyxyxz+xy xyxyx|
|-----------------------------------------------------------------------------|
|2 2   2     2     2 2 2 2     2     2 2 2       2     2   2       2     2   2|
| y xyx yz+xy xyxyx y x y xz+xy xyxyx y x yxyz+xy xyxyx yxy xyxz+xy xyxyx yxy |
|-----------------------------------------------------------------------------|
| 2     2     2     2     2     2           2   2 2           2   2 2     2   |
|x yz+xy xyxyx yxyxy xz+xy xyxyx yxyxyxyz+xy xyx y xyxyxyxz+xy xyx y xyxyx yz+|
|-----------------------------------------------------------------------------|
|  2   2 2   2 2     2   2 2   2       2   2 2 2 2       2   2 2 2 2 2     2  |
|xy xyx y xyx y xz+xy xyx y xyx yxyz+xy xyx y x y xyxz+xy xyx y x y x yz+xy   |
|-----------------------------------------------------------------------------|
|   2 2 2   2     2   2 2 2         2   2   2         2   2   2   2     2   2 |
|xyx y x yxy xz+xy xyx y x yxyxyz+xy xyx yxy xyxyxz+xy xyx yxy xyx yz+xy xyx  |
|-----------------------------------------------------------------------------|
|   2 2 2     2   2   2 2       2   2     2       2   2     2 2     2   2     |
|yxy x y xz+xy xyx yxy x yxyz+xy xyx yxyxy xyxz+xy xyx yxyxy x yz+xy xyx      |
|-----------------------------------------------------------------------------|
|       2     2   2             2 2 2             2 2 2       2     2 2 2     |
|yxyxyxy xz+xy xyx yxyxyxyxyz+xy x y xyxyxyxyxz+xy x y xyxyxyx yz+xy x y xyxyx|
|-----------------------------------------------------------------------------|
|2 2     2 2 2     2       2 2 2   2 2       2 2 2   2 2 2     2 2 2   2   2  |
| y xz+xy x y xyxyx yxyz+xy x y xyx y xyxz+xy x y xyx y x yz+xy x y xyx yxy xz|
|-----------------------------------------------------------------------------|
|   2 2 2   2         2 2 2 2 2         2 2 2 2 2   2     2 2 2 2 2 2 2     2 |
|+xy x y xyx yxyxyz+xy x y x y xyxyxz+xy x y x y xyx yz+xy x y x y x y xz+xy x|
|-----------------------------------------------------------------------------|
|2 2 2 2 2       2 2 2 2   2       2 2 2 2   2 2     2 2 2 2     2     2 2 2 2|
| y x y x yxyz+xy x y x yxy xyxz+xy x y x yxy x yz+xy x y x yxyxy xz+xy x y x |
|-----------------------------------------------------------------------------|
|           2 2   2           2 2   2     2     2 2   2   2 2     2 2   2   2 |
|yxyxyxyz+xy x yxy xyxyxyxz+xy x yxy xyxyx yz+xy x yxy xyx y xz+xy x yxy xyx  |
|-----------------------------------------------------------------------------|
|       2 2   2 2 2       2 2   2 2 2 2     2 2   2 2   2     2 2   2 2       |
|yxyz+xy x yxy x y xyxz+xy x yxy x y x yz+xy x yxy x yxy xz+xy x yxy x yxyxyz+|
|-----------------------------------------------------------------------------|
|  2 2     2         2 2     2   2     2 2     2 2 2     2 2     2 2       2 2|
|xy x yxyxy xyxyxz+xy x yxyxy xyx yz+xy x yxyxy x y xz+xy x yxyxy x yxyz+xy x |
|-----------------------------------------------------------------------------|
|       2       2 2       2 2     2 2         2     2 2                 2     |
|yxyxyxy xyxz+xy x yxyxyxy x yz+xy x yxyxyxyxy xz+xy x yxyxyxyxyxyz+xyxy      |
|-----------------------------------------------------------------------------|
|                 2         2       2       2 2       2       2         2     |
|xyxyxyxyxyxz+xyxy xyxyxyxyx yz+xyxy xyxyxyx y xz+xyxy xyxyxyx yxyz+xyxy xyxyx|
|-----------------------------------------------------------------------------|
|2 2         2     2 2 2       2     2   2       2     2           2   2 2    |
| y xyxz+xyxy xyxyx y x yz+xyxy xyxyx yxy xz+xyxy xyxyx yxyxyz+xyxy xyx y     |
|-----------------------------------------------------------------------------|
|           2   2 2   2       2   2 2 2 2       2   2 2 2         2   2   2   |
|xyxyxz+xyxy xyx y xyx yz+xyxy xyx y x y xz+xyxy xyx y x yxyz+xyxy xyx yxy    |
|-----------------------------------------------------------------------------|
|         2   2   2 2       2   2     2       2   2             2 2 2         |
|xyxz+xyxy xyx yxy x yz+xyxy xyx yxyxy xz+xyxy xyx yxyxyxyz+xyxy x y xyxyxyxz+|
|-----------------------------------------------------------------------------|
|    2 2 2     2       2 2 2   2 2       2 2 2   2         2 2 2 2 2         2|
|xyxy x y xyxyx yz+xyxy x y xyx y xz+xyxy x y xyx yxyz+xyxy x y x y xyxz+xyxy |
|-----------------------------------------------------------------------------|
| 2 2 2 2 2       2 2 2 2   2       2 2 2 2           2 2   2           2 2   |
|x y x y x yz+xyxy x y x yxy xz+xyxy x y x yxyxyz+xyxy x yxy xyxyxz+xyxy x yxy|
|-----------------------------------------------------------------------------|
|2   2       2 2   2 2 2       2 2   2 2         2 2     2         2 2     2 2|
| xyx yz+xyxy x yxy x y xz+xyxy x yxy x yxyz+xyxy x yxyxy xyxz+xyxy x yxyxy x |
|-----------------------------------------------------------------------------|
|       2 2       2       2 2                 2                 2       2     |
|yz+xyxy x yxyxyxy xz+xyxy x yxyxyxyxyz+xyxyxy xyxyxyxyxz+xyxyxy xyxyxyx yz+  |
|-----------------------------------------------------------------------------|
|      2     2 2         2     2           2   2 2           2   2 2 2        |
|xyxyxy xyxyx y xz+xyxyxy xyxyx yxyz+xyxyxy xyx y xyxz+xyxyxy xyx y x yz+     |
|-----------------------------------------------------------------------------|
|      2   2   2         2   2             2 2 2             2 2 2   2        |
|xyxyxy xyx yxy xz+xyxyxy xyx yxyxyz+xyxyxy x y xyxyxz+xyxyxy x y xyx yz+     |
|-----------------------------------------------------------------------------|
|      2 2 2 2 2         2 2 2 2           2 2   2           2 2   2 2        |
|xyxyxy x y x y xz+xyxyxy x y x yxyz+xyxyxy x yxy xyxz+xyxyxy x yxy x yz+     |
|-----------------------------------------------------------------------------|
|      2 2     2         2 2                 2                 2     2        |
|xyxyxy x yxyxy xz+xyxyxy x yxyxyxyz+xyxyxyxy xyxyxyxz+xyxyxyxy xyxyx yz+     |
|-----------------------------------------------------------------------------|
|        2   2 2           2   2             2 2 2             2 2 2 2        |
|xyxyxyxy xyx y xz+xyxyxyxy xyx yxyz+xyxyxyxy x y xyxz+xyxyxyxy x y x yz+     |
|-----------------------------------------------------------------------------|
|        2 2   2           2 2                 2                 2   2        |
|xyxyxyxy x yxy xz+xyxyxyxy x yxyxyz+xyxyxyxyxy xyxyxz+xyxyxyxyxy xyx yz+     |
|-----------------------------------------------------------------------------|
|          2 2 2             2 2                 2                 2 2        |
|xyxyxyxyxy x y xz+xyxyxyxyxy x yxyz+xyxyxyxyxyxy xyxz+xyxyxyxyxyxy x yz+     |
|-----------------------------------------------------------------------------|
|              2                                                              |
|xyxyxyxyxyxyxy xz+xyxyxyxyxyxyxyxyz                                          |
+-----------------------------------------------------------------------------+

We also use Bergman to compute Hilbert series of an NCQuotientRing,
using the hilbertBergman, command. By
default, the Hilbert series is given to degree 10. As mentioned above, we
suggest reducing the degree limit for rings whose growth is not well understood
beforehand.

+---------------------------------------------------------------------------+
|i12 : hilbertBergman B                                                     |
|--Calling bergman for HS computation.                                      |
|Complete!                                                                  |
|                                                                           |
|                 2      3      4      5      6      7      8      9      10|
|o12 = 1 + 3T + 6T  + 10T  + 15T  + 21T  + 28T  + 36T  + 45T  + 55T  + 66T  |
|                                                                           |
|o12 : ZZ[T]                                                                |
+---------------------------------------------------------------------------+

Perhaps a major achievement of the NCAlgebra package is the method
rightKernelBergman. The functionality described above
involves only the most basic Bergman calls, and long time Bergman users may
find little reason to prefer NCAlgebra on those grounds. On the other hand,
computing kernel generators for a matrix with entries in a noncommutative ring
is anything but straightforward, and we reduce the call to a single command.

+-----------------------------------------------------------------------------+
|i13 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})                              |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o13 = B                                                                      |
|                                                                             |
|o13 : NCQuotientRing                                                         |
+-----------------------------------------------------------------------------+
|i14 : A = ambient B                                                          |
|                                                                             |
|o14 = A                                                                      |
|                                                                             |
|o14 : NCPolynomialRing                                                       |
+-----------------------------------------------------------------------------+
|i15 : g = -y^3-x*y*z+y*x*z+x^3                                               |
|                                                                             |
|        3          3                                                         |
|o15 = -y +yxz-xyz+x                                                          |
|                                                                             |
|o15 : A                                                                      |
+-----------------------------------------------------------------------------+
|i16 : C = A/(ideal B + ncIdeal g)                                            |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o16 = C                                                                      |
|                                                                             |
|o16 : NCQuotientRing                                                         |
+-----------------------------------------------------------------------------+
|i17 : M = ncMatrix {{x,y,z,0}, {-y*z-2*x^2,-y*x,z*x-x*z,x},{x*y-2*y*x,x*z,-x^|
|                                                                             |
|o17 = | x          y    z         0 |                                        |
|      | -y*z-2*x^2 -y*x y^2-2*x*z x |                                        |
|      | -2*y*x+x*y x*z  -x^2      y |                                        |
|      | -2*y^2+x*z x^2  -x*y      z |                                        |
|                                                                             |
|o17 : NCMatrix                                                               |
|-----------------------------------------------------------------------------|
|2,y}, {-y^2-z*x,x^2,-x*y,z}}                                                 |
+-----------------------------------------------------------------------------+

For details about matrices over noncommutative rings, see NCMatrix.
Provided the entries of M are homogeneous and their degrees are
compatible, M can be viewed as a graded (degree 0) homomorphism of graded free
B-modules. For more on this degree-compatibility, see assignDegrees.

+------------------------------------------+
|i18 : assignDegrees(M,{1,0,0,0},{2,2,2,1})|
|                                          |
|o18 = | x          y    z         0 |     |
|      | -y*z-2*x^2 -y*x y^2-2*x*z x |     |
|      | -2*y*x+x*y x*z  -x^2      y |     |
|      | -2*y^2+x*z x^2  -x*y      z |     |
|                                          |
|o18 : NCMatrix                            |
+------------------------------------------+

Now, we can compute the kernel of M. It is always assumed that M determines a
map of graded right modules. As always in the noncommutative case, computing
generators of the kernel of a map is generally an infinite linear algebra
problem. The rightKernelBergman, method returns a set
of minimal kernel generators to degree 10, or to the degree specified by the
user.

+----------------------------------------------+
|i19 : ker1M = rightKernelBergman(M)           |
|--Calling Bergman for NCGB calculation.       |
|Complete!                                     |
|--Calling Bergman for NCGB calculation.       |
|Complete!                                     |
|                                              |
|o19 = | -z     -x     y            -y*z-x^2  ||
|      | y      z      x            y^2       ||
|      | -x     y      -z           2*y*x-x*y ||
|      | -2*y^2 -2*x^2 -2*y*x+2*x*y -2*x*y*z  ||
|                                              |
|o19 : NCMatrix                                |
+----------------------------------------------+
|i20 : M*ker1M == 0                            |
|                                              |
|o20 = true                                    |
+----------------------------------------------+

In principle, this method can be used to compute the minimal free resolution of
a finitely generated B-module with known presentation up to a specified degree.

+-------------------------------------------+
|i21 : ker2M = rightKernelBergman(ker1M)    |
|--Calling Bergman for NCGB calculation.    |
|Complete!                                  |
|--Calling Bergman for NCGB calculation.    |
|Complete!                                  |
|--Calling Bergman for NCGB calculation.    |
|Complete!                                  |
|--Calling Bergman for NCGB calculation.    |
|Complete!                                  |
|                                           |
|o21 = | -y x^2  -x*z       -x*y       |    |
|      | x  y^2  -y*x+2*x*y -y*z+2*x^2 |    |
|      | z  -x*y x^2        -x*z       |    |
|      | 0  -z   -y         -x         |    |
|                                           |
|o21 : NCMatrix                             |
+-------------------------------------------+
|i22 : ker3M = rightKernelBergman(ker2M)    |
|--Calling Bergman for NCGB calculation.    |
|Complete!                                  |
|--Calling Bergman for NCGB calculation.    |
|Complete!                                  |
|                                           |
|o22 = | 0  -2*y*x -2*y^2+2*x*z -y*x*z+x^3 ||
|      | -y -z     -x           -x*y       ||
|      | -z x      y            x*z        ||
|      | x  y      -z           0          ||
|                                           |
|o22 : NCMatrix                             |
+-------------------------------------------+

See also
========

  * General setup information

- NCMatrix -- Negates NCMatrices
********************************

Synopsis
========

  * Operator: - (Macaulay2Doc),
  * Usage:
        L = -M
  * Inputs:
      * M, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This negates NCMatrices.

+--------------------------------------------------+
|i1 : A = QQ{x,y,z}                                |
|                                                  |
|o1 = A                                            |
|                                                  |
|o1 : NCPolynomialRing                             |
+--------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                     |
|                                                  |
|o2 = | x y z |                                    |
|                                                  |
|o2 : NCMatrix                                     |
+--------------------------------------------------+
|i3 : sigma = ncMap(A,A,{y,z,x})                   |
|                                                  |
|o3 = NCRingMap A <--- A                           |
|                                                  |
|o3 : NCRingMap                                    |
+--------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}|
|                                                  |
|o4 = | x y z |                                    |
|     | y z x |                                    |
|     | z x y |                                    |
|                                                  |
|o4 : NCMatrix                                     |
+--------------------------------------------------+
|i5 : -N                                           |
|                                                  |
|o5 = | -x -y -z |                                 |
|     | -y -z -x |                                 |
|     | -z -x -y |                                 |
|                                                  |
|o5 : NCMatrix                                     |
+--------------------------------------------------+

Ways to use this method:
========================

  * - NCMatrix -- Negates NCMatrices

ambient(NCQuotientRing) -- Ambient ring of an NCQuotientRing
************************************************************

Synopsis
========

  * Function: ambient (Macaulay2Doc),
  * Usage:
        A = ambient B
  * Inputs:
      * B, an instance of the type NCQuotientRing,
  * Outputs:
      * A, an instance of the type NCPolynomialRing,

Description
===========

Returns the ambient ring of an NCQuotientRing.

As quotients of NCQuotientRings are added, this will return the top-level
ambient ring.

+-----------------------------------------------+
|i1 : B = skewPolynomialRing(QQ,(-1)_QQ,{x,y,z})|
|--Calling Bergman for NCGB calculation.        |
|Complete!                                      |
|                                               |
|o1 = B                                         |
|                                               |
|o1 : NCQuotientRing                            |
+-----------------------------------------------+
|i2 : A = ambient B                             |
|                                               |
|o2 = A                                         |
|                                               |
|o2 : NCPolynomialRing                          |
+-----------------------------------------------+

Ways to use this method:
========================

  * ambient(NCQuotientRing) -- Ambient ring
    of an NCQuotientRing

ambient(NCRingMap) -- Extends an NCRingMap to the ambient ring of the source.
*****************************************************************************

Synopsis
========

  * Function: ambient (Macaulay2Doc),
  * Usage:
        g = ambient f
  * Inputs:
      * f, an instance of the type NCRingMap,
  * Outputs:
      * g, an instance of the type NCRingMap,

Description
===========

If f:R->S is a ring map and R=A/I is a quotient ring, this method returns the
NCRingMap g:A->S obtained by composing f with the natural map. This method is
called by isWellDefined(NCRingMap), and can
be used to determine what ideal to mod out of the target so the map becomes
well-defined.

+-----------------------------------------------------+
|i1 : A = skewPolynomialRing(QQ,(-1)_QQ,{w,x,y,z})    |
|--Calling Bergman for NCGB calculation.              |
|Complete!                                            |
|                                                     |
|o1 = A                                               |
|                                                     |
|o1 : NCQuotientRing                                  |
+-----------------------------------------------------+
|i2 : B = QQ{w,x,y,z}/ncIdeal{w*x+x*w,w*y+y*w,x*y+y*x}|
|--Calling Bergman for NCGB calculation.              |
|Complete!                                            |
|                                                     |
|o2 = B                                               |
|                                                     |
|o2 : NCQuotientRing                                  |
+-----------------------------------------------------+
|i3 : f = ncMap(B,A,gens B)                           |
|                                                     |
|o3 = NCRingMap B <--- A                              |
|                                                     |
|o3 : NCRingMap                                       |
+-----------------------------------------------------+
|i4 : isWellDefined f                                 |
|                                                     |
|o4 = false                                           |
+-----------------------------------------------------+
|i5 : g = ambient f                                   |
|                                                     |
|o5 = NCRingMap B <--- QQ{w, x, y, z}                 |
|                                                     |
|o5 : NCRingMap                                       |
+-----------------------------------------------------+
|i6 : (gens ideal A)/g                                |
|                                                     |
|o6 = {0, 0, 0, zw+wz, zx+xz, zy+yz}                  |
|                                                     |
|o6 : List                                            |
+-----------------------------------------------------+

Ways to use this method:
========================

  * ambient(NCRingMap) -- Extends an NCRingMap
    to the ambient ring of the source.

assignDegrees -- Weights entries of a matrix to make associated map of free modules graded
******************************************************************************************

Synopsis
========

  * Usage:
        assignDegrees(M) or assignDegrees(M,targetDegs,sourceDegs)
  * Inputs:
      * M, an instance of the type NCMatrix,
      * targetDegs, a list (Macaulay2Doc), a list of integer
        weights for the target basis vectors
      * sourceDegs, a list (Macaulay2Doc), a list of integer
        weights for the source basis vectors
  * Outputs:
      * an instance of the type NCMatrix, the same matrix M
        with source and target keys specified and isHomogeneous flag true

Description
===========

A matrix M with homogeneous entries in an NCRing can determine a homomorphism
of graded free modules if the entries satisfy certain consistency conditions.
Finding a set of degrees for source and target basis vectors such that M
determines a graded module map is an integer programming problem. This method
does not solve the problem in general.

With only one input, this method checks to see if the entries in each column
all have the same homogeneous degree. If so, the method assigns source and
target degrees in the natural way and the isHomogeneous (Macaulay2Doc),
flag is set for M. If not, all degrees are set to
0 and the flag is not set. This method is called any time a matrix is created.

With three inputs, the user may specify the desired degree shifts on inputs and
outputs such that the associated module map is graded.

+-----------------------------------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})                               |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o1 = B                                                                       |
|                                                                             |
|o1 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : M = ncMatrix {{x,y,z,0}, {-y*z-2*x^2,-y*x,z*x-x*z,x},{x*y-2*y*x,x*z,-x^2|
|                                                                             |
|o2 = | x          y    z         0 |                                         |
|     | -y*z-2*x^2 -y*x y^2-2*x*z x |                                         |
|     | -2*y*x+x*y x*z  -x^2      y |                                         |
|     | -2*y^2+x*z x^2  -x*y      z |                                         |
|                                                                             |
|o2 : NCMatrix                                                                |
|-----------------------------------------------------------------------------|
|,y}, {-y^2-z*x,x^2,-x*y,z}}                                                  |
+-----------------------------------------------------------------------------+
|i3 : isHomogeneous M                                                         |
|                                                                             |
|o3 = false                                                                   |
+-----------------------------------------------------------------------------+
|i4 : assignDegrees(M,{1,0,0,0},{2,2,2,1})                                    |
|                                                                             |
|o4 = | x          y    z         0 |                                         |
|     | -y*z-2*x^2 -y*x y^2-2*x*z x |                                         |
|     | -2*y*x+x*y x*z  -x^2      y |                                         |
|     | -2*y^2+x*z x^2  -x*y      z |                                         |
|                                                                             |
|o4 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i5 : isHomogeneous M                                                         |
|                                                                             |
|o5 = true                                                                    |
+-----------------------------------------------------------------------------+
|i6 : N = ncMatrix {gens B}                                                   |
|                                                                             |
|o6 = | x y z |                                                               |
|                                                                             |
|o6 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i7 : isHomogeneous N                                                         |
|                                                                             |
|o7 = true                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * isHomogeneous (Macaulay2Doc) -- whether something is
    homogeneous (graded)
  * rightKernelBergman -- Methods for computing
    kernels of matrices over noncommutative rings using Bergman

Ways to use assignDegrees :
===========================

  * "assignDegrees(NCMatrix)"
  * "assignDegrees(NCMatrix,List,List)"

For the programmer
==================

The object assignDegrees, is a method function (Macaulay2Doc).

baseName(NCRingElement) -- Returns the base name of a generator of an NCRing
****************************************************************************

Synopsis
========

  * Function: baseName (Macaulay2Doc),
  * Usage:
        name = baseName f
  * Inputs:
      * f, an instance of the type NCRingElement,

Description
===========

Returns the base name of a generator of an NCRing.  This could be something of
type IndexedVariable (Macaulay2Doc), or a Symbol (Macaulay2Doc).

+---------------------+
|i1 : A = QQ{x,y,z,w} |
|                     |
|o1 = A               |
|                     |
|o1 : NCPolynomialRing|
+---------------------+
|i2 : baseName x      |
|                     |
|o2 = x               |
|                     |
|o2 : Symbol          |
+---------------------+
|i3 : B = QQ{p_1..p_6}|
|                     |
|o3 = B               |
|                     |
|o3 : NCPolynomialRing|
+---------------------+
|i4 : baseName p_1    |
|                     |
|o4 = p               |
|      1              |
|                     |
|o4 : IndexedVariable |
+---------------------+

Ways to use this method:
========================

  * baseName(NCRingElement) -- Returns the
    base name of a generator of an NCRing

basis(ZZ,NCIdeal) -- Returns a basis of an NCIdeal in a particular degree.
**************************************************************************

Synopsis
========

  * Function: basis (Macaulay2Doc),
  * Usage:
        bas = basis(n,I)
  * Inputs:
      * n, an integer (Macaulay2Doc),
      * I, an instance of the type NCIdeal,
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), => ..., default value null, null
      * Limit (Macaulay2Doc), => ..., default value infinity, null
      * SourceRing (Macaulay2Doc), => ..., default value null, null
      * Strategy (Macaulay2Doc), => ..., default value null, null
      * Truncate (Macaulay2Doc), => ..., default value false, null
      * Variables (Macaulay2Doc), => ..., default value null, null
  * Outputs:
      * bas, an instance of the type NCMatrix,

Description
===========

This command returns a basis (or minimal generating set, if the ground ring is
not a field), of a homogeneous two-sided ideal in a noncommutative ring.

+-----------------------------------------------------------------------------+
|i1 : A = QQ{x,y,z}                                                           |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : p = y*z + z*y - x^2                                                     |
|                                                                             |
|            2                                                                |
|o2 = zy+yz-x                                                                 |
|                                                                             |
|o2 : A                                                                       |
+-----------------------------------------------------------------------------+
|i3 : q = x*z + z*x - y^2                                                     |
|                                                                             |
|         2                                                                   |
|o3 = zx-y +xz                                                                |
|                                                                             |
|o3 : A                                                                       |
+-----------------------------------------------------------------------------+
|i4 : r = z^2 - x*y - y*x                                                     |
|                                                                             |
|      2                                                                      |
|o4 = z -yx-xy                                                                |
|                                                                             |
|o4 : A                                                                       |
+-----------------------------------------------------------------------------+
|i5 : I = ncIdeal{p,q,r}                                                      |
|                                                                             |
|                             2      2      2                                 |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}                          |
|                                                                             |
|o5 : NCIdeal                                                                 |
+-----------------------------------------------------------------------------+
|i6 : bas = basis(3,I)                                                        |
|                                                                             |
|o6 = | z*x^2-y^2*x+x*z*x z*y*x+y*z*x-x^3 z^2*x-y*x^2-x*y*x -y*x^2+x^2*y      |
|                                                                             |
|o6 : NCMatrix                                                                |
|-----------------------------------------------------------------------------|
|-y^2*x+x*y^2 z*x*y-y^3+x*z*y z*y^2+y*z*y-y*x^2 z^2*y-y^2*x-y*x*y -z*x^2+x^2*z|
|-----------------------------------------------------------------------------|
|-z*y*x-y^3+y*x*z+x^3 -z*y^2+z*x*z+y*x^2+x*y*x -z*x*y+y^3+x*y*z-x^3           |
|-----------------------------------------------------------------------------|
|-z*y^2+y^2*z z*y*z-z*x^2+y^2*x+y*x*y -y*x^2+x*z^2-x*y*x y*z^2-y^2*x-y*x*y    |
|-----------------------------------------------------------------------------|
|z^3-z*y*x-z*x*y |                                                            |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * basis(ZZ,NCIdeal) -- Returns a basis of an
    NCIdeal in a particular degree.

basis(ZZ,NCLeftIdeal) -- Returns a basis of an NCLeftIdeal in a particular degree.
**********************************************************************************

Synopsis
========

  * Function: basis (Macaulay2Doc),
  * Usage:
        bas = basis(n,I)
  * Inputs:
      * n, an integer (Macaulay2Doc),
      * I, an instance of the type NCLeftIdeal,
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), => ..., default value null, null
      * Limit (Macaulay2Doc), => ..., default value infinity, null
      * SourceRing (Macaulay2Doc), => ..., default value null, null
      * Strategy (Macaulay2Doc), => ..., default value null, null
      * Truncate (Macaulay2Doc), => ..., default value false, null
      * Variables (Macaulay2Doc), => ..., default value null, null
  * Outputs:
      * bas, an instance of the type NCMatrix,

Description
===========

This command returns a basis (or minimal generating set, if the ground ring is
not a field), of a homogeneous left ideal in a noncommutative ring.

+-----------------------------------------------------------------------------+
|i1 : A = QQ{x,y,z}                                                           |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : p = y*z + z*y - x^2                                                     |
|                                                                             |
|            2                                                                |
|o2 = zy+yz-x                                                                 |
|                                                                             |
|o2 : A                                                                       |
+-----------------------------------------------------------------------------+
|i3 : q = x*z + z*x - y^2                                                     |
|                                                                             |
|         2                                                                   |
|o3 = zx-y +xz                                                                |
|                                                                             |
|o3 : A                                                                       |
+-----------------------------------------------------------------------------+
|i4 : r = z^2 - x*y - y*x                                                     |
|                                                                             |
|      2                                                                      |
|o4 = z -yx-xy                                                                |
|                                                                             |
|o4 : A                                                                       |
+-----------------------------------------------------------------------------+
|i5 : I = ncLeftIdeal{p,q,r}                                                  |
|                                                                             |
|                        2      2      2                                      |
|o5 = Left ideal {zy+yz-x , zx-y +xz, z -yx-xy}                               |
|                                                                             |
|o5 : NCLeftIdeal                                                             |
+-----------------------------------------------------------------------------+
|i6 : bas = basis(3,I)                                                        |
|                                                                             |
|o6 = | x*z*x-x*y^2+x^2*z y*z*x-y^3+y*x*z z^2*x-z*y^2+z*x*z x*z*y+x*y*z-x^3   |
|                                                                             |
|o6 : NCMatrix                                                                |
|-----------------------------------------------------------------------------|
|y*z*y+y^2*z-y*x^2 z^2*y+z*y*z-z*x^2 x*z^2-x*y*x-x^2*y y*z^2-y^2*x-y*x*y      |
|-----------------------------------------------------------------------------|
|z^3-z*y*x-z*x*y |                                                            |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * basis(ZZ,NCLeftIdeal) -- Returns a
    basis of an NCLeftIdeal in a particular degree.

basis(ZZ,NCRightIdeal) -- Returns a basis of an NCRightIdeal in a particular degree.
************************************************************************************

Synopsis
========

  * Function: basis (Macaulay2Doc),
  * Usage:
        bas = basis(n,I)
  * Inputs:
      * n, an integer (Macaulay2Doc),
      * I, an instance of the type NCRightIdeal,
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), => ..., default value null, null
      * Limit (Macaulay2Doc), => ..., default value infinity, null
      * SourceRing (Macaulay2Doc), => ..., default value null, null
      * Strategy (Macaulay2Doc), => ..., default value null, null
      * Truncate (Macaulay2Doc), => ..., default value false, null
      * Variables (Macaulay2Doc), => ..., default value null, null
  * Outputs:
      * bas, an instance of the type NCMatrix,

Description
===========

This command returns a basis (or minimal generating set, if the ground ring is
not a field), of a homogeneous right ideal in a noncommutative ring.

+-----------------------------------------------------------------------------+
|i1 : A = QQ{x,y,z}                                                           |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : p = y*z + z*y - x^2                                                     |
|                                                                             |
|            2                                                                |
|o2 = zy+yz-x                                                                 |
|                                                                             |
|o2 : A                                                                       |
+-----------------------------------------------------------------------------+
|i3 : q = x*z + z*x - y^2                                                     |
|                                                                             |
|         2                                                                   |
|o3 = zx-y +xz                                                                |
|                                                                             |
|o3 : A                                                                       |
+-----------------------------------------------------------------------------+
|i4 : r = z^2 - x*y - y*x                                                     |
|                                                                             |
|      2                                                                      |
|o4 = z -yx-xy                                                                |
|                                                                             |
|o4 : A                                                                       |
+-----------------------------------------------------------------------------+
|i5 : I = ncRightIdeal{p,q,r}                                                 |
|                                                                             |
|                         2      2      2                                     |
|o5 = Right ideal {zy+yz-x , zx-y +xz, z -yx-xy}                              |
|                                                                             |
|o5 : NCRightIdeal                                                            |
+-----------------------------------------------------------------------------+
|i6 : bas = basis(3,I)                                                        |
|                                                                             |
|o6 = | z*x^2-y^2*x+x*z*x z*y*x+y*z*x-x^3 z^2*x-y*x^2-x*y*x z*x*y-y^3+x*z*y   |
|                                                                             |
|o6 : NCMatrix                                                                |
|-----------------------------------------------------------------------------|
|z*y^2+y*z*y-x^2*y z^2*y-y*x*y-x*y^2 z*x*z-y^2*z+x*z^2 z*y*z+y*z^2-x^2*z      |
|-----------------------------------------------------------------------------|
|z^3-y*x*z-x*y*z |                                                            |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * basis(ZZ,NCRightIdeal) -- Returns a
    basis of an NCRightIdeal in a particular degree.

basis(ZZ,NCRing) -- Returns a basis of an NCRing in a particular degree.
************************************************************************

Synopsis
========

  * Function: basis (Macaulay2Doc),
  * Usage:
        bas = basis(n,B)
  * Inputs:
      * n, an integer (Macaulay2Doc),
      * I, an instance of the type NCRing,
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), => ..., default value null, null
      * Limit (Macaulay2Doc), => ..., default value infinity, null
      * SourceRing (Macaulay2Doc), => ..., default value null, null
      * Strategy (Macaulay2Doc), => ..., default value null, null
      * Truncate (Macaulay2Doc), => ..., default value false, null
      * Variables (Macaulay2Doc), => ..., default value null, null
  * Outputs:
      * bas, an instance of the type NCMatrix,

Description
===========

This command returns a basis (or minimal generating set, if the ground ring is
not a field), of a graded noncommutative ring.

+-----------------------------------------------------------------------------+
|i1 : A = QQ{x,y,z}                                                           |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : p = y*z + z*y - x^2                                                     |
|                                                                             |
|            2                                                                |
|o2 = zy+yz-x                                                                 |
|                                                                             |
|o2 : A                                                                       |
+-----------------------------------------------------------------------------+
|i3 : q = x*z + z*x - y^2                                                     |
|                                                                             |
|         2                                                                   |
|o3 = zx-y +xz                                                                |
|                                                                             |
|o3 : A                                                                       |
+-----------------------------------------------------------------------------+
|i4 : r = z^2 - x*y - y*x                                                     |
|                                                                             |
|      2                                                                      |
|o4 = z -yx-xy                                                                |
|                                                                             |
|o4 : A                                                                       |
+-----------------------------------------------------------------------------+
|i5 : I = ncIdeal{p,q,r}                                                      |
|                                                                             |
|                             2      2      2                                 |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}                          |
|                                                                             |
|o5 : NCIdeal                                                                 |
+-----------------------------------------------------------------------------+
|i6 : B = A/I                                                                 |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o6 = B                                                                       |
|                                                                             |
|o6 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i7 : bas = basis(4,B)                                                        |
|                                                                             |
|o7 = | x^4 x^2*y*x y*x*y*x x^3*y x*y*x*y x^2*y^2 y*x*y^2 x*y^3 y^4 x^3*z     |
|                                                                             |
|o7 : NCMatrix                                                                |
|-----------------------------------------------------------------------------|
|x*y*x*z x^2*y*z y*x*y*z x*y^2*z y^3*z |                                      |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * basis(ZZ,NCRing) -- Returns a basis of an
    NCRing in a particular degree.

centralElements -- Finds central elements in a given degree
***********************************************************

Synopsis
========

  * Usage:
        centralElements(A,n)
  * Inputs:
      * A, an instance of the type NCRing,
      * n, an integer (Macaulay2Doc), the homogeneous degree in which
        to compute central elements
  * Outputs:
      * an instance of the type NCMatrix,

Description
===========

If the given NCRing has central elements of the specified degree, this method
returns a basis for the space of central elements in that degree.

+----------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})|
|--Calling Bergman for NCGB calculation.       |
|Complete!                                     |
|                                              |
|o1 = B                                        |
|                                              |
|o1 : NCQuotientRing                           |
+----------------------------------------------+
|i2 : centralElements(B,2)                     |
|                                              |
|o2 = | x^2 y*x+x*y y^2 |                      |
|                                              |
|o2 : NCMatrix                                 |
+----------------------------------------------+
|i3 : centralElements(B,3)                     |
|                                              |
|o3 = | y^3-y*x*z+x*y*z-x^3 |                  |
|                                              |
|o3 : NCMatrix                                 |
+----------------------------------------------+

Ways to use centralElements :
=============================

  * "centralElements(NCRing,ZZ)"

For the programmer
==================

The object centralElements, is a method function (Macaulay2Doc).

coefficientRing(NCRing) -- Returns the base ring of an NCRing
*************************************************************

Synopsis
========

  * Function: coefficientRing (Macaulay2Doc),
  * Usage:
        k = coefficientRing NCRing
  * Inputs:
      * A, an instance of the type NCRing,
  * Outputs:
      * k, a ring (Macaulay2Doc),

Description
===========

This function returns the base ring of an NCRing

+-----------------------------------------+
|i1 : A = QQ{x,y,z}                       |
|                                         |
|o1 = A                                   |
|                                         |
|o1 : NCPolynomialRing                    |
+-----------------------------------------+
|i2 : coefficientRing A                   |
|                                         |
|o2 = QQ                                  |
|                                         |
|o2 : Ring                                |
+-----------------------------------------+
|i3 : R = ZZ/101[a,b,c,d]/(ideal(a^2-b^2))|
|                                         |
|o3 = R                                   |
|                                         |
|o3 : QuotientRing                        |
+-----------------------------------------+
|i4 : B = R{x,y,z}                        |
|                                         |
|o4 = B                                   |
|                                         |
|o4 : NCPolynomialRing                    |
+-----------------------------------------+
|i5 : coefficientRing B                   |
|                                         |
|o5 = R                                   |
|                                         |
|o5 : QuotientRing                        |
+-----------------------------------------+

Ways to use this method:
========================

  * coefficientRing(NCRing) -- Returns the
    base ring of an NCRing

coordinates -- Computes coordinates relative to a given basis
*************************************************************

Synopsis
========

  * Usage:
        coordinates L
  * Inputs:
      * L, an instance of the type NCRingElement, or a
        List (Macaulay2Doc), of NCRingElements
  * Optional inputs (Macaulay2Doc),:
      * Basis => a list (Macaulay2Doc), default value null, a list
        of homogeneous elements to use as a basis for computing coordinate
        vectors
  * Outputs:
      * a matrix (Macaulay2Doc),

Description
===========

Generally, linear algebra in graded rings is performed using the monomial basis
obtained from a Groebner basis calculation. In some cases, it is desirable to
work relative to a different basis. This method calls sparseCoeffs,
to compute the coordinate vector(s) of a ring element (or a list
of ring elements) relative to a user-specified basis. If no basis is specified,
the method simple calls sparseCoeffs, with no options.

+----------------------------------------------------+
|i1 : R = QQ[w]/ideal(w^2+w+1)                       |
|                                                    |
|o1 = R                                              |
|                                                    |
|o1 : QuotientRing                                   |
+----------------------------------------------------+
|i2 : A = skewPolynomialRing(R,promote(-1,R),{x,y,z})|
|                                                    |
|o2 = A                                              |
|                                                    |
|o2 : NCQuotientRing                                 |
+----------------------------------------------------+

One motivating example comes from invariant theory. In this example, we take a
skew polynomial ring in three variables and act by the cyclic subgroup of
graded automorphisms of A generated by permuting the variables. A basis for the
fixed ring is given by "orbit sums" of basis monomials. Here we work in
homogeneous degree 3.

+-----------------------------------------------------------------+
|i3 : g = ncMap(A,A,{y,z,x})                                      |
|                                                                 |
|o3 = NCRingMap A <--- A                                          |
|                                                                 |
|o3 : NCRingMap                                                   |
+-----------------------------------------------------------------+
|i4 : gList = {g, g^2, g^3}                                       |
|                                                                 |
|o4 = {NCRingMap A <--- A, NCRingMap A <--- A, NCRingMap A <--- A}|
|                                                                 |
|o4 : List                                                        |
+-----------------------------------------------------------------+
|i5 : a = sum apply(3,i-> (gList#i)(x^3))                         |
|                                                                 |
|      3  3  3                                                    |
|o5 = z +y +x                                                     |
|                                                                 |
|o5 : A                                                           |
+-----------------------------------------------------------------+
|i6 : b = sum apply(3,i-> (gList#i)(x^2*y))                       |
|                                                                 |
|      2    2  2                                                  |
|o6 = y z+xz +x y                                                 |
|                                                                 |
|o6 : A                                                           |
+-----------------------------------------------------------------+
|i7 : c = sum apply(3,i-> (gList#i)(x*y^2))                       |
|                                                                 |
|       2   2  2                                                  |
|o7 = yz +xy +x z                                                 |
|                                                                 |
|o7 : A                                                           |
+-----------------------------------------------------------------+
|i8 : d = sum apply(3,i-> (gList#i)(x*y*z))                       |
|                                                                 |
|o8 = 3xyz                                                        |
|                                                                 |
|o8 : A                                                           |
+-----------------------------------------------------------------+

It is clear that these are linearly independent. Next, we take a homogeneous
polynomial of degree 3, make it invariant, and compute its coordinate vector.

+-----------------------------------------------------------+
|i9 : p = w^2*z^2*y+x^2*z+(1-w)*y^3                         |
|                                                           |
|                2           3  2                           |
|o9 = (- w - 1)yz +(- w + 1)y +x z                          |
|                                                           |
|o9 : A                                                     |
+-----------------------------------------------------------+
|i10 : g(p)==p                                              |
|                                                           |
|o10 = false                                                |
+-----------------------------------------------------------+
|i11 : p' = sum apply(3,i-> (gList#i)(p))                   |
|                                                           |
|                3     2           3     2    2            3|
|o11 = (- w + 1)z +-wyz +(- w + 1)y +-wxy +-wx z+(- w + 1)x |
|                                                           |
|o11 : A                                                    |
+-----------------------------------------------------------+
|i12 : g(p')==p'                                            |
|                                                           |
|o12 = true                                                 |
+-----------------------------------------------------------+
|i13 : coordinates(p',Basis=>{a,b,c,d})                     |
|                                                           |
|o13 = | -w+1 |                                             |
|      | 0    |                                             |
|      | -w   |                                             |
|      | 0    |                                             |
|                                                           |
|              4       1                                    |
|o13 : Matrix R  <--- R                                     |
+-----------------------------------------------------------+

See also
========

  * sparseCoeffs -- Converts ring elements into vectors
    over the coefficient ring

Ways to use coordinates :
=========================

  * "coordinates(List)"
  * "coordinates(NCRingElement)"

For the programmer
==================

The object coordinates, is a method function with options (Macaulay2Doc).

degree(NCRingElement) -- Returns the degree of an NCRingElement
***************************************************************

Synopsis
========

  * Function: degree (Macaulay2Doc),
  * Usage:
        d = degree f
  * Inputs:
      * f, an instance of the type NCRingElement,
  * Outputs:
      * d, an integer (Macaulay2Doc),

Description
===========

Returns the degree of an NCRingElement.  At the moment, multigraded NCRings are
not supported.

+----------------------------+
|i1 : A = QQ{x,y,z,w}        |
|                            |
|o1 = A                      |
|                            |
|o1 : NCPolynomialRing       |
+----------------------------+
|i2 : f = x^2+y^2+z^3        |
|                            |
|      3  2  2               |
|o2 = z +y +x                |
|                            |
|o2 : A                      |
+----------------------------+
|i3 : degree f               |
|                            |
|o3 = 3                      |
+----------------------------+
|i4 : isHomogeneous f        |
|                            |
|o4 = false                  |
+----------------------------+
|i5 : setWeights(A,{3,3,2,1})|
|                            |
|o5 = A                      |
|                            |
|o5 : NCPolynomialRing       |
+----------------------------+
|i6 : degree f               |
|                            |
|o6 = 6                      |
+----------------------------+
|i7 : isHomogeneous f        |
|                            |
|o7 = true                   |
+----------------------------+

Ways to use this method:
========================

  * degree(NCRingElement) -- Returns the
    degree of an NCRingElement

endomorphismRing -- Methods for creating endomorphism rings of modules over a commutative ring
**********************************************************************************************

Synopsis
========

  * Usage:
        E = endomorphismRing(M,X)
  * Inputs:
      * M, a module (Macaulay2Doc),
      * X, a symbol (Macaulay2Doc), the base name for the indexed
        variables serving as generators for the output ring
  * Outputs:
      * E, an instance of the type NCQuotientRing,

Description
===========

This method computes a presentation for the endomorphism ring of a module over
a commutative ring R. The presentation is given as a quotient of an
NCPolynomialRing with coefficients in R generated by indexed variables. The
second argument specifies the symbol to use for the indexed variables. The
presentation this method returns is unlikely to be minimal. Simplifications to
the presentation may be made with Link to minimizeRelations.

+-----------------------------------------------------------------------------+
|i1 : Q = QQ[a,b,c]                                                           |
|                                                                             |
|o1 = Q                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : R = Q/ideal{a*b-c^2}                                                    |
|                                                                             |
|o2 = R                                                                       |
|                                                                             |
|o2 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i3 : kRes = res(coker vars R, LengthLimit=>7)                                |
|                                                                             |
|      1      3      4      4      4      4      4      4                     |
|o3 = R  <-- R  <-- R  <-- R  <-- R  <-- R  <-- R  <-- R                      |
|                                                                             |
|     0      1      2      3      4      5      6      7                      |
|                                                                             |
|o3 : ChainComplex                                                            |
+-----------------------------------------------------------------------------+
|i4 : M = coker kRes.dd_5                                                     |
|                                                                             |
|o4 = cokernel {4} | 0  -a 0  -c |                                            |
|              {4} | -b 0  -c 0  |                                            |
|              {4} | c  0  a  0  |                                            |
|              {4} | 0  c  0  b  |                                            |
|                                                                             |
|                            4                                                |
|o4 : R-module, quotient of R                                                 |
+-----------------------------------------------------------------------------+
|i5 : B = endomorphismRing(M,X)                                               |
|                                                                             |
|o5 = B                                                                       |
|                                                                             |
|o5 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i6 : gensI = gens ideal B                                                    |
|                                                                             |
|                                                                             |
|o6 = {X X +-X , -X +X X , -X +X X , X X , X X , X X +-X , X X , X X +-X ,    |
|       0 1   0    3  0 2    2  1 2   0 3   1 3   2 3   2   1 0   2 0   1     |
|     ------------------------------------------------------------------------|
|                                   2    2        2    2                      |
|     X X , X X +-X , X X , X X , X  , X  +-X , X  , X  +-X }                 |
|      2 1   3 0   0   3 1   3 2   0    1    1   2    3    3                  |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : gensIMin = minimizeRelations(gensI)                                     |
|                                                                             |
|                                2    2                                       |
|o7 = {X X X +-X , X X X +-X , X  , X  }                                      |
|       0 2 0   0   2 0 2   2   0    2                                        |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+

The endomorphisms are cached in the endomorphism ring and can be accessed via
the key endomorphismRingGens. We verify that X_3 is redundant:

+-------------------------------------------------------------------------+
|i8 : maps = B.cache.endomorphismRingGens                                 |
|                                                                         |
|o8 = {{4} | 0 0 1 0 |, {4} | 0 0 0 0 |, {4} | 0 0 0 0 |, {4} | 1 0 0 0 |}|
|      {4} | 0 0 0 0 |  {4} | 0 1 0 0 |  {4} | 0 0 0 1 |  {4} | 0 0 0 0 | |
|      {4} | 0 0 0 0 |  {4} | 0 0 1 0 |  {4} | 1 0 0 0 |  {4} | 0 0 0 0 | |
|      {4} | 0 1 0 0 |  {4} | 0 0 0 0 |  {4} | 0 0 0 0 |  {4} | 0 0 0 1 | |
|                                                                         |
|o8 : List                                                                |
+-------------------------------------------------------------------------+
|i9 : maps_3 == maps_0*maps_2                                             |
|                                                                         |
|o9 = true                                                                |
+-------------------------------------------------------------------------+

Ways to use endomorphismRing :
==============================

  * "endomorphismRing(Module,Symbol)"

For the programmer
==================

The object endomorphismRing, is a method function (Macaulay2Doc).

entries(NCMatrix) -- Returns the entries of the NCMatrix
********************************************************

Synopsis
========

  * Function: entries (Macaulay2Doc),
  * Usage:
        L = entries M
  * Inputs:
      * M, an instance of the type NCMatrix,
  * Outputs:
      * L, a list (Macaulay2Doc),

Description
===========

Returns the entries of the NCMatrix as a doubly nested list.

+-----------------------------------------------------------------------------+
|i1 : A = QQ{a,b,c,d}                                                         |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : M = ncMatrix {{a,b,c,d},{b,c,d,a}}                                      |
|                                                                             |
|o2 = | a b c d |                                                             |
|     | b c d a |                                                             |
|                                                                             |
|o2 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i3 : N = M || 2*M || -3*M                                                    |
|                                                                             |
|o3 = | a    b    c    d    |                                                 |
|     | b    c    d    a    |                                                 |
|     | 2*a  2*b  2*c  2*d  |                                                 |
|     | 2*b  2*c  2*d  2*a  |                                                 |
|     | -3*a -3*b -3*c -3*d |                                                 |
|     | -3*b -3*c -3*d -3*a |                                                 |
|                                                                             |
|o3 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i4 : entries N                                                               |
|                                                                             |
|o4 = {{a, b, c, d}, {b, c, d, a}, {2a, 2b, 2c, 2d}, {2b, 2c, 2d, 2a}, {-3a,  |
|     ------------------------------------------------------------------------|
|     -3b, -3c, -3d}, {-3b, -3c, -3d, -3a}}                                   |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * entries(NCMatrix) -- Returns the entries of
    the NCMatrix

envelopingAlgebra -- Create the enveloping algebra
**************************************************

Synopsis
========

  * Usage:
        Ae = envelopingAlgebra(A,x)
  * Inputs:
      * A, an instance of the type NCRing,
      * x, a symbol (Macaulay2Doc),
  * Outputs:
      * Ae, an instance of the type NCRing,

Description
===========

This function returns the enveloping algebra A ** Aop.  The symbol argument is
used to define the variables in Aop.

+-----------------------------------------------------------------------------+
|i1 : B = skewPolynomialRing(QQ,(-1)_QQ, {a,b,c})                             |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o1 = B                                                                       |
|                                                                             |
|o1 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : envelopingAlgebra(B,v)                                                  |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o2 = QQ{a, b, c, v , v , v } / {ba+ab, ca+ac, cb+bc, v v +v v , v v +v v ,   |
|                  0   1   2                           1 0  0 1   2 0  0 2    |
|                                                                             |
|o2 : NCQuotientRing                                                          |
|-----------------------------------------------------------------------------|
|v v +v v , v a-av , v a-av , v a-av , v b-bv } + More...                     |
| 2 1  1 2   0    0   1    1   2    2   0    0                                |
+-----------------------------------------------------------------------------+

Ways to use envelopingAlgebra :
===============================

  * "envelopingAlgebra(NCRing,Symbol)"

For the programmer
==================

The object envelopingAlgebra, is a method function (Macaulay2Doc).

fourDimSklyanin -- Defines a four-dimensional Sklyanin with given parameters
****************************************************************************

Synopsis
========

  * Usage:
        fourDimSklyanin(R,params,varList)
  * Inputs:
      * R, a ring (Macaulay2Doc),
      * params, a list (Macaulay2Doc),
      * varList, a list (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * DegreeLimit (missing documentation) => an integer (Macaulay2Doc),
        default value 5, null
  * Outputs:
      * an instance of the type NCRing,

Description
===========

This method constructs a three dimensional Sklyanin algebra with parameters
from the params list, and variables from varList (see here (see
https://www.math.washington.edu/~smith/Research/Skly-survey.pdf )). If either
list is not the appropriate length, then an error is thrown.  The generic such
algebra has a fairly complicated Groebner basis, so the optional parameter
DegreeLimit has been defaulted to 5.  If only one list is provided, it is used
for the variable names, and a random choice for each parameter is chosen.

In order to not get a degenerate example, one should ensure that the parameters
provided satisfy \alpha + \beta + \gamma + \alpha\beta\gamma = 0. This method
does not check this condition, since the degenerate examples are of interest as
well.  If no parameters are provided, however a generic choice of \alpha,\beta
and \gamma satisfying the equation above are selected.

+-----------------------------------------------------------------------------+
|i1 : C = fourDimSklyanin(QQ,{a,b,c,d})                                       |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o1 = C                                                                       |
|                                                                             |
|o1 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : ncGroebnerBasis ideal C                                                 |
|                                                                             |
|         2  1818276801    2 2143385  2   14253260827  3   150884721  4  10166|
|o2 = babc - ----------baba +-------ba ba+-----------ba b- ---------ad - -----|
|             116742400       177408       525340800        51074800      1276|
|         1    4                                                              |
|     db- -bd- -ac; Lead Term = (db, 1)                                       |
|         3    3                                                              |
|        2    1                                                               |
|     ca+-bd- -ac; Lead Term = (ca, 1)                                        |
|        3    3                                                               |
|      2   154     468  2 792  2  1089  2                2                    |
|     b a- ---bab- ---ad +---ac - ----ab ; Lead Term = (b a, 1)               |
|          919     919    919      919                                        |
|        3 324950129    2  844561  2    324950129  3  124834203  4 16823214  4|
|     bab +---------baba - ------ba ba- ---------ba b+---------ad +--------ac |
|          160520800       271040       160520800     140455700     7022785   |
|        3   3890140   2   12943        43  2    911  3   1204  3    35878612 |
|     bac - --------bab c- -----babad- ---ba bd- ---ba c- ----ab c- ----------|
|           10280853       49720       120       720      2757      4294592685|
|        11    7                                                              |
|     dc+--ba+--ab; Lead Term = (dc, 1)                                       |
|        18   18                                                              |
|         40    7                                                             |
|     da- --bc+--ad; Lead Term = (da, 1)                                      |
|         33   33                                                             |
|         7   26                                                              |
|     cb+--bc+--ad; Lead Term = (cb, 1)                                       |
|        33   33                                                              |
|          7    11                                                            |
|     cd- --ba- --ab; Lead Term = (cd, 1)                                     |
|         18    18                                                            |
|       2  20  2  11  2   7    919 2                  2                       |
|     bd - --bc - --ba - --aba+---a b; Lead Term = (bd , 1)                   |
|          11      4     18    396                                            |
|        2  2260   2  799760   2 10109  3  4480    2  745360  3   713377   2  |
|     bad - ----bac +-------bab +-----ba +------abc +-------ab - -------aba - |
|           1419     1066959      4644    118551     1066959     2133918      |
|       3  8 3   116489     1153  2    11739  3   347053  2   370237      1087|
|     bc +--b c- ------babd+----ba c- ------ad - -------ab d+-------abac- ----|
|         99     330840      720      101090     1213080     3639240       800|
|           726822279  2 2  730237383  2 2  18634  2 2  776151559  4     2 324|
|     babab+---------ba d - ---------ba c - -----ba b - ---------ba -abab +---|
|           561822800       309002540       91205       204299200          160|
|                                                                             |
|o2 : NCGroebnerBasis                                                         |
|-----------------------------------------------------------------------------|
|949  4  2560916417  2 2  444796  4  372650850976079      166872692193833   2 |
|---ac - ----------ab c - ------ab - ---------------ababa+---------------aba b|
|870      849756985       638435      58417371619200       9789200467200      |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
| 8946325044  2 2 728827  4 34474710943933       16892056950761   2  151412449|
|+----------ab c +------ab +--------------ababa- --------------aba b+---------|
| 9347326835      638435    17849752439200        2991144587200       89248762|
|       9267643   2    1314768  2 3    9717484  2 2  4958833111 2      7195043|
|ababd+--------aba c- ---------a d - ----------a b d+----------a bac- --------|
|      37384920       477176965      1431530895      4580898864       13935256|
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|80758031 2    822640 3                   2                                   |
|--------a ba+-------a b; Lead Term = (bad , 1)                               |
|46946196     1066959                                                         |
|15153 2     31304  3                  3                                      |
|-----a bc- -------a d; Lead Term = (bc , 1)                                  |
|63280      1667985                                                           |
|950129   3  1008 2  2 18634 2 3 74611264729 2  2  230516 3   20566 4         |
|------aba +-----a bc +-----a b +-----------a ba - ------a ba+-----a b; Lead T|
|520800     91205      91205     24720203200        91205     91205           |
|-----------------------------------------------------------------------------|
|  172755830058223 2     26773655493 3 2 138932082197701 3 2  3633135120329 3 |
|- ---------------a bab- -----------a d +---------------a c - -------------a b|
|   12981638137600        3283403200      11358933370400       93875482400    |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|24951 2    24103521 3 2  125076396897 3 2 325473383 3 2                  3   |
|-----a bab+--------a d - ------------a c +---------a b ; Lead Term = (bab , 1|
|19600       9825200       33990279400      25537400                          |
|8 3      7012096   4                   3                                     |
|-a bc- -----------a d; Lead Term = (bac , 1)                                 |
|5      15746839845                                                           |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|erm = (babab, 1)                                                             |
|-----------------------------------------------------------------------------|
|2                   2                                                        |
| ; Lead Term = (babc , 1)                                                    |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|)                                                                            |
+-----------------------------------------------------------------------------+

In all nondegenerate cases, there is are two central elements of degree two
which form a regular sequence on the four dimensional Sklyanin (this was proven
by Paul Smith and Toby Stafford in a paper in Compositio.

+----------------------------------------------------+
|i3 : centralElements(C,2)                           |
|                                                    |
|o3 = | c^2-11/9*b^2+13/9*a^2 d^2+20/9*b^2-22/9*a^2 ||
|                                                    |
|o3 : NCMatrix                                       |
+----------------------------------------------------+

These algebras also all AS-regular and as such have the same Hilbert series as
a commutative polynomial algebra in four variables, as we can see here:

+----------------------------------------------+
|i4 : hilbertBergman(C, DegreeLimit => 6)      |
|--Calling bergman for HS computation.         |
|Complete!                                     |
|                                              |
|                 2      3      4      5      6|
|o4 = 1 + 4T + 10T  + 20T  + 35T  + 56T  + 84T |
|                                              |
|o4 : ZZ[T]                                    |
+----------------------------------------------+

Ways to use fourDimSklyanin :
=============================

  * "fourDimSklyanin(Ring,List)"
  * "fourDimSklyanin(Ring,List,List)"

For the programmer
==================

The object fourDimSklyanin, is a method function with options (Macaulay2Doc).

freeProduct -- Define the free product of two algebras
******************************************************

Synopsis
========

  * Usage:
        C = freeProduct(A,B)
  * Inputs:
      * A, an instance of the type NCRing,
      * B, an instance of the type NCRing,
  * Outputs:
      * C, an instance of the type NCRing,

Description
===========

This function returns the free product of the algebras A and B.

+------------------------------------------------+
|i1 : A = QQ{x,y,z}                              |
|                                                |
|o1 = A                                          |
|                                                |
|o1 : NCPolynomialRing                           |
+------------------------------------------------+
|i2 : B = skewPolynomialRing(QQ,(-1)_QQ, {a,b,c})|
|--Calling Bergman for NCGB calculation.         |
|Complete!                                       |
|                                                |
|o2 = B                                          |
|                                                |
|o2 : NCQuotientRing                             |
+------------------------------------------------+
|i3 : C = freeProduct(A,B)                       |
|--Calling Bergman for NCGB calculation.         |
|Complete!                                       |
|                                                |
|o3 = C                                          |
|                                                |
|o3 : NCQuotientRing                             |
+------------------------------------------------+

Ways to use freeProduct :
=========================

  * "freeProduct(NCRing,NCRing)"

For the programmer
==================

The object freeProduct, is a method function (Macaulay2Doc).

gbFromOutputFile -- Read in a NCGroebnerBasis from a Bergman output file.
*************************************************************************

Synopsis
========

  * Usage:
        Igb = gbFromOutputFile(A,fileName)
  * Inputs:
      * A, an instance of the type NCPolynomialRing,
      * fileName, a string (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * CacheBergmanGB => a Boolean value (Macaulay2Doc),
        default value true, specifies whether or not to cache the Groebner
        basis for later use
      * MakeMonic => a Boolean value (Macaulay2Doc), default
        value true, specifies whether the Bergman output should be made monic
      * ReturnIdeal => a Boolean value (Macaulay2Doc), default
        value false, specifies whether to return an NCIdeal or the
        NCGroebnerBasis
  * Outputs:
      * Igb, an instance of the type NCGroebnerBasis,
        or an NCIdeal,

Description
===========

This command reads in a Groebner basis from a Bergman output file. It can be
useful if you have performed a lengthy computation before, and wish to load in
a previously computed result to do some computations.

The Groebner basis we are reading in for this example is located in the
NCAlgebra auxiliary files directory. We are currently unable to compile this
documentation node in a way that enables M2 to read the file. We give a text
version of the session until the issue is resolved.

+----------------------------------------------------------------------+
|i1 : A=QQ{x56,x46,x36,x26,x16,x45,x35,x25,x15,x34,x24,x14,x23,x13,x12}|
|                                                                      |
|o1 = A                                                                |
|                                                                      |
|o1 : NCPolynomialRing                                                 |
+----------------------------------------------------------------------+

I = gbFromOutputFile(A,"NCAlgebra/FK.bo", ReturnIdeal=>true)

B=A/I

hilbertSeries(B,Order=>4)

In "Quadratic algebras, Dunkl elements, and Schubert calculus," Fomin and
Kirillov introduce a family of noncommutative algebras E_n which may be thought
of as the quadratic closure of the ring of "Bruhat operators" acting on a
vector space whose basis is the symmetric group. In that paper, they provide
Hilbert series for the algebras E_1, ..., E_5. The file loaded above is a
Groebner basis of E_6 to degree 6. Thus B is isomorphic to E_6 in low degrees.

Ways to use gbFromOutputFile :
==============================

  * "gbFromOutputFile(NCPolynomialRing,String)"

For the programmer
==================

The object gbFromOutputFile, is a method function with options (Macaulay2Doc).

gddKernel -- Computes a homogeneous generating set of the kernel of a ring map.
*******************************************************************************

Synopsis
========

  * Usage:
        kern = gddKernel(n,phi)
  * Inputs:
      * n, an integer (Macaulay2Doc),
      * phi, an instance of the type NCRingMap,
  * Outputs:
      * kern, a list (Macaulay2Doc),

Description
===========

This function returns a generating set of the kernel of a ring map up to a
specified degree.

+------------------------------------------------+
|i1 : A = QQ{x,y,z}                              |
|                                                |
|o1 = A                                          |
|                                                |
|o1 : NCPolynomialRing                           |
+------------------------------------------------+
|i2 : B = skewPolynomialRing(QQ,(-1)_QQ, {a,b,c})|
|--Calling Bergman for NCGB calculation.         |
|Complete!                                       |
|                                                |
|o2 = B                                          |
|                                                |
|o2 : NCQuotientRing                             |
+------------------------------------------------+
|i3 : phi = ncMap(B,A,{a,b,c})                   |
|                                                |
|o3 = NCRingMap B <--- A                         |
|                                                |
|o3 : NCRingMap                                  |
+------------------------------------------------+
|i4 : gddKernel(4,phi)                           |
|Computing kernel in degree 1                    |
|Computing kernel in degree 2                    |
|Computing kernel in degree 3                    |
|Computing kernel in degree 4                    |
|                                                |
|o4 = {yx+xy, zx+xz, zy+yz}                      |
|                                                |
|o4 : List                                       |
+------------------------------------------------+

Ways to use gddKernel :
=======================

  * "gddKernel(ZZ,NCRingMap)"

For the programmer
==================

The object gddKernel, is a method function (Macaulay2Doc).

generators(NCGroebnerBasis) -- The list of algebra generators of an NCGroebnerBasis
***********************************************************************************

Synopsis
========

  * Function: generators (Macaulay2Doc),
  * Usage:
        gensIgb = generators Igb
  * Inputs:
      * Igb, an instance of the type NCGroebnerBasis,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing (Macaulay2Doc), => ...,
        default value null, null
  * Outputs:
      * gensIgb, a list (Macaulay2Doc),

Description
===========

This function returns the generators of an NCGroebnerBasis as a list.  As
usual, gens is a synonym for generators.

+-----------------------------------------------------+
|i1 : A = QQ{x,y,z}                                   |
|                                                     |
|o1 = A                                               |
|                                                     |
|o1 : NCPolynomialRing                                |
+-----------------------------------------------------+
|i2 : p = y*z + z*y - x^2                             |
|                                                     |
|            2                                        |
|o2 = zy+yz-x                                         |
|                                                     |
|o2 : A                                               |
+-----------------------------------------------------+
|i3 : q = x*z + z*x - y^2                             |
|                                                     |
|         2                                           |
|o3 = zx-y +xz                                        |
|                                                     |
|o3 : A                                               |
+-----------------------------------------------------+
|i4 : r = z^2 - x*y - y*x                             |
|                                                     |
|      2                                              |
|o4 = z -yx-xy                                        |
|                                                     |
|o4 : A                                               |
+-----------------------------------------------------+
|i5 : I = ncIdeal {p,q,r}                             |
|                                                     |
|                             2      2      2         |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}  |
|                                                     |
|o5 : NCIdeal                                         |
+-----------------------------------------------------+
|i6 : Igb = ncGroebnerBasis I                         |
|--Calling Bergman for NCGB calculation.              |
|Complete!                                            |
|                                                     |
|      2    2                2                        |
|o6 = y x-xy ; Lead Term = (y x, 1)                   |
|       2  2                  2                       |
|     yx -x y; Lead Term = (yx , 1)                   |
|         2                                           |
|     zx-y +xz; Lead Term = (zx, 1)                   |
|            2                                        |
|     zy+yz-x ; Lead Term = (zy, 1)                   |
|      2                      2                       |
|     z -yx-xy; Lead Term = (z , 1)                   |
|                                                     |
|o6 : NCGroebnerBasis                                 |
+-----------------------------------------------------+
|i7 : gens Igb                                        |
|                                                     |
|       2    2    2  2       2            2   2       |
|o7 = {y x-xy , yx -x y, zx-y +xz, zy+yz-x , z -yx-xy}|
|                                                     |
|o7 : List                                            |
+-----------------------------------------------------+

Ways to use this method:
========================

  * generators(NCGroebnerBasis) -- The
    list of algebra generators of an NCGroebnerBasis

generators(NCIdeal) -- Returns the generators of an NCIdeal
***********************************************************

Synopsis
========

  * Function: generators (Macaulay2Doc),
  * Usage:
        gensI = generators I
  * Inputs:
      * I, an instance of the type NCIdeal,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing (Macaulay2Doc), => ...,
        default value null, null
  * Outputs:
      * gensI, a list (Macaulay2Doc),

Description
===========

Returns the generators of an NCIdeal.

+---------------------------------------------------+
|i1 : A = QQ{x,y,z}                                 |
|                                                   |
|o1 = A                                             |
|                                                   |
|o1 : NCPolynomialRing                              |
+---------------------------------------------------+
|i2 : p = y*z + z*y - x^2                           |
|                                                   |
|            2                                      |
|o2 = zy+yz-x                                       |
|                                                   |
|o2 : A                                             |
+---------------------------------------------------+
|i3 : q = x*z + z*x - y^2                           |
|                                                   |
|         2                                         |
|o3 = zx-y +xz                                      |
|                                                   |
|o3 : A                                             |
+---------------------------------------------------+
|i4 : r = z^2 - x*y - y*x                           |
|                                                   |
|      2                                            |
|o4 = z -yx-xy                                      |
|                                                   |
|o4 : A                                             |
+---------------------------------------------------+
|i5 : I = ncIdeal{p,q,r}                            |
|                                                   |
|                             2      2      2       |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                                   |
|o5 : NCIdeal                                       |
+---------------------------------------------------+
|i6 : gens I                                        |
|                                                   |
|             2      2      2                       |
|o6 = {zy+yz-x , zx-y +xz, z -yx-xy}                |
|                                                   |
|o6 : List                                          |
+---------------------------------------------------+

Ways to use this method:
========================

  * generators(NCIdeal) -- Returns the
    generators of an NCIdeal

generators(NCLeftIdeal) -- Returns the generators of an NCLeftIdeal
*******************************************************************

Synopsis
========

  * Function: generators (Macaulay2Doc),
  * Usage:
        gensI = generators I
  * Inputs:
      * I, an instance of the type NCLeftIdeal,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing (Macaulay2Doc), => ...,
        default value null, null
  * Outputs:
      * gensI, a list (Macaulay2Doc),

Description
===========

Returns the generators of an NCLeftIdeal.

+----------------------------------------------+
|i1 : A = QQ{x,y,z}                            |
|                                              |
|o1 = A                                        |
|                                              |
|o1 : NCPolynomialRing                         |
+----------------------------------------------+
|i2 : p = y*z + z*y - x^2                      |
|                                              |
|            2                                 |
|o2 = zy+yz-x                                  |
|                                              |
|o2 : A                                        |
+----------------------------------------------+
|i3 : q = x*z + z*x - y^2                      |
|                                              |
|         2                                    |
|o3 = zx-y +xz                                 |
|                                              |
|o3 : A                                        |
+----------------------------------------------+
|i4 : r = z^2 - x*y - y*x                      |
|                                              |
|      2                                       |
|o4 = z -yx-xy                                 |
|                                              |
|o4 : A                                        |
+----------------------------------------------+
|i5 : I = ncLeftIdeal{p,q,r}                   |
|                                              |
|                        2      2      2       |
|o5 = Left ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                              |
|o5 : NCLeftIdeal                              |
+----------------------------------------------+
|i6 : gens I                                   |
|                                              |
|             2      2      2                  |
|o6 = {zy+yz-x , zx-y +xz, z -yx-xy}           |
|                                              |
|o6 : List                                     |
+----------------------------------------------+

Ways to use this method:
========================

  * generators(NCLeftIdeal) -- Returns the
    generators of an NCLeftIdeal

generators(NCRightIdeal) -- Returns the generators of an NCRightIdeal
*********************************************************************

Synopsis
========

  * Function: generators (Macaulay2Doc),
  * Usage:
        gensI = generators I
  * Inputs:
      * I, an instance of the type NCRightIdeal,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing (Macaulay2Doc), => ...,
        default value null, null
  * Outputs:
      * gensI, a list (Macaulay2Doc),

Description
===========

Returns the generators of an NCRightIdeal.

+-----------------------------------------------+
|i1 : A = QQ{x,y,z}                             |
|                                               |
|o1 = A                                         |
|                                               |
|o1 : NCPolynomialRing                          |
+-----------------------------------------------+
|i2 : p = y*z + z*y - x^2                       |
|                                               |
|            2                                  |
|o2 = zy+yz-x                                   |
|                                               |
|o2 : A                                         |
+-----------------------------------------------+
|i3 : q = x*z + z*x - y^2                       |
|                                               |
|         2                                     |
|o3 = zx-y +xz                                  |
|                                               |
|o3 : A                                         |
+-----------------------------------------------+
|i4 : r = z^2 - x*y - y*x                       |
|                                               |
|      2                                        |
|o4 = z -yx-xy                                  |
|                                               |
|o4 : A                                         |
+-----------------------------------------------+
|i5 : I = ncRightIdeal{p,q,r}                   |
|                                               |
|                         2      2      2       |
|o5 = Right ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                               |
|o5 : NCRightIdeal                              |
+-----------------------------------------------+
|i6 : gens I                                    |
|                                               |
|             2      2      2                   |
|o6 = {zy+yz-x , zx-y +xz, z -yx-xy}            |
|                                               |
|o6 : List                                      |
+-----------------------------------------------+

Ways to use this method:
========================

  * generators(NCRightIdeal) -- Returns
    the generators of an NCRightIdeal

generators(NCRing) -- The list of algebra generators of an NCRing
*****************************************************************

Synopsis
========

  * Function: generators (Macaulay2Doc),
  * Usage:
        gensA = generators A
  * Inputs:
      * A, an instance of the type NCRing,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing (Macaulay2Doc), => ...,
        default value null, null
  * Outputs:
      * gensA, a list (Macaulay2Doc),

Description
===========

This function returns the generators of an NCRing as a list.  As usual, gens is
a synonym for generators.

+---------------------+
|i1 : A = QQ{x,y,z}   |
|                     |
|o1 = A               |
|                     |
|o1 : NCPolynomialRing|
+---------------------+
|i2 : generators A    |
|                     |
|o2 = {x, y, z}       |
|                     |
|o2 : List            |
+---------------------+
|i3 : gens A          |
|                     |
|o3 = {x, y, z}       |
|                     |
|o3 : List            |
+---------------------+

Ways to use this method:
========================

  * generators(NCRing) -- The list of algebra
    generators of an NCRing

hilbertBergman -- Calls Bergman to compute the Hilbert series of an NCQuotientRing
**********************************************************************************

Synopsis
========

  * Usage:
        hseries = hilbertBergman(A)
  * Inputs:
      * A, an instance of the type NCQuotientRing,
  * Optional inputs (Macaulay2Doc),:
      * DegreeLimit => an integer (Macaulay2Doc), default value 10
  * Outputs:
      * hseries, a ring element (Macaulay2Doc),

Description
===========

This method calls the Bergman function ncpbhgroebner to compute the Hilbert
series of an NCQuotientRing. The input ring must be a ring over QQ or ZZ/p. At
this time, the output is correct only for NCRings with a standard grading - all
generators have degree 1. The output is returned as a polynomial in ZZ[T].

+-----------------------------------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})                               |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o1 = B                                                                       |
|                                                                             |
|o1 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : hilbertBergman(B,DegreeLimit=>12)                                       |
|--Calling bergman for HS computation.                                        |
|Complete!                                                                    |
|                                                                             |
|                2      3      4      5      6      7      8      9      10   |
|o2 = 1 + 3T + 6T  + 10T  + 15T  + 21T  + 28T  + 36T  + 45T  + 55T  + 66T   + |
|     ------------------------------------------------------------------------|
|        11      12                                                           |
|     78T   + 91T                                                             |
|                                                                             |
|o2 : ZZ[T]                                                                   |
+-----------------------------------------------------------------------------+

Ways to use hilbertBergman :
============================

  * "hilbertBergman(NCQuotientRing)"

For the programmer
==================

The object hilbertBergman, is a method function with options (Macaulay2Doc).

hilbertSeries(NCRing) -- Computes the Hilbert series of an NCRing
*****************************************************************

Synopsis
========

  * Function: hilbertSeries (Macaulay2Doc),
  * Usage:
        hseries = hilbertSeries(A)
  * Inputs:
      * A, an instance of the type NCRing,
  * Optional inputs (Macaulay2Doc),:
      * Order (Macaulay2Doc),
        => an integer (Macaulay2Doc), default value infinity,
        null
      * Reduce (Macaulay2Doc),
        => ..., default value false, null
  * Outputs:
      * hseries, a ring element (Macaulay2Doc),

Description
===========

This method computes the Hilbert series of a graded NCRing.  If the ring is
defined ober QQ or ZZ/p, and standard graded, it calls hilbertBergman.
Otherwise, if the ring is defined over a field (and
potentially not standard graded), then a basis is computed and the generating
function of the degrees of that basis is returned.  The degree to which one
computes the Hilbert series is controlled with the Order option. The output is
returned as a polynomial in ZZ[T].

+-----------------------------------------------------------------------------+
|i1 : A = QQ{x,y,z}                                                           |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : hilbertSeries(A,Order=>10)                                              |
|                                                                             |
|                2      3      4       5       6        7        8         9  |
|o2 = 1 + 3T + 9T  + 27T  + 81T  + 243T  + 729T  + 2187T  + 6561T  + 19683T  +|
|     ------------------------------------------------------------------------|
|           10                                                                |
|     59049T                                                                  |
|                                                                             |
|o2 : ZZ[T]                                                                   |
+-----------------------------------------------------------------------------+
|i3 : setWeights(A,{1,2,3})                                                   |
|                                                                             |
|o3 = A                                                                       |
|                                                                             |
|o3 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i4 : hilbertSeries(A,Order=>10)                                              |
|                                                                             |
|               2     3     4      5      6      7      8       9       10    |
|o4 = 1 + T + 2T  + 4T  + 7T  + 13T  + 24T  + 44T  + 81T  + 149T  + 274T      |
|                                                                             |
|o4 : ZZ[T]                                                                   |
+-----------------------------------------------------------------------------+
|i5 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})                               |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o5 = B                                                                       |
|                                                                             |
|o5 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i6 : hilbertSeries(B,Order=>10)                                              |
|--Calling bergman for HS computation.                                        |
|Complete!                                                                    |
|                                                                             |
|                2      3      4      5      6      7      8      9      10   |
|o6 = 1 + 3T + 6T  + 10T  + 15T  + 21T  + 28T  + 36T  + 45T  + 55T  + 66T     |
|                                                                             |
|o6 : ZZ[T]                                                                   |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * hilbertSeries(NCRing) -- Computes the
    Hilbert series of an NCRing

Hom(ZZ,NCMatrix,NCMatrix) -- Compute a graded component of Hom(M,N)
*******************************************************************

Synopsis
========

  * Function: Hom (Macaulay2Doc),
  * Usage:
        homs = Hom(n,M,N)
  * Inputs:
      * n, an integer (Macaulay2Doc),
      * M, an instance of the type NCMatrix,
      * N, an instance of the type NCMatrix,
  * Outputs:
      * homs, a list (Macaulay2Doc),

Description
===========

This function computes a generating set of the degree n component of Hom(M,N)
as a module over the coefficient ring of A = ring M.

Ways to use this method:
========================

  * Hom(ZZ,NCMatrix,NCMatrix), --
    Compute a graded component of Hom(M,N)

homogDual -- Computes the dual of a pure homogeneous ideal
**********************************************************

Synopsis
========

  * Usage:
        homogDual I
  * Inputs:
      * I, an instance of the type NCIdeal, or an
        NCQuotientRing, or a Ring (Macaulay2Doc).
  * Outputs:
      * an instance of the type NCIdeal, or an
        NCQuotientRing,

Description
===========

The homogeneous dual of a pure ideal I in an NCPolynomialRing A is generated by
the orthogonal complement to the generators of I under the natural pairing on
the generating subspace of A and its linear dual. Though technically the dual
ideal belongs to the tensor algebra on the dual space of generators, this
method returns the dual ideal in the same NCPolynomialRing.

If the input is an NCQuotient ring, the method is applied to the defining ideal
of the quotient and the corresponding quotient ring is returned.

Commonly used in conjunction with quadraticClosure.

+--------------------------------------------------------+
|i1 : A = QQ{x,y,z}                                      |
|                                                        |
|o1 = A                                                  |
|                                                        |
|o1 : NCPolynomialRing                                   |
+--------------------------------------------------------+
|i2 : I = ncIdeal{x*z-z*x, y*z, x*y^2-y^2*x, x^3*y-y*x^3}|
|                                                        |
|                                    2    2     3  3     |
|o2 = Two-sided ideal {-zx+xz, yz, -y x+xy , -yx +x y}   |
|                                                        |
|o2 : NCIdeal                                            |
+--------------------------------------------------------+
|i3 : J = quadraticClosure I                             |
|                                                        |
|o3 = Two-sided ideal {-zx+xz, yz}                       |
|                                                        |
|o3 : NCIdeal                                            |
+--------------------------------------------------------+
|i4 : J' = homogDual J                                   |
|                                                        |
|                       2           2              2     |
|o4 = Two-sided ideal {x , yx, xy, y , zy, zx+xz, z }    |
|                                                        |
|o4 : NCIdeal                                            |
+--------------------------------------------------------+

See also
========

  * quadraticClosure -- Creates the subideal generated
    by quadratic elements of a given ideal

Ways to use homogDual :
=======================

  * "homogDual(NCIdeal)"
  * "homogDual(NCQuotientRing)"
  * "homogDual(Ring)"

For the programmer
==================

The object homogDual, is a method function (Macaulay2Doc).

ideal(NCPolynomialRing) -- The defining ideal of an NCPolynomialRing
********************************************************************

Synopsis
========

  * Function: ideal (Macaulay2Doc),
  * Usage:
        I = ideal A
  * Inputs:
      * A, an instance of the type NCPolynomialRing,
  * Outputs:
      * I, an instance of the type NCIdeal,

Description
===========

This returns the defining ideal of an NCPolynomialRing, which will be the zero
ideal in the noncommutative polynomial ring.

+------------------------+
|i1 : A = QQ{x,y}        |
|                        |
|o1 = A                  |
|                        |
|o1 : NCPolynomialRing   |
+------------------------+
|i2 : ideal A            |
|                        |
|o2 = Two-sided ideal {0}|
|                        |
|o2 : NCIdeal            |
+------------------------+

Ways to use this method:
========================

  * ideal(NCPolynomialRing) -- The defining
    ideal of an NCPolynomialRing

ideal(NCQuotientRing) -- Defining ideal of an NCQuotientRing in its ambient ring
********************************************************************************

Synopsis
========

  * Function: ideal (Macaulay2Doc),
  * Usage:
        I = ideal B
  * Inputs:
      * B, an instance of the type NCQuotientRing,
  * Outputs:
      * I, an instance of the type NCIdeal,

Description
===========

This returns the defining ideal of an NCQuotientRing in its ambient ring.  As
of now, this is always an ideal in an NCPolynomialRing, but when quotients of
NCQuotientRing,s are added, this will no longer be the
case.

+-----------------------------------------------+
|i1 : B = skewPolynomialRing(QQ,(-1)_QQ,{x,y,z})|
|--Calling Bergman for NCGB calculation.        |
|Complete!                                      |
|                                               |
|o1 = B                                         |
|                                               |
|o1 : NCQuotientRing                            |
+-----------------------------------------------+
|i2 : A = ambient B                             |
|                                               |
|o2 = A                                         |
|                                               |
|o2 : NCPolynomialRing                          |
+-----------------------------------------------+
|i3 : I = ideal B                               |
|                                               |
|o3 = Two-sided ideal {yx+xy, zx+xz, zy+yz}     |
|                                               |
|o3 : NCIdeal                                   |
+-----------------------------------------------+
|i4 : ring I === A                              |
|                                               |
|o4 = true                                      |
+-----------------------------------------------+

Ways to use this method:
========================

  * ideal(NCQuotientRing) -- Defining ideal
    of an NCQuotientRing in its ambient ring

isCentral -- Determines if an element is central
************************************************

Synopsis
========

  * Usage:
        isCentral x or isCentral(x,ncgb)
  * Inputs:
      * x, an instance of the type NCRingElement,
      * ncgb, an instance of the type NCGroebnerBasis,
        a Groebner basis for the NCRing to which x belongs.
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

This method checks to see if a given NCRing element is central.

+----------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})|
|--Calling Bergman for NCGB calculation.       |
|Complete!                                     |
|                                              |
|o1 = B                                        |
|                                              |
|o1 : NCQuotientRing                           |
+----------------------------------------------+
|i2 : g = -y^3-x*y*z+y*x*z+x^3                 |
|                                              |
|       3          3                           |
|o2 = -y +yxz-xyz+x                            |
|                                              |
|o2 : B                                        |
+----------------------------------------------+
|i3 : h = x^2 + y^2 + z^2                      |
|                                              |
|      2        2                              |
|o3 = y +yx+xy+x                               |
|                                              |
|o3 : B                                        |
+----------------------------------------------+
|i4 : isCentral h                              |
|                                              |
|o4 = true                                     |
+----------------------------------------------+
|i5 : isCentral g                              |
|                                              |
|o5 = true                                     |
+----------------------------------------------+

See also
========

  * centralElements -- Finds central elements in a
    given degree

Ways to use isCentral :
=======================

  * "isCentral(NCRingElement)"
  * "isCentral(NCRingElement,NCGroebnerBasis)"

For the programmer
==================

The object isCentral, is a method function (Macaulay2Doc).

isCommutative(NCRing) -- Returns whether an NCRing is commutative
*****************************************************************

Synopsis
========

  * Function: isCommutative (Macaulay2Doc),
  * Usage:
        isCommutative A or isExterior A
  * Inputs:
      * A, an instance of the type NCRing,
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

This function returns whether an NCRing is commutative or a quotient of the
exterior algebra

+------------------------------------------------+
|i1 : A = QQ{x,y,z}                              |
|                                                |
|o1 = A                                          |
|                                                |
|o1 : NCPolynomialRing                           |
+------------------------------------------------+
|i2 : isCommutative A                            |
|                                                |
|o2 = false                                      |
+------------------------------------------------+
|i3 : B = skewPolynomialRing(QQ,(-1)_QQ,{x,y,z}) |
|--Calling Bergman for NCGB calculation.         |
|Complete!                                       |
|                                                |
|o3 = B                                          |
|                                                |
|o3 : NCQuotientRing                             |
+------------------------------------------------+
|i4 : isCommutative B                            |
|                                                |
|o4 = false                                      |
+------------------------------------------------+
|i5 : C = skewPolynomialRing(QQ,1_QQ,{x,y,z})    |
|--Calling Bergman for NCGB calculation.         |
|Complete!                                       |
|                                                |
|o5 = C                                          |
|                                                |
|o5 : NCQuotientRing                             |
+------------------------------------------------+
|i6 : isCommutative C                            |
|                                                |
|o6 = true                                       |
+------------------------------------------------+
|i7 : D = toNCRing(QQ[x,y,SkewCommutative=>true])|
|--Calling Bergman for NCGB calculation.         |
|Complete!                                       |
|                                                |
|o7 = D                                          |
|                                                |
|o7 : NCQuotientRing                             |
+------------------------------------------------+
|i8 : isExterior D                               |
|                                                |
|o8 = true                                       |
+------------------------------------------------+

Ways to use this method:
========================

  * isCommutative(NCRing) -- Returns whether
    an NCRing is commutative

isConstant(NCRingElement) -- Returns whether the NCRingElement is constant
**************************************************************************

Synopsis
========

  * Function: isConstant (Macaulay2Doc),
  * Usage:
        t = isConstant f
  * Inputs:
      * f, an instance of the type NCRingElement,
  * Outputs:
      * t, a Boolean value (Macaulay2Doc),

Description
===========

Returns whether the NCRingElement is constant.

+----------------------+
|i1 : A = QQ{x,y,z,w}  |
|                      |
|o1 = A                |
|                      |
|o1 : NCPolynomialRing |
+----------------------+
|i2 : f = x^2+y^2+2*z^3|
|                      |
|       3  2  2        |
|o2 = 2z +y +x         |
|                      |
|o2 : A                |
+----------------------+
|i3 : isConstant f     |
|                      |
|o3 = false            |
+----------------------+
|i4 : g = promote(1,A) |
|                      |
|o4 = 1                |
|                      |
|o4 : A                |
+----------------------+
|i5 : isConstant g     |
|                      |
|o5 = true             |
+----------------------+

Ways to use this method:
========================

  * isConstant(NCRingElement) -- Returns
    whether the NCRingElement is constant

isHomogeneous(NCIdeal) -- Determines whether the input defines a homogeneous object
***********************************************************************************

Synopsis
========

  * Function: isHomogeneous (Macaulay2Doc),
  * Usage:
        isHomogeneous x
  * Inputs:
      * x, an instance of the type NCIdeal, or an
        NCLeftIdeal, an NCRightIdeal, an
        NCRing, an NCMatrix, or an NCRingElement,
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

Many methods in the NCAlgebra package require inputs to be homogeneous. The
meaning of "homogeneous" depens on the type of object.

If x is an NCRingElement, the method returns true if all
terms of x have the same degree.

If x is an NCIdeal, NCLeftIdeal, or
NCRightIdeal, the method returns true if all generators of the
ideal are homogeneous (not necessarily of the same degree).

If x is an NCPolynomialRing, the method returns true.
If x is any other NCRing, the method returns true if and only if
the defining ideal of x is homogeneous.

If x is an NCMatrix, the method returns true if integer
weights were assigned to the source and target of the associated map of free
right modules such that the map is graded (degree 0). See assignDegrees.

+-----------------------------------+
|i1 : A=QQ{x,y,z}                   |
|                                   |
|o1 = A                             |
|                                   |
|o1 : NCPolynomialRing              |
+-----------------------------------+
|i2 : w=x^3-y^2                     |
|                                   |
|       2  3                        |
|o2 = -y +x                         |
|                                   |
|o2 : A                             |
+-----------------------------------+
|i3 : isHomogeneous w               |
|                                   |
|o3 = false                         |
+-----------------------------------+
|i4 : setWeights(A, {2,3,1})        |
|                                   |
|o4 = A                             |
|                                   |
|o4 : NCPolynomialRing              |
+-----------------------------------+
|i5 : isHomogeneous w               |
|                                   |
|o5 = true                          |
+-----------------------------------+
|i6 : I = ncIdeal{w,x+z^2}          |
|                                   |
|                        2  3   2   |
|o6 = Two-sided ideal {-y +x , z +x}|
|                                   |
|o6 : NCIdeal                       |
+-----------------------------------+
|i7 : isHomogeneous I               |
|                                   |
|o7 = true                          |
+-----------------------------------+
+-----------------------------------------------------------------------------+
|i8 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})                               |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o8 = B                                                                       |
|                                                                             |
|o8 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i9 : M = ncMatrix {{x,y,z,0}, {-y*z-2*x^2,-y*x,z*x-x*z,x},{x*y-2*y*x,x*z,-x^2|
|                                                                             |
|o9 = | x          y    z         0 |                                         |
|     | -y*z-2*x^2 -y*x y^2-2*x*z x |                                         |
|     | -2*y*x+x*y x*z  -x^2      y |                                         |
|     | -2*y^2+x*z x^2  -x*y      z |                                         |
|                                                                             |
|o9 : NCMatrix                                                                |
|-----------------------------------------------------------------------------|
|,y}, {-y^2-z*x,x^2,-x*y,z}}                                                  |
+-----------------------------------------------------------------------------+
|i10 : isHomogeneous M                                                        |
|                                                                             |
|o10 = false                                                                  |
+-----------------------------------------------------------------------------+
|i11 : assignDegrees(M,{1,0,0,0},{2,2,2,1})                                   |
|                                                                             |
|o11 = | x          y    z         0 |                                        |
|      | -y*z-2*x^2 -y*x y^2-2*x*z x |                                        |
|      | -2*y*x+x*y x*z  -x^2      y |                                        |
|      | -2*y^2+x*z x^2  -x*y      z |                                        |
|                                                                             |
|o11 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+
|i12 : isHomogeneous M                                                        |
|                                                                             |
|o12 = true                                                                   |
+-----------------------------------------------------------------------------+
|i13 : N = ncMatrix {gens B}                                                  |
|                                                                             |
|o13 = | x y z |                                                              |
|                                                                             |
|o13 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+
|i14 : isHomogeneous N                                                        |
|                                                                             |
|o14 = true                                                                   |
+-----------------------------------------------------------------------------+

See also
========

  * isHomogeneous(NCRingMap) -- Determines
    if an NCRingMap preserves the natural grading
  * setWeights -- Set a nonstandard grading for a NCRing.
  * assignDegrees -- Weights entries of a matrix to make
    associated map of free modules graded

Ways to use this method:
========================

  * isHomogeneous(NCIdeal) -- Determines
    whether the input defines a homogeneous object
  * "isHomogeneous(NCLeftIdeal)"
  * "isHomogeneous(NCMatrix)"
  * "isHomogeneous(NCRightIdeal)"
  * "isHomogeneous(NCRing)"
  * "isHomogeneous(NCRingElement)"

isHomogeneous(NCRingMap) -- Determines if an NCRingMap preserves the natural grading
************************************************************************************

Synopsis
========

  * Function: isHomogeneous (Macaulay2Doc),
  * Usage:
        isHomogeneous f
  * Inputs:
      * f, an instance of the type NCRingMap,
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

This method returns true if the map f is degree 0; that is, if the generators
of the source of f are mapped to elements of the same degree in the target.

+-----------------------------------------------------+
|i1 : A = skewPolynomialRing(QQ,(-1)_QQ,{w,x,y,z})    |
|--Calling Bergman for NCGB calculation.              |
|Complete!                                            |
|                                                     |
|o1 = A                                               |
|                                                     |
|o1 : NCQuotientRing                                  |
+-----------------------------------------------------+
|i2 : B = QQ{w,x,y,z}/ncIdeal{w*x+x*w,w*y+y*w,x*y+y*x}|
|--Calling Bergman for NCGB calculation.              |
|Complete!                                            |
|                                                     |
|o2 = B                                               |
|                                                     |
|o2 : NCQuotientRing                                  |
+-----------------------------------------------------+
|i3 : f = ncMap(B,A,gens B)                           |
|                                                     |
|o3 = NCRingMap B <--- A                              |
|                                                     |
|o3 : NCRingMap                                       |
+-----------------------------------------------------+
|i4 : isHomogeneous f                                 |
|                                                     |
|o4 = true                                            |
+-----------------------------------------------------+
|i5 : C = QQ{a,b,c}                                   |
|                                                     |
|o5 = C                                               |
|                                                     |
|o5 : NCPolynomialRing                                |
+-----------------------------------------------------+
|i6 : g = ncMap(C,A,{a^3,b^2,a+b,a-b})                |
|                                                     |
|o6 = NCRingMap C <--- A                              |
|                                                     |
|o6 : NCRingMap                                       |
+-----------------------------------------------------+
|i7 : isHomogeneous g                                 |
|                                                     |
|o7 = false                                           |
+-----------------------------------------------------+
|i8 : setWeights(A,{3,2,1,1})                         |
|                                                     |
|o8 = A                                               |
|                                                     |
|o8 : NCQuotientRing                                  |
+-----------------------------------------------------+
|i9 : isHomogeneous g                                 |
|                                                     |
|o9 = true                                            |
+-----------------------------------------------------+

See also
========

  * isHomogeneous(NCIdeal) -- Determines
    whether the input defines a homogeneous object

Ways to use this method:
========================

  * isHomogeneous(NCRingMap) -- Determines
    if an NCRingMap preserves the natural grading

isLeftRegular -- Determines if a given (homogeneous) element is regular in a given degree
*****************************************************************************************

Synopsis
========

  * Usage:
        isLeftRegular(x,n) or isRightRegular(x,n)
  * Inputs:
      * x, an instance of the type NCRingElement,
      * n, an integer (Macaulay2Doc), the degree in which regularity
        is checked.
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

Given an element x in an NCRing, isLeftRegular returns true if a*x=0 implies
a=0 for all a in the specified homogeneous degree n. Likewise isRightRegular
returns true if x*a=0 implies a=0 for all elements a of degree n. The method
calls leftMultiplicationMap, or
rightMultiplicationMap, as appropriate and checks the
kernel in the specified degree.

+----------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})|
|--Calling Bergman for NCGB calculation.       |
|Complete!                                     |
|                                              |
|o1 = B                                        |
|                                              |
|o1 : NCQuotientRing                           |
+----------------------------------------------+
|i2 : g = -y^3-x*y*z+y*x*z+x^3                 |
|                                              |
|       3          3                           |
|o2 = -y +yxz-xyz+x                            |
|                                              |
|o2 : B                                        |
+----------------------------------------------+
|i3 : isLeftRegular(g,6)                       |
|                                              |
|o3 = true                                     |
+----------------------------------------------+
|i4 : C = QQ{x,y}                              |
|                                              |
|o4 = C                                        |
|                                              |
|o4 : NCPolynomialRing                         |
+----------------------------------------------+
|i5 : D = C/ncIdeal{x^2+x*y,y^2}               |
|--Calling Bergman for NCGB calculation.       |
|Complete!                                     |
|                                              |
|o5 = D                                        |
|                                              |
|o5 : NCQuotientRing                           |
+----------------------------------------------+
|i6 : isLeftRegular(x,1)                       |
|                                              |
|o6 = true                                     |
+----------------------------------------------+
|i7 : isRightRegular(x,1)                      |
|                                              |
|o7 = false                                    |
+----------------------------------------------+

See also
========

  * leftMultiplicationMap -- Computes a matrix
    for left or right multiplication by a homogeneous element
  * rightMultiplicationMap -- Computes a matrix
    for left or right multiplication by a homogeneous element

Ways to use isLeftRegular :
===========================

  * "isLeftRegular(NCRingElement,ZZ)"

For the programmer
==================

The object isLeftRegular, is a method function (Macaulay2Doc).

isNormal(NCRingElement) -- Determines if a given NCRingElement is normal
************************************************************************

Synopsis
========

  * Function: isNormal (IntegralClosure),
  * Usage:
        isNormal x
  * Inputs:
      * x, an instance of the type NCRingElement,
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

Given an element x in an NCRing R, this method returns true if Rx=xR.

+------------------------------------------+
|i1 : A = QQ{a,b,c}                        |
|                                          |
|o1 = A                                    |
|                                          |
|o1 : NCPolynomialRing                     |
+------------------------------------------+
|i2 : I = ncIdeal {a*b+b*a,a*c+c*a,b*c+c*b}|
|                                          |
|o2 = Two-sided ideal {ba+ab, ca+ac, cb+bc}|
|                                          |
|o2 : NCIdeal                              |
+------------------------------------------+
|i3 : B = A/I                              |
|--Calling Bergman for NCGB calculation.   |
|Complete!                                 |
|                                          |
|o3 = B                                    |
|                                          |
|o3 : NCQuotientRing                       |
+------------------------------------------+
|i4 : sigma = ncMap(B,B,{b,c,a})           |
|                                          |
|o4 = NCRingMap B <--- B                   |
|                                          |
|o4 : NCRingMap                            |
+------------------------------------------+
|i5 : isWellDefined sigma                  |
|                                          |
|o5 = true                                 |
+------------------------------------------+
|i6 : C = oreExtension(B,sigma,w)          |
|--Calling Bergman for NCGB calculation.   |
|Complete!                                 |
|                                          |
|o6 = C                                    |
|                                          |
|o6 : NCQuotientRing                       |
+------------------------------------------+
|i7 : isCentral w                          |
|                                          |
|o7 = false                                |
+------------------------------------------+
|i8 : isNormal w                           |
|                                          |
|o8 = true                                 |
+------------------------------------------+

See also
========

  * isCentral -- Determines if an element is central
  * normalElements -- Finds normal elements

Ways to use this method:
========================

  * isNormal(NCRingElement) -- Determines
    if a given NCRingElement is normal

isWellDefined(NCRingMap) -- Determines if an NCRingMap is well-defined.
***********************************************************************

Synopsis
========

  * Function: isWellDefined (Macaulay2Doc),
  * Usage:
        isWellDefined f
  * Inputs:
      * f, an instance of the type NCRingMap,
  * Outputs:
      * a Boolean value (Macaulay2Doc),

Description
===========

Returns true if the given NCRingMap evaluates as 0 on the defining relations of
the source.

+-----------------------------------------------------+
|i1 : A = skewPolynomialRing(QQ,(-1)_QQ,{w,x,y,z})    |
|--Calling Bergman for NCGB calculation.              |
|Complete!                                            |
|                                                     |
|o1 = A                                               |
|                                                     |
|o1 : NCQuotientRing                                  |
+-----------------------------------------------------+
|i2 : B = QQ{w,x,y,z}/ncIdeal{w*x+x*w,w*y+y*w,x*y+y*x}|
|--Calling Bergman for NCGB calculation.              |
|Complete!                                            |
|                                                     |
|o2 = B                                               |
|                                                     |
|o2 : NCQuotientRing                                  |
+-----------------------------------------------------+
|i3 : f = ncMap(B,A,gens B)                           |
|                                                     |
|o3 = NCRingMap B <--- A                              |
|                                                     |
|o3 : NCRingMap                                       |
+-----------------------------------------------------+
|i4 : isWellDefined f                                 |
|                                                     |
|o4 = false                                           |
+-----------------------------------------------------+
|i5 : C = QQ{a,b,c}                                   |
|                                                     |
|o5 = C                                               |
|                                                     |
|o5 : NCPolynomialRing                                |
+-----------------------------------------------------+
|i6 : g = ncMap(C,A,{a^3,b^2,a+b,a-b})                |
|                                                     |
|o6 = NCRingMap C <--- A                              |
|                                                     |
|o6 : NCRingMap                                       |
+-----------------------------------------------------+
|i7 : isWellDefined g                                 |
|                                                     |
|o7 = false                                           |
+-----------------------------------------------------+

Ways to use this method:
========================

  * isWellDefined(NCRingMap) -- Determines
    if an NCRingMap is well-defined.

kernelComponent -- Computes a basis of the kernel of a ring map in a specified degree.
**************************************************************************************

Synopsis
========

  * Usage:
        kern = kernelComponent(n,phi)
  * Inputs:
      * n, an integer (Macaulay2Doc),
      * phi, an instance of the type NCRingMap,
  * Outputs:
      * kern, an instance of the type NCMatrix,

Description
===========

This function returns a basis of the kernel of a ring map in a specified
degree.

+------------------------------------------------+
|i1 : A = QQ{x,y,z}                              |
|                                                |
|o1 = A                                          |
|                                                |
|o1 : NCPolynomialRing                           |
+------------------------------------------------+
|i2 : B = skewPolynomialRing(QQ,(-1)_QQ, {a,b,c})|
|--Calling Bergman for NCGB calculation.         |
|Complete!                                       |
|                                                |
|o2 = B                                          |
|                                                |
|o2 : NCQuotientRing                             |
+------------------------------------------------+
|i3 : phi = ncMap(B,A,{a,b,c})                   |
|                                                |
|o3 = NCRingMap B <--- A                         |
|                                                |
|o3 : NCRingMap                                  |
+------------------------------------------------+
|i4 : kernelComponent(2,phi)                     |
|                                                |
|o4 = | y*x+x*y z*x+x*z z*y+y*z |                |
|                                                |
|o4 : NCMatrix                                   |
+------------------------------------------------+

Ways to use kernelComponent :
=============================

  * "kernelComponent(ZZ,NCRingMap)"

For the programmer
==================

The object kernelComponent, is a method function (Macaulay2Doc).

leadCoefficient(NCRingElement) -- Returns the lead monomial of an NCRingElement
*******************************************************************************

Synopsis
========

  * Function: leadCoefficient (Macaulay2Doc),
  * Usage:
        coeff = leadCoefficient f
  * Inputs:
      * f, an instance of the type NCRingElement,
  * Outputs:
      * coeff, a ring element (Macaulay2Doc),

Description
===========

Returns the lead coefficient of an NCRingElement (as an element of the base).

+------------------------------+
|i1 : A = QQ{x,y,z,w}          |
|                              |
|o1 = A                        |
|                              |
|o1 : NCPolynomialRing         |
+------------------------------+
|i2 : f = x^2+y^2+z^3          |
|                              |
|      3  2  2                 |
|o2 = z +y +x                  |
|                              |
|o2 : A                        |
+------------------------------+
|i3 : coeff = leadCoefficient f|
|                              |
|o3 = 1                        |
|                              |
|o3 : QQ                       |
+------------------------------+

Ways to use this method:
========================

  * leadCoefficient(NCRingElement),
    -- Returns the lead monomial of an NCRingElement

leadMonomial(NCRingElement) -- Returns the lead monomial of an NCRingElement
****************************************************************************

Synopsis
========

  * Function: leadMonomial (Macaulay2Doc),
  * Usage:
        mon = leadMonomial f
  * Inputs:
      * f, an instance of the type NCRingElement,
  * Outputs:
      * mon, an instance of the type NCRingElement,

Description
===========

Returns the lead monomial of an NCRingElement (as an NCRingElement).

+-------------------------+
|i1 : A = QQ{x,y,z,w}     |
|                         |
|o1 = A                   |
|                         |
|o1 : NCPolynomialRing    |
+-------------------------+
|i2 : f = x^2+y^2+z^3     |
|                         |
|      3  2  2            |
|o2 = z +y +x             |
|                         |
|o2 : A                   |
+-------------------------+
|i3 : mon = leadMonomial f|
|                         |
|      3                  |
|o3 = z                   |
|                         |
|o3 : A                   |
+-------------------------+

Ways to use this method:
========================

  * leadMonomial(NCRingElement), --
    Returns the lead monomial of an NCRingElement

leadTerm(NCRingElement) -- Returns the lead term of an NCRingElement
********************************************************************

Synopsis
========

  * Function: leadTerm (Macaulay2Doc),
  * Usage:
        coeff = leadTerm f
  * Inputs:
      * f, an instance of the type NCRingElement,
  * Outputs:
      * coeff, an instance of the type NCRingElement,

Description
===========

Returns the lead term of an NCRingElement (as an NCRingElement).

+-----------------------+
|i1 : A = QQ{x,y,z,w}   |
|                       |
|o1 = A                 |
|                       |
|o1 : NCPolynomialRing  |
+-----------------------+
|i2 : f = x^2+y^2+2*z^3 |
|                       |
|       3  2  2         |
|o2 = 2z +y +x          |
|                       |
|o2 : A                 |
+-----------------------+
|i3 : coeff = leadTerm f|
|                       |
|       3               |
|o3 = 2z                |
|                       |
|o3 : A                 |
+-----------------------+

Ways to use this method:
========================

  * leadTerm(NCRingElement) -- Returns the
    lead term of an NCRingElement

leftMultiplicationMap -- Computes a matrix for left or right multiplication by a homogeneous element
****************************************************************************************************

Synopsis
========

  * Usage:
        leftMultiplicationMap(r,n) or leftMultiplicationMap(r,n,m) or leftMultiplicationMap(r,fromBasis,toBasis)
  * Inputs:
      * r, an instance of the type NCRingElement,
      * n, an integer (Macaulay2Doc), the homogeneous degree for the
        source of the map
      * m, an integer (Macaulay2Doc), the homogeneous degree for the
        target of the map
      * fromBasis, a list (Macaulay2Doc), a list of monomials of
        the same homogeneous degree
      * toBasis, a list (Macaulay2Doc), a list of monomials of
        homogeneous degree deg(r) larger than the degree of the toBasis
  * Outputs:
      * a matrix (Macaulay2Doc),

Description
===========

These methods return a matrix over the coefficient ring of the NCRing to which
r belongs. The matrix represents left or right multiplication by r. Most
commonly, the user will enter the ring element (required to be homogeneous) and
a degree n. The result is the matrix of the map A_n -> A_n+d where d is the
degree of r. The matrix is computed relative to the monomial basis obtain using
basis(ZZ,NCRing).

Alternatively, the user can enter sets of independent monomials to serve as a
basis for the domain and co-domain of the maps. The method left or right
multiplies r by the fromBasis and converts to coordinates via
sparseCoeffs, and the toBasis.

+----------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})|
|--Calling Bergman for NCGB calculation.       |
|Complete!                                     |
|                                              |
|o1 = B                                        |
|                                              |
|o1 : NCQuotientRing                           |
+----------------------------------------------+
|i2 : leftMultiplicationMap(x,2)               |
|                                              |
|o2 = | 1 0 0 0 0 0 |                          |
|     | 0 1 0 0 0 0 |                          |
|     | 0 0 1 0 0 0 |                          |
|     | 0 0 0 0 0 0 |                          |
|     | 0 0 0 1 0 0 |                          |
|     | 0 0 0 0 0 0 |                          |
|     | 0 0 0 0 1 0 |                          |
|     | 0 0 0 0 0 0 |                          |
|     | 0 0 0 0 0 1 |                          |
|     | 0 0 0 0 0 0 |                          |
|                                              |
|              10        6                     |
|o2 : Matrix QQ   <--- QQ                      |
+----------------------------------------------+
|i3 : kernel oo                                |
|                                              |
|o3 = image 0                                  |
|                                              |
|                               6              |
|o3 : QQ-module, submodule of QQ               |
+----------------------------------------------+
|i4 : isRightRegular(x,2)                      |
|                                              |
|o4 = true                                     |
+----------------------------------------------+

If the element is not regular, you can use these methods to compute the
annihilators in particular degrees.

+---------------------------------------+
|i5 : C = QQ{x,y}                       |
|                                       |
|o5 = C                                 |
|                                       |
|o5 : NCPolynomialRing                  |
+---------------------------------------+
|i6 : D = C/ncIdeal{x^2+x*y,y^2}        |
|--Calling Bergman for NCGB calculation.|
|Complete!                              |
|                                       |
|o6 = D                                 |
|                                       |
|o6 : NCQuotientRing                    |
+---------------------------------------+
|i7 : isRightRegular(x,1)               |
|                                       |
|o7 = false                             |
+---------------------------------------+
|i8 : leftMultiplicationMap(x,1)        |
|                                       |
|o8 = | 1 -1 |                          |
|     | 0 0  |                          |
|                                       |
|              2        2               |
|o8 : Matrix QQ  <--- QQ                |
+---------------------------------------+
|i9 : M=matrix gens kernel oo           |
|                                       |
|o9 = | 1 |                             |
|     | 1 |                             |
|                                       |
|              2        1               |
|o9 : Matrix QQ  <--- QQ                |
+---------------------------------------+
|i10 : basis(1,D)*M                     |
|                                       |
|o10 = | y+x |                          |
|                                       |
|o10 : NCMatrix                         |
+---------------------------------------+

See also
========

  * sparseCoeffs -- Converts ring elements into vectors
    over the coefficient ring

Ways to use leftMultiplicationMap :
===================================

  * "leftMultiplicationMap(NCRingElement,List,List)"
  * "leftMultiplicationMap(NCRingElement,ZZ)"
  * "leftMultiplicationMap(NCRingElement,ZZ,ZZ)"

For the programmer
==================

The object leftMultiplicationMap, is a
method function (Macaulay2Doc).

lift(NCMatrix) -- Lifts an NCMatrix
***********************************

Synopsis
========

  * Function: lift (Macaulay2Doc),
  * Usage:
        L = lift M
  * Inputs:
      * M, an instance of the type NCMatrix,
  * Optional inputs (Macaulay2Doc),:
      * Verify (Macaulay2Doc), => ..., default value true, null
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command lifts an NCMatrix to a matrix over its ambient (Macaulay2Doc),
NCRing.

+---------------------------------------------------------------------+
|i1 : A = QQ{x,y,z,w}                                                 |
|                                                                     |
|o1 = A                                                               |
|                                                                     |
|o1 : NCPolynomialRing                                                |
+---------------------------------------------------------------------+
|i2 : B = A/ncIdeal{y*z + z*y - x^2, x*z + z*x - y^2, z^2 - x*y - y*x}|
|--Calling Bergman for NCGB calculation.                              |
|Complete!                                                            |
|                                                                     |
|o2 = B                                                               |
|                                                                     |
|o2 : NCQuotientRing                                                  |
+---------------------------------------------------------------------+
|i3 : M = ncMatrix {{x,y,z,w},{y,z,w,x}}                              |
|                                                                     |
|o3 = | x y z w |                                                     |
|     | y z w x |                                                     |
|                                                                     |
|o3 : NCMatrix                                                        |
+---------------------------------------------------------------------+
|i4 : N = M || 2*M || -3*M                                            |
|                                                                     |
|o4 = | x    y    z    w    |                                         |
|     | y    z    w    x    |                                         |
|     | 2*x  2*y  2*z  2*w  |                                         |
|     | 2*y  2*z  2*w  2*x  |                                         |
|     | -3*x -3*y -3*z -3*w |                                         |
|     | -3*y -3*z -3*w -3*x |                                         |
|                                                                     |
|o4 : NCMatrix                                                        |
+---------------------------------------------------------------------+
|i5 : ring N                                                          |
|                                                                     |
|o5 = B                                                               |
|                                                                     |
|o5 : NCQuotientRing                                                  |
+---------------------------------------------------------------------+
|i6 : ring lift N                                                     |
|                                                                     |
|o6 = A                                                               |
|                                                                     |
|o6 : NCPolynomialRing                                                |
+---------------------------------------------------------------------+

Ways to use this method:
========================

  * lift(NCMatrix) -- Lifts an NCMatrix

List * NCRingElement -- Scales a list by an NCRingElement on the right
**********************************************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        xsf = xs*f
  * Inputs:
      * xs, a list (Macaulay2Doc),
      * f, an instance of the type NCRingElement,
  * Outputs:
      * xsf, a list (Macaulay2Doc),

Description
===========

Scales a list by an NCRingElement on the right.

+-----------------------------------------------------------------------------+
|i1 : A = QQ{x,y}                                                             |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : f = x^2+y^2                                                             |
|                                                                             |
|      2  2                                                                   |
|o2 = y +x                                                                    |
|                                                                             |
|o2 : A                                                                       |
+-----------------------------------------------------------------------------+
|i3 : bas = flatten entries basis(3,A)                                        |
|                                                                             |
|       3    2        2    2          2   3                                   |
|o3 = {x , yx , xyx, y x, x y, yxy, xy , y }                                  |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : bas*f                                                                   |
|                                                                             |
|       3 2  5    2 2   4      2    3   2  2  2 3   2 3  2  2     3     2     |
|o4 = {x y +x , yx y +yx , xyxy +xyx , y xy +y x , x y +x yx , yxy +yxyx ,    |
|     ------------------------------------------------------------------------|
|       4   2 2   5  3 2                                                      |
|     xy +xy x , y +y x }                                                     |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * List * NCRingElement -- Scales a list by an
    NCRingElement on the right

List / NCRingMap -- Applies an NCRingMap to each element of a list
******************************************************************

Synopsis
========

  * Operator: / (Macaulay2Doc),
  * Usage:
        L/f
  * Inputs:
      * L, a list (Macaulay2Doc),
      * f, an instance of the type NCRingMap,
  * Outputs:
      * a list (Macaulay2Doc),

Description
===========

This operation is the same thing as apply(L,x->f(x)). Note that the operation
is left associative.

+-----------------------------+
|i1 : A = QQ{x,y}             |
|                             |
|o1 = A                       |
|                             |
|o1 : NCPolynomialRing        |
+-----------------------------+
|i2 : f = ncMap(A,A,{x^2,y^2})|
|                             |
|o2 = NCRingMap A <--- A      |
|                             |
|o2 : NCRingMap               |
+-----------------------------+
|i3 : g = ncMap(A,A,{x+y,y})  |
|                             |
|o3 = NCRingMap A <--- A      |
|                             |
|o3 : NCRingMap               |
+-----------------------------+
|i4 : gens A/f/g              |
|                             |
|       2        2   2        |
|o4 = {y +yx+xy+x , y }       |
|                             |
|o4 : List                    |
+-----------------------------+
|i5 : gens A/g/f              |
|                             |
|       2  2   2              |
|o5 = {y +x , y }             |
|                             |
|o5 : List                    |
+-----------------------------+

Ways to use this method:
========================

  * List / NCRingMap -- Applies an NCRingMap to each
    element of a list

Matrix * NCMatrix -- Product of NCMatrices
******************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        L = N*M
  * Inputs:
      * N, a matrix (Macaulay2Doc),
      * M, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command allows for the product of composable NCMatrices (or ordinary
matrices over the base).

+--------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})    |
|--Calling Bergman for NCGB calculation.           |
|Complete!                                         |
|                                                  |
|o1 = B                                            |
|                                                  |
|o1 : NCQuotientRing                               |
+--------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                     |
|                                                  |
|o2 = | x y z |                                    |
|                                                  |
|o2 : NCMatrix                                     |
+--------------------------------------------------+
|i3 : sigma = ncMap(B,B,{y,z,x})                   |
|                                                  |
|o3 = NCRingMap B <--- B                           |
|                                                  |
|o3 : NCRingMap                                    |
+--------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}|
|                                                  |
|o4 = | x y z |                                    |
|     | y z x |                                    |
|     | z x y |                                    |
|                                                  |
|o4 : NCMatrix                                     |
+--------------------------------------------------+
|i5 : L = map(QQ^3,QQ^3,{{2,0,0},{1,2,0},{1,2,3}}) |
|                                                  |
|o5 = | 2 0 0 |                                    |
|     | 1 2 0 |                                    |
|     | 1 2 3 |                                    |
|                                                  |
|              3        3                          |
|o5 : Matrix QQ  <--- QQ                           |
+--------------------------------------------------+
|i6 : L*N                                          |
|                                                  |
|o6 = | 2*x       2*y       2*z       |            |
|     | 2*y+x     2*z+y     z+2*x     |            |
|     | 3*z+2*y+x 2*z+y+3*x z+3*y+2*x |            |
|                                                  |
|o6 : NCMatrix                                     |
+--------------------------------------------------+

Ways to use this method:
========================

  * Matrix * NCMatrix -- Product of NCMatrices

matrix(NCRingMap) -- An NCMatrix associated to an NCRingMap.
************************************************************

Synopsis
========

  * Function: matrix (Macaulay2Doc),
  * Usage:
        matrix f
  * Inputs:
      * f, an instance of the type NCRingMap,
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), => ..., default value
        null, null
  * Outputs:
      * an instance of the type NCMatrix,

Description
===========

This function returns a matrix whose entries are the images of the source
generators in the target ring of f. The type of matrix depends on the type of
the target ring.

+-------------------------------------------------+
|i1 : A = skewPolynomialRing(QQ,(-1)_QQ,{w,x,y,z})|
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|                                                 |
|o1 = A                                           |
|                                                 |
|o1 : NCQuotientRing                              |
+-------------------------------------------------+
|i2 : B = QQ[a,b,c,SkewCommutative=>true]         |
|                                                 |
|o2 = B                                           |
|                                                 |
|o2 : PolynomialRing, 3 skew commutative variables|
+-------------------------------------------------+
|i3 : f = ncMap(B,A,{a^3,b^2,a+b,a-b})            |
|                                                 |
|o3 = NCRingMap B <--- A                          |
|                                                 |
|o3 : NCRingMap                                   |
+-------------------------------------------------+
|i4 : matrix f                                    |
|                                                 |
|o4 = | 0 0 a+b a-b |                             |
|                                                 |
|             1       4                           |
|o4 : Matrix B  <--- B                            |
+-------------------------------------------------+
|i5 : g = ncMap(A,A,{x,y,z,w})                    |
|                                                 |
|o5 = NCRingMap A <--- A                          |
|                                                 |
|o5 : NCRingMap                                   |
+-------------------------------------------------+
|i6 : matrix g                                    |
|                                                 |
|o6 = | x y z w |                                 |
|                                                 |
|o6 : NCMatrix                                    |
+-------------------------------------------------+

Ways to use this method:
========================

  * matrix(NCRingMap) -- An NCMatrix associated
    to an NCRingMap.

minimizeRelations -- Minimizes a list of NCRingElements
*******************************************************

Synopsis
========

  * Usage:
        mgens = minimizeRelations(gens)
  * Inputs:
      * gens, a list (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Verbosity => ..., default value 0
  * Outputs:
      * mgens, a list (Macaulay2Doc),

Description
===========

Given a list of NCRingElements, this method produces a generating set for the
NCIdeal generated by the list which (possibly) uses fewer generators and/or
fewer NCRing generators. Commonly used with Link to endomorphismRing.

+-----------------------------------------------------------------------------+
|i1 : Q = QQ[a,b,c,d]                                                         |
|                                                                             |
|o1 = Q                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : R = Q/ideal{a*b+c*d}                                                    |
|                                                                             |
|o2 = R                                                                       |
|                                                                             |
|o2 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i3 : kRes = res(coker vars R, LengthLimit=>7)                                |
|                                                                             |
|      1      4      7      8      8      8      8      8                     |
|o3 = R  <-- R  <-- R  <-- R  <-- R  <-- R  <-- R  <-- R                      |
|                                                                             |
|     0      1      2      3      4      5      6      7                      |
|                                                                             |
|o3 : ChainComplex                                                            |
+-----------------------------------------------------------------------------+
|i4 : M = coker kRes.dd_5                                                     |
|                                                                             |
|o4 = cokernel {4} | b  0  0  0  0  c  0 0 |                                  |
|              {4} | 0  a  0  0  c  0  0 0 |                                  |
|              {4} | -c 0  0  -a 0  0  0 c |                                  |
|              {4} | 0  -c -b 0  0  0  c 0 |                                  |
|              {4} | d  0  0  0  0  -a 0 0 |                                  |
|              {4} | 0  d  0  0  -b 0  0 0 |                                  |
|              {4} | 0  0  d  0  c  0  a 0 |                                  |
|              {4} | 0  0  0  d  0  c  0 b |                                  |
|                                                                             |
|                            8                                                |
|o4 : R-module, quotient of R                                                 |
+-----------------------------------------------------------------------------+
|i5 : B = endomorphismRing(M,Y)                                               |
|                                                                             |
|o5 = B                                                                       |
|                                                                             |
|o5 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i6 : gensI = gens ideal B                                                    |
|                                                                             |
|                                                                             |
|o6 = {Y Y , Y Y , Y Y , Y Y , Y Y , Y Y , -Y +Y Y , -Y +Y Y , Y Y , Y Y ,    |
|       0 1   0 2   1 2   0 3   1 3   2 3    4  0 4    5  1 4   2 4   3 4     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y , Y Y , Y Y , Y Y , Y Y +-Y , Y Y , Y Y , -Y +Y Y , -Y +Y Y , Y Y , |
|      0 5   1 5   2 5   3 5   4 5   4   0 6   1 6    6  2 6    7  3 6   4 6  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y , Y Y , Y Y , Y Y , Y Y , Y Y , Y Y , Y Y +-Y , Y Y +-aY ,          |
|      5 6   0 7   1 7   2 7   3 7   4 7   5 7   6 7   6   0 8    0           |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y +-aY , Y Y , Y Y , Y Y , Y Y , Y  +Y Y , -Y +Y Y +aY , Y Y +dY ,    |
|      1 8    1   2 8   3 8   4 8   5 8   13  6 8    8  7 8   0   0 9   0     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y +dY , Y Y , Y Y , Y Y , Y Y , Y  +Y Y +cY , -Y +Y Y +-dY , Y Y +dY ,|
|      1 9   1   2 9   3 9   4 9   5 9   10  6 9   1    9  7 9    0   8 9   8 |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , -Y  +Y Y  +-cY , Y +Y Y  +dY , Y Y  +cY , Y Y  +cY ,      |
|      0 10   1 10    10  2 10    1   9  3 10   0   4 10   0   5 10   1       |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , Y Y  , Y Y  , Y Y  , Y Y  , -Y  +Y Y  +-bY , Y  +Y Y  ,   |
|      6 10   7 10   8 10   9 10   0 11   1 11    11  2 11    1   12  3 11    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  +bY , Y Y  +bY , Y Y  , Y Y  , Y Y  , Y Y  , Y  Y  , Y Y  , Y Y  , |
|      4 11   0   5 11   1   6 11   7 11   8 11   9 11   10 11   0 12   1 12  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , Y Y  , Y Y  , Y  +Y Y  +bY , -Y  +Y Y  , Y Y  , Y Y  ,    |
|      2 12   3 12   4 12   5 12   11  6 12   1    12  7 12   8 12   9 12     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y Y  , Y Y  , -Y  +Y Y  , Y +Y Y  +-aY , Y Y  , Y Y  ,  |
|      10 12   11 12   0 13   1 13    13  2 13   8  3 13    0   4 13   5 13   |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , Y Y  , Y Y  , Y  Y  , Y  Y  , Y  Y  , -Y  +-cY +Y Y  ,    |
|      6 13   7 13   8 13   9 13   10 13   11 13   12 13    14    3  0 14     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  +dY +Y Y  , Y Y  , Y Y  , Y Y  , Y Y  , Y Y  +cY , Y Y  +cY ,        |
|      17   2  1 14   2 14   3 14   4 14   5 14   6 14   2   7 14   3         |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -aY  +Y Y  , dY  +Y Y  , -cY  +Y  Y  , dY  +Y  Y  , Y  Y  +-b*dY ,      |
|        14  8 14    14  9 14     17  10 14    16  11 14   12 14      3       |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +-a*cY , -Y  +-aY +Y Y  , Y  +Y Y  , Y Y  , Y Y  , Y Y  , Y Y  ,  |
|      13 14      2    15    3  0 15   18  1 15   2 15   3 15   4 15   5 15   |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  +aY , Y Y  +aY , -aY  +Y Y  , dY  +Y Y  , -aY  +Y  Y  ,            |
|      6 15   2   7 15   3     15  8 15    15  9 15     17  10 15             |
|     ------------------------------------------------------------------------|
|                          2             2                                    |
|     dY  +Y  Y  , Y  Y  +d Y , Y  Y  +-a Y , Y  Y  , Y Y  , Y Y  ,           |
|       17  11 15   12 15    3   13 15     2   14 15   0 16   1 16            |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  +-bY , Y Y  +-bY , Y  +Y Y  , -Y  +Y Y  +bY , Y Y  , Y Y  , Y Y  , |
|      2 16    2   3 16    3   19  4 16    16  5 16   2   6 16   7 16   8 16  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , dY  +Y  Y  +b*cY , Y  Y  +dY  ,  |
|      9 16   10 16   11 16   12 16   13 16    19  14 16     3   15 16   14   |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , Y Y  +dY , Y Y  +dY , Y  +Y Y  +cY , -Y  +Y Y  +-dY ,     |
|      0 17   1 17   2 17   2   3 17   3   14  4 17   3    17  5 17    2      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , Y Y  , Y Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  +dY  ,|
|      6 17   7 17   8 17   9 17   10 17   11 17   12 17   13 17   14 17   14 |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +dY  , Y  Y  +dY  , Y Y  , Y Y  , Y Y  , Y Y  , Y  +Y Y  +aY ,    |
|      15 17   15   16 17   16   0 18   1 18   2 18   3 18   15  4 18   3     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -Y  +Y Y  , Y Y  , Y Y  , Y Y  , Y Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , |
|       18  5 18   6 18   7 18   8 18   9 18   10 18   11 18   12 18   13 18  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , Y  Y  , -Y  +Y Y  , Y  +-bY +Y Y  , Y Y  ,      |
|      14 18   15 18   16 18   17 18    19  0 19   16    2  1 19   2 19       |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , Y Y  , Y Y  , Y Y  , -cY  +Y Y  , dY  +Y Y  +b*cY ,       |
|      3 19   4 19   5 19   6 19   7 19     14  8 19    19  9 19     3        |
|     ------------------------------------------------------------------------|
|                                         2             2                     |
|     -cY  +Y  Y  , -bY  +Y  Y  , Y  Y  +b Y , Y  Y  +-c Y , Y  Y  , Y  Y  ,  |
|        16  10 19     16  11 19   12 19    3   13 19     2   14 19   15 19   |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , aY +Y Y  , aY +Y Y  , Y Y  , Y Y  , Y Y  ,      |
|      16 19   17 19   18 19    4  0 20    5  1 20   2 20   3 20   4 20       |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y  +Y Y  , -Y  +Y Y  +-aY , -aY  +Y Y  , dY  +Y Y  ,             |
|      5 20   25  6 20    20  7 20    4     20  8 20    20  9 20              |
|     ------------------------------------------------------------------------|
|                                                      2                      |
|     dY  +Y  Y  +-a*cY , -dY  +Y  Y  , -dY  +Y  Y  +-d Y , -aY  +Y  Y  ,     |
|       25  10 20      5     22  11 20     21  12 20     4     25  13 20      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , dY +Y Y  , dY +Y Y  ,   |
|      14 20   15 20   16 20   17 20   18 20   19 20    4  0 21    5  1 21    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , Y Y  , Y Y  , Y  +Y Y  +cY , -Y  +Y Y  +-dY , -dY  +Y Y  ,|
|      2 21   3 21   4 21   5 21   22  6 21   5    21  7 21    4     20  8 21 |
|     ------------------------------------------------------------------------|
|                                                                             |
|     dY  +Y Y  , dY  +Y  Y  , dY  +-dY  +Y  Y  , dY  +Y  Y  +b*dY ,          |
|       21  9 21    22  10 21    23    16  11 21    24  12 21     3           |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -dY  +Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  ,   |
|        25  13 21   14 21   15 21   16 21   17 21   18 21   19 21   20 21    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , -Y  +-cY +Y Y  , Y  +dY +Y Y  , Y Y  +cY , Y Y  +cY ,     |
|      0 22   1 22    22    5  2 22   21   4  3 22   4 22   4   5 22   5      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , Y Y  , Y Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  ,             |
|      6 22   7 22   8 22   9 22   10 22   11 22   12 22   13 22              |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -cY  +Y  Y  , -dY  +Y  Y  , -bY  +Y  Y  , dY  +Y  Y  , Y  Y  +-a*dY ,   |
|        21  14 22     20  15 22     22  16 22    22  17 22   18 22      5    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +-b*cY , Y  Y  +cY  , Y  Y  +cY  , Y Y  , Y Y  ,                  |
|      19 22      4   20 22   20   21 22   21   0 23   1 23                   |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -Y  +Y  +-bY +Y Y  +-bY , Y  +Y Y  , Y  +Y Y  +bY , -Y  +Y Y  +bY +bY , |
|       23  16    5  2 23    2   24  3 23   19  4 23   4    16  5 23   5   2  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , Y Y  , Y Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  ,             |
|      6 23   7 23   8 23   9 23   10 23   11 23   12 23   13 23              |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -bY  +dY  +Y  Y  +b*cY , dY  +Y  Y  +dY  , -bY  +Y  Y  , dY  +Y  Y  ,   |
|        21   19  14 23     3    21  15 23   14     23  16 23    23  17 23    |
|     ------------------------------------------------------------------------|
|                  2    2                   2                                 |
|     Y  Y  +dY  +d Y +d Y , Y  Y  +-bY  +-b Y , -cY  +Y  Y  +-cY  ,          |
|      18 23   17    5    2   19 23    19     4     21  20 23    14           |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +bY  +-dY  +-b*cY , Y  Y  +bY  +cY  , Y Y  , Y Y  , Y Y  , Y Y  , |
|      21 23   21    19      3   22 23   22   16   0 24   1 24   2 24   3 24  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , Y  +-Y  +Y Y  +bY +bY , -Y  +Y Y  , Y Y  , Y Y  , Y  Y  , |
|      4 24   5 24   23   16  6 24   5   2    24  7 24   8 24   9 24   10 24  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , |
|      11 24   12 24   13 24   14 24   15 24   16 24   17 24   18 24   19 24  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y Y  , Y Y  , -Y  +Y Y  , Y  +aY +Y Y  ,|
|      20 24   21 24   22 24   23 24   0 25   1 25    25  2 25   20   4  3 25 |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , Y Y  , Y Y  , Y Y  , Y Y  , Y  Y  , Y  Y  , Y  Y  ,       |
|      4 25   5 25   6 25   7 25   8 25   9 25   10 25   11 25   12 25        |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , -cY  +Y  Y  , -aY  +Y  Y  , cY  +Y  Y  , dY  +Y  Y  +-a*cY ,    |
|      13 25     20  14 25     20  15 25    22  16 25    25  17 25      5     |
|     ------------------------------------------------------------------------|
|              2            2                                                 |
|     Y  Y  +-a Y , Y  Y  +c Y , Y  Y  , Y  Y  , Y  Y  , Y  Y  +cY  ,         |
|      18 25     5   19 25    4   20 25   21 25   22 25   23 25   22          |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +cY  +c*dY , -Y  +-cY +Y Y  , Y  +dY +Y Y  , Y Y  , Y Y  , Y Y  , |
|      24 25   21     4    26    7  0 26   29   6  1 26   2 26   3 26   4 26  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  +cY , Y Y  +cY , -aY  +Y Y  , dY  +Y Y  , -cY  +Y  Y  ,     |
|      5 26   6 26   6   7 26   7     26  8 26    26  9 26     29  10 26      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -dY  +Y  Y  , Y  Y  +-b*dY , Y  Y  +-a*cY , Y  Y  , Y  Y  , Y  Y  ,     |
|        28  11 26   12 26      7   13 26      6   14 26   15 26   16 26      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , |
|      17 26   18 26   19 26   20 26   21 26   22 26   23 26   24 26   25 26  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -Y  +Y +-aY +Y Y  +-aY , Y  +Y Y  , Y Y  , Y Y  , Y Y  , Y Y  ,         |
|       27  8    7  0 27    0   30  1 27   2 27   3 27   4 27   5 27          |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  +Y Y  +aY , -Y +Y Y  +aY +aY , -aY  +Y Y  , dY  +Y Y  ,              |
|      13  6 27   6    8  7 27   7   0     27  8 27    27  9 27               |
|     ------------------------------------------------------------------------|
|                                                            2    2           |
|     -aY  +dY  +Y  Y  +a*cY , dY  +Y  Y  +dY  , Y  Y  +dY +d Y +d Y ,        |
|        29   13  10 27     1    29  11 27   10   12 27   9    7    0         |
|     ------------------------------------------------------------------------|
|                    2                                                        |
|     Y  Y  +-aY  +-a Y , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  ,     |
|      13 27    13     6   14 27   15 27   16 27   17 27   18 27   19 27      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  +aY  +cY , Y Y  , |
|      20 27   21 27   22 27   23 27   24 27   25 27   26 27   26   8   0 28  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , bY +Y Y  , bY +Y Y  , Y  +Y Y  , -Y  +-bY +Y Y  , Y Y  , Y Y  ,  |
|      1 28    6  2 28    7  3 28   31  4 28    28    6  5 28   6 28   7 28   |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , Y Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , dY  +Y  Y  +-b*cY ,       |
|      8 28   9 28   10 28   11 28   12 28   13 28    31  14 28      7        |
|     ------------------------------------------------------------------------|
|                                                             2               |
|     -dY  +Y  Y  , -bY  +Y  Y  , dY  +Y  Y  , -dY  +Y  Y  +-d Y ,            |
|        26  15 28     28  16 28    28  17 28     29  18 28     6             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -bY  +Y  Y  , cY  +Y  Y  , -dY  +Y  Y  +b*cY , cY  +Y  Y  , Y  Y  ,     |
|        31  19 28    26  20 28     31  21 28     7    28  22 28   23 28      |
|     ------------------------------------------------------------------------|
|                     2                                                       |
|     Y  Y  , Y  Y  +c Y , Y  Y  , Y  Y  , Y Y  , Y Y  , dY +Y Y  , dY +Y Y  ,|
|      24 28   25 28    6   26 28   27 28   0 29   1 29    6  2 29    7  3 29 |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  +cY +Y Y  , -Y  +-dY +Y Y  , Y Y  , Y Y  , Y Y  , Y Y  , Y  Y  ,     |
|      26   7  4 29    29    6  5 29   6 29   7 29   8 29   9 29   10 29      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , dY  +Y  Y  , dY  +Y  Y  +-dY , -dY  +Y  Y  ,    |
|      11 29   12 29   13 29    26  14 29    27  15 29    8     28  16 29     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     dY  +Y  Y  , dY  +Y  Y  +a*dY , -dY  +Y  Y  , -aY  +Y  Y  ,             |
|       29  17 29    30  18 29     1     31  19 29     26  20 29              |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -dY  +Y  Y  , cY  +Y  Y  , Y  Y  , Y  Y  , Y  Y  +-a*cY , Y  Y  ,       |
|        26  21 29    29  22 29   23 29   24 29   25 29      6   26 29        |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y Y  , Y Y  , Y Y  , Y Y  , Y  +-Y +aY +Y Y  +aY ,      |
|      27 29   28 29   0 30   1 30   2 30   3 30   27   8   7  4 30   0       |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -Y  +Y Y  , Y Y  , Y Y  , Y Y  , Y Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , |
|       30  5 30   6 30   7 30   8 30   9 30   10 30   11 30   12 30   13 30  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , -aY  +Y  Y  ,           |
|      14 30   15 30   16 30   17 30   18 30   19 30     27  20 30            |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -dY  +Y  Y  , aY  +Y  Y  +-dY  +-a*cY , -dY  +Y  Y  +-dY  ,             |
|        27  21 30    29  22 30    13      1     29  23 30    10              |
|     ------------------------------------------------------------------------|
|                   2     2                   2                               |
|     Y  Y  +-dY +-d Y +-d Y , Y  Y  +-aY  +-a Y , Y  Y  , Y  Y  , Y  Y  ,    |
|      24 30    9     7     0   25 30    13     6   26 30   27 30   28 30     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , -Y  +Y Y  , Y  +bY +Y Y  , Y Y  , Y Y  , Y Y  , Y Y  , Y Y  ,   |
|      29 30    31  0 31   28   6  1 31   2 31   3 31   4 31   5 31   6 31    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , cY  +Y Y  , dY  +Y Y  +-b*cY , -cY  +Y  Y  , -bY  +Y  Y  ,       |
|      7 31    26  8 31    31  9 31      7     28  10 31     28  11 31        |
|     ------------------------------------------------------------------------|
|              2            2                                                 |
|     Y  Y  +-b Y , Y  Y  +c Y , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  ,      |
|      12 31     7   13 31    6   14 31   15 31   16 31   17 31   18 31       |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  ,         |
|      19 31   20 31   21 31   22 31   23 31   24 31   25 31   26 31          |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +cY  , Y  Y  , Y  Y  , Y  Y  +cY  +c*dY , Y Y +-Y , Y Y , Y Y ,   |
|      27 31   26   28 31   29 31   30 31   29     6   1 0   1   2 0   2 1    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y , Y Y , Y Y +-Y , Y Y , Y Y +-Y , Y Y , Y Y , Y Y , Y Y +-Y , Y Y , |
|      3 0   3 1   3 2   3   4 0   4 1   0   4 2   4 3   5 0   5 1   1   5 2  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y , Y Y , Y Y , Y Y , Y Y , Y Y +-Y , Y Y , Y Y , Y Y , Y Y , Y Y ,   |
|      5 3   5 4   6 0   6 1   6 2   6 3   2   6 4   6 5   7 0   7 1   7 2    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y +-Y , Y Y , Y Y , Y Y , Y Y +-Y , Y Y , Y Y , Y Y , Y  +Y Y , Y Y , |
|      7 3   3   7 4   7 5   7 6   8 0   8   8 1   8 2   8 3   20  8 4   8 5  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y , Y Y , Y Y +-Y , Y Y , Y Y , Y Y , -Y  +Y Y , Y Y , Y Y , Y Y ,    |
|      8 6   8 7   9 0   9   9 1   9 2   9 3    21  9 4   9 5   9 6   9 7     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y +dY , Y  Y +-Y  , Y  Y , Y  Y , Y  Y , -Y  +Y  Y , Y  Y , Y  Y ,    |
|      9 8   8   10 0   10   10 1   10 2   10 3    22  10 4   10 5   10 6     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , dY  +Y  Y +a*cY , Y  Y +dY  , Y  Y +-Y  , Y  Y , Y  Y , Y  Y ,   |
|      10 7    13  10 8     1   10 9   10   11 0   11   11 1   11 2   11 3    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -Y  +Y  +Y  Y , Y  Y , Y  Y , Y  Y , Y  Y +dY  , Y  Y +dY  , Y  Y  ,    |
|       23  16  11 4   11 5   11 6   11 7   11 8   10   11 9   11   11 10     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y +-Y  , Y  Y , Y  Y , Y  Y , -Y  +Y  Y +-bY , Y  Y , Y  Y , Y  Y ,  |
|      12 0   12   12 1   12 2   12 3    24  12 4    3   12 5   12 6   12 7   |
|     ------------------------------------------------------------------------|
|                2                                                            |
|     Y  Y +dY +d Y , Y  Y +dY  , Y  Y  , Y  Y  , Y  Y +-Y  , Y  Y , Y  Y ,   |
|      12 8   9    0   12 9   12   12 10   12 11   13 0   13   13 1   13 2    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , Y  +Y  Y , Y  Y , Y  Y , Y  Y , Y  Y +-aY  , Y  Y +dY  , Y  Y  , |
|      13 3   25  13 4   13 5   13 6   13 7   13 8    13   13 9   13   13 10  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y , Y  Y , Y  Y +-Y  , Y  Y , Y  Y , Y  Y ,          |
|      13 11   13 12   14 0   14 1   14 2   14   14 3   14 4   14 5           |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -Y  +Y  Y , Y  Y , Y  Y , Y  Y , Y  Y  +-cY , Y  Y  +-bY , Y  Y  ,      |
|       26  14 6   14 7   14 8   14 9   14 10    9   14 11    9   14 12       |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +-cY , Y  Y , Y  Y , Y  Y +-Y  , Y  Y , Y  Y , Y  Y ,             |
|      14 13    8   15 0   15 1   15 2   15   15 3   15 4   15 5              |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -Y  +Y  Y +Y , Y  Y , Y  Y , Y  Y , Y  Y  +dY , Y  Y  +dY , Y  Y  ,     |
|       27  15 6  8   15 7   15 8   15 9   15 10   8   15 11   9   15 12      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +-aY , Y  Y  , Y  Y , Y  Y , Y  Y +-Y  , Y  Y , Y  Y , Y  Y ,     |
|      15 13    8   15 14   16 0   16 1   16 2   16   16 3   16 4   16 5      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  +Y  Y , Y  Y , Y  Y , Y  Y , Y  Y  +-bY  , Y  Y  +-bY  , Y  Y  ,     |
|      28  16 6   16 7   16 8   16 9   16 10    10   16 11    11   16 12      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +-cY  , Y  Y  , Y  Y  , Y  Y , Y  Y , Y  Y +-Y  , Y  Y , Y  Y ,   |
|      16 13    10   16 14   16 15   17 0   17 1   17 2   17   17 3   17 4    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , -Y  +Y  Y , Y  Y , Y  Y , Y  Y , Y  Y  +dY  , Y  Y  +dY  ,       |
|      17 5    29  17 6   17 7   17 8   17 9   17 10   10   17 11   11        |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  +dY  +a*cY , Y  Y  , Y  Y  , Y  Y  +dY  , Y  Y , Y  Y ,   |
|      17 12   17 13   13     1   17 14   17 15   17 16   16   18 0   18 1    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y +-Y  , Y  Y , Y  Y , Y  Y , -Y  +Y  Y +-aY , Y  Y , Y  Y , Y  Y ,  |
|      18 2   18   18 3   18 4   18 5    30  18 6    1   18 7   18 8   18 9   |
|     ------------------------------------------------------------------------|
|                            2                    2                           |
|     Y  Y  +-a*dY , Y  Y  +d Y , Y  Y  , Y  Y  +a Y , Y  Y  , Y  Y  ,        |
|      18 10      1   18 11    1   18 12   18 13    1   18 14   18 15         |
|     ------------------------------------------------------------------------|
|                  2                                                          |
|     Y  Y  +dY  +d Y , Y  Y  +dY  , Y  Y , Y  Y , Y  Y +-Y  , Y  Y , Y  Y ,  |
|      18 16   17    2   18 17   18   19 0   19 1   19 2   19   19 3   19 4   |
|     ------------------------------------------------------------------------|
|                                                                    2        |
|     Y  Y , Y  +Y  Y , Y  Y , Y  Y , Y  Y , Y  Y  +-b*cY , Y  Y  +-b Y ,     |
|      19 5   31  19 6   19 7   19 8   19 9   19 10      0   19 11     0      |
|     ------------------------------------------------------------------------|
|                      2                                                      |
|     Y  Y  , Y  Y  +-c Y , Y  Y  , Y  Y  , Y  Y  +-bY  , Y  Y  +dY  , Y  Y  ,|
|      19 12   19 13     0   19 14   19 15   19 16    19   19 17   19   19 18 |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , Y  Y +Y , Y  Y , Y  Y , Y  Y , Y  Y +-Y  , Y  Y , Y  Y , Y  Y ,  |
|      20 0   20 1  8   20 2   20 3   20 4   20 5   20   20 6   20 7   20 8   |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , Y  Y  +-cY , Y  Y  +-cY , Y  Y  , Y  Y  , Y  Y  , Y  Y  ,        |
|      20 9   20 10    8   20 11    9   20 12   20 13   20 14   20 15         |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +-cY  , Y  Y  +-aY  , Y  Y  +-aY  , Y  Y  , Y  Y , Y  Y +-Y ,     |
|      20 16    14   20 17    14   20 18    15   20 19   21 0   21 1   9      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , Y  Y , Y  Y , Y  Y +-Y  , Y  Y , Y  Y , Y  Y , Y  Y , Y  Y  +cY ,|
|      21 2   21 3   21 4   21 5   21   21 6   21 7   21 8   21 9   21 10   9 |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +bY , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  +-dY  +-b*cY ,        |
|      21 11   9   21 12   21 13   21 14   21 15   21 16    19      3         |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +-dY  , Y  Y  +-dY  , Y  Y  , Y  Y  , Y  Y , Y  Y +-Y  , Y  Y ,   |
|      21 17    14   21 18    15   21 19   21 20   22 0   22 1   10   22 2    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , Y  Y , Y  Y +-Y  , Y  Y , Y  Y , Y  Y , Y  Y , Y  Y  +cY  ,      |
|      22 3   22 4   22 5   22   22 6   22 7   22 8   22 9   22 10   10       |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +bY  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  +cY  , Y  Y  +cY  ,  |
|      22 11   10   22 12   22 13   22 14   22 15   22 16   16   22 17   17   |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +aY  , Y  Y  , Y  Y  , Y  Y  , Y  Y , Y  Y +-Y  , Y  Y +-Y  ,     |
|      22 18   17   22 19   22 20   22 21   23 0   23 1   11   23 2   16      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , Y  Y , Y  Y +-Y  +Y  , Y  +Y  Y , Y  Y , Y  Y , Y  Y , Y  Y  ,   |
|      23 3   23 4   23 5   23  16   28  23 6   23 7   23 8   23 9   23 10    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  +-cY  , Y  Y  , Y  Y  , Y  Y  , Y  Y  ,           |
|      23 11   23 12   23 13    10   23 14   23 15   23 16   23 17            |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +-dY  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y , Y  Y +-Y  ,        |
|      23 18    17   23 19   23 20   23 21   23 22   24 0   24 1   12         |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y +bY , Y  Y , Y  Y , Y  Y +-Y  +-bY , Y  Y +bY , Y  Y , Y  Y ,      |
|      24 2   3   24 3   24 4   24 5   24    3   24 6   7   24 7   24 8       |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , Y  Y  , Y  Y  , Y  Y  , Y  Y  +-cY +-c*dY , Y  Y  , Y  Y  ,      |
|      24 9   24 10   24 11   24 12   24 13    9      0   24 14   24 15       |
|     ------------------------------------------------------------------------|
|                              2                                              |
|     Y  Y  , Y  Y  , Y  Y  +-d Y , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  ,   |
|      24 16   24 17   24 18     3   24 19   24 20   24 21   24 22   24 23    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , Y  Y +Y  , Y  Y , Y  Y , Y  Y , Y  Y +-Y  , Y  Y , Y  Y , Y  Y , |
|      25 0   25 1  13   25 2   25 3   25 4   25 5   25   25 6   25 7   25 8  |
|     ------------------------------------------------------------------------|
|                                         2                                   |
|     Y  Y , Y  Y  +-cY  , Y  Y  +-cY  +-c Y , Y  Y  , Y  Y  , Y  Y  , Y  Y  ,|
|      25 9   25 10    13   25 11    10     1   25 12   25 13   25 14   25 15 |
|     ------------------------------------------------------------------------|
|              2                            2                                 |
|     Y  Y  +-c Y , Y  Y  +-a*cY , Y  Y  +-a Y , Y  Y  , Y  Y  , Y  Y  ,      |
|      25 16     2   25 17      2   25 18     2   25 19   25 20   25 21       |
|     ------------------------------------------------------------------------|
|                                 2     2                                     |
|     Y  Y  +cY  , Y  Y  +-cY  +-c Y +-c Y , Y  Y  , Y  Y , Y  Y , Y  Y ,     |
|      25 22   25   25 23    22     5     2   25 24   26 0   26 1   26 2      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y +-Y  , Y  Y , Y  Y , Y  Y , Y  Y +-Y  , Y  Y +cY , Y  Y +cY ,      |
|      26 3   14   26 4   26 5   26 6   26 7   26   26 8   8   26 9   9       |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  +bY , Y  Y  , Y  Y  +cY  , Y  Y  +aY  , Y  Y  ,   |
|      26 10   26 11   26 12   9   26 13   26 14   14   26 15   14   26 16    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , Y  Y  +cY  , Y  Y  +cY  , Y  Y  , Y  Y  ,       |
|      26 17   26 18   26 19   26 20   20   26 21   21   26 22   26 23        |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +bY  +-dY  +-b*cY , Y  Y  , Y  Y +-Y , Y  Y , Y  Y , Y  Y +-Y  ,  |
|      26 24   21    19      3   26 25   27 0   8   27 1   27 2   27 3   15   |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y +Y  , Y  Y , Y  Y , Y  Y +-Y  +Y , Y  Y , Y  Y , Y  Y  , Y  Y  ,   |
|      27 4  20   27 5   27 6   27 7   27  8   27 8   27 9   27 10   27 11    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +-dY , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  ,            |
|      27 12    9   27 13   27 14   27 15   27 16   27 17   27 18             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +-cY  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  +-dY  +-dY  ,       |
|      27 19    14   27 20   27 21   27 22   27 23   27 24    21    14        |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y , Y  Y , Y  Y , Y  Y +Y  , Y  Y , Y  Y , Y  Y ,    |
|      27 25   27 26   28 0   28 1   28 2   28 3  16   28 4   28 5   28 6     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y +-Y  , Y  Y +-cY  , Y  Y +-bY  , Y  Y  , Y  Y  , Y  Y  +-bY  ,     |
|      28 7   28   28 8    10   28 9    10   28 10   28 11   28 12    11      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  +-cY  , Y  Y  +-cY  , Y  Y  , Y  Y  , Y  Y  , Y  Y  ,     |
|      28 13   28 14    16   28 15    17   28 16   28 17   28 18   28 19      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +cY  , Y  Y  +-bY  , Y  Y  , Y  Y  , Y  Y  +-bY  , Y  Y  ,        |
|      28 20   22   28 21    22   28 22   28 23   28 24    23   28 25         |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +cY  , -cY  +Y  Y  +-cY  , Y  Y , Y  Y , Y  Y , Y  Y +-Y  , Y  Y ,|
|      28 26   28     29  28 27    10   29 0   29 1   29 2   29 3   17   29 4 |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , Y  Y , Y  Y +-Y  , Y  Y +-dY  +-a*cY , Y  Y +-dY  , Y  Y  ,      |
|      29 5   29 6   29 7   29   29 8    13      1   29 9    10   29 10       |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  +-dY  , Y  Y  , Y  Y  +cY  , Y  Y  +aY  , Y  Y  , Y  Y  , |
|      29 11   29 12    11   29 13   29 14   17   29 15   17   29 16   29 17  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  +-dY  +a*cY , Y  Y  +-dY  , Y  Y  , Y  Y  ,       |
|      29 18   29 19   29 20    25     5   29 21    22   29 22   29 23        |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +-dY  , Y  Y  , Y  Y  +cY  , Y  Y  +aY  +-dY  +-a*cY , Y  Y  ,    |
|      29 24    23   29 25   29 26   29   29 27   29    13      1   29 28     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y +aY , Y  Y , Y  Y , Y  Y +-Y  , Y  Y +aY , Y  Y , Y  Y ,           |
|      30 0   1   30 1   30 2   30 3   18   30 4   5   30 5   30 6            |
|     ------------------------------------------------------------------------|
|                                                             2               |
|     Y  Y +-Y  +-aY , Y  Y , Y  Y , Y  Y  , Y  Y  , Y  Y  +-d Y , Y  Y  ,    |
|      30 7   30    1   30 8   30 9   30 10   30 11   30 12     1   30 13     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  , Y  Y  +-cY  +-c*dY , Y  Y  ,    |
|      30 14   30 15   30 16   30 17   30 18   30 19    17      2   30 20     |
|     ------------------------------------------------------------------------|
|                                            2     2                          |
|     Y  Y  , Y  Y  , Y  Y  , Y  Y  +-dY  +-d Y +-d Y , Y  Y  , Y  Y  ,       |
|      30 21   30 22   30 23   30 24    17     5     2   30 25   30 26        |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , Y  Y  , Y  Y , Y  Y , Y  Y , Y  Y +Y  , Y  Y , Y  Y ,   |
|      30 27   30 28   30 29   31 0   31 1   31 2   31 3  19   31 4   31 5    |
|     ------------------------------------------------------------------------|
|                                2                                            |
|     Y  Y , Y  Y +-Y  , Y  Y +-c Y , Y  Y +-b*cY , Y  Y  , Y  Y  ,           |
|      31 6   31 7   31   31 8     0   31 9      0   31 10   31 11            |
|     ------------------------------------------------------------------------|
|              2                                         2                    |
|     Y  Y  +-b Y , Y  Y  , Y  Y  +-cY  , Y  Y  +-cY  +-c Y , Y  Y  , Y  Y  , |
|      31 12     0   31 13   31 14    19   31 15    14     3   31 16   31 17  |
|     ------------------------------------------------------------------------|
|                             2                                               |
|     Y  Y  , Y  Y  , Y  Y  +c Y , Y  Y  +-b*cY , Y  Y  , Y  Y  ,             |
|      31 18   31 19   31 20    4   31 21      4   31 22   31 23              |
|     ------------------------------------------------------------------------|
|                    2                                        2     2         |
|     Y  Y  +-bY  +-b Y , Y  Y  , Y  Y  +cY  , Y  Y  +-cY  +-c Y +-c Y ,      |
|      31 24    19     4   31 25   31 26   31   31 27    26     7     0       |
|     ------------------------------------------------------------------------|
|                               2        2    2        2    2    2        2   |
|     Y  Y  , Y  Y  , Y  Y  , Y  +-Y , Y  , Y  +-Y , Y  , Y  , Y  +-Y , Y  ,  |
|      31 28   31 29   31 30   0    0   1    2    2   3    4    5    5   6    |
|     ------------------------------------------------------------------------|
|       2        2         2         2     2     2     2     2     2          |
|     Y  +-Y , Y  +-aY , Y  +dY , Y   , Y   , Y   , Y   , Y   , Y   ,         |
|      7    7   8     8   9    9   10    11    12    13    14    15           |
|     ------------------------------------------------------------------------|
|        2           2          2     2     2     2     2          2     2    |
|     Y   +-bY  , Y   +dY  , Y   , Y   , Y   , Y   , Y   +cY  , Y   , Y   ,   |
|      16     16   17    17   18    19    20    21    22    22   23    24     |
|     ------------------------------------------------------------------------|
|        2     2          2     2     2     2     2                           |
|     Y   , Y   +cY  , Y   , Y   , Y   , Y   , Y   }                          |
|      25    26    26   27    28    29    30    31                            |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : gensIMin = minimizeRelations(gensI)                                     |
|                                                                             |
|                                                                             |
|o7 = {Y Y , Y Y Y +-Y , Y Y , Y Y , Y Y Y +-Y , Y Y , bY Y  Y +dY Y  +b*dY , |
|       1 3   4 1 4   4   3 4   1 6   6 3 6   6   4 6    4 29 3   4 23     4  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -bY  Y +dY Y  Y +c*dY , bY  Y +b*dY Y +dY Y Y  +b*dY Y ,                |
|        27 3   4 29 3     3    29 3     6 3   1 4 23     1 4                 |
|     ------------------------------------------------------------------------|
|                                                                             |
|     dY  Y +-a*dY +-aY Y  , cY  Y +-aY  +-dY  , aY Y  +dY Y  +c*dY , Y Y  ,  |
|       27 4      4    3 22    29 3    23    22    3 23   3 22     3   1 22   |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -Y  +Y Y Y  +-cY Y , Y Y  +cY , Y Y  , Y Y  , -Y  +Y Y Y  +Y Y Y  ,     |
|       22  6 3 22    1 4   4 22   4   6 22   1 23    23  6 3 23  1 4 23      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y  , cY Y  +-bY Y  +-b*cY , Y  Y Y  +dY  ,                            |
|      6 23    3 23    3 22      3   29 3 23   23                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  +bY  +b*cY Y +cY Y Y  +b*cY Y , bY  Y +c*dY +cY Y  ,              |
|      22 23   22     6 3   1 4 23     1 4    27 4     4   3 22               |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -Y  +Y Y Y  +Y Y Y  , Y Y  , Y Y  , -aY  +Y  Y Y  +-dY Y  +-a*dY +a*cY ,|
|       27  4 1 27  3 6 27   3 27   4 27     29  22 1 27    6 27      6     1 |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y  , Y  Y  , -bY  +dY Y  +-c*dY Y +bY Y Y  , bY  +dY  Y ,            |
|      22 27   23 27     27   4 29      4 1   3 6 27    29   23 6             |
|     ------------------------------------------------------------------------|
|             2                                                               |
|     -dY  +-d Y +bY Y  +c*dY , cY  Y +Y  Y  Y , Y Y  , Y Y  +dY Y ,          |
|        29     6   1 27     1    23 6  22 23 6   1 29   3 29   3 6           |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -Y  +-dY +Y Y Y  , Y Y  , cY  +Y  Y  , Y  Y  , Y  Y  , Y Y Y +-Y , Y Y ,|
|       29    6  1 4 29   6 29    29  22 29   23 29   27 29   1 4 1   1   3 1 |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y Y Y +-Y , Y Y , Y Y , Y Y , Y  Y Y +-Y  , aY  Y +-dY Y  +-a*dY +a*cY ,|
|      3 6 3   3   4 3   6 1   6 4   22 1 4   22    22 1    6 27      6     1 |
|     ------------------------------------------------------------------------|
|                                          2                                  |
|     aY  Y +dY  Y , cY  Y +bY Y  +-c*dY +c Y , Y  Y Y +-Y  , Y  Y , Y  Y ,   |
|       23 1   22 1    22 1   6 27      6    1   29 3 6   29   22 3   22 4    |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , Y  Y Y +-bY Y +-Y Y Y  +-bY Y , Y  Y , Y  Y ,                    |
|      22 6   23 6 3    6 3   1 4 23    1 4   23 3   23 4                     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y Y +-Y  +bY Y +Y Y Y  +bY Y , Y  Y  ,                               |
|      23 1 4   23   6 3  1 4 23   1 4   23 22                                |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y Y +-aY Y +-Y Y Y  +-aY Y , Y  Y , Y  Y ,                           |
|      27 4 1    4 1   3 6 27    3 6   27 1   27 6                            |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y Y +-Y  +aY Y +Y Y Y  +aY Y , Y  Y  , Y  Y  ,                       |
|      27 3 6   27   4 1  3 6 27   3 6   27 22   27 23                        |
|     ------------------------------------------------------------------------|
|                                                                             |
|     -aY  +-dY  +-c*dY Y +aY Y Y  +-c*dY Y , -cY  +aY  Y , Y  Y , Y  Y ,     |
|        23    22      6 3   1 4 23      1 4     29   23 6   29 1   29 4      |
|     ------------------------------------------------------------------------|
|                                                                             |
|     Y  Y , Y  Y  , Y  Y  , Y  Y  +aY  +dY Y  +a*dY +-a*cY ,                 |
|      29 6   29 22   29 23   29 27   29   6 27     6      1                  |
|     ------------------------------------------------------------------------|
|                                 2    2    2    2     2          2     2     |
|     aY  +a*dY +cY Y  +-a*cY , Y  , Y  , Y  , Y  , Y   +cY  , Y   , Y   ,    |
|       29     6   1 27      1   1    3    4    6    22    22   23    27      |
|     ------------------------------------------------------------------------|
|        2                                                                    |
|     Y   }                                                                   |
|      29                                                                     |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use minimizeRelations :
===============================

  * "minimizeRelations(List)"

For the programmer
==================

The object minimizeRelations, is a method function with options (Macaulay2Doc).

monomials(NCRingElement) -- Returns the monomials appearing in the NCRingElement
********************************************************************************

Synopsis
========

  * Function: monomials (Macaulay2Doc),
  * Usage:
        mons = support f
  * Inputs:
      * f, an instance of the type NCRingElement,
  * Optional inputs (Macaulay2Doc),:
      * Variables (Macaulay2Doc),
        => ..., default value null, null
  * Outputs:
      * mons, an instance of the type NCMatrix,

Description
===========

Returns the monomials appearing in NCRingElement as an NCMatrix.

+-----------------------+
|i1 : A = QQ{x,y,z,w}   |
|                       |
|o1 = A                 |
|                       |
|o1 : NCPolynomialRing  |
+-----------------------+
|i2 : f = x^2+y^2+z^3   |
|                       |
|      3  2  2          |
|o2 = z +y +x           |
|                       |
|o2 : A                 |
+-----------------------+
|i3 : mons = monomials f|
|                       |
|o3 = | z^3 y^2 x^2 |   |
|                       |
|o3 : NCMatrix          |
+-----------------------+

Ways to use this method:
========================

  * monomials(NCRingElement) -- Returns
    the monomials appearing in the NCRingElement

NCGroebnerBasis -- Type of a Groebner basis for an NCIdeal in an NCRing.
************************************************************************

Description
===========

This is the type for a Groebner basis of an ideal in the tensor algebra. One
can provide one using the ncGroebnerBasis(...,InstallGB=>...),
option of ncGroebnerBasis, if you
happen to know it.

One also can have Macaulay2 call Bergman and have it computed via the function
twoSidedNCGroebnerBasisBergman.  This
command is automatically called when defining a quotient ring, if the defining
ideal does not yet have a cached Groebner basis.

You can also install one from a Bergman output file if you have that handy; see
gbFromOutputFile.

Below are a couple of examples.

+----------------------------------------------+
|i1 : R = QQ[a,b,c,d]/ideal{a*b+c*d}           |
|                                              |
|o1 = R                                        |
|                                              |
|o1 : QuotientRing                             |
+----------------------------------------------+
|i2 : A = R {x,y,z}                            |
|                                              |
|o2 = A                                        |
|                                              |
|o2 : NCPolynomialRing                         |
+----------------------------------------------+
|i3 : I = ncIdeal {a*x*y,b*z^2}                |
|                                              |
|                             2                |
|o3 = Two-sided ideal {axy, bz }               |
|                                              |
|o3 : NCIdeal                                  |
+----------------------------------------------+
|i4 : Igb = ncGroebnerBasis(I, InstallGB=>true)|
|                                              |
|       2                2                     |
|o4 = bz ; Lead Term = (z , b)                 |
|     axy; Lead Term = (xy, a)                 |
|                                              |
|o4 : NCGroebnerBasis                          |
+----------------------------------------------+

Note that after the InstallGB flag is set, no checking is done to ensure that
the input is in fact a Groebner basis.

+-----------------------------------------------------------------------------+
|i5 : c*z^2 % Igb                                                             |
|                                                                             |
|       2                                                                     |
|o5 = cz                                                                      |
|                                                                             |
|o5 : A                                                                       |
+-----------------------------------------------------------------------------+
|i6 : b*z^2 % Igb                                                             |
|                                                                             |
|o6 = 0                                                                       |
|                                                                             |
|o6 : A                                                                       |
+-----------------------------------------------------------------------------+
|i7 : A = QQ{x,y,z}                                                           |
|                                                                             |
|o7 = A                                                                       |
|                                                                             |
|o7 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i8 : p = y*z + z*y - x^2                                                     |
|                                                                             |
|            2                                                                |
|o8 = zy+yz-x                                                                 |
|                                                                             |
|o8 : A                                                                       |
+-----------------------------------------------------------------------------+
|i9 : q = x*z + z*x - y^2                                                     |
|                                                                             |
|         2                                                                   |
|o9 = zx-y +xz                                                                |
|                                                                             |
|o9 : A                                                                       |
+-----------------------------------------------------------------------------+
|i10 : r = z^2 - x*y - y*x                                                    |
|                                                                             |
|       2                                                                     |
|o10 = z -yx-xy                                                               |
|                                                                             |
|o10 : A                                                                      |
+-----------------------------------------------------------------------------+
|i11 : I = ncIdeal {p,q,r}                                                    |
|                                                                             |
|                              2      2      2                                |
|o11 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}                         |
|                                                                             |
|o11 : NCIdeal                                                                |
+-----------------------------------------------------------------------------+
|i12 : Igb = ncGroebnerBasis I                                                |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|       2    2                2                                               |
|o12 = y x-xy ; Lead Term = (y x, 1)                                          |
|        2  2                  2                                              |
|      yx -x y; Lead Term = (yx , 1)                                          |
|          2                                                                  |
|      zx-y +xz; Lead Term = (zx, 1)                                          |
|             2                                                               |
|      zy+yz-x ; Lead Term = (zy, 1)                                          |
|       2                      2                                              |
|      z -yx-xy; Lead Term = (z , 1)                                          |
|                                                                             |
|o12 : NCGroebnerBasis                                                        |
+-----------------------------------------------------------------------------+
|i13 : normalFormBergman(z^17,Igb)                                            |
|--Calling Bergman for NF calculation for 1 elements.                         |
|Complete!                                                                    |
|Writing bergman input file.                                                  |
|Writing bergman init file.                                                   |
|                                                                             |
|                                            2             2    3           3 |
|o13 = yxyxyxyxyxyxyxyxz+xyxyxyxyxyxyxyxyz+8x yxyxyxyxyxyxy z+8x yxyxyxyxyxy z|
|                                                                             |
|o13 : A                                                                      |
|-----------------------------------------------------------------------------|
|    4         4     5       5     6     6     7   7     8 8                  |
|+28x yxyxyxyxy z+28x yxyxyxy z+56x yxyxy z+56x yxy z+70x y z                 |
+-----------------------------------------------------------------------------+

stuff

Methods that use an object of class NCGroebnerBasis :
=====================================================

  * generators(NCGroebnerBasis) -- The
    list of algebra generators of an NCGroebnerBasis
  * "isCentral(NCRingElement,NCGroebnerBasis)" -- see isCentral,
    -- Determines if an element is central
  * NCMatrix % NCGroebnerBasis -- Reduces
    the entries of an NCMatrix with respect to an NCGroebnerBasis
  * NCRingElement % NCGroebnerBasis, --
    Reduces a NCRingElement by a NCGroebnerBasis
  * "QQ % NCGroebnerBasis" -- see NCRingElement % NCGroebnerBasis,
    -- Reduces a NCRingElement by a
    NCGroebnerBasis
  * "ZZ % NCGroebnerBasis" -- see NCRingElement % NCGroebnerBasis,
    -- Reduces a NCRingElement by a
    NCGroebnerBasis
  * "NCRingMap NCGroebnerBasis" -- see NCRingMap NCIdeal,
    -- Apply a ring map to the generators of an ideal
  * "normalFormBergman(List,NCGroebnerBasis)" -- see normalFormBergman,
    -- Calls Bergman for a normal form calculation
  * "normalFormBergman(NCRingElement,NCGroebnerBasis)" -- see
    normalFormBergman, -- Calls Bergman for a normal form
    calculation
  * "ring(NCGroebnerBasis)" -- see ring(NCIdeal), --
    Returns the ring of an NCIdeal or NCGroebnerBasis

For the programmer
==================

The object NCGroebnerBasis, is a type (Macaulay2Doc),
with ancestor classes HashTable (Macaulay2Doc),
< Thing (Macaulay2Doc).

ncGroebnerBasis -- Compute a noncommutative Groebner basis.
***********************************************************

Synopsis
========

  * Usage:
        Igb = ncGroebnerBasis I
  * Inputs:
      * I, an instance of the type NCIdeal, or a List (Macaulay2Doc),
        of NCRingElements
  * Optional inputs (Macaulay2Doc),:
      * DegreeLimit (missing documentation) => an integer (Macaulay2Doc),
        default value 100, the maximum degree for the
        calculation of a Groebner basis
      * InstallGB => a Boolean value (Macaulay2Doc), default
        value false, set this to true to install a NCGroebnerBasis without
        verifying that it is one
  * Outputs:
      * Igb, an instance of the type NCGroebnerBasis,

Description
===========

+----------------------------------------------+
|i1 : R = QQ[a,b,c,d]/ideal{a*b+c*d}           |
|                                              |
|o1 = R                                        |
|                                              |
|o1 : QuotientRing                             |
+----------------------------------------------+
|i2 : A = R {x,y,z}                            |
|                                              |
|o2 = A                                        |
|                                              |
|o2 : NCPolynomialRing                         |
+----------------------------------------------+
|i3 : I = ncIdeal {a*x*y,b*z^2}                |
|                                              |
|                             2                |
|o3 = Two-sided ideal {axy, bz }               |
|                                              |
|o3 : NCIdeal                                  |
+----------------------------------------------+
|i4 : Igb = ncGroebnerBasis(I, InstallGB=>true)|
|                                              |
|       2                2                     |
|o4 = bz ; Lead Term = (z , b)                 |
|     axy; Lead Term = (xy, a)                 |
|                                              |
|o4 : NCGroebnerBasis                          |
+----------------------------------------------+
|i5 : c*z^2 % Igb                              |
|                                              |
|       2                                      |
|o5 = cz                                       |
|                                              |
|o5 : A                                        |
+----------------------------------------------+
|i6 : b*z^2 % Igb                              |
|                                              |
|o6 = 0                                        |
|                                              |
|o6 : A                                        |
+----------------------------------------------+

Note that after the InstallGB flag is set, no checking is done to ensure that
the input is in fact a Groebner basis.

+----------------------------------------------------+
|i7 : A = QQ{x,y,z}                                  |
|                                                    |
|o7 = A                                              |
|                                                    |
|o7 : NCPolynomialRing                               |
+----------------------------------------------------+
|i8 : p = y*z + z*y - x^2                            |
|                                                    |
|            2                                       |
|o8 = zy+yz-x                                        |
|                                                    |
|o8 : A                                              |
+----------------------------------------------------+
|i9 : q = x*z + z*x - y^2                            |
|                                                    |
|         2                                          |
|o9 = zx-y +xz                                       |
|                                                    |
|o9 : A                                              |
+----------------------------------------------------+
|i10 : r = z^2 - x*y - y*x                           |
|                                                    |
|       2                                            |
|o10 = z -yx-xy                                      |
|                                                    |
|o10 : A                                             |
+----------------------------------------------------+
|i11 : I = ncIdeal {p,q,r}                           |
|                                                    |
|                              2      2      2       |
|o11 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                                    |
|o11 : NCIdeal                                       |
+----------------------------------------------------+
|i12 : Igb = ncGroebnerBasis I                       |
|--Calling Bergman for NCGB calculation.             |
|Complete!                                           |
|                                                    |
|       2    2                2                      |
|o12 = y x-xy ; Lead Term = (y x, 1)                 |
|        2  2                  2                     |
|      yx -x y; Lead Term = (yx , 1)                 |
|          2                                         |
|      zx-y +xz; Lead Term = (zx, 1)                 |
|             2                                      |
|      zy+yz-x ; Lead Term = (zy, 1)                 |
|       2                      2                     |
|      z -yx-xy; Lead Term = (z , 1)                 |
|                                                    |
|o12 : NCGroebnerBasis                               |
+----------------------------------------------------+

If the InstallGB flag is not set, then a call to Bergman is made, if the base
ring is QQ (Macaulay2Doc), or a finite field of characteristic p.
Otherwise, an error is raised.

Now we can do things with an ncgb, like compute normal forms (using the Bergman
interface).

+-----------------------------------------------------------------------------+
|i13 : normalFormBergman(z^17,Igb)                                            |
|--Calling Bergman for NF calculation for 1 elements.                         |
|Complete!                                                                    |
|Writing bergman input file.                                                  |
|Writing bergman init file.                                                   |
|                                                                             |
|                                            2             2    3           3 |
|o13 = yxyxyxyxyxyxyxyxz+xyxyxyxyxyxyxyxyz+8x yxyxyxyxyxyxy z+8x yxyxyxyxyxy z|
|                                                                             |
|o13 : A                                                                      |
|-----------------------------------------------------------------------------|
|    4         4     5       5     6     6     7   7     8 8                  |
|+28x yxyxyxyxy z+28x yxyxyxy z+56x yxyxy z+56x yxy z+70x y z                 |
+-----------------------------------------------------------------------------+

Or using the built in reduction code:

+-----------------------------------------------------------------------------+
|i14 : z^17 % Igb                                                             |
|                                                                             |
|                                            2             2    3           3 |
|o14 = yxyxyxyxyxyxyxyxz+xyxyxyxyxyxyxyxyz+8x yxyxyxyxyxyxy z+8x yxyxyxyxyxy z|
|                                                                             |
|o14 : A                                                                      |
|-----------------------------------------------------------------------------|
|    4         4     5       5     6     6     7   7     8 8                  |
|+28x yxyxyxyxy z+28x yxyxyxy z+56x yxyxy z+56x yxy z+70x y z                 |
+-----------------------------------------------------------------------------+

Calls to Bergman are usually faster, except for when the polynomial is small.
See the documentation for NCRingElement % NCGroebnerBasis,
for details on controlling when Bergman is called.

Ways to use ncGroebnerBasis :
=============================

  * "ncGroebnerBasis(List)"
  * "ncGroebnerBasis(NCIdeal)"

For the programmer
==================

The object ncGroebnerBasis, is a method function with options (Macaulay2Doc).

NCIdeal -- Type of a two-sided ideal in a noncommutative ring
*************************************************************

Description
===========

This defines a right ideal in a noncommutative ring.

Functions and methods returning an object of class NCIdeal :
============================================================

  * ideal(NCPolynomialRing) -- The defining
    ideal of an NCPolynomialRing
  * ideal(NCQuotientRing) -- Defining ideal
    of an NCQuotientRing in its ambient ring

Methods that use an object of class NCIdeal :
=============================================

  * basis(ZZ,NCIdeal) -- Returns a basis of an
    NCIdeal in a particular degree.
  * generators(NCIdeal) -- Returns the
    generators of an NCIdeal
  * "homogDual(NCIdeal)" -- see homogDual, -- Computes the
    dual of a pure homogeneous ideal
  * isHomogeneous(NCIdeal) -- Determines
    whether the input defines a homogeneous object
  * "ncGroebnerBasis(NCIdeal)" -- see ncGroebnerBasis,
    -- Compute a noncommutative Groebner basis.
  * NCIdeal + NCIdeal -- Sum of NCIdeals
  * NCPolynomialRing / NCIdeal -- Construct
    a NCQuotientRing
  * NCRingMap NCIdeal -- Apply a ring map to the
    generators of an ideal
  * "quadraticClosure(NCIdeal)" -- see quadraticClosure,
    -- Creates the subideal generated by quadratic elements
    of a given ideal
  * ring(NCIdeal) -- Returns the ring of an NCIdeal
    or NCGroebnerBasis
  * "twoSidedNCGroebnerBasisBergman(NCIdeal)" -- see
    twoSidedNCGroebnerBasisBergman, -- Calls
    Bergman to compute a two sided noncommutative Groebner Basis.

For the programmer
==================

The object NCIdeal, is a type (Macaulay2Doc), with
ancestor classes HashTable (Macaulay2Doc), < Thing (Macaulay2Doc).

ncIdeal -- Define a two-sided ideal in a noncommutative ring
************************************************************

Synopsis
========

  * Usage:
        I = ncIdeal fs
  * Inputs:
      * fs, an instance of the type NCRingElement, or a
        List (Macaulay2Doc), of NCRingElements
  * Outputs:
      * I, an instance of the type NCIdeal,

Description
===========

This defines a two-sided ideal in a noncommutative ring.

+---------------------------------------------------+
|i1 : A = QQ{x,y,z}                                 |
|                                                   |
|o1 = A                                             |
|                                                   |
|o1 : NCPolynomialRing                              |
+---------------------------------------------------+
|i2 : p = y*z + z*y - x^2                           |
|                                                   |
|            2                                      |
|o2 = zy+yz-x                                       |
|                                                   |
|o2 : A                                             |
+---------------------------------------------------+
|i3 : q = x*z + z*x - y^2                           |
|                                                   |
|         2                                         |
|o3 = zx-y +xz                                      |
|                                                   |
|o3 : A                                             |
+---------------------------------------------------+
|i4 : r = z^2 - x*y - y*x                           |
|                                                   |
|      2                                            |
|o4 = z -yx-xy                                      |
|                                                   |
|o4 : A                                             |
+---------------------------------------------------+
|i5 : I = ncIdeal{p,q,r}                            |
|                                                   |
|                             2      2      2       |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                                   |
|o5 : NCIdeal                                       |
+---------------------------------------------------+

Ways to use ncIdeal :
=====================

  * "ncIdeal(List)"
  * "ncIdeal(NCRingElement)"

For the programmer
==================

The object ncIdeal, is a method function (Macaulay2Doc).

NCIdeal + NCIdeal -- Sum of NCIdeals
************************************

Synopsis
========

  * Operator: + (Macaulay2Doc),
  * Usage:
        K = I + J
  * Inputs:
      * I, an instance of the type NCIdeal,
      * J, an instance of the type NCIdeal,
  * Outputs:
      * K, an instance of the type NCIdeal,

Description
===========

This command sums two NCIdeals.

+---------------------------------------------------+
|i1 : A = QQ{x,y,z}                                 |
|                                                   |
|o1 = A                                             |
|                                                   |
|o1 : NCPolynomialRing                              |
+---------------------------------------------------+
|i2 : p = y*z + z*y - x^2                           |
|                                                   |
|            2                                      |
|o2 = zy+yz-x                                       |
|                                                   |
|o2 : A                                             |
+---------------------------------------------------+
|i3 : q = x*z + z*x - y^2                           |
|                                                   |
|         2                                         |
|o3 = zx-y +xz                                      |
|                                                   |
|o3 : A                                             |
+---------------------------------------------------+
|i4 : r = z^2 - x*y - y*x                           |
|                                                   |
|      2                                            |
|o4 = z -yx-xy                                      |
|                                                   |
|o4 : A                                             |
+---------------------------------------------------+
|i5 : I = ncIdeal{p,q}                              |
|                                                   |
|                             2      2              |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz}          |
|                                                   |
|o5 : NCIdeal                                       |
+---------------------------------------------------+
|i6 : J = ncIdeal r                                 |
|                                                   |
|                       2                           |
|o6 = Two-sided ideal {z -yx-xy}                    |
|                                                   |
|o6 : NCIdeal                                       |
+---------------------------------------------------+
|i7 : I + J                                         |
|                                                   |
|                             2      2      2       |
|o7 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                                   |
|o7 : NCIdeal                                       |
+---------------------------------------------------+

Ways to use this method:
========================

  * NCIdeal + NCIdeal -- Sum of NCIdeals

NCLeftIdeal -- Type of a left ideal in a noncommutative ring
************************************************************

Description
===========

This defines a left ideal in a noncommutative ring.  Not much can be done with
these objects at this point (as one can tell by the dearth of operations that
take an NCLeftIdeal as input), , but eventually it will be a 'fully featured'
object.

Methods that use an object of class NCLeftIdeal :
=================================================

  * basis(ZZ,NCLeftIdeal) -- Returns a
    basis of an NCLeftIdeal in a particular degree.
  * generators(NCLeftIdeal) -- Returns the
    generators of an NCLeftIdeal
  * "isHomogeneous(NCLeftIdeal)" -- see isHomogeneous(NCIdeal),
    -- Determines whether the input defines a
    homogeneous object
  * NCLeftIdeal + NCLeftIdeal -- Sum of
    NCLeftIdeals
  * ring(NCLeftIdeal) -- Returns the ring of an
    NCLeftIdeal

For the programmer
==================

The object NCLeftIdeal, is a type (Macaulay2Doc),
with ancestor classes HashTable (Macaulay2Doc),
< Thing (Macaulay2Doc).

ncLeftIdeal -- Define a left ideal in a noncommutative ring
***********************************************************

Synopsis
========

  * Usage:
        I = ncLeftIdeal fs
  * Inputs:
      * fs, an instance of the type NCRingElement, or a
        List (Macaulay2Doc), of NCRingElements
  * Outputs:
      * I, an instance of the type NCLeftIdeal,

Description
===========

This defines a left ideal in a noncommutative ring.  Not much can be done with
these objects at this point (as one can tell by the dearth of operations that
take an NCLeftIdeal as input), but eventually it will be a 'fully featured'
object.

+----------------------------------------------+
|i1 : A = QQ{x,y,z}                            |
|                                              |
|o1 = A                                        |
|                                              |
|o1 : NCPolynomialRing                         |
+----------------------------------------------+
|i2 : p = y*z + z*y - x^2                      |
|                                              |
|            2                                 |
|o2 = zy+yz-x                                  |
|                                              |
|o2 : A                                        |
+----------------------------------------------+
|i3 : q = x*z + z*x - y^2                      |
|                                              |
|         2                                    |
|o3 = zx-y +xz                                 |
|                                              |
|o3 : A                                        |
+----------------------------------------------+
|i4 : r = z^2 - x*y - y*x                      |
|                                              |
|      2                                       |
|o4 = z -yx-xy                                 |
|                                              |
|o4 : A                                        |
+----------------------------------------------+
|i5 : I = ncLeftIdeal{p,q,r}                   |
|                                              |
|                        2      2      2       |
|o5 = Left ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                              |
|o5 : NCLeftIdeal                              |
+----------------------------------------------+

Ways to use ncLeftIdeal :
=========================

  * "ncLeftIdeal(List)"
  * "ncLeftIdeal(NCRingElement)"

For the programmer
==================

The object ncLeftIdeal, is a method function (Macaulay2Doc).

NCLeftIdeal + NCLeftIdeal -- Sum of NCLeftIdeals
************************************************

Synopsis
========

  * Operator: + (Macaulay2Doc),
  * Usage:
        K = I + J
  * Inputs:
      * I, an instance of the type NCLeftIdeal,
      * J, an instance of the type NCLeftIdeal,
  * Outputs:
      * K, an instance of the type NCLeftIdeal,

Description
===========

This command sums two NCLeftIdeals.

+----------------------------------------------+
|i1 : A = QQ{x,y,z}                            |
|                                              |
|o1 = A                                        |
|                                              |
|o1 : NCPolynomialRing                         |
+----------------------------------------------+
|i2 : p = y*z + z*y - x^2                      |
|                                              |
|            2                                 |
|o2 = zy+yz-x                                  |
|                                              |
|o2 : A                                        |
+----------------------------------------------+
|i3 : q = x*z + z*x - y^2                      |
|                                              |
|         2                                    |
|o3 = zx-y +xz                                 |
|                                              |
|o3 : A                                        |
+----------------------------------------------+
|i4 : r = z^2 - x*y - y*x                      |
|                                              |
|      2                                       |
|o4 = z -yx-xy                                 |
|                                              |
|o4 : A                                        |
+----------------------------------------------+
|i5 : I = ncLeftIdeal{p,q}                     |
|                                              |
|                        2      2              |
|o5 = Left ideal {zy+yz-x , zx-y +xz}          |
|                                              |
|o5 : NCLeftIdeal                              |
+----------------------------------------------+
|i6 : J = ncLeftIdeal r                        |
|                                              |
|                  2                           |
|o6 = Left ideal {z -yx-xy}                    |
|                                              |
|o6 : NCLeftIdeal                              |
+----------------------------------------------+
|i7 : I + J                                    |
|                                              |
|                        2      2      2       |
|o7 = Left ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                              |
|o7 : NCLeftIdeal                              |
+----------------------------------------------+

Ways to use this method:
========================

  * NCLeftIdeal + NCLeftIdeal -- Sum of
    NCLeftIdeals

ncMap -- Make a map to or from an NCRing
****************************************

Synopsis
========

  * Usage:
        f = ncMap(B,A,m)
  * Inputs:
      * A, an instance of the type NCRing, or a Ring (Macaulay2Doc),
      * B, an instance of the type NCRing, or a Ring (Macaulay2Doc),
      * m, a list (Macaulay2Doc), the images of the generators of
        A.
  * Optional inputs (Macaulay2Doc),:
      * Derivation => a Boolean value (Macaulay2Doc), default
        value false
  * Outputs:
      * f, an instance of the type NCRingMap,

Description
===========

NCRingMaps are linear and multiplicative by definition, but need not be
well-defined or homogeneous. The user has the option to define an NCRingMap to
be a derivation. Such a map must have the same source and target.

+----------------------------------------------------+
|i1 : A = skewPolynomialRing(QQ,(-1)_QQ,{w,x,y,z})   |
|--Calling Bergman for NCGB calculation.             |
|Complete!                                           |
|                                                    |
|o1 = A                                              |
|                                                    |
|o1 : NCQuotientRing                                 |
+----------------------------------------------------+
|i2 : B = QQ{a,b,c}                                  |
|                                                    |
|o2 = B                                              |
|                                                    |
|o2 : NCPolynomialRing                               |
+----------------------------------------------------+
|i3 : f = ncMap(B,A,{a^3,b^2,a+b,a-b})               |
|                                                    |
|o3 = NCRingMap B <--- A                             |
|                                                    |
|o3 : NCRingMap                                      |
+----------------------------------------------------+
|i4 : f(w*x+2*y)                                     |
|                                                    |
|         3 2                                        |
|o4 = 2b+a b +2a                                     |
|                                                    |
|o4 : B                                              |
+----------------------------------------------------+
|i5 : g = ncMap(B,B,{a*b,b^2,c*a*c},Derivation=>true)|
|                                                    |
|o5 = NCRingMap B <--- B                             |
|                                                    |
|o5 : NCRingMap                                      |
+----------------------------------------------------+
|i6 : g(a*b)==g(a)*b+a*g(b)                          |
|                                                    |
|o6 = true                                           |
+----------------------------------------------------+
|i7 : g(promote(1,B))                                |
|                                                    |
|o7 = 0                                              |
|                                                    |
|o7 : B                                              |
+----------------------------------------------------+
|i8 : g(c*a+2*b)                                     |
|                                                    |
|                2                                   |
|o8 = caca+cab+2b                                    |
|                                                    |
|o8 : B                                              |
+----------------------------------------------------+

See also
========

  * NCRingMap -- Type of a map to or from a noncommutative
    ring.

Ways to use ncMap :
===================

  * "ncMap(NCRing,NCRing,List)"
  * "ncMap(NCRing,Ring,List)"
  * "ncMap(Ring,NCRing,List)"

For the programmer
==================

The object ncMap, is a method function with options (Macaulay2Doc).

NCMatrix -- Type of a matrix over a noncommutative ring
*******************************************************

Description
===========

This is the type of a matrix over a noncommutative ring.  These represent
homomorphisms between two free modules in chosen bases (whether you think of it
as a map of left or right modules is up you).  Modules themselves are not
implemented yet in the NCAlgebra, package, but are slated for a
later release.

Common ways to make (and use) a matrix include

  * ncMatrix(List) -- Create an NCMatrix
  * basis(ZZ,NCRing) -- Returns a basis of an
    NCRing in a particular degree.
  * rightKernel(NCMatrix,ZZ) -- Method for computing
    kernels of matrices over noncommutative rings in a given degree without
    using Bergman
  * rightKernelBergman(NCMatrix) -- Methods for
    computing kernels of matrices over noncommutative rings using Bergman

Common ways to get information about matrices

  * ring(NCMatrix) -- Gives the ring of the NCMatrix
  * entries(NCMatrix) -- Returns the entries of
    the NCMatrix

Common operations on matrices:

  * NCMatrix + NCMatrix -- Add NCMatrices
  * NCMatrix - NCMatrix -- Subtract NCMatrices
  * NCMatrix % NCGroebnerBasis -- Reduces
    the entries of an NCMatrix with respect to an NCGroebnerBasis
  * NCMatrix * NCMatrix -- Product of NCMatrices
  * NCMatrix * NCRingElement -- Product of
    NCMatrices
  * NCMatrix * RingElement -- Product of
    NCMatrices
  * NCMatrix // NCMatrix -- Factor one map through
    another
  * NCMatrix _ List -- Select some columns of an
    NCMatrix
  * NCMatrix == NCMatrix -- Test equality of
    matrices
  * NCMatrix | NCMatrix -- Join NCMatrices
    horizontally
  * NCMatrix || NCMatrix -- Join NCMatrices
    vertically
  * NCMatrix ^ List -- Select some rows of an NCMatrix
  * NCMatrix ^ ZZ -- Exponentiate an NCMatrix

This is the type of a matrix with entries in an NCRing.  Many of the basic
operations one can perform on a Matrix (Macaulay2Doc), are also
allowed with an NCMatrix, and the behavior of the functions
should be similar to the corresponding 'usual' command. Some examples of
creating and using NCMatrices are given below.

+-----------------------------------------------------------------------------+
|i1 : A = QQ{a,b,c,d}                                                         |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : M = ncMatrix {{a,b,c,d}}                                                |
|                                                                             |
|o2 = | a b c d |                                                             |
|                                                                             |
|o2 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i3 : N = ncMatrix {{M,2*M,3*M},{4*M,5*M,6*M}}                                |
|                                                                             |
|o3 = | a   b   c   d   2*a 2*b 2*c 2*d 3*a 3*b 3*c 3*d |                     |
|     | 4*a 4*b 4*c 4*d 5*a 5*b 5*c 5*d 6*a 6*b 6*c 6*d |                     |
|                                                                             |
|o3 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i4 : B = QQ{x,y,z}                                                           |
|                                                                             |
|o4 = B                                                                       |
|                                                                             |
|o4 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i5 : f = y*z + z*y - x^2                                                     |
|                                                                             |
|            2                                                                |
|o5 = zy+yz-x                                                                 |
|                                                                             |
|o5 : B                                                                       |
+-----------------------------------------------------------------------------+
|i6 : g = x*z + z*x - y^2                                                     |
|                                                                             |
|         2                                                                   |
|o6 = zx-y +xz                                                                |
|                                                                             |
|o6 : B                                                                       |
+-----------------------------------------------------------------------------+
|i7 : h = z^2 - x*y - y*x                                                     |
|                                                                             |
|      2                                                                      |
|o7 = z -yx-xy                                                                |
|                                                                             |
|o7 : B                                                                       |
+-----------------------------------------------------------------------------+
|i8 : I = ncIdeal {f,g,h}                                                     |
|                                                                             |
|                             2      2      2                                 |
|o8 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}                          |
|                                                                             |
|o8 : NCIdeal                                                                 |
+-----------------------------------------------------------------------------+
|i9 : Igb = ncGroebnerBasis I                                                 |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|      2    2                2                                                |
|o9 = y x-xy ; Lead Term = (y x, 1)                                           |
|       2  2                  2                                               |
|     yx -x y; Lead Term = (yx , 1)                                           |
|         2                                                                   |
|     zx-y +xz; Lead Term = (zx, 1)                                           |
|            2                                                                |
|     zy+yz-x ; Lead Term = (zy, 1)                                           |
|      2                      2                                               |
|     z -yx-xy; Lead Term = (z , 1)                                           |
|                                                                             |
|o9 : NCGroebnerBasis                                                         |
+-----------------------------------------------------------------------------+
|i10 : M = ncMatrix {{x, y, z}}                                               |
|                                                                             |
|o10 = | x y z |                                                              |
|                                                                             |
|o10 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+
|i11 : sigma = ncMap(B,B,{y,z,x})                                             |
|                                                                             |
|o11 = NCRingMap B <--- B                                                     |
|                                                                             |
|o11 : NCRingMap                                                              |
+-----------------------------------------------------------------------------+
|i12 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}                          |
|                                                                             |
|o12 = | x y z |                                                              |
|      | y z x |                                                              |
|      | z x y |                                                              |
|                                                                             |
|o12 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+
|i13 : Nred = N^3 % Igb                                                       |
|                                                                             |
|o13 = | -y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y             |
|      | y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3              |
|      | 2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                                  |
|                                                                             |
|o13 : NCMatrix                                                               |
|-----------------------------------------------------------------------------|
|y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3                      |
|2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                                          |
|-y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y                     |
|-----------------------------------------------------------------------------|
|2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                      |                   |
|-y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y |                   |
|y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3  |                   |
+-----------------------------------------------------------------------------+
|i14 : C = B/I                                                                |
|                                                                             |
|o14 = C                                                                      |
|                                                                             |
|o14 : NCQuotientRing                                                         |
+-----------------------------------------------------------------------------+
|i15 : phi = ncMap(C,B,gens C)                                                |
|                                                                             |
|o15 = NCRingMap C <--- B                                                     |
|                                                                             |
|o15 : NCRingMap                                                              |
+-----------------------------------------------------------------------------+
|i16 : NC = phi N                                                             |
|                                                                             |
|o16 = | x y z |                                                              |
|      | y z x |                                                              |
|      | z x y |                                                              |
|                                                                             |
|o16 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+
|i17 : N3C = NC^3                                                             |
|                                                                             |
|o17 = | -y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y             |
|      | y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3              |
|      | 2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                                  |
|                                                                             |
|o17 : NCMatrix                                                               |
|-----------------------------------------------------------------------------|
|y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3                      |
|2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                                          |
|-y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y                     |
|-----------------------------------------------------------------------------|
|2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                      |                   |
|-y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y |                   |
|y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3  |                   |
+-----------------------------------------------------------------------------+
|i18 : X = NC + 3*NC                                                          |
|                                                                             |
|o18 = | 4*x 4*y 4*z |                                                        |
|      | 4*y 4*z 4*x |                                                        |
|      | 4*z 4*x 4*y |                                                        |
|                                                                             |
|o18 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+
|i19 : Y = NC | 2*NC                                                          |
|                                                                             |
|o19 = | x y z 2*x 2*y 2*z |                                                  |
|      | y z x 2*y 2*z 2*x |                                                  |
|      | z x y 2*z 2*x 2*y |                                                  |
|                                                                             |
|o19 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+
|i20 : Z = X || NC                                                            |
|                                                                             |
|o20 = | 4*x 4*y 4*z |                                                        |
|      | 4*y 4*z 4*x |                                                        |
|      | 4*z 4*x 4*y |                                                        |
|      | x   y   z   |                                                        |
|      | y   z   x   |                                                        |
|      | z   x   y   |                                                        |
|                                                                             |
|o20 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+

Functions and methods returning an object of class NCMatrix :
=============================================================

  * basis(ZZ,NCIdeal) -- Returns a basis of an
    NCIdeal in a particular degree.
  * basis(ZZ,NCLeftIdeal) -- Returns a
    basis of an NCLeftIdeal in a particular degree.
  * basis(ZZ,NCRightIdeal) -- Returns a
    basis of an NCRightIdeal in a particular degree.
  * basis(ZZ,NCRing) -- Returns a basis of an
    NCRing in a particular degree.
  * lift(NCMatrix) -- Lifts an NCMatrix

Methods that use an object of class NCMatrix :
==============================================

  * - NCMatrix -- Negates NCMatrices
  * "assignDegrees(NCMatrix)" -- see assignDegrees, --
    Weights entries of a matrix to make associated map of free modules graded
  * "assignDegrees(NCMatrix,List,List)" -- see assignDegrees,
    -- Weights entries of a matrix to make associated map of
    free modules graded
  * entries(NCMatrix) -- Returns the entries of
    the NCMatrix
  * Hom(ZZ,NCMatrix,NCMatrix), --
    Compute a graded component of Hom(M,N)
  * "isHomogeneous(NCMatrix)" -- see isHomogeneous(NCIdeal),
    -- Determines whether the input defines a
    homogeneous object
  * Matrix * NCMatrix -- Product of NCMatrices
  * NCMatrix % NCGroebnerBasis -- Reduces
    the entries of an NCMatrix with respect to an NCGroebnerBasis
  * NCMatrix * Matrix -- Product of NCMatrices
  * NCMatrix * NCMatrix -- Product of NCMatrices
  * NCMatrix * NCRingElement -- Product of
    NCMatrices
  * NCMatrix * QQ -- Product of NCMatrices
  * NCMatrix * RingElement -- Product of
    NCMatrices
  * NCMatrix * ZZ -- Product of NCMatrices
  * NCMatrix ** NCMatrix (missing documentation)
  * NCMatrix + NCMatrix -- Add NCMatrices
  * NCMatrix ++ NCMatrix (missing documentation)
  * NCMatrix - NCMatrix -- Subtract NCMatrices
  * NCMatrix // NCMatrix -- Factor one map through
    another
  * NCMatrix == NCMatrix -- Test equality of
    matrices
  * "NCMatrix == ZZ" -- see NCMatrix == NCMatrix,
    -- Test equality of matrices
  * "ZZ == NCMatrix" -- see NCMatrix == NCMatrix,
    -- Test equality of matrices
  * NCMatrix ^ List -- Select some rows of an NCMatrix
  * NCMatrix ^ ZZ -- Exponentiate an NCMatrix
  * NCMatrix _ List -- Select some columns of an
    NCMatrix
  * NCMatrix _ ZZ -- Induced map in homogeneous degree
    n
  * NCMatrix | NCMatrix -- Join NCMatrices
    horizontally
  * NCMatrix || NCMatrix -- Join NCMatrices
    vertically
  * NCMatrix Array -- Graded shift of an NCMatrix.
  * NCRingElement * NCMatrix -- Product of
    NCMatrices
  * "NCRingMap NCMatrix" -- see NCRingMap NCRingElement,
    -- Apply an NCRingMap to an element or matrix
  * QQ * NCMatrix -- Product of NCMatrices
  * resolution(NCMatrix) -- Compute the
    resolution of coker M as a map of free right modules
  * "rightKernel(NCMatrix,ZZ)" -- see rightKernel, -- Method
    for computing kernels of matrices over noncommutative rings in a given
    degree without using Bergman
  * "rightKernelBergman(NCMatrix)" -- see rightKernelBergman,
    -- Methods for computing kernels of matrices over
    noncommutative rings using Bergman
  * ring(NCMatrix) -- Gives the ring of the NCMatrix
  * RingElement * NCMatrix -- Product of
    NCMatrices
  * transpose(NCMatrix) -- Transposes an
    NCMatrix
  * ZZ * NCMatrix -- Product of NCMatrices

For the programmer
==================

The object NCMatrix, is a type (Macaulay2Doc), with
ancestor classes MutableHashTable (Macaulay2Doc), <
HashTable (Macaulay2Doc) < Thing (Macaulay2Doc).

ncMatrix -- Create an NCMatrix
******************************

Synopsis
========

  * Usage:
        M = ncMatrix entriesList
  * Inputs:
      * entriesList, a list (Macaulay2Doc),
  * Outputs:
      * M, an instance of the type NCMatrix,

Description
===========

This command creates an NCMatrix.  As with the matrix (Macaulay2Doc),
command, the user may provide this matrix as a doubly
nested list of NCRingElements, or as a doubly nested list of NCMatrices.

The ncMatrix(NCRing,List,List) constructor is used only when creating maps to
and from the zero free module.

+--------------------------------------------------------+
|i1 : A = QQ{a,b,c,d}                                    |
|                                                        |
|o1 = A                                                  |
|                                                        |
|o1 : NCPolynomialRing                                   |
+--------------------------------------------------------+
|i2 : M = ncMatrix {{a,b,c,d}}                           |
|                                                        |
|o2 = | a b c d |                                        |
|                                                        |
|o2 : NCMatrix                                           |
+--------------------------------------------------------+
|i3 : N = ncMatrix {{M,2*M,3*M},{4*M,5*M,6*M}}           |
|                                                        |
|o3 = | a   b   c   d   2*a 2*b 2*c 2*d 3*a 3*b 3*c 3*d ||
|     | 4*a 4*b 4*c 4*d 5*a 5*b 5*c 5*d 6*a 6*b 6*c 6*d ||
|                                                        |
|o3 : NCMatrix                                           |
+--------------------------------------------------------+

Ways to use ncMatrix :
======================

  * "ncMatrix(List)"
  * "ncMatrix(NCRing,List,List)"

For the programmer
==================

The object ncMatrix, is a method function (Macaulay2Doc).

NCMatrix % NCGroebnerBasis -- Reduces the entries of an NCMatrix with respect to an NCGroebnerBasis
***************************************************************************************************

Synopsis
========

  * Operator: % (Macaulay2Doc),
  * Usage:
        L = M % Igb
  * Inputs:
      * M, an instance of the type NCMatrix,
      * Igb, an instance of the type NCGroebnerBasis,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command reduces the entries of an NCMatrix with respect to an
NCGroebnerBasis.

+-----------------------------------------------------------------------------+
|i1 : A = QQ{x,y,z}                                                           |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : f = y*z + z*y - x^2                                                     |
|                                                                             |
|            2                                                                |
|o2 = zy+yz-x                                                                 |
|                                                                             |
|o2 : A                                                                       |
+-----------------------------------------------------------------------------+
|i3 : g = x*z + z*x - y^2                                                     |
|                                                                             |
|         2                                                                   |
|o3 = zx-y +xz                                                                |
|                                                                             |
|o3 : A                                                                       |
+-----------------------------------------------------------------------------+
|i4 : h = z^2 - x*y - y*x                                                     |
|                                                                             |
|      2                                                                      |
|o4 = z -yx-xy                                                                |
|                                                                             |
|o4 : A                                                                       |
+-----------------------------------------------------------------------------+
|i5 : I = ncIdeal {f,g,h}                                                     |
|                                                                             |
|                             2      2      2                                 |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}                          |
|                                                                             |
|o5 : NCIdeal                                                                 |
+-----------------------------------------------------------------------------+
|i6 : Igb = ncGroebnerBasis I                                                 |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|      2    2                2                                                |
|o6 = y x-xy ; Lead Term = (y x, 1)                                           |
|       2  2                  2                                               |
|     yx -x y; Lead Term = (yx , 1)                                           |
|         2                                                                   |
|     zx-y +xz; Lead Term = (zx, 1)                                           |
|            2                                                                |
|     zy+yz-x ; Lead Term = (zy, 1)                                           |
|      2                      2                                               |
|     z -yx-xy; Lead Term = (z , 1)                                           |
|                                                                             |
|o6 : NCGroebnerBasis                                                         |
+-----------------------------------------------------------------------------+
|i7 : M = ncMatrix {{x, y, z}}                                                |
|                                                                             |
|o7 = | x y z |                                                               |
|                                                                             |
|o7 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i8 : sigma = ncMap(A,A,{y,z,x})                                              |
|                                                                             |
|o8 = NCRingMap A <--- A                                                      |
|                                                                             |
|o8 : NCRingMap                                                               |
+-----------------------------------------------------------------------------+
|i9 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}                           |
|                                                                             |
|o9 = | x y z |                                                               |
|     | y z x |                                                               |
|     | z x y |                                                               |
|                                                                             |
|o9 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i10 : N3 = N^3                                                               |
|                                                                             |
|o10 = | z^2*x+z*y*z+z*x*y+y*z*y+y^2*x+y*x*z+x*z^2+x*y^2+x^3                  |
|      | z^2*y+z*y*x+z*x*z+y*z^2+y^3+y*x^2+x*z*x+x*y*z+x^2*y                  |
|      | z^3+z*y^2+z*x^2+y*z*x+y^2*z+y*x*y+x*z*y+x*y*x+x^2*z                  |
|                                                                             |
|o10 : NCMatrix                                                               |
|-----------------------------------------------------------------------------|
|z^2*y+z*y*x+z*x*z+y*z^2+y^3+y*x^2+x*z*x+x*y*z+x^2*y                          |
|z^3+z*y^2+z*x^2+y*z*x+y^2*z+y*x*y+x*z*y+x*y*x+x^2*z                          |
|z^2*x+z*y*z+z*x*y+y*z*y+y^2*x+y*x*z+x*z^2+x*y^2+x^3                          |
|-----------------------------------------------------------------------------|
|z^3+z*y^2+z*x^2+y*z*x+y^2*z+y*x*y+x*z*y+x*y*x+x^2*z |                        |
|z^2*x+z*y*z+z*x*y+y*z*y+y^2*x+y*x*z+x*z^2+x*y^2+x^3 |                        |
|z^2*y+z*y*x+z*x*z+y*z^2+y^3+y*x^2+x*z*x+x*y*z+x^2*y |                        |
+-----------------------------------------------------------------------------+
|i11 : N3red = N3 % Igb                                                       |
|                                                                             |
|o11 = | -y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y             |
|      | y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3              |
|      | 2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                                  |
|                                                                             |
|o11 : NCMatrix                                                               |
|-----------------------------------------------------------------------------|
|y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3                      |
|2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                                          |
|-y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y                     |
|-----------------------------------------------------------------------------|
|2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                      |                   |
|-y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y |                   |
|y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3  |                   |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix % NCGroebnerBasis -- Reduces
    the entries of an NCMatrix with respect to an NCGroebnerBasis

NCMatrix * Matrix -- Product of NCMatrices
******************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        L = M*N
  * Inputs:
      * M, an instance of the type NCMatrix,
      * N, a matrix (Macaulay2Doc),
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command allows for the product of composable NCMatrices (or ordinary
matrices over the base).

+--------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})    |
|--Calling Bergman for NCGB calculation.           |
|Complete!                                         |
|                                                  |
|o1 = B                                            |
|                                                  |
|o1 : NCQuotientRing                               |
+--------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                     |
|                                                  |
|o2 = | x y z |                                    |
|                                                  |
|o2 : NCMatrix                                     |
+--------------------------------------------------+
|i3 : sigma = ncMap(B,B,{y,z,x})                   |
|                                                  |
|o3 = NCRingMap B <--- B                           |
|                                                  |
|o3 : NCRingMap                                    |
+--------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}|
|                                                  |
|o4 = | x y z |                                    |
|     | y z x |                                    |
|     | z x y |                                    |
|                                                  |
|o4 : NCMatrix                                     |
+--------------------------------------------------+
|i5 : L = map(QQ^3,QQ^3,{{2,0,0},{1,2,0},{1,2,3}}) |
|                                                  |
|o5 = | 2 0 0 |                                    |
|     | 1 2 0 |                                    |
|     | 1 2 3 |                                    |
|                                                  |
|              3        3                          |
|o5 : Matrix QQ  <--- QQ                           |
+--------------------------------------------------+
|i6 : N*L                                          |
|                                                  |
|o6 = | z+y+2*x 2*z+2*y 3*z |                      |
|     | z+2*y+x 2*z+2*x 3*x |                      |
|     | 2*z+y+x 2*y+2*x 3*y |                      |
|                                                  |
|o6 : NCMatrix                                     |
+--------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix * Matrix -- Product of NCMatrices

NCMatrix * NCMatrix -- Product of NCMatrices
********************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        L = M*N
  * Inputs:
      * M, an instance of the type NCMatrix,
      * N, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command allows for the product of composable NCMatrices (or ordinary
matrices over the base).

+-----------------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})             |
|--Calling Bergman for NCGB calculation.                    |
|Complete!                                                  |
|                                                           |
|o1 = B                                                     |
|                                                           |
|o1 : NCQuotientRing                                        |
+-----------------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                              |
|                                                           |
|o2 = | x y z |                                             |
|                                                           |
|o2 : NCMatrix                                              |
+-----------------------------------------------------------+
|i3 : sigma = ncMap(B,B,{y,z,x})                            |
|                                                           |
|o3 = NCRingMap B <--- B                                    |
|                                                           |
|o3 : NCRingMap                                             |
+-----------------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}         |
|                                                           |
|o4 = | x y z |                                             |
|     | y z x |                                             |
|     | z x y |                                             |
|                                                           |
|o4 : NCMatrix                                              |
+-----------------------------------------------------------+
|i5 : N' = ncMatrix {{sigma sigma M}, {sigma M}, {M}}       |
|                                                           |
|o5 = | z x y |                                             |
|     | y z x |                                             |
|     | x y z |                                             |
|                                                           |
|o5 : NCMatrix                                              |
+-----------------------------------------------------------+
|i6 : N*N'                                                  |
|                                                           |
|o6 = | 2*y^2       2*x^2       2*y*x+2*x*y |               |
|     | 2*x^2       2*y*x+2*x*y 2*y^2       |               |
|     | 2*y*x+2*x*y 2*y^2       2*x^2       |               |
|                                                           |
|o6 : NCMatrix                                              |
+-----------------------------------------------------------+
|i7 : N'*N                                                  |
|                                                           |
|o7 = | y*z+y^2-x*z+x*y  -y*z+y*x+x*z+x^2 y^2+y*x+x*y+x^2  ||
|     | -y*z+y*x+x*z+x^2 y^2+y*x+x*y+x^2  y*z+y^2-x*z+x*y  ||
|     | y^2+y*x+x*y+x^2  y*z+y^2-x*z+x*y  -y*z+y*x+x*z+x^2 ||
|                                                           |
|o7 : NCMatrix                                              |
+-----------------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix * NCMatrix -- Product of NCMatrices

NCMatrix * NCRingElement -- Product of NCMatrices
*************************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        L = M*f
  * Inputs:
      * M, an instance of the type NCMatrix,
      * f, an instance of the type NCRingElement,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command allows for the scalar multiplication of an NCMatrix by an
NCRingElement on the right.

+--------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})    |
|--Calling Bergman for NCGB calculation.           |
|Complete!                                         |
|                                                  |
|o1 = B                                            |
|                                                  |
|o1 : NCQuotientRing                               |
+--------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                     |
|                                                  |
|o2 = | x y z |                                    |
|                                                  |
|o2 : NCMatrix                                     |
+--------------------------------------------------+
|i3 : sigma = ncMap(B,B,{y,z,x})                   |
|                                                  |
|o3 = NCRingMap B <--- B                           |
|                                                  |
|o3 : NCRingMap                                    |
+--------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}|
|                                                  |
|o4 = | x y z |                                    |
|     | y z x |                                    |
|     | z x y |                                    |
|                                                  |
|o4 : NCMatrix                                     |
+--------------------------------------------------+
|i5 : N*x^2                                        |
|                                                  |
|o5 = | x^3   x^2*y x^2*z |                        |
|     | x^2*y x^2*z x^3   |                        |
|     | x^2*z x^3   x^2*y |                        |
|                                                  |
|o5 : NCMatrix                                     |
+--------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix * NCRingElement -- Product of
    NCMatrices

NCMatrix * QQ -- Product of NCMatrices
**************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        L = M*a
  * Inputs:
      * M, an instance of the type NCMatrix,
      * a, a rational number (Macaulay2Doc),
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command allows for the scaling of an NCMatrix, by an
element in QQ (Macaulay2Doc).

+--------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})    |
|--Calling Bergman for NCGB calculation.           |
|Complete!                                         |
|                                                  |
|o1 = B                                            |
|                                                  |
|o1 : NCQuotientRing                               |
+--------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                     |
|                                                  |
|o2 = | x y z |                                    |
|                                                  |
|o2 : NCMatrix                                     |
+--------------------------------------------------+
|i3 : sigma = ncMap(B,B,{y,z,x})                   |
|                                                  |
|o3 = NCRingMap B <--- B                           |
|                                                  |
|o3 : NCRingMap                                    |
+--------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}|
|                                                  |
|o4 = | x y z |                                    |
|     | y z x |                                    |
|     | z x y |                                    |
|                                                  |
|o4 : NCMatrix                                     |
+--------------------------------------------------+
|i5 : N*(1/2)                                      |
|                                                  |
|o5 = | 1/2*x 1/2*y 1/2*z |                        |
|     | 1/2*y 1/2*z 1/2*x |                        |
|     | 1/2*z 1/2*x 1/2*y |                        |
|                                                  |
|o5 : NCMatrix                                     |
+--------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix * QQ -- Product of NCMatrices

NCMatrix * RingElement -- Product of NCMatrices
***********************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        L = M*f
  * Inputs:
      * M, an instance of the type NCMatrix,
      * N, a ring element (Macaulay2Doc),
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command allows for the scaling of an NCMatrix by an element in the base
ring.

+--------------------------------------------------+
|i1 : R = frac(QQ[a])                              |
|                                                  |
|o1 = R                                            |
|                                                  |
|o1 : FractionField                                |
+--------------------------------------------------+
|i2 : B = skewPolynomialRing(R,a,{x,y,z})          |
|                                                  |
|o2 = B                                            |
|                                                  |
|o2 : NCQuotientRing                               |
+--------------------------------------------------+
|i3 : M = ncMatrix {{x, y, z}}                     |
|                                                  |
|o3 = | x y z |                                    |
|                                                  |
|o3 : NCMatrix                                     |
+--------------------------------------------------+
|i4 : sigma = ncMap(B,B,{y,z,x})                   |
|                                                  |
|o4 = NCRingMap B <--- B                           |
|                                                  |
|o4 : NCRingMap                                    |
+--------------------------------------------------+
|i5 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}|
|                                                  |
|o5 = | x y z |                                    |
|     | y z x |                                    |
|     | z x y |                                    |
|                                                  |
|o5 : NCMatrix                                     |
+--------------------------------------------------+
|i6 : N*a                                          |
|                                                  |
|o6 = | a*x a*y a*z |                              |
|     | a*y a*z a*x |                              |
|     | a*z a*x a*y |                              |
|                                                  |
|o6 : NCMatrix                                     |
+--------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix * RingElement -- Product of
    NCMatrices

NCMatrix * ZZ -- Product of NCMatrices
**************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        L = M*a
  * Inputs:
      * M, an instance of the type NCMatrix,
      * a, an integer (Macaulay2Doc),
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command allows for the scaling of an NCMatrix, by an
element in ZZ (Macaulay2Doc).

+--------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})    |
|--Calling Bergman for NCGB calculation.           |
|Complete!                                         |
|                                                  |
|o1 = B                                            |
|                                                  |
|o1 : NCQuotientRing                               |
+--------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                     |
|                                                  |
|o2 = | x y z |                                    |
|                                                  |
|o2 : NCMatrix                                     |
+--------------------------------------------------+
|i3 : sigma = ncMap(B,B,{y,z,x})                   |
|                                                  |
|o3 = NCRingMap B <--- B                           |
|                                                  |
|o3 : NCRingMap                                    |
+--------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}|
|                                                  |
|o4 = | x y z |                                    |
|     | y z x |                                    |
|     | z x y |                                    |
|                                                  |
|o4 : NCMatrix                                     |
+--------------------------------------------------+
|i5 : N*3                                          |
|                                                  |
|o5 = | 3*x 3*y 3*z |                              |
|     | 3*y 3*z 3*x |                              |
|     | 3*z 3*x 3*y |                              |
|                                                  |
|o5 : NCMatrix                                     |
+--------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix * ZZ -- Product of NCMatrices

NCMatrix + NCMatrix -- Add NCMatrices
*************************************

Synopsis
========

  * Operator: + (Macaulay2Doc),
  * Usage:
        L = M + N
  * Inputs:
      * M, an instance of the type NCMatrix,
      * N, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This adds NCMatrices.

+----------------------------------------------------+
|i1 : A = QQ{x,y,z}                                  |
|                                                    |
|o1 = A                                              |
|                                                    |
|o1 : NCPolynomialRing                               |
+----------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                       |
|                                                    |
|o2 = | x y z |                                      |
|                                                    |
|o2 : NCMatrix                                       |
+----------------------------------------------------+
|i3 : sigma = ncMap(A,A,{y,z,x})                     |
|                                                    |
|o3 = NCRingMap A <--- A                             |
|                                                    |
|o3 : NCRingMap                                      |
+----------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}  |
|                                                    |
|o4 = | x y z |                                      |
|     | y z x |                                      |
|     | z x y |                                      |
|                                                    |
|o4 : NCMatrix                                       |
+----------------------------------------------------+
|i5 : N' = ncMatrix {{sigma sigma M}, {sigma M}, {M}}|
|                                                    |
|o5 = | z x y |                                      |
|     | y z x |                                      |
|     | x y z |                                      |
|                                                    |
|o5 : NCMatrix                                       |
+----------------------------------------------------+
|i6 : N + N'                                         |
|                                                    |
|o6 = | z+x y+x z+y |                                |
|     | 2*y 2*z 2*x |                                |
|     | z+x y+x z+y |                                |
|                                                    |
|o6 : NCMatrix                                       |
+----------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix + NCMatrix -- Add NCMatrices

NCMatrix - NCMatrix -- Subtract NCMatrices
******************************************

Synopsis
========

  * Operator: - (Macaulay2Doc),
  * Usage:
        L = M - N
  * Inputs:
      * M, an instance of the type NCMatrix,
      * N, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This subtracts NCMatrices.

+----------------------------------------------------+
|i1 : A = QQ{x,y,z}                                  |
|                                                    |
|o1 = A                                              |
|                                                    |
|o1 : NCPolynomialRing                               |
+----------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                       |
|                                                    |
|o2 = | x y z |                                      |
|                                                    |
|o2 : NCMatrix                                       |
+----------------------------------------------------+
|i3 : sigma = ncMap(A,A,{y,z,x})                     |
|                                                    |
|o3 = NCRingMap A <--- A                             |
|                                                    |
|o3 : NCRingMap                                      |
+----------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}  |
|                                                    |
|o4 = | x y z |                                      |
|     | y z x |                                      |
|     | z x y |                                      |
|                                                    |
|o4 : NCMatrix                                       |
+----------------------------------------------------+
|i5 : N' = ncMatrix {{sigma sigma M}, {sigma M}, {M}}|
|                                                    |
|o5 = | z x y |                                      |
|     | y z x |                                      |
|     | x y z |                                      |
|                                                    |
|o5 : NCMatrix                                       |
+----------------------------------------------------+
|i6 : N - N'                                         |
|                                                    |
|o6 = | -z+x y-x  z-y  |                             |
|     | 0    0    0    |                             |
|     | z-x  -y+x -z+y |                             |
|                                                    |
|o6 : NCMatrix                                       |
+----------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix - NCMatrix -- Subtract NCMatrices

NCMatrix // NCMatrix -- Factor one map through another
******************************************************

Synopsis
========

  * Operator: // (Macaulay2Doc),
  * Usage:
        L = M // N
  * Inputs:
      * M, an instance of the type NCMatrix,
      * N, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command factors one map through another.  One nice application of this is
to compute twisted matrix factorizations. If the maps input are homogeneous,
then the degrees must match up for the command to work.

If M does not factor through N, then the return value L is such that M - N*L is
the reduction of M modulo a Groebner basis for the image of N.

Here is an example of doing so over a PI Sklyanin algebra.  Note that since
quotients of quotients are (unfortunately) not yet implemented, we have to do a
bit of acrobatics to define the quotient of the Sklyanin we want.

+----------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})|
|--Calling Bergman for NCGB calculation.       |
|Complete!                                     |
|                                              |
|o1 = B                                        |
|                                              |
|o1 : NCQuotientRing                           |
+----------------------------------------------+
|i2 : A = ambient B                            |
|                                              |
|o2 = A                                        |
|                                              |
|o2 : NCPolynomialRing                         |
+----------------------------------------------+

The element g below is central in B (the two is just for convenience).

+-----------------------------------------------------------------------------+
|i3 : g = 2*(-y^3-x*y*z+y*x*z+x^3)                                            |
|                                                                             |
|        3             3                                                      |
|o3 = -2y +2yxz-2xyz+2x                                                       |
|                                                                             |
|o3 : A                                                                       |
+-----------------------------------------------------------------------------+
|i4 : J = (ideal B) + ncIdeal {g}                                             |
|                                                                             |
|                             2      2       2           3             3      |
|o4 = Two-sided ideal {zy+yz-x , zx-y +xz, -z +yx+xy, -2y +2yxz-2xyz+2x }     |
|                                                                             |
|o4 : NCIdeal                                                                 |
+-----------------------------------------------------------------------------+
|i5 : B' = A/J -- Factor of sklyanin                                          |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o5 = B'                                                                      |
|                                                                             |
|o5 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i6 : k = ncMatrix {{x,y,z}}                                                  |
|                                                                             |
|o6 = | x y z |                                                               |
|                                                                             |
|o6 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i7 : BprimeToB = ncMap(B,B',gens B) -- way to lift back from B' to B         |
|                                                                             |
|o7 = NCRingMap B <--- B'                                                     |
|                                                                             |
|o7 : NCRingMap                                                               |
+-----------------------------------------------------------------------------+
|i8 : M = BprimeToB rightKernelBergman rightKernelBergman k  -- second syzygy |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o8 = | -z y*z     -y^2    -y*x-2*x*y |                                       |
|     | x  y*x+x*y y*z+x^2 -y^2+3*x*z |                                       |
|     | y  -x*z    -x*y    x^2        |                                       |
|     | 0  -2*y    -2*x    -2*z       |                                       |
|                                                                             |
|o8 : NCMatrix                                                                |
|-----------------------------------------------------------------------------|
|of k over B                                                                  |
+-----------------------------------------------------------------------------+

At this point, M is maximal Cohen-Macaulay B'-module, and hence the projective
dimension of M as a B-module is 1.  Since M is a B' module, multiplication by g
on the complex that gives the resolution over B is null homotopic.  This means
we may factor the map f through f times the identity.  We do so below.

+-----------------------------------------------------------------------------+
|i9 : gId = g*(ncMatrix applyTable(entries id_(ZZ^4), i -> promote(i,B)))     |
|                                                                             |
|o9 = | -2*y^3+2*y*x*z-2*x*y*z+2*x^3 0                            0           |
|     | 0                            -2*y^3+2*y*x*z-2*x*y*z+2*x^3 0           |
|     | 0                            0                            -2*y^3+2*y*x|
|     | 0                            0                            0           |
|                                                                             |
|o9 : NCMatrix                                                                |
|-----------------------------------------------------------------------------|
|                 0                            |                              |
|                 0                            |                              |
|*z-2*x*y*z+2*x^3 0                            |                              |
|                 -2*y^3+2*y*x*z-2*x*y*z+2*x^3 |                              |
+-----------------------------------------------------------------------------+
|i10 : assignDegrees(gId,{2,2,2,3},{5,5,5,6});                                |
+-----------------------------------------------------------------------------+
|i11 : M' = gId // M                                                          |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o11 = | -2*y*x 0  -2*y^2+2*x*z y*x*z+x^3 |                                   |
|      | -x     z  -y           y^2-x*z   |                                   |
|      | -y     -x z            y*z-x^2   |                                   |
|      | z      y  x            0         |                                   |
|                                                                             |
|o11 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+
|i12 : M*M' == gId                                                            |
|                                                                             |
|o12 = true                                                                   |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix // NCMatrix -- Factor one map through
    another

NCMatrix == NCMatrix -- Test equality of matrices
*************************************************

Synopsis
========

  * Operator: == (Macaulay2Doc),
  * Usage:
        isEqual = M == N
  * Inputs:
      * M, an instance of the type NCMatrix, or an integer
      * N, an instance of the type NCMatrix, or an integer
  * Outputs:
      * isEqual, a Boolean value (Macaulay2Doc),

Description
===========

This command tests equality for matrices.  If one of the inputs is an integer,
then the test only will work if the integer is zero.  Below, we test the
well-definedness of the exponentiation operation using Groebner bases.

+-----------------------------------------------------------------------------+
|i1 : A = QQ{x,y,z}                                                           |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : f = y*z + z*y - x^2                                                     |
|                                                                             |
|            2                                                                |
|o2 = zy+yz-x                                                                 |
|                                                                             |
|o2 : A                                                                       |
+-----------------------------------------------------------------------------+
|i3 : g = x*z + z*x - y^2                                                     |
|                                                                             |
|         2                                                                   |
|o3 = zx-y +xz                                                                |
|                                                                             |
|o3 : A                                                                       |
+-----------------------------------------------------------------------------+
|i4 : h = z^2 - x*y - y*x                                                     |
|                                                                             |
|      2                                                                      |
|o4 = z -yx-xy                                                                |
|                                                                             |
|o4 : A                                                                       |
+-----------------------------------------------------------------------------+
|i5 : I = ncIdeal {f,g,h}                                                     |
|                                                                             |
|                             2      2      2                                 |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}                          |
|                                                                             |
|o5 : NCIdeal                                                                 |
+-----------------------------------------------------------------------------+
|i6 : Igb = ncGroebnerBasis I                                                 |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|      2    2                2                                                |
|o6 = y x-xy ; Lead Term = (y x, 1)                                           |
|       2  2                  2                                               |
|     yx -x y; Lead Term = (yx , 1)                                           |
|         2                                                                   |
|     zx-y +xz; Lead Term = (zx, 1)                                           |
|            2                                                                |
|     zy+yz-x ; Lead Term = (zy, 1)                                           |
|      2                      2                                               |
|     z -yx-xy; Lead Term = (z , 1)                                           |
|                                                                             |
|o6 : NCGroebnerBasis                                                         |
+-----------------------------------------------------------------------------+
|i7 : M = ncMatrix {{x, y, z}}                                                |
|                                                                             |
|o7 = | x y z |                                                               |
|                                                                             |
|o7 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i8 : sigma = ncMap(A,A,{y,z,x})                                              |
|                                                                             |
|o8 = NCRingMap A <--- A                                                      |
|                                                                             |
|o8 : NCRingMap                                                               |
+-----------------------------------------------------------------------------+
|i9 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}                           |
|                                                                             |
|o9 = | x y z |                                                               |
|     | y z x |                                                               |
|     | z x y |                                                               |
|                                                                             |
|o9 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i10 : Nred = N^3 % Igb                                                       |
|                                                                             |
|o10 = | -y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y             |
|      | y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3              |
|      | 2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                                  |
|                                                                             |
|o10 : NCMatrix                                                               |
|-----------------------------------------------------------------------------|
|y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3                      |
|2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                                          |
|-y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y                     |
|-----------------------------------------------------------------------------|
|2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                      |                   |
|-y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y |                   |
|y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3  |                   |
+-----------------------------------------------------------------------------+
|i11 : B = A/I                                                                |
|                                                                             |
|o11 = B                                                                      |
|                                                                             |
|o11 : NCQuotientRing                                                         |
+-----------------------------------------------------------------------------+
|i12 : phi = ncMap(B,A,gens B)                                                |
|                                                                             |
|o12 = NCRingMap B <--- A                                                     |
|                                                                             |
|o12 : NCRingMap                                                              |
+-----------------------------------------------------------------------------+
|i13 : NB = phi N                                                             |
|                                                                             |
|o13 = | x y z |                                                              |
|      | y z x |                                                              |
|      | z x y |                                                              |
|                                                                             |
|o13 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+
|i14 : N3B = NB^3                                                             |
|                                                                             |
|o14 = | -y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y             |
|      | y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3              |
|      | 2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                                  |
|                                                                             |
|o14 : NCMatrix                                                               |
|-----------------------------------------------------------------------------|
|y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3                      |
|2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                                          |
|-y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y                     |
|-----------------------------------------------------------------------------|
|2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                      |                   |
|-y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y |                   |
|y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3  |                   |
+-----------------------------------------------------------------------------+
|i15 : (phi Nred) == N3B                                                      |
|                                                                             |
|o15 = true                                                                   |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix == NCMatrix -- Test equality of
    matrices
  * "NCMatrix == ZZ"
  * "ZZ == NCMatrix"

NCMatrix ^ List -- Select some rows of an NCMatrix
**************************************************

Synopsis
========

  * Operator: ^ (Macaulay2Doc),
  * Usage:
        L = M^rows
  * Inputs:
      * M, an instance of the type NCMatrix,
      * rows, a list (Macaulay2Doc),
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command selects some rows of an NCMatrix.

+---------------------------------------+
|i1 : A = QQ{a,b,c,d}                   |
|                                       |
|o1 = A                                 |
|                                       |
|o1 : NCPolynomialRing                  |
+---------------------------------------+
|i2 : M = ncMatrix {{a,b,c,d},{b,c,d,a}}|
|                                       |
|o2 = | a b c d |                       |
|     | b c d a |                       |
|                                       |
|o2 : NCMatrix                          |
+---------------------------------------+
|i3 : N = M || 2*M || -3*M              |
|                                       |
|o3 = | a    b    c    d    |           |
|     | b    c    d    a    |           |
|     | 2*a  2*b  2*c  2*d  |           |
|     | 2*b  2*c  2*d  2*a  |           |
|     | -3*a -3*b -3*c -3*d |           |
|     | -3*b -3*c -3*d -3*a |           |
|                                       |
|o3 : NCMatrix                          |
+---------------------------------------+
|i4 : N^{0,3,4}                         |
|                                       |
|o4 = | a    b    c    d    |           |
|     | 2*b  2*c  2*d  2*a  |           |
|     | -3*a -3*b -3*c -3*d |           |
|                                       |
|o4 : NCMatrix                          |
+---------------------------------------+

Ways to use this method:
========================

  * NCMatrix ^ List -- Select some rows of an NCMatrix

NCMatrix ^ ZZ -- Exponentiate an NCMatrix
*****************************************

Synopsis
========

  * Operator: ^ (Macaulay2Doc),
  * Usage:
        L = M^n
  * Inputs:
      * M, an instance of the type NCMatrix,
      * n, an integer (Macaulay2Doc),
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This exponentiates an NCMatrix.  It should be remarked that the matrix is
reduced with the GB of the ring it is over on each iteration of the product.
If your algebra is significantly smaller than the tensor algebra, this is a
large savings. The input is assumed to be a nonnegative integer at this time.

+-----------------------------------------------------------------------------+
|i1 : A = QQ{x,y,z}                                                           |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                                                |
|                                                                             |
|o2 = | x y z |                                                               |
|                                                                             |
|o2 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i3 : sigma = ncMap(A,A,{y,z,x})                                              |
|                                                                             |
|o3 = NCRingMap A <--- A                                                      |
|                                                                             |
|o3 : NCRingMap                                                               |
+-----------------------------------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}                           |
|                                                                             |
|o4 = | x y z |                                                               |
|     | y z x |                                                               |
|     | z x y |                                                               |
|                                                                             |
|o4 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i5 : N^3                                                                     |
|                                                                             |
|o5 = | z^2*x+z*y*z+z*x*y+y*z*y+y^2*x+y*x*z+x*z^2+x*y^2+x^3                   |
|     | z^2*y+z*y*x+z*x*z+y*z^2+y^3+y*x^2+x*z*x+x*y*z+x^2*y                   |
|     | z^3+z*y^2+z*x^2+y*z*x+y^2*z+y*x*y+x*z*y+x*y*x+x^2*z                   |
|                                                                             |
|o5 : NCMatrix                                                                |
|-----------------------------------------------------------------------------|
|z^2*y+z*y*x+z*x*z+y*z^2+y^3+y*x^2+x*z*x+x*y*z+x^2*y                          |
|z^3+z*y^2+z*x^2+y*z*x+y^2*z+y*x*y+x*z*y+x*y*x+x^2*z                          |
|z^2*x+z*y*z+z*x*y+y*z*y+y^2*x+y*x*z+x*z^2+x*y^2+x^3                          |
|-----------------------------------------------------------------------------|
|z^3+z*y^2+z*x^2+y*z*x+y^2*z+y*x*y+x*z*y+x*y*x+x^2*z |                        |
|z^2*x+z*y*z+z*x*y+y*z*y+y^2*x+y*x*z+x*z^2+x*y^2+x^3 |                        |
|z^2*y+z*y*x+z*x*z+y*z^2+y^3+y*x^2+x*z*x+x*y*z+x^2*y |                        |
+-----------------------------------------------------------------------------+
|i6 : B = A/ncIdeal{y*z + z*y - x^2, x*z + z*x - y^2, z^2 - x*y - y*x}        |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o6 = B                                                                       |
|                                                                             |
|o6 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i7 : NB = promote(N,B)                                                       |
|                                                                             |
|o7 = | x y z |                                                               |
|     | y z x |                                                               |
|     | z x y |                                                               |
|                                                                             |
|o7 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i8 : NB^3                                                                    |
|                                                                             |
|o8 = | -y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y              |
|     | y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3               |
|     | 2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                                   |
|                                                                             |
|o8 : NCMatrix                                                                |
|-----------------------------------------------------------------------------|
|y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3                      |
|2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                                          |
|-y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y                     |
|-----------------------------------------------------------------------------|
|2*y^2*z+y^3+y*x*y+x*y*x+2*x^2*z+x^3                      |                   |
|-y^2*z+y^3+y*x*z-y*x*y+x*y*z+x*y^2+2*x*y*x+x^2*z+3*x^2*y |                   |
|y^2*z+y*x*z+2*y*x*y+x*y*z+3*x*y^2-x*y*x-x^2*z+x^2*y+x^3  |                   |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix ^ ZZ -- Exponentiate an NCMatrix

NCMatrix _ List -- Select some columns of an NCMatrix
*****************************************************

Synopsis
========

  * Operator: _ (Macaulay2Doc),
  * Usage:
        L = M_cols
  * Inputs:
      * M, an instance of the type NCMatrix,
      * cols, a list (Macaulay2Doc),
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command selects some columns of an NCMatrix.

+---------------------------------------+
|i1 : A = QQ{a,b,c,d}                   |
|                                       |
|o1 = A                                 |
|                                       |
|o1 : NCPolynomialRing                  |
+---------------------------------------+
|i2 : M = ncMatrix {{a,b,c,d},{b,c,d,a}}|
|                                       |
|o2 = | a b c d |                       |
|     | b c d a |                       |
|                                       |
|o2 : NCMatrix                          |
+---------------------------------------+
|i3 : N = M || 2*M || -3*M              |
|                                       |
|o3 = | a    b    c    d    |           |
|     | b    c    d    a    |           |
|     | 2*a  2*b  2*c  2*d  |           |
|     | 2*b  2*c  2*d  2*a  |           |
|     | -3*a -3*b -3*c -3*d |           |
|     | -3*b -3*c -3*d -3*a |           |
|                                       |
|o3 : NCMatrix                          |
+---------------------------------------+
|i4 : N_{0,2}                           |
|                                       |
|o4 = | a    c    |                     |
|     | b    d    |                     |
|     | 2*a  2*c  |                     |
|     | 2*b  2*d  |                     |
|     | -3*a -3*c |                     |
|     | -3*b -3*d |                     |
|                                       |
|o4 : NCMatrix                          |
+---------------------------------------+

Ways to use this method:
========================

  * NCMatrix _ List -- Select some columns of an
    NCMatrix

NCMatrix _ ZZ -- Induced map in homogeneous degree n
****************************************************

Synopsis
========

  * Operator: _ (Macaulay2Doc),
  * Usage:
        m = M_n
  * Inputs:
      * M, an instance of the type NCMatrix,
      * n, an integer (Macaulay2Doc),
  * Outputs:
      * m, a matrix (Macaulay2Doc),

Description
===========

If we regard M as defining a map of graded right free modules, then M_n returns
the induced map of underlying R-modules in degree n, where R is the coefficient
ring of ring M.

Ways to use this method:
========================

  * NCMatrix _ ZZ -- Induced map in homogeneous degree
    n

NCMatrix | NCMatrix -- Join NCMatrices horizontally
***************************************************

Synopsis
========

  * Operator: | (Macaulay2Doc),
  * Usage:
        L = M | N
  * Inputs:
      * M, an instance of the type NCMatrix,
      * N, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command joins NCMatrices horizontally.

+----------------------------------------------------+
|i1 : A = QQ{a,b,c,d}                                |
|                                                    |
|o1 = A                                              |
|                                                    |
|o1 : NCPolynomialRing                               |
+----------------------------------------------------+
|i2 : M = ncMatrix {{a,b,c,d},{b,c,d,a}}             |
|                                                    |
|o2 = | a b c d |                                    |
|     | b c d a |                                    |
|                                                    |
|o2 : NCMatrix                                       |
+----------------------------------------------------+
|i3 : N = M | 2*M | -3*M                             |
|                                                    |
|o3 = | a b c d 2*a 2*b 2*c 2*d -3*a -3*b -3*c -3*d ||
|     | b c d a 2*b 2*c 2*d 2*a -3*b -3*c -3*d -3*a ||
|                                                    |
|o3 : NCMatrix                                       |
+----------------------------------------------------+

Ways to use this method:
========================

  * NCMatrix | NCMatrix -- Join NCMatrices
    horizontally

NCMatrix || NCMatrix -- Join NCMatrices vertically
**************************************************

Synopsis
========

  * Operator: || (Macaulay2Doc),
  * Usage:
        L = M || N
  * Inputs:
      * M, an instance of the type NCMatrix,
      * N, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command joins NCMatrices vertically.

+---------------------------------------+
|i1 : A = QQ{a,b,c,d}                   |
|                                       |
|o1 = A                                 |
|                                       |
|o1 : NCPolynomialRing                  |
+---------------------------------------+
|i2 : M = ncMatrix {{a,b,c,d},{b,c,d,a}}|
|                                       |
|o2 = | a b c d |                       |
|     | b c d a |                       |
|                                       |
|o2 : NCMatrix                          |
+---------------------------------------+
|i3 : N = M || 2*M || -3*M              |
|                                       |
|o3 = | a    b    c    d    |           |
|     | b    c    d    a    |           |
|     | 2*a  2*b  2*c  2*d  |           |
|     | 2*b  2*c  2*d  2*a  |           |
|     | -3*a -3*b -3*c -3*d |           |
|     | -3*b -3*c -3*d -3*a |           |
|                                       |
|o3 : NCMatrix                          |
+---------------------------------------+

Ways to use this method:
========================

  * NCMatrix || NCMatrix -- Join NCMatrices
    vertically

NCMatrix Array -- Graded shift of an NCMatrix.
**********************************************

Synopsis
========

  * Operator: SPACE (Macaulay2Doc),
  * Usage:
        N = M x
  * Inputs:
      * M, an instance of the type NCMatrix,
      * x, an array (Macaulay2Doc),
  * Outputs:
      * N, an instance of the type NCMatrix,

Description
===========

Shifts the source and target in degrees by n if x = [n].

Ways to use this method:
========================

  * NCMatrix Array -- Graded shift of an NCMatrix.

NCPolynomialRing -- Type of a noncommutative polynomial ring
************************************************************

Synopsis
========

  * Usage:
        A = QQ{x,y}

Description
===========

This is the type of a noncommutative polynomial ring over a commutative ring R
(i.e. a tensor algebra over R).  It has parent type NCRing.

+---------------------+
|i1 : A = QQ{x,y}     |
|                     |
|o1 = A               |
|                     |
|o1 : NCPolynomialRing|
+---------------------+

Methods that use an object of class NCPolynomialRing :
======================================================

  * ambient(NCPolynomialRing) (missing documentation)
  * "gbFromOutputFile(NCPolynomialRing,String)" -- see gbFromOutputFile,
    -- Read in a NCGroebnerBasis from a Bergman output file.
  * ideal(NCPolynomialRing) -- The defining
    ideal of an NCPolynomialRing
  * NCPolynomialRing / NCIdeal -- Construct
    a NCQuotientRing

For the programmer
==================

The object NCPolynomialRing, is a type (Macaulay2Doc),
with ancestor classes NCRing, < Ring (Macaulay2Doc)
< Type (Macaulay2Doc) < MutableHashTable (Macaulay2Doc)
< HashTable (Macaulay2Doc) <
Thing (Macaulay2Doc).

NCPolynomialRing / NCIdeal -- Construct a NCQuotientRing
********************************************************

Synopsis
========

  * Operator: / (Macaulay2Doc),
  * Usage:
        B = A/I
  * Inputs:
      * A, an instance of the type NCPolynomialRing,
      * I, an instance of the type NCIdeal,
  * Outputs:
      * B, an instance of the type NCQuotientRing,

Description
===========

This is one way to create a quotient of the tensor algebra modulo some
relations.

At this point, one cannot define quotients of quotients.

If the base ring is QQ or a finite field of order p, then Bergman is called to
compute a Groebner basis.

If not, then one has a couple of options.  The first is to take the defining
ideal of the algebra, and provide a Groebner Basis by calling
ncGroebnerBasis, with the InstallGB flag set to true.  Of
course, if this generating set is not a Groebner basis, then you will get
incorrect results upon calls to functions like basis(ZZ,NCRing).

The alternative is to use the built in commands skewPolynomialRing,
and oreExtension, which has the same
effect as above occurring behind the scenes.  Just be careful using these
commands to create your ring if your base ring is not a field Bergman can work
with, as the generating sets created may not be a Groebner basis for the
defining ideal (this is more often a problem for oreExtension,
than skewPolynomialRing).

+---------------------------------------------------+
|i1 : A = QQ{x,y,z}                                 |
|                                                   |
|o1 = A                                             |
|                                                   |
|o1 : NCPolynomialRing                              |
+---------------------------------------------------+
|i2 : f = y*z + z*y - x^2                           |
|                                                   |
|            2                                      |
|o2 = zy+yz-x                                       |
|                                                   |
|o2 : A                                             |
+---------------------------------------------------+
|i3 : g = x*z + z*x - y^2                           |
|                                                   |
|         2                                         |
|o3 = zx-y +xz                                      |
|                                                   |
|o3 : A                                             |
+---------------------------------------------------+
|i4 : h = z^2 - x*y - y*x                           |
|                                                   |
|      2                                            |
|o4 = z -yx-xy                                      |
|                                                   |
|o4 : A                                             |
+---------------------------------------------------+
|i5 : I=ncIdeal{f,g,h}                              |
|                                                   |
|                             2      2      2       |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                                   |
|o5 : NCIdeal                                       |
+---------------------------------------------------+
|i6 : B = A/I                                       |
|--Calling Bergman for NCGB calculation.            |
|Complete!                                          |
|                                                   |
|o6 = B                                             |
|                                                   |
|o6 : NCQuotientRing                                |
+---------------------------------------------------+
|i7 : z^2                                           |
|                                                   |
|o7 = yx+xy                                         |
|                                                   |
|o7 : B                                             |
+---------------------------------------------------+
|i8 : R = toField(QQ[a]/ideal(a^4+a^3+a^2+a+1))     |
|                                                   |
|o8 = R                                             |
|                                                   |
|o8 : PolynomialRing                                |
+---------------------------------------------------+
|i9 : C = skewPolynomialRing(R,a,{x,y,z})           |
|                                                   |
|o9 = C                                             |
|                                                   |
|o9 : NCQuotientRing                                |
+---------------------------------------------------+
|i10 : y*x                                          |
|                                                   |
|          3    2                                   |
|o10 = (- a  - a  - a - 1)xy                        |
|                                                   |
|o10 : C                                            |
+---------------------------------------------------+

Ways to use this method:
========================

  * NCPolynomialRing / NCIdeal -- Construct
    a NCQuotientRing

NCQuotientRing -- Type of a noncommutative ring
***********************************************

Description
===========

This is the type of a quotient of a tensor algebra by a two-sided ideal.

At this point, one cannot define quotients of quotients.

Methods that use an object of class NCQuotientRing :
====================================================

  * ambient(NCQuotientRing) -- Ambient ring
    of an NCQuotientRing
  * "hilbertBergman(NCQuotientRing)" -- see hilbertBergman,
    -- Calls Bergman to compute the Hilbert series of an
    NCQuotientRing
  * "homogDual(NCQuotientRing)" -- see homogDual, -- Computes
    the dual of a pure homogeneous ideal
  * ideal(NCQuotientRing) -- Defining ideal
    of an NCQuotientRing in its ambient ring
  * "normalElements(NCQuotientRing,ZZ,Symbol,Symbol)" -- see
    normalElements, -- Finds normal elements
  * "quadraticClosure(NCQuotientRing)" -- see quadraticClosure,
    -- Creates the subideal generated by quadratic elements
    of a given ideal

For the programmer
==================

The object NCQuotientRing, is a type (Macaulay2Doc),
with ancestor classes NCRing, < Ring (Macaulay2Doc)
< Type (Macaulay2Doc) < MutableHashTable (Macaulay2Doc)
< HashTable (Macaulay2Doc) <
Thing (Macaulay2Doc).

NCRightIdeal -- Type of a right ideal in a noncommutative ring
**************************************************************

Description
===========

This defines a right ideal in a noncommutative ring.  Not much can be done with
these objects at this point (as one can tell by the dearth of operations that
take an NCRightIdeal as input), , but eventually it will be a 'fully featured'
object.

Methods that use an object of class NCRightIdeal :
==================================================

  * basis(ZZ,NCRightIdeal) -- Returns a
    basis of an NCRightIdeal in a particular degree.
  * generators(NCRightIdeal) -- Returns
    the generators of an NCRightIdeal
  * "isHomogeneous(NCRightIdeal)" -- see isHomogeneous(NCIdeal),
    -- Determines whether the input defines a
    homogeneous object
  * NCRightIdeal + NCRightIdeal -- Sum of
    NCRightIdeals
  * ring(NCRightIdeal) -- Returns the ring of an
    NCRightIdeal

For the programmer
==================

The object NCRightIdeal, is a type (Macaulay2Doc),
with ancestor classes HashTable (Macaulay2Doc),
< Thing (Macaulay2Doc).

ncRightIdeal -- Define a right ideal in a noncommutative ring
*************************************************************

Synopsis
========

  * Usage:
        I = ncRightIdeal fs
  * Inputs:
      * fs, an instance of the type NCRingElement, or a
        List (Macaulay2Doc), of NCRingElements
  * Outputs:
      * I, an instance of the type NCRightIdeal,

Description
===========

This defines a right ideal in a noncommutative ring.  Not much can be done with
these objects at this point (as one can tell by the dearth of operations that
take an NCRightIdeal as input), but eventually it will be a 'fully featured'
object.

+-----------------------------------------------+
|i1 : A = QQ{x,y,z}                             |
|                                               |
|o1 = A                                         |
|                                               |
|o1 : NCPolynomialRing                          |
+-----------------------------------------------+
|i2 : p = y*z + z*y - x^2                       |
|                                               |
|            2                                  |
|o2 = zy+yz-x                                   |
|                                               |
|o2 : A                                         |
+-----------------------------------------------+
|i3 : q = x*z + z*x - y^2                       |
|                                               |
|         2                                     |
|o3 = zx-y +xz                                  |
|                                               |
|o3 : A                                         |
+-----------------------------------------------+
|i4 : r = z^2 - x*y - y*x                       |
|                                               |
|      2                                        |
|o4 = z -yx-xy                                  |
|                                               |
|o4 : A                                         |
+-----------------------------------------------+
|i5 : I = ncRightIdeal{p,q,r}                   |
|                                               |
|                         2      2      2       |
|o5 = Right ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                               |
|o5 : NCRightIdeal                              |
+-----------------------------------------------+

Ways to use ncRightIdeal :
==========================

  * "ncRightIdeal(List)"
  * "ncRightIdeal(NCRingElement)"

For the programmer
==================

The object ncRightIdeal, is a method function (Macaulay2Doc).

NCRightIdeal + NCRightIdeal -- Sum of NCRightIdeals
***************************************************

Synopsis
========

  * Operator: + (Macaulay2Doc),
  * Usage:
        K = I + J
  * Inputs:
      * I, an instance of the type NCRightIdeal,
      * J, an instance of the type NCRightIdeal,
  * Outputs:
      * K, an instance of the type NCRightIdeal,

Description
===========

This command sums two NCRightIdeals.

+-----------------------------------------------+
|i1 : A = QQ{x,y,z}                             |
|                                               |
|o1 = A                                         |
|                                               |
|o1 : NCPolynomialRing                          |
+-----------------------------------------------+
|i2 : p = y*z + z*y - x^2                       |
|                                               |
|            2                                  |
|o2 = zy+yz-x                                   |
|                                               |
|o2 : A                                         |
+-----------------------------------------------+
|i3 : q = x*z + z*x - y^2                       |
|                                               |
|         2                                     |
|o3 = zx-y +xz                                  |
|                                               |
|o3 : A                                         |
+-----------------------------------------------+
|i4 : r = z^2 - x*y - y*x                       |
|                                               |
|      2                                        |
|o4 = z -yx-xy                                  |
|                                               |
|o4 : A                                         |
+-----------------------------------------------+
|i5 : I = ncRightIdeal{p,q}                     |
|                                               |
|                         2      2              |
|o5 = Right ideal {zy+yz-x , zx-y +xz}          |
|                                               |
|o5 : NCRightIdeal                              |
+-----------------------------------------------+
|i6 : J = ncRightIdeal r                        |
|                                               |
|                   2                           |
|o6 = Right ideal {z -yx-xy}                    |
|                                               |
|o6 : NCRightIdeal                              |
+-----------------------------------------------+
|i7 : I + J                                     |
|                                               |
|                         2      2      2       |
|o7 = Right ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                               |
|o7 : NCRightIdeal                              |
+-----------------------------------------------+

Ways to use this method:
========================

  * NCRightIdeal + NCRightIdeal -- Sum of
    NCRightIdeals

NCRing -- Type of a noncommutative ring
***************************************

Description
===========

All noncommutative rings have this as an ancestor type.  It is the parent of
the types NCPolynomialRing, and NCQuotientRing.

In addition to defining a ring as a quotient of a NCPolynomialRing,
some common ways to create NCRings include
skewPolynomialRing, endomorphismRing,
and oreExtension.

Let's consider a three dimensional Sklyanin algebra.  We first define the
tensor algebra:

+---------------------+
|i1 : A = QQ{x,y,z}   |
|                     |
|o1 = A               |
|                     |
|o1 : NCPolynomialRing|
+---------------------+

Then input the defining relations, and put them in an ideal:

+---------------------------------------------------+
|i2 : f = y*z + z*y - x^2                           |
|                                                   |
|            2                                      |
|o2 = zy+yz-x                                       |
|                                                   |
|o2 : A                                             |
+---------------------------------------------------+
|i3 : g = x*z + z*x - y^2                           |
|                                                   |
|         2                                         |
|o3 = zx-y +xz                                      |
|                                                   |
|o3 : A                                             |
+---------------------------------------------------+
|i4 : h = z^2 - x*y - y*x                           |
|                                                   |
|      2                                            |
|o4 = z -yx-xy                                      |
|                                                   |
|o4 : A                                             |
+---------------------------------------------------+
|i5 : I=ncIdeal{f,g,h}                              |
|                                                   |
|                             2      2      2       |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                                   |
|o5 : NCIdeal                                       |
+---------------------------------------------------+

Next, define the quotient ring (as well as try a few functions on this new
ring).  Note that when the quotient ring is defined, a call is made to Bergman
to compute the Groebner basis of I (out to a certain degree, should the
Groebner basis be infinite).

+---------------------------------------+
|i6 : B=A/I                             |
|--Calling Bergman for NCGB calculation.|
|Complete!                              |
|                                       |
|o6 = B                                 |
|                                       |
|o6 : NCQuotientRing                    |
+---------------------------------------+
|i7 : generators B                      |
|                                       |
|o7 = {x, y, z}                         |
|                                       |
|o7 : List                              |
+---------------------------------------+
|i8 : numgens B                         |
|                                       |
|o8 = 3                                 |
+---------------------------------------+
|i9 : isCommutative B                   |
|                                       |
|o9 = false                             |
+---------------------------------------+
|i10 : coefficientRing B                |
|                                       |
|o10 = QQ                               |
|                                       |
|o10 : Ring                             |
+---------------------------------------+

As we can see, x is an element of B.

+-------+
|i11 : x|
|       |
|o11 = x|
|       |
|o11 : B|
+-------+

If we define a new ring containing x, x is now part of that new ring

+--------------------------------------------------+
|i12 : C = skewPolynomialRing(QQ,(-1)_QQ,{x,y,z,w})|
|--Calling Bergman for NCGB calculation.           |
|Complete!                                         |
|                                                  |
|o12 = C                                           |
|                                                  |
|o12 : NCQuotientRing                              |
+--------------------------------------------------+
|i13 : x                                           |
|                                                  |
|o13 = x                                           |
|                                                  |
|o13 : C                                           |
+--------------------------------------------------+

We can 'go back' to B using the command use(NCRing).

+--------------------+
|i14 : use B         |
|                    |
|o14 = B             |
|                    |
|o14 : NCQuotientRing|
+--------------------+
|i15 : x             |
|                    |
|o15 = x             |
|                    |
|o15 : B             |
+--------------------+
|i16 : use C         |
|                    |
|o16 = C             |
|                    |
|o16 : NCQuotientRing|
+--------------------+

We can also create an Ore extension.  First define a NCRingMap,
with ncMap.

+----------------------------------+
|i17 : sigma = ncMap(C,C,{y,z,w,x})|
|                                  |
|o17 = NCRingMap C <--- C          |
|                                  |
|o17 : NCRingMap                   |
+----------------------------------+

Then call the command oreExtension.

+---------------------------------------+
|i18 : D = oreExtension(C,sigma,a)      |
|--Calling Bergman for NCGB calculation.|
|Complete!                              |
|                                       |
|o18 = D                                |
|                                       |
|o18 : NCQuotientRing                   |
+---------------------------------------+
|i19 : generators D                     |
|                                       |
|o19 = {x, y, z, w, a}                  |
|                                       |
|o19 : List                             |
+---------------------------------------+
|i20 : numgens D                        |
|                                       |
|o20 = 5                                |
+---------------------------------------+

See also
========

  * Basic operations on noncommutative algebras

Types of NCRing :
=================

  * NCPolynomialRing -- Type of a noncommutative
    polynomial ring
  * NCQuotientRing -- Type of a noncommutative ring

Functions and methods returning an object of class NCRing :
===========================================================

  * ring(NCIdeal) -- Returns the ring of an NCIdeal
    or NCGroebnerBasis
  * ring(NCLeftIdeal) -- Returns the ring of an
    NCLeftIdeal
  * ring(NCMatrix) -- Gives the ring of the NCMatrix
  * ring(NCRightIdeal) -- Returns the ring of an
    NCRightIdeal
  * ring(NCRingElement) -- Returns the NCRing
    of an NCRingElement

Methods that use an object of class NCRing :
============================================

  * basis(ZZ,NCRing) -- Returns a basis of an
    NCRing in a particular degree.
  * "centralElements(NCRing,ZZ)" -- see centralElements,
    -- Finds central elements in a given degree
  * coefficientRing(NCRing) -- Returns the
    base ring of an NCRing
  * "envelopingAlgebra(NCRing,Symbol)" -- see envelopingAlgebra,
    -- Create the enveloping algebra
  * "freeProduct(NCRing,NCRing)" -- see freeProduct, --
    Define the free product of two algebras
  * generators(NCRing) -- The list of algebra
    generators of an NCRing
  * hilbertSeries(NCRing) -- Computes the
    Hilbert series of an NCRing
  * isCommutative(NCRing) -- Returns whether
    an NCRing is commutative
  * "isExterior(NCRing)" -- see isCommutative(NCRing),
    -- Returns whether an NCRing is commutative
  * "isHomogeneous(NCRing)" -- see isHomogeneous(NCIdeal),
    -- Determines whether the input defines a
    homogeneous object
  * "ncMap(NCRing,NCRing,List)" -- see ncMap, -- Make a map to or
    from an NCRing
  * "ncMap(NCRing,Ring,List)" -- see ncMap, -- Make a map to or
    from an NCRing
  * "ncMap(Ring,NCRing,List)" -- see ncMap, -- Make a map to or
    from an NCRing
  * "ncMatrix(NCRing,List,List)" -- see ncMatrix, -- Create an
    NCMatrix
  * numgens(NCRing) -- The number of algebra
    generators of an NCRing
  * "oppositeRing(NCRing)" -- see oppositeRing, -- Creates
    the opposite ring of a noncommutative ring
  * "oreExtension(NCRing,NCRingMap,NCRingElement)" -- see oreExtension,
    -- Creates an Ore extension of a noncommutative ring
  * "oreExtension(NCRing,NCRingMap,NCRingMap,NCRingElement)" -- see
    oreExtension, -- Creates an Ore extension of a noncommutative
    ring
  * "oreExtension(NCRing,NCRingMap,NCRingMap,Symbol)" -- see
    oreExtension, -- Creates an Ore extension of a noncommutative
    ring
  * "oreExtension(NCRing,NCRingMap,Symbol)" -- see oreExtension,
    -- Creates an Ore extension of a noncommutative ring
  * "oreIdeal(NCRing,NCRingMap,NCRingElement)" -- see oreIdeal,
    -- Creates the defining ideal of an Ore extension of a noncommutative ring
  * "oreIdeal(NCRing,NCRingMap,NCRingMap,NCRingElement)" -- see oreIdeal,
    -- Creates the defining ideal of an Ore extension of a
    noncommutative ring
  * "oreIdeal(NCRing,NCRingMap,NCRingMap,Symbol)" -- see oreIdeal,
    -- Creates the defining ideal of an Ore extension of a
    noncommutative ring
  * "oreIdeal(NCRing,NCRingMap,Symbol)" -- see oreIdeal, --
    Creates the defining ideal of an Ore extension of a noncommutative ring
  * "NCRing ** NCRing" -- see qTensorProduct, -- Define
    the (q-)commuting tensor product
  * "qTensorProduct(NCRing,NCRing,QQ)" -- see qTensorProduct,
    -- Define the (q-)commuting tensor product
  * "qTensorProduct(NCRing,NCRing,RingElement)" -- see qTensorProduct,
    -- Define the (q-)commuting tensor product
  * "qTensorProduct(NCRing,NCRing,ZZ)" -- see qTensorProduct,
    -- Define the (q-)commuting tensor product
  * "setWeights(NCRing,List)" -- see setWeights, -- Set a
    nonstandard grading for a NCRing.
  * "toM2Ring(NCRing)" -- see toM2Ring, -- Compute the
    abelianization of an NCRing and returns a Ring.
  * use(NCRing) -- Brings the variables of a particular
    NCRing in scope

For the programmer
==================

The object NCRing, is a type (Macaulay2Doc), with
ancestor classes Ring (Macaulay2Doc), < Type (Macaulay2Doc)
< MutableHashTable (Macaulay2Doc) <
HashTable (Macaulay2Doc) < Thing (Macaulay2Doc).

NCRingElement -- Type of an element in a noncommutative ring
************************************************************

Description
===========

This is the type of an element in a noncommutative graded ring.  One can deal
with these elements in much the same way as in the commutative case.  See
RingElement (Macaulay2Doc), for details.

Methods that use an object of class NCRingElement :
===================================================

  * baseName(NCRingElement) -- Returns the
    base name of a generator of an NCRing
  * "coordinates(NCRingElement)" -- see coordinates, --
    Computes coordinates relative to a given basis
  * degree(NCRingElement) -- Returns the
    degree of an NCRingElement
  * "isCentral(NCRingElement)" -- see isCentral, -- Determines
    if an element is central
  * "isCentral(NCRingElement,NCGroebnerBasis)" -- see isCentral,
    -- Determines if an element is central
  * isConstant(NCRingElement) -- Returns
    whether the NCRingElement is constant
  * "isHomogeneous(NCRingElement)" -- see isHomogeneous(NCIdeal),
    -- Determines whether the input defines a
    homogeneous object
  * "isLeftRegular(NCRingElement,ZZ)" -- see isLeftRegular,
    -- Determines if a given (homogeneous) element is regular in
    a given degree
  * "isRightRegular(NCRingElement,ZZ)" -- see isLeftRegular,
    -- Determines if a given (homogeneous) element is regular in
    a given degree
  * isNormal(NCRingElement) -- Determines
    if a given NCRingElement is normal
  * leadCoefficient(NCRingElement),
    -- Returns the lead monomial of an NCRingElement
  * leadMonomial(NCRingElement), --
    Returns the lead monomial of an NCRingElement
  * leadTerm(NCRingElement) -- Returns the
    lead term of an NCRingElement
  * "leftMultiplicationMap(NCRingElement,List,List)" -- see
    leftMultiplicationMap, -- Computes a matrix for left
    or right multiplication by a homogeneous element
  * "leftMultiplicationMap(NCRingElement,ZZ)" -- see
    leftMultiplicationMap, -- Computes a matrix for left
    or right multiplication by a homogeneous element
  * "leftMultiplicationMap(NCRingElement,ZZ,ZZ)" -- see
    leftMultiplicationMap, -- Computes a matrix for left
    or right multiplication by a homogeneous element
  * "rightMultiplicationMap(NCRingElement,List,List)" -- see
    leftMultiplicationMap, -- Computes a matrix for left
    or right multiplication by a homogeneous element
  * "rightMultiplicationMap(NCRingElement,ZZ)" -- see
    leftMultiplicationMap, -- Computes a matrix for left
    or right multiplication by a homogeneous element
  * "rightMultiplicationMap(NCRingElement,ZZ,ZZ)" -- see
    leftMultiplicationMap, -- Computes a matrix for left
    or right multiplication by a homogeneous element
  * List * NCRingElement -- Scales a list by an
    NCRingElement on the right
  * monomials(NCRingElement) -- Returns
    the monomials appearing in the NCRingElement
  * "ncIdeal(NCRingElement)" -- see ncIdeal, -- Define a
    two-sided ideal in a noncommutative ring
  * "ncLeftIdeal(NCRingElement)" -- see ncLeftIdeal, --
    Define a left ideal in a noncommutative ring
  * NCMatrix * NCRingElement -- Product of
    NCMatrices
  * "ncRightIdeal(NCRingElement)" -- see ncRightIdeal, --
    Define a right ideal in a noncommutative ring
  * NCRingElement % NCGroebnerBasis, --
    Reduces a NCRingElement by a NCGroebnerBasis
  * NCRingElement * List -- Scales a list by an
    NCRingElement on the left
  * NCRingElement * NCMatrix -- Product of
    NCMatrices
  * NCRingMap NCRingElement -- Apply an
    NCRingMap to an element or matrix
  * "normalAutomorphism(NCRingElement)" -- see normalAutomorphism,
    -- Computes the automorphism determined by a normal
    homogeneous element
  * "normalFormBergman(NCRingElement,NCGroebnerBasis)" -- see
    normalFormBergman, -- Calls Bergman for a normal form
    calculation
  * "oreExtension(NCRing,NCRingMap,NCRingElement)" -- see oreExtension,
    -- Creates an Ore extension of a noncommutative ring
  * "oreExtension(NCRing,NCRingMap,NCRingMap,NCRingElement)" -- see
    oreExtension, -- Creates an Ore extension of a noncommutative
    ring
  * "oreIdeal(NCRing,NCRingMap,NCRingElement)" -- see oreIdeal,
    -- Creates the defining ideal of an Ore extension of a noncommutative ring
  * "oreIdeal(NCRing,NCRingMap,NCRingMap,NCRingElement)" -- see oreIdeal,
    -- Creates the defining ideal of an Ore extension of a
    noncommutative ring
  * ring(NCRingElement) -- Returns the NCRing
    of an NCRingElement
  * size(NCRingElement) -- Returns the number
    of terms of an NCRingElement
  * "sparseCoeffs(NCRingElement)" -- see sparseCoeffs, --
    Converts ring elements into vectors over the coefficient ring
  * support(NCRingElement) -- Returns the
    variables appearing in the NCRingElement
  * terms(NCRingElement) -- Returns the terms
    of an NCRingElement
  * toString(NCRingElement) -- Converts an
    NCRingElement to a string

For the programmer
==================

The object NCRingElement, is a type (Macaulay2Doc),
with ancestor classes HashTable (Macaulay2Doc),
< Thing (Macaulay2Doc).

NCRingElement % NCGroebnerBasis -- Reduces a NCRingElement by a NCGroebnerBasis
*******************************************************************************

Synopsis
========

  * Operator: % (Macaulay2Doc),
  * Usage:
        fred = f % Igb
  * Inputs:
      * f, an instance of the type NCRingElement, or an
        integer, or a rational number
      * Igb, an instance of the type NCGroebnerBasis,
  * Outputs:
      * fred, an instance of the type NCRingElement,

Description
===========

This command reduces the input modulo a noncommutative Groebner basis. It will
either reduce it using top-level Macaulay code, or via a call to Bergman,
depending on the size and degree of the input element.

+---------------------------------------------------+
|i1 : A = QQ{x,y,z}                                 |
|                                                   |
|o1 = A                                             |
|                                                   |
|o1 : NCPolynomialRing                              |
+---------------------------------------------------+
|i2 : p = y*z + z*y - x^2                           |
|                                                   |
|            2                                      |
|o2 = zy+yz-x                                       |
|                                                   |
|o2 : A                                             |
+---------------------------------------------------+
|i3 : q = x*z + z*x - y^2                           |
|                                                   |
|         2                                         |
|o3 = zx-y +xz                                      |
|                                                   |
|o3 : A                                             |
+---------------------------------------------------+
|i4 : r = z^2 - x*y - y*x                           |
|                                                   |
|      2                                            |
|o4 = z -yx-xy                                      |
|                                                   |
|o4 : A                                             |
+---------------------------------------------------+
|i5 : I = ncIdeal {p,q,r}                           |
|                                                   |
|                             2      2      2       |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                                   |
|o5 : NCIdeal                                       |
+---------------------------------------------------+
|i6 : Igb = ncGroebnerBasis I                       |
|--Calling Bergman for NCGB calculation.            |
|Complete!                                          |
|                                                   |
|      2    2                2                      |
|o6 = y x-xy ; Lead Term = (y x, 1)                 |
|       2  2                  2                     |
|     yx -x y; Lead Term = (yx , 1)                 |
|         2                                         |
|     zx-y +xz; Lead Term = (zx, 1)                 |
|            2                                      |
|     zy+yz-x ; Lead Term = (zy, 1)                 |
|      2                      2                     |
|     z -yx-xy; Lead Term = (z , 1)                 |
|                                                   |
|o6 : NCGroebnerBasis                               |
+---------------------------------------------------+
|i7 : z^6 % Igb                                     |
|                                                   |
|                     2   2   3 3                   |
|o7 = yxyxyx+xyxyxy+3x yxy +3x y                    |
|                                                   |
|o7 : A                                             |
+---------------------------------------------------+

Ways to use this method:
========================

  * NCRingElement % NCGroebnerBasis, --
    Reduces a NCRingElement by a NCGroebnerBasis
  * "QQ % NCGroebnerBasis"
  * "ZZ % NCGroebnerBasis"

NCRingElement * List -- Scales a list by an NCRingElement on the left
*********************************************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        fxs = f*xs
  * Inputs:
      * f, an instance of the type NCRingElement,
      * xs, a list (Macaulay2Doc),
  * Outputs:
      * xsf, a list (Macaulay2Doc),

Description
===========

Scales a list by an NCRingElement on the right.

+-----------------------------------------------------------------------------+
|i1 : A = QQ{x,y}                                                             |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : f = x^2+y^2                                                             |
|                                                                             |
|      2  2                                                                   |
|o2 = y +x                                                                    |
|                                                                             |
|o2 : A                                                                       |
+-----------------------------------------------------------------------------+
|i3 : bas = flatten entries basis(3,A)                                        |
|                                                                             |
|       3    2        2    2          2   3                                   |
|o3 = {x , yx , xyx, y x, x y, yxy, xy , y }                                  |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : f*bas                                                                   |
|                                                                             |
|       2 3  5   3 2  2  2   2     3     4   2 2    2 2   4    3    2         |
|o4 = {y x +x , y x +x yx , y xyx+x yx, y x+x y x, y x y+x y, y xy+x yxy,     |
|     ------------------------------------------------------------------------|
|      2  2  3 2   5  2 3                                                     |
|     y xy +x y , y +x y }                                                    |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * NCRingElement * List -- Scales a list by an
    NCRingElement on the left

NCRingElement * NCMatrix -- Product of NCMatrices
*************************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        L = f*M
  * Inputs:
      * f, an instance of the type NCRingElement,
      * M, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command allows for the scalar multiplication of an NCMatrix by an
NCRingElement on the left.

+--------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})    |
|--Calling Bergman for NCGB calculation.           |
|Complete!                                         |
|                                                  |
|o1 = B                                            |
|                                                  |
|o1 : NCQuotientRing                               |
+--------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                     |
|                                                  |
|o2 = | x y z |                                    |
|                                                  |
|o2 : NCMatrix                                     |
+--------------------------------------------------+
|i3 : sigma = ncMap(B,B,{y,z,x})                   |
|                                                  |
|o3 = NCRingMap B <--- B                           |
|                                                  |
|o3 : NCRingMap                                    |
+--------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}|
|                                                  |
|o4 = | x y z |                                    |
|     | y z x |                                    |
|     | z x y |                                    |
|                                                  |
|o4 : NCMatrix                                     |
+--------------------------------------------------+
|i5 : x^2*N                                        |
|                                                  |
|o5 = | x^3   x^2*y x^2*z |                        |
|     | x^2*y x^2*z x^3   |                        |
|     | x^2*z x^3   x^2*y |                        |
|                                                  |
|o5 : NCMatrix                                     |
+--------------------------------------------------+

Ways to use this method:
========================

  * NCRingElement * NCMatrix -- Product of
    NCMatrices

NCRingMap -- Type of a map to or from a noncommutative ring.
************************************************************

Description
===========

As in the commutative case, a map F:R->S where R or S is an NCRing is specified
by giving the images in S of the variables of R. The target map is given first.

Common ways to make (and use) an NCRingMap include

  * ncMap(Ring,NCRing,List) -- Make a map to or from an NCRing
  * ncMap(NCRing,Ring,List) -- Make a map to or from an NCRing
  * ncMap(NCRing,NCRing,List) -- Make a map to or from an NCRing
  * normalElements(NCRingMap,ZZ), --
    Finds elements normalized by a ring map
  * oreExtension(NCRing,NCRingMap,NCRingMap,NCRingElement),
    -- Creates an Ore extension of a noncommutative ring
  * oreExtension(NCRing,NCRingMap,NCRingMap,Symbol), --
    Creates an Ore extension of a noncommutative ring
  * oreExtension(NCRing,NCRingMap,NCRingElement), --
    Creates an Ore extension of a noncommutative ring
  * oreExtension(NCRing,NCRingMap,Symbol) -- Creates an
    Ore extension of a noncommutative ring
  * oreIdeal(NCRing,NCRingMap,NCRingMap,NCRingElement), --
    Creates the defining ideal of an Ore extension of a noncommutative ring
  * oreIdeal(NCRing,NCRingMap,NCRingMap,Symbol) -- Creates the
    defining ideal of an Ore extension of a noncommutative ring
  * oreIdeal(NCRing,NCRingMap,NCRingElement) -- Creates the
    defining ideal of an Ore extension of a noncommutative ring
  * oreIdeal(NCRing,NCRingMap,Symbol) -- Creates the defining
    ideal of an Ore extension of a noncommutative ring

Common ways to get information about NCRingMaps Code UL {TO (source,NCRingMap),
TO (target,NCRingMap), TO (matrix,NCRingMap), TO (isWellDefined,NCRingMap), TO
(isHomogeneous,NCRingMap), TO (symbol _, NCRingMap, ZZ)} Text Common operations
involving NCRingMaps Code UL {TO (ambient,NCRingMap), TO (symbol
/,List,NCRingMap), TO (symbol SPACE, NCRingMap, NCRingElement), TO (symbol
SPACE, NCRingMap, RingElement), TO (symbol SPACE, NCRingMap, NCMatrix), }

+-------------------------------------------------+
|i1 : A = skewPolynomialRing(QQ,(-1)_QQ,{w,x,y,z})|
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|                                                 |
|o1 = A                                           |
|                                                 |
|o1 : NCQuotientRing                              |
+-------------------------------------------------+
|i2 : B = QQ{a,b,c}                               |
|                                                 |
|o2 = B                                           |
|                                                 |
|o2 : NCPolynomialRing                            |
+-------------------------------------------------+
|i3 : f = ncMap(B,A,{a^3,b^2,a+b,a-b})            |
|                                                 |
|o3 = NCRingMap B <--- A                          |
|                                                 |
|o3 : NCRingMap                                   |
+-------------------------------------------------+
|i4 : target f                                    |
|                                                 |
|o4 = B                                           |
|                                                 |
|o4 : NCPolynomialRing                            |
+-------------------------------------------------+
|i5 : source f                                    |
|                                                 |
|o5 = A                                           |
|                                                 |
|o5 : NCQuotientRing                              |
+-------------------------------------------------+
|i6 : matrix f                                    |
|                                                 |
|o6 = | a^3 b^2 b+a -b+a |                        |
|                                                 |
|o6 : NCMatrix                                    |
+-------------------------------------------------+

Note that NCRingMaps need not be well-defined or homogeneous. Apply a function
to an element or a matrix using the usual function notation. NCRingMaps are
linear and multiplicative by definition.

+--------------------+
|i7 : f(w*x+2*y)     |
|                    |
|         3 2        |
|o7 = 2b+a b +2a     |
|                    |
|o7 : B              |
+--------------------+
|i8 : isWellDefined f|
|                    |
|o8 = false          |
+--------------------+
|i9 : isHomogeneous f|
|                    |
|o9 = false          |
+--------------------+

The user has the option to define an NCRingMap to be a derivation. Of course,
such a map must have the same source and target.

+-----------------------------------------------------+
|i10 : g = ncMap(B,B,{a*b,b^2,c*a*c},Derivation=>true)|
|                                                     |
|o10 = NCRingMap B <--- B                             |
|                                                     |
|o10 : NCRingMap                                      |
+-----------------------------------------------------+
|i11 : g(a*b)==g(a)*b+a*g(b)                          |
|                                                     |
|o11 = true                                           |
+-----------------------------------------------------+
|i12 : g(promote(1,B))                                |
|                                                     |
|o12 = 0                                              |
|                                                     |
|o12 : B                                              |
+-----------------------------------------------------+
|i13 : g(c*a+2*b)                                     |
|                                                     |
|                 2                                   |
|o13 = caca+cab+2b                                    |
|                                                     |
|o13 : B                                              |
+-----------------------------------------------------+

Methods that use an object of class NCRingMap :
===============================================

  * ambient(NCRingMap) -- Extends an NCRingMap
    to the ambient ring of the source.
  * "gddKernel(ZZ,NCRingMap)" -- see gddKernel, -- Computes a
    homogeneous generating set of the kernel of a ring map.
  * isHomogeneous(NCRingMap) -- Determines
    if an NCRingMap preserves the natural grading
  * isWellDefined(NCRingMap) -- Determines
    if an NCRingMap is well-defined.
  * "kernelComponent(ZZ,NCRingMap)" -- see kernelComponent,
    -- Computes a basis of the kernel of a ring map in a
    specified degree.
  * List / NCRingMap -- Applies an NCRingMap to each
    element of a list
  * matrix(NCRingMap) -- An NCMatrix associated
    to an NCRingMap.
  * NCRingMap + NCRingMap -- Basic operations
    with NCRingMaps
  * "NCRingMap ^ ZZ" -- see NCRingMap + NCRingMap,
    -- Basic operations with NCRingMaps
  * "QQ * NCRingMap" -- see NCRingMap + NCRingMap,
    -- Basic operations with NCRingMaps
  * "RingElement * NCRingMap" -- see NCRingMap + NCRingMap,
    -- Basic operations with NCRingMaps
  * "ZZ * NCRingMap" -- see NCRingMap + NCRingMap,
    -- Basic operations with NCRingMaps
  * NCRingMap @@ NCRingMap -- Compose two
    NCRingMaps
  * NCRingMap _ ZZ -- Matrix of one homogeneous
    component of an NCRingMap
  * "NCRingMap NCGroebnerBasis" -- see NCRingMap NCIdeal,
    -- Apply a ring map to the generators of an ideal
  * NCRingMap NCIdeal -- Apply a ring map to the
    generators of an ideal
  * "NCRingMap NCMatrix" -- see NCRingMap NCRingElement,
    -- Apply an NCRingMap to an element or matrix
  * NCRingMap NCRingElement -- Apply an
    NCRingMap to an element or matrix
  * "NCRingMap RingElement" -- see NCRingMap NCRingElement,
    -- Apply an NCRingMap to an element or matrix
  * normalElements(NCRingMap,ZZ), --
    Finds elements normalized by a ring map
  * "oreExtension(NCRing,NCRingMap,NCRingElement)" -- see oreExtension,
    -- Creates an Ore extension of a noncommutative ring
  * "oreExtension(NCRing,NCRingMap,NCRingMap,NCRingElement)" -- see
    oreExtension, -- Creates an Ore extension of a noncommutative
    ring
  * "oreExtension(NCRing,NCRingMap,NCRingMap,Symbol)" -- see
    oreExtension, -- Creates an Ore extension of a noncommutative
    ring
  * "oreExtension(NCRing,NCRingMap,Symbol)" -- see oreExtension,
    -- Creates an Ore extension of a noncommutative ring
  * "oreIdeal(NCRing,NCRingMap,NCRingElement)" -- see oreIdeal,
    -- Creates the defining ideal of an Ore extension of a noncommutative ring
  * "oreIdeal(NCRing,NCRingMap,NCRingMap,NCRingElement)" -- see oreIdeal,
    -- Creates the defining ideal of an Ore extension of a
    noncommutative ring
  * "oreIdeal(NCRing,NCRingMap,NCRingMap,Symbol)" -- see oreIdeal,
    -- Creates the defining ideal of an Ore extension of a
    noncommutative ring
  * "oreIdeal(NCRing,NCRingMap,Symbol)" -- see oreIdeal, --
    Creates the defining ideal of an Ore extension of a noncommutative ring
  * source(NCRingMap) -- Source of a map
  * target(NCRingMap) -- Target of a map

For the programmer
==================

The object NCRingMap, is a type (Macaulay2Doc),
with ancestor classes HashTable (Macaulay2Doc), < Thing (Macaulay2Doc).

NCRingMap + NCRingMap -- Basic operations with NCRingMaps
*********************************************************

Synopsis
========

  * Operator: + (Macaulay2Doc),
  * Usage:
        h = f + g or r*f
  * Inputs:
      * f, an instance of the type NCRingMap,
      * g, an instance of the type NCRingMap,
  * Outputs:
      * h, an instance of the type NCRingMap,

Description
===========

Defines the sum of NCRingMaps.  Though a linear combination of ring maps is not
a ring map in general, this routine is useful in constructing ring maps
programmatically.  The sum is defined only on generators of the common source
of f and g, while for higher degree monomials m, one no longer has f(m) + g(m)
= h(m) (so it is only the sum on words of length 1).

+--------------------------------+
|i1 : A = QQ{x,y}                |
|                                |
|o1 = A                          |
|                                |
|o1 : NCPolynomialRing           |
+--------------------------------+
|i2 : f = ncMap(A,A,{x,y})       |
|                                |
|o2 = NCRingMap A <--- A         |
|                                |
|o2 : NCRingMap                  |
+--------------------------------+
|i3 : g = ncMap(A,A,{y,x})       |
|                                |
|o3 = NCRingMap A <--- A         |
|                                |
|o3 : NCRingMap                  |
+--------------------------------+
|i4 : h = 3*f + 4*g              |
|                                |
|o4 = NCRingMap A <--- A         |
|                                |
|o4 : NCRingMap                  |
+--------------------------------+
|i5 : matrix h                   |
|                                |
|o5 = | 4*y+3*x 3*y+4*x |        |
|                                |
|o5 : NCMatrix                   |
+--------------------------------+
|i6 : k = h^3                    |
|                                |
|o6 = NCRingMap A <--- A         |
|                                |
|o6 : NCRingMap                  |
+--------------------------------+
|i7 : matrix k                   |
|                                |
|o7 = | 172*y+171*x 171*y+172*x ||
|                                |
|o7 : NCMatrix                   |
+--------------------------------+

Ways to use this method:
========================

  * NCRingMap + NCRingMap -- Basic operations
    with NCRingMaps

NCRingMap @@ NCRingMap -- Compose two NCRingMaps
************************************************

Synopsis
========

  * Operator: @@ (Macaulay2Doc),
  * Usage:
        f @@ g
  * Inputs:
      * f, an instance of the type NCRingMap,
      * g, an instance of the type NCRingMap,
  * Outputs:
      * an instance of the type NCRingMap,

Description
===========

+-----------------------------+
|i1 : A = QQ{x,y}             |
|                             |
|o1 = A                       |
|                             |
|o1 : NCPolynomialRing        |
+-----------------------------+
|i2 : f = ncMap(A,A,{x^2,y^2})|
|                             |
|o2 = NCRingMap A <--- A      |
|                             |
|o2 : NCRingMap               |
+-----------------------------+
|i3 : g = ncMap(A,A,{x+y,y})  |
|                             |
|o3 = NCRingMap A <--- A      |
|                             |
|o3 : NCRingMap               |
+-----------------------------+
|i4 : gens A/f @@ g           |
|                             |
|       2  2   2              |
|o4 = {y +x , y }             |
|                             |
|o4 : List                    |
+-----------------------------+
|i5 : gens A/g @@ f           |
|                             |
|       2        2   2        |
|o5 = {y +yx+xy+x , y }       |
|                             |
|o5 : List                    |
+-----------------------------+

Ways to use this method:
========================

  * NCRingMap @@ NCRingMap -- Compose two
    NCRingMaps

NCRingMap _ ZZ -- Matrix of one homogeneous component of an NCRingMap
*********************************************************************

Synopsis
========

  * Operator: _ (Macaulay2Doc),
  * Usage:
        f_n
  * Inputs:
      * f, an instance of the type NCRingMap,
      * n, an integer (Macaulay2Doc),
  * Outputs:
      * a matrix (Macaulay2Doc),

Description
===========

This method returns the homogeneous degree n component of the ring map f. The
output is the matrix (over the coefficient ring of the target) of the component
map relative to the monomial bases for the source and target.

+-------------------------------------------------+
|i1 : A = skewPolynomialRing(QQ,(-1)_QQ,{w,x,y,z})|
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|                                                 |
|o1 = A                                           |
|                                                 |
|o1 : NCQuotientRing                              |
+-------------------------------------------------+
|i2 : setWeights(A,{1,1,2,2})                     |
|                                                 |
|o2 = A                                           |
|                                                 |
|o2 : NCQuotientRing                              |
+-------------------------------------------------+
|i3 : f = ncMap(A,A,{x,w,z,y})                    |
|                                                 |
|o3 = NCRingMap A <--- A                          |
|                                                 |
|o3 : NCRingMap                                   |
+-------------------------------------------------+
|i4 : basis(1,A)                                  |
|                                                 |
|o4 = | w x |                                     |
|                                                 |
|o4 : NCMatrix                                    |
+-------------------------------------------------+
|i5 : f_1                                         |
|                                                 |
|o5 = | 0 1 |                                     |
|     | 1 0 |                                     |
|                                                 |
|              2        2                         |
|o5 : Matrix QQ  <--- QQ                          |
+-------------------------------------------------+
|i6 : basis(2,A)                                  |
|                                                 |
|o6 = | y z w^2 w*x x^2 |                         |
|                                                 |
|o6 : NCMatrix                                    |
+-------------------------------------------------+
|i7 : f_2                                         |
|                                                 |
|o7 = | 0 1 0 0  0 |                              |
|     | 1 0 0 0  0 |                              |
|     | 0 0 0 0  1 |                              |
|     | 0 0 0 -1 0 |                              |
|     | 0 0 1 0  0 |                              |
|                                                 |
|              5        5                         |
|o7 : Matrix QQ  <--- QQ                          |
+-------------------------------------------------+

Ways to use this method:
========================

  * NCRingMap _ ZZ -- Matrix of one homogeneous
    component of an NCRingMap

NCRingMap NCIdeal -- Apply a ring map to the generators of an ideal
*******************************************************************

Synopsis
========

  * Operator: SPACE (Macaulay2Doc),
  * Usage:
        J = f I
  * Inputs:
      * f, an instance of the type NCRingMap,
      * I, an instance of the type NCIdeal, or
        NCGroebnerBasis,
  * Outputs:
      * J, an instance of the type NCIdeal, or
        NCGroebnerBasis,

Description
===========

This function applies the ring map f to the generators of the ideal or
noncommutative Groebner basis that is passed in.

+------------------------------+
|i1 : A = QQ{x,y}              |
|                              |
|o1 = A                        |
|                              |
|o1 : NCPolynomialRing         |
+------------------------------+
|i2 : g = ncMap(A,A,{y,x})     |
|                              |
|o2 = NCRingMap A <--- A       |
|                              |
|o2 : NCRingMap                |
+------------------------------+
|i3 : I = ncIdeal {x^2*y+y*x^2}|
|                              |
|                        2  2  |
|o3 = Two-sided ideal {yx +x y}|
|                              |
|o3 : NCIdeal                  |
+------------------------------+
|i4 : g I                      |
|                              |
|                       2    2 |
|o4 = Two-sided ideal {y x+xy }|
|                              |
|o4 : NCIdeal                  |
+------------------------------+

Ways to use this method:
========================

  * "NCRingMap NCGroebnerBasis"
  * NCRingMap NCIdeal -- Apply a ring map to the
    generators of an ideal

NCRingMap NCRingElement -- Apply an NCRingMap to an element or matrix
*********************************************************************

Synopsis
========

  * Operator: SPACE (Macaulay2Doc),
  * Usage:
        f x
  * Inputs:
      * f, an instance of the type NCRingMap,
      * x, an instance of the type NCRingElement, or a
        RingElement (Macaulay2Doc), or an NCMatrix,
  * Outputs:
      * an instance of the type NCRingElement,

Description
===========

+-----------------------------------------------------------------------------+
|i1 : A = skewPolynomialRing(QQ,(-1)_QQ,{w,x,y,z})                            |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : B = QQ{a,b,c}                                                           |
|                                                                             |
|o2 = B                                                                       |
|                                                                             |
|o2 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i3 : f = ncMap(B,A,{a^3,b^2,a+b,a-b})                                        |
|                                                                             |
|o3 = NCRingMap B <--- A                                                      |
|                                                                             |
|o3 : NCRingMap                                                               |
+-----------------------------------------------------------------------------+
|i4 : f(w*x+2*y)                                                              |
|                                                                             |
|         3 2                                                                 |
|o4 = 2b+a b +2a                                                              |
|                                                                             |
|o4 : B                                                                       |
+-----------------------------------------------------------------------------+
|i5 : f basis(2,A)                                                            |
|                                                                             |
|o5 = | a^6 a^3*b^2 b^4 a^3*b+a^4 b^3+b^2*a b^2+b*a+a*b+a^2 -a^3*b+a^4        |
|                                                                             |
|o5 : NCMatrix                                                                |
|-----------------------------------------------------------------------------|
|-b^3+b^2*a -b^2+b*a-a*b+a^2 b^2-b*a-a*b+a^2 |                                |
+-----------------------------------------------------------------------------+

Ways to use this method:
========================

  * "NCRingMap NCMatrix"
  * NCRingMap NCRingElement -- Apply an
    NCRingMap to an element or matrix
  * "NCRingMap RingElement"

normalAutomorphism -- Computes the automorphism determined by a normal homogeneous element
******************************************************************************************

Synopsis
========

  * Usage:
        normalAutomorphism x
  * Inputs:
      * x, an instance of the type NCRingElement, a
        homogeneous normal element
  * Outputs:
      * an instance of the type NCRingMap,

Description
===========

Let x be a homogeneous element in an NCRing R. If x is normal then x determines
a graded ring automorphism f of R by x*a = f(x)*a. This method returns this
automorphism as an NCRingMap.

+------------------------------------------+
|i1 : A = QQ{a,b,c}                        |
|                                          |
|o1 = A                                    |
|                                          |
|o1 : NCPolynomialRing                     |
+------------------------------------------+
|i2 : I = ncIdeal {a*b+b*a,a*c+c*a,b*c+c*b}|
|                                          |
|o2 = Two-sided ideal {ba+ab, ca+ac, cb+bc}|
|                                          |
|o2 : NCIdeal                              |
+------------------------------------------+
|i3 : B = A/I                              |
|--Calling Bergman for NCGB calculation.   |
|Complete!                                 |
|                                          |
|o3 = B                                    |
|                                          |
|o3 : NCQuotientRing                       |
+------------------------------------------+
|i4 : sigma = ncMap(B,B,{b,c,a})           |
|                                          |
|o4 = NCRingMap B <--- B                   |
|                                          |
|o4 : NCRingMap                            |
+------------------------------------------+
|i5 : isWellDefined sigma                  |
|                                          |
|o5 = true                                 |
+------------------------------------------+
|i6 : C = oreExtension(B,sigma,w)          |
|--Calling Bergman for NCGB calculation.   |
|Complete!                                 |
|                                          |
|o6 = C                                    |
|                                          |
|o6 : NCQuotientRing                       |
+------------------------------------------+
|i7 : isNormal w^2                         |
|                                          |
|o7 = true                                 |
+------------------------------------------+
|i8 : phi = normalAutomorphism w^2         |
|                                          |
|o8 = NCRingMap C <--- C                   |
|                                          |
|o8 : NCRingMap                            |
+------------------------------------------+
|i9 : matrix phi                           |
|                                          |
|o9 = | c a b w |                          |
|                                          |
|o9 : NCMatrix                             |
+------------------------------------------+
|i10 : (matrix sigma @@ sigma)             |
|                                          |
|o10 = | c a b |                           |
|                                          |
|o10 : NCMatrix                            |
+------------------------------------------+

See also
========

  * normalElements -- Finds normal elements

Ways to use normalAutomorphism :
================================

  * "normalAutomorphism(NCRingElement)"

For the programmer
==================

The object normalAutomorphism, is a method function (Macaulay2Doc).

normalElements -- Finds normal elements
***************************************

Synopsis
========

  * Usage:
        normalElements(A,n,x,y)
  * Inputs:
      * A, an instance of the type NCQuotientRing,
      * n, an integer (Macaulay2Doc),
      * x, a symbol (Macaulay2Doc),
      * y, a symbol (Macaulay2Doc),
  * Outputs:
      * a list (Macaulay2Doc),

Description
===========

Let b_1,...,b_n be a monomial basis for an NCRing A in degree d. We assume A is
generated by elements a_1,...,a_k of degree 1. A homogeneous element r in A is
normal if a_i*r is in the span of the r*a_j for all i.

Using the input symbols x and y, we define the "normal variety" to be the set
of common solutions to the equations x_j*a_i*b_j =
y_j1*b_j*a_1+...+y_jk*b_j*a_k for all i and j. Saturating the ideal at each x_i
we extract polynomial equations the x_i must satisfy for the element
x_1*b_1+...+x_n*b_n to be normal in A.

Before computing the normal variety, this method checks for normal monomials in
degree n. These are returned first to reduce the complexity of the problem.
Then the method computes the variety and returns its components. The equations
the method returns are given in terms of the indexed variable x. The indices
are basis monomials in degree n.

The following example is a 3-dimensional Sklyanin algebra.

+-------------------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})               |
|--Calling Bergman for NCGB calculation.                      |
|Complete!                                                    |
|                                                             |
|o1 = B                                                       |
|                                                             |
|o1 : NCQuotientRing                                          |
+-------------------------------------------------------------+
|i2 : basis(2,B)                                              |
|                                                             |
|o2 = | x^2 y*x x*y y^2 x*z y*z |                             |
|                                                             |
|o2 : NCMatrix                                                |
+-------------------------------------------------------------+
|i3 : normalElements(B,2,r,s)                                 |
|Normal monomials of degree 2:                                |
| 2                                                           |
|x                                                            |
| 2                                                           |
|y                                                            |
|Components of the normal variety, excluding normal monomials:|
|                                                             |
|o3 = {| r_(y*z) r_(x*z) r_(y*x)-r_(x*y) |}                   |
|                                                             |
|o3 : List                                                    |
+-------------------------------------------------------------+

The normal elements in degree 2 are x^2, y^2 and z^2. The basis calculation
shows x^2 and y^2 are normal forms in B. The normalElements method first checks
all basis monomials using isNormal (IntegralClosure). In this
case it finds x^2 and y^2 are normal and returns this information. However, z^2
is not a normal form expression. The normal form of z^2 is x*y+y*x. In the
second phase of the calculation, the method returns generators of the ideal
describing the normal elements (excluding the normal monomials). We see the
coefficients of basis monomials y*z and x*z must be 0 and the coefficients of
x*y and y*x must be equal. The last equation identifies z^2 = x*y+y*x as a
normal element of degree 2.

+-----------------------------------------------------------------------------+
|i4 : normalElements(B,3,t,u)                                                 |
|Normal monomials of degree 3:                                                |
|none                                                                         |
|Components of the normal variety, excluding normal monomials:                |
|                                                                             |
|o4 = {| t_(y^2*z) t_(y*x*z)+t_(x*y*z) t_(x^2*z) t_(y^3)-t_(x*y*z) t_(x*y^2)  |
|     ------------------------------------------------------------------------|
|     t_(y*x*y) t_(x^2*y) t_(x*y*x) t_(x^3)+t_(x*y*z) |}                      |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+
|i5 : g = -y^3-x*y*z+y*x*z+x^3                                                |
|                                                                             |
|       3          3                                                          |
|o5 = -y +yxz-xyz+x                                                           |
|                                                                             |
|o5 : B                                                                       |
+-----------------------------------------------------------------------------+
|i6 : isCentral g                                                             |
|                                                                             |
|o6 = true                                                                    |
+-----------------------------------------------------------------------------+

In degree 3, there are no normal monomials. The function returns several
equations which determine the only normal element of degree 3 (up to scaling)
is the central element g.

Ways to use normalElements :
============================

  * "normalElements(NCQuotientRing,ZZ,Symbol,Symbol)"
  * normalElements(NCRingMap,ZZ), --
    Finds elements normalized by a ring map

For the programmer
==================

The object normalElements, is a method function (Macaulay2Doc).

normalElements(NCRingMap,ZZ) -- Finds elements normalized by a ring map
***********************************************************************

Synopsis
========

  * Function: normalElements,
  * Usage:
        normalElements(f,n)
  * Inputs:
      * f, an instance of the type NCRingMap,
      * n, an integer (Macaulay2Doc), a homogeneous degree in which
        to search for normal elements
  * Outputs:
      * a list (Macaulay2Doc),

Description
===========

A normal element x in an NCRing R determines an automorphism f of R by
a*x=x*f(a). Conversely, given a ring endomorphism, we may ask if any x satisfy
the above equation for all a.

Given an NCRingMap f and a degree n, this method returns solutions to the
equations a*x=x*f(a) for all generators a of R.

+-------------------------------------------------+
|i1 : B = skewPolynomialRing(QQ,(-1)_QQ,{x,y,z,w})|
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|                                                 |
|o1 = B                                           |
|                                                 |
|o1 : NCQuotientRing                              |
+-------------------------------------------------+
|i2 : sigma = ncMap(B,B,{y,z,w,x})                |
|                                                 |
|o2 = NCRingMap B <--- B                          |
|                                                 |
|o2 : NCRingMap                                   |
+-------------------------------------------------+
|i3 : C = oreExtension(B,sigma,a)                 |
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|                                                 |
|o3 = C                                           |
|                                                 |
|o3 : NCQuotientRing                              |
+-------------------------------------------------+
|i4 : sigmaC = ncMap(C,C,{y,z,w,x,a})             |
|                                                 |
|o4 = NCRingMap C <--- C                          |
|                                                 |
|o4 : NCRingMap                                   |
+-------------------------------------------------+
|i5 : normalElements(sigmaC,1)                    |
|                                                 |
|o5 = | a |                                       |
|                                                 |
|o5 : NCMatrix                                    |
+-------------------------------------------------+
|i6 : normalElements(sigmaC,2)                    |
|                                                 |
|o6 = 0                                           |
|                                                 |
|              1                                  |
|o6 : Matrix QQ  <--- 0                           |
+-------------------------------------------------+
|i7 : normalElements(sigmaC @@ sigmaC,2)          |
|                                                 |
|o7 = | a^2 |                                     |
|                                                 |
|o7 : NCMatrix                                    |
+-------------------------------------------------+

Ways to use this method:
========================

  * normalElements(NCRingMap,ZZ), --
    Finds elements normalized by a ring map

normalFormBergman -- Calls Bergman for a normal form calculation
****************************************************************

Synopsis
========

  * Usage:
        nfList = normalFormBergman(L,Igb)
  * Inputs:
      * L, an instance of the type NCRingElement, or a
        List (Macaulay2Doc), of NCRingElements
      * Igb, an instance of the type NCGroebnerBasis,
  * Outputs:
      * nfList, a list (Macaulay2Doc),

Description
===========

This method takes a list of NCRingElements and calls Bergman to reduce each
element to normal form relative to the given NCGroebnerBasis for the NCIdeal
defining the NCRing to which the list elements belong.

+-----------------------------------------------------------------------------+
|i1 : A = QQ{x,y,z}                                                           |
|                                                                             |
|o1 = A                                                                       |
|                                                                             |
|o1 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i2 : f = y*z + z*y - x^2                                                     |
|                                                                             |
|            2                                                                |
|o2 = zy+yz-x                                                                 |
|                                                                             |
|o2 : A                                                                       |
+-----------------------------------------------------------------------------+
|i3 : g = x*z + z*x - y^2                                                     |
|                                                                             |
|         2                                                                   |
|o3 = zx-y +xz                                                                |
|                                                                             |
|o3 : A                                                                       |
+-----------------------------------------------------------------------------+
|i4 : h = z^2 - x*y - y*x                                                     |
|                                                                             |
|      2                                                                      |
|o4 = z -yx-xy                                                                |
|                                                                             |
|o4 : A                                                                       |
+-----------------------------------------------------------------------------+
|i5 : I = ncIdeal {f,g,h}                                                     |
|                                                                             |
|                             2      2      2                                 |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}                          |
|                                                                             |
|o5 : NCIdeal                                                                 |
+-----------------------------------------------------------------------------+
|i6 : Igb = ncGroebnerBasis I                                                 |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|      2    2                2                                                |
|o6 = y x-xy ; Lead Term = (y x, 1)                                           |
|       2  2                  2                                               |
|     yx -x y; Lead Term = (yx , 1)                                           |
|         2                                                                   |
|     zx-y +xz; Lead Term = (zx, 1)                                           |
|            2                                                                |
|     zy+yz-x ; Lead Term = (zy, 1)                                           |
|      2                      2                                               |
|     z -yx-xy; Lead Term = (z , 1)                                           |
|                                                                             |
|o6 : NCGroebnerBasis                                                         |
+-----------------------------------------------------------------------------+
|i7 : normalFormBergman(z^17,Igb)                                             |
|--Calling Bergman for NF calculation for 1 elements.                         |
|Complete!                                                                    |
|Writing bergman input file.                                                  |
|Writing bergman init file.                                                   |
|                                                                             |
|                                           2             2    3           3  |
|o7 = yxyxyxyxyxyxyxyxz+xyxyxyxyxyxyxyxyz+8x yxyxyxyxyxyxy z+8x yxyxyxyxyxy z+|
|                                                                             |
|o7 : A                                                                       |
|-----------------------------------------------------------------------------|
|   4         4     5       5     6     6     7   7     8 8                   |
|28x yxyxyxyxy z+28x yxyxyxy z+56x yxyxy z+56x yxy z+70x y z                  |
+-----------------------------------------------------------------------------+

Ways to use normalFormBergman :
===============================

  * "normalFormBergman(List,NCGroebnerBasis)"
  * "normalFormBergman(NCRingElement,NCGroebnerBasis)"

For the programmer
==================

The object normalFormBergman, is a method function with options (Macaulay2Doc).

numgens(NCRing) -- The number of algebra generators of an NCRing
****************************************************************

Synopsis
========

  * Function: numgens (Macaulay2Doc),
  * Usage:
        numgensA = numgens A
  * Inputs:
      * A, an instance of the type NCRing,
  * Outputs:
      * numgensA, an integer (Macaulay2Doc),

Description
===========

This function returns the number of generators of an NCRing.

+---------------------+
|i1 : A = QQ{x,y,z}   |
|                     |
|o1 = A               |
|                     |
|o1 : NCPolynomialRing|
+---------------------+
|i2 : numgens A       |
|                     |
|o2 = 3               |
+---------------------+

Ways to use this method:
========================

  * numgens(NCRing) -- The number of algebra
    generators of an NCRing

oppositeRing -- Creates the opposite ring of a noncommutative ring
******************************************************************

Synopsis
========

  * Usage:
        Aop = oppositeRing A
  * Inputs:
      * A, an instance of the type NCRing,
  * Outputs:
      * Aop, an instance of the type NCRing,

Description
===========

Given an NCRing A, this creates an NCRing whose defining NCIdeal is generated
by the "opposites" - elements whose noncommutative monomial terms have been
reversed - of the generators of the defining NCIdeal of A. If the coefficient
ring of A is a Bergman ring, an NCGroebnerBasis is computed for Aop.

+------------------------------------------+
|i1 : R = QQ[q]/ideal{q^4+q^3+q^2+q+1}     |
|                                          |
|o1 = R                                    |
|                                          |
|o1 : QuotientRing                         |
+------------------------------------------+
|i2 : A = skewPolynomialRing(R,q,{x,y,z,w})|
|                                          |
|o2 = A                                    |
|                                          |
|o2 : NCQuotientRing                       |
+------------------------------------------+
|i3 : x*y == q*y*x                         |
|                                          |
|o3 = true                                 |
+------------------------------------------+
|i4 : Aop = oppositeRing A                 |
|                                          |
|o4 = Aop                                  |
|                                          |
|o4 : NCQuotientRing                       |
+------------------------------------------+
|i5 : y*x == q*x*y                         |
|                                          |
|o5 = true                                 |
+------------------------------------------+

See also
========

  * skewPolynomialRing -- Defines a skew polynomial
    ring via a skewing matrix

Ways to use oppositeRing :
==========================

  * "oppositeRing(NCRing)"

For the programmer
==================

The object oppositeRing, is a method function (Macaulay2Doc).

oreExtension -- Creates an Ore extension of a noncommutative ring
*****************************************************************

Synopsis
========

  * Usage:
        oreExtension(A,sigma,delta,x) or oreExtension(A,sigma,x)
  * Inputs:
      * A, an instance of the type NCRing,
      * sigma, an instance of the type NCRingMap,
      * delta, an instance of the type NCRingMap,
      * x, an instance of the type NCRingElement, or a
        Symbol (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Degree (missing documentation) => ..., default value 1, null
  * Outputs:
      * an instance of the type NCQuotientRing,

Description
===========

This method calls oreIdeal, and returns the associated Ore
extension as an NCQuotientRing.

+-------------------------------------------------+
|i1 : B = skewPolynomialRing(QQ,(-1)_QQ,{x,y,z,w})|
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|                                                 |
|o1 = B                                           |
|                                                 |
|o1 : NCQuotientRing                              |
+-------------------------------------------------+
|i2 : sigma = ncMap(B,B,{y,z,w,x})                |
|                                                 |
|o2 = NCRingMap B <--- B                          |
|                                                 |
|o2 : NCRingMap                                   |
+-------------------------------------------------+
|i3 : C = oreExtension(B,sigma,a)                 |
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|                                                 |
|o3 = C                                           |
|                                                 |
|o3 : NCQuotientRing                              |
+-------------------------------------------------+

See also
========

  * oreIdeal -- Creates the defining ideal of an Ore extension
    of a noncommutative ring

Ways to use oreExtension :
==========================

  * "oreExtension(NCRing,NCRingMap,NCRingElement)"
  * "oreExtension(NCRing,NCRingMap,NCRingMap,NCRingElement)"
  * "oreExtension(NCRing,NCRingMap,NCRingMap,Symbol)"
  * "oreExtension(NCRing,NCRingMap,Symbol)"

For the programmer
==================

The object oreExtension, is a method function with options (Macaulay2Doc).

oreIdeal -- Creates the defining ideal of an Ore extension of a noncommutative ring
***********************************************************************************

Synopsis
========

  * Usage:
        oreIdeal(A,sigma,delta,x) or oreIdeal(A,sigma,x)
  * Inputs:
      * A, an instance of the type NCRing,
      * sigma, an instance of the type NCRingMap,
      * delta, an instance of the type NCRingMap,
      * x, an instance of the type NCRingElement, or a
        Symbol (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Degree (missing documentation) => ..., default value 1, null
  * Outputs:
      * an instance of the type NCIdeal,

Description
===========

Given a ring A, an Ore extension of A by x is the quotient of the free
extension A<x> by the relations x*a - sigma(a)*x-delta(a) where sigma is an
automorphism of A and delta is a sigma-derivation. This method returns the
defining ideal (in the appropriate tensor algebra) of an Ore extension of A by
x. The current version assumes the sigma-derivation delta is 0.

+-----------------------------------------------------------------------------+
|i1 : B = skewPolynomialRing(QQ,(-1)_QQ,{x,y,z,w})                            |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o1 = B                                                                       |
|                                                                             |
|o1 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : sigma = ncMap(B,B,{y,z,w,x})                                            |
|                                                                             |
|o2 = NCRingMap B <--- B                                                      |
|                                                                             |
|o2 : NCRingMap                                                               |
+-----------------------------------------------------------------------------+
|i3 : C = oreIdeal(B,sigma,a)                                                 |
|                                                                             |
|o3 = Two-sided ideal {yx+xy, zx+xz, zy+yz, wx+xw, wy+yw, wz+zw, ax-ya, ay-za,|
|                                                                             |
|o3 : NCIdeal                                                                 |
|-----------------------------------------------------------------------------|
|az-wa, aw-xa}                                                                |
+-----------------------------------------------------------------------------+

See also
========

  * oreExtension -- Creates an Ore extension of a
    noncommutative ring

Ways to use oreIdeal :
======================

  * "oreIdeal(NCRing,NCRingMap,NCRingElement)"
  * "oreIdeal(NCRing,NCRingMap,NCRingMap,NCRingElement)"
  * "oreIdeal(NCRing,NCRingMap,NCRingMap,Symbol)"
  * "oreIdeal(NCRing,NCRingMap,Symbol)"

For the programmer
==================

The object oreIdeal, is a method function with options (Macaulay2Doc).

QQ * NCMatrix -- Product of NCMatrices
**************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        L = a*M
  * Inputs:
      * a, a rational number (Macaulay2Doc),
      * M, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command allows for the scaling of an NCMatrix, by an
element in QQ (Macaulay2Doc).

+--------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})    |
|--Calling Bergman for NCGB calculation.           |
|Complete!                                         |
|                                                  |
|o1 = B                                            |
|                                                  |
|o1 : NCQuotientRing                               |
+--------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                     |
|                                                  |
|o2 = | x y z |                                    |
|                                                  |
|o2 : NCMatrix                                     |
+--------------------------------------------------+
|i3 : sigma = ncMap(B,B,{y,z,x})                   |
|                                                  |
|o3 = NCRingMap B <--- B                           |
|                                                  |
|o3 : NCRingMap                                    |
+--------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}|
|                                                  |
|o4 = | x y z |                                    |
|     | y z x |                                    |
|     | z x y |                                    |
|                                                  |
|o4 : NCMatrix                                     |
+--------------------------------------------------+
|i5 : (1/2)*N                                      |
|                                                  |
|o5 = | 1/2*x 1/2*y 1/2*z |                        |
|     | 1/2*y 1/2*z 1/2*x |                        |
|     | 1/2*z 1/2*x 1/2*y |                        |
|                                                  |
|o5 : NCMatrix                                     |
+--------------------------------------------------+

Ways to use this method:
========================

  * QQ * NCMatrix -- Product of NCMatrices

qTensorProduct -- Define the (q-)commuting tensor product
*********************************************************

Synopsis
========

  * Usage:
        C = qTensorProduct(A,B,q)
  * Inputs:
      * A, an instance of the type NCRing,
      * B, an instance of the type NCRing,
      * q, a ring element (Macaulay2Doc),
  * Outputs:
      * C, an instance of the type NCRing,

Description
===========

This function returns the algebra that contains A and B as a subalgebra, with
the commutation law on the images of A and B given by a*b = q*b*a for all a in
A and b in B. In the case of A ** B, q = 1.

+--------------------------------------------------------+
|i1 : A = QQ{x,y}                                        |
|                                                        |
|o1 = A                                                  |
|                                                        |
|o1 : NCPolynomialRing                                   |
+--------------------------------------------------------+
|i2 : B = skewPolynomialRing(QQ,(-1)_QQ, {a,b})          |
|--Calling Bergman for NCGB calculation.                 |
|Complete!                                               |
|                                                        |
|o2 = B                                                  |
|                                                        |
|o2 : NCQuotientRing                                     |
+--------------------------------------------------------+
|i3 : C = qTensorProduct(A,B,-1_QQ)                      |
|--Calling Bergman for NCGB calculation.                 |
|Complete!                                               |
|--Calling Bergman for NCGB calculation.                 |
|Complete!                                               |
|                                                        |
|o3 = C                                                  |
|                                                        |
|o3 : NCQuotientRing                                     |
+--------------------------------------------------------+
|i4 : ideal C                                            |
|                                                        |
|o4 = Two-sided ideal {ba+ab, ax+xa, bx+xb, ay+ya, by+yb}|
|                                                        |
|o4 : NCIdeal                                            |
+--------------------------------------------------------+
|i5 : D = A ** B                                         |
|--Calling Bergman for NCGB calculation.                 |
|Complete!                                               |
|--Calling Bergman for NCGB calculation.                 |
|Complete!                                               |
|                                                        |
|o5 = D                                                  |
|                                                        |
|o5 : NCQuotientRing                                     |
+--------------------------------------------------------+
|i6 : ideal D                                            |
|                                                        |
|o6 = Two-sided ideal {ba+ab, ax-xa, bx-xb, ay-ya, by-yb}|
|                                                        |
|o6 : NCIdeal                                            |
+--------------------------------------------------------+

Ways to use qTensorProduct :
============================

  * "qTensorProduct(NCRing,NCRing,QQ)"
  * "qTensorProduct(NCRing,NCRing,RingElement)"
  * "qTensorProduct(NCRing,NCRing,ZZ)"

For the programmer
==================

The object qTensorProduct, is a method function (Macaulay2Doc).

quadraticClosure -- Creates the subideal generated by quadratic elements of a given ideal
*****************************************************************************************

Synopsis
========

  * Usage:
        quadraticClosure I
  * Inputs:
      * I, an instance of the type NCIdeal,
  * Outputs:
      * an instance of the type NCIdeal, the quadratic closure
        of I

Description
===========

The quadratic closure of an NCIdeal in an NCPolynomialRing is the NCIdeal
generated by the elements of degree at most 2. Commonly used with Link to
homogDual in the case where the ideal generators are homogeneous of degree
greater than 1.

If the input is an NCQuotientRing, the method is applied to the defining ideal
of the quotient ring and the corresponding quotient ring is returned. At the
moment, quotients of quotients is not implemented, and the ambient ring of the
input NCQuotientRing is assumed to be an NCPolynomialRing.

This method is commonly used in conjunction with homogDual.

+--------------------------------------------------------+
|i1 : A = QQ{x,y,z}                                      |
|                                                        |
|o1 = A                                                  |
|                                                        |
|o1 : NCPolynomialRing                                   |
+--------------------------------------------------------+
|i2 : I = ncIdeal{x*z-z*x, y*z, x*y^2-y^2*x, x^3*y-y*x^3}|
|                                                        |
|                                    2    2     3  3     |
|o2 = Two-sided ideal {-zx+xz, yz, -y x+xy , -yx +x y}   |
|                                                        |
|o2 : NCIdeal                                            |
+--------------------------------------------------------+
|i3 : J = quadraticClosure I                             |
|                                                        |
|o3 = Two-sided ideal {-zx+xz, yz}                       |
|                                                        |
|o3 : NCIdeal                                            |
+--------------------------------------------------------+

See also
========

  * homogDual -- Computes the dual of a pure homogeneous
    ideal

Ways to use quadraticClosure :
==============================

  * "quadraticClosure(NCIdeal)"
  * "quadraticClosure(NCQuotientRing)"

For the programmer
==================

The object quadraticClosure, is a method function (Macaulay2Doc).

resolution(NCMatrix) -- Compute the resolution of coker M as a map of free right modules
****************************************************************************************

Synopsis
========

  * Function: resolution (Macaulay2Doc),
  * Usage:
        res M
  * Inputs:
      * M, an instance of the type NCMatrix,
  * Optional inputs (Macaulay2Doc),:
      * LengthLimit (Macaulay2Doc),
        => an integer (Macaulay2Doc), default value
        infinity, The length of the resolution.  This defaults to the number of
        variables of ring M.
      * DegreeLimit (Macaulay2Doc),
        => ..., default value null, null
      * FastNonminimal (Macaulay2Doc), => ..., default
        value false, null
      * HardDegreeLimit (Macaulay2Doc),
        => ..., default value {}, null
      * PairLimit (Macaulay2Doc),
        => ..., default value infinity, null
      * SortStrategy (Macaulay2Doc),
        => ..., default value 0, null
      * StopBeforeComputation (Macaulay2Doc),
        => ..., default value false, null
      * Strategy (Macaulay2Doc),
        => ..., default value null, null
      * SyzygyLimit (Macaulay2Doc),
        => ..., default value infinity, null
  * Outputs:
      * an instance of the type NCChainComplex,

Description
===========

This function computes a minimal graded free resolution of the cokernel of M,
considered as a map of graded right free modules.  M must be homogeneous for
this command to work.

As of this version, NCChainComplex (the return type) is still quite simple,
though betti (Macaulay2Doc), still works on them.

+-----------------------------------------------+
|i1 : A = skewPolynomialRing(QQ,(-1)_QQ,{x,y,z})|
|--Calling Bergman for NCGB calculation.        |
|Complete!                                      |
|                                               |
|o1 = A                                         |
|                                               |
|o1 : NCQuotientRing                            |
+-----------------------------------------------+
|i2 : M = ncMatrix {{x,y,z}}                    |
|                                               |
|o2 = | x y z |                                 |
|                                               |
|o2 : NCMatrix                                  |
+-----------------------------------------------+
|i3 : Mres = res M                              |
|--Calling Bergman for NCGB calculation.        |
|Complete!                                      |
|--Calling Bergman for NCGB calculation.        |
|Complete!                                      |
|--Calling Bergman for NCGB calculation.        |
|Complete!                                      |
|                                               |
|      1      3      3      1                   |
|o3 = A  <-- A  <-- A  <-- A                    |
|                                               |
|     0      1      2      3                    |
|                                               |
|o3 : NCChainComplex                            |
+-----------------------------------------------+
|i4 : Mres#0                                    |
|                                               |
|o4 = | x y z |                                 |
|                                               |
|o4 : NCMatrix                                  |
+-----------------------------------------------+
|i5 : Mres#1                                    |
|                                               |
|o5 = | 0  -z -y |                              |
|     | -z 0  -x |                              |
|     | -y -x 0  |                              |
|                                               |
|o5 : NCMatrix                                  |
+-----------------------------------------------+
|i6 : Mres#2                                    |
|                                               |
|o6 = | -x |                                    |
|     | -y |                                    |
|     | -z |                                    |
|                                               |
|o6 : NCMatrix                                  |
+-----------------------------------------------+
|i7 : betti Mres                                |
|                                               |
|            0 1 2 3                            |
|o7 = total: 1 3 3 1                            |
|         0: 1 3 3 1                            |
|                                               |
|o7 : BettiTally                                |
+-----------------------------------------------+

See also
========

  * resolution (Macaulay2Doc) -- projective resolution

Ways to use this method:
========================

  * resolution(NCMatrix) -- Compute the
    resolution of coker M as a map of free right modules

rightKernel -- Method for computing kernels of matrices over noncommutative rings in a given degree without using Bergman
*************************************************************************************************************************

Synopsis
========

  * Usage:
        rightKernel(M,n)
  * Inputs:
      * M, an instance of the type NCMatrix,
      * n, an integer (Macaulay2Doc), the degree in which to compute
        the kernel
  * Optional inputs (Macaulay2Doc),:
      * NumberOfBins => an integer (Macaulay2Doc), default value 1,
        an integer dividing the number of rows of M
      * Verbosity => an integer (Macaulay2Doc), default value 0
  * Outputs:
      * an instance of the type NCMatrix,

Description
===========

The method rightKernelBergman, is a very effective
tool for computing kernels of homogeneous matrices with entries in rings over
QQ or ZZ/p. This method provides an alternative that can be used for NCMatrices
over any ground ring. The method is also useful when one knows additional
homological information - for example if the cokernel of M has a linear free
resolution.

Given an NCMatrix M and an integer n, this method returns a basis for the
kernel of the matrix (viewed as a linear map of free right modules) in
homogeneous degree n. The method successively computes annihilators of columns
of M and intersects them. For large matrices or large values of n, it may save
memory to break the calculation into smaller pieces. Use the option
NumberOfBins to reduce the memory (but increase the time) the program uses. Set
Verbosity to 1 to see progress updates.

To avoid accidental calls to Bergman for normal form calculations, set the
MAXSIZE environment variable fairly high, say 1000.

+----------------------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})                  |
|--Calling Bergman for NCGB calculation.                         |
|Complete!                                                       |
|                                                                |
|o1 = B                                                          |
|                                                                |
|o1 : NCQuotientRing                                             |
+----------------------------------------------------------------+
|i2 : sigma = ncMap(B,B,{y,z,x})                                 |
|                                                                |
|o2 = NCRingMap B <--- B                                         |
|                                                                |
|o2 : NCRingMap                                                  |
+----------------------------------------------------------------+
|i3 : C = oreExtension(B,sigma,w)                                |
|--Calling Bergman for NCGB calculation.                         |
|Complete!                                                       |
|                                                                |
|o3 = C                                                          |
|                                                                |
|o3 : NCQuotientRing                                             |
+----------------------------------------------------------------+
|i4 : D = (ambient C)/(ideal C + ncIdeal{promote(w^2,ambient C)})|
|--Calling Bergman for NCGB calculation.                         |
|Complete!                                                       |
|                                                                |
|o4 = D                                                          |
|                                                                |
|o4 : NCQuotientRing                                             |
+----------------------------------------------------------------+

This algebra is an Ore extension of a 3-dimensional Sklyanin algebra, factored
by the normal regular element w^2. This algebra is Koszul, hence it has a
linear free resolution. The rightKernel method is significantly faster than
rightKernelBergman in this case. Also note the two methods return different
generating sets for the kernel.

+---------------------------------------+
|i5 : M1 = ncMatrix {{x,y,z,w}}         |
|                                       |
|o5 = | x y z w |                       |
|                                       |
|o5 : NCMatrix                          |
+---------------------------------------+
|i6 : M2 = rightKernel(M1,1)            |
|                                       |
|o6 = | z  -x -y 0  0  -w 0 |           |
|     | -y z  -x -w 0  0  0 |           |
|     | x  y  z  0  -w 0  0 |           |
|     | 0  0  0  x  y  z  w |           |
|                                       |
|o6 : NCMatrix                          |
+---------------------------------------+
|i7 : M3 = rightKernel(M2,1)            |
|                                       |
|o7 = | -y 0  w  0  0  0  0  0 |        |
|     | -x 0  0  -w 0  0  0  0 |        |
|     | z  -w 0  0  0  0  0  0 |        |
|     | 0  z  -x -y 0  0  -w 0 |        |
|     | 0  -y z  -x -w 0  0  0 |        |
|     | 0  x  y  z  0  -w 0  0 |        |
|     | 0  0  0  0  x  y  z  w |        |
|                                       |
|o7 : NCMatrix                          |
+---------------------------------------+
|i8 : rightKernelBergman(M2)            |
|--Calling Bergman for NCGB calculation.|
|Complete!                              |
|--Calling Bergman for NCGB calculation.|
|Complete!                              |
|                                       |
|o8 = | 0 0  0  0  y  0  -w 0  |        |
|     | 0 0  0  0  x  w  0  0  |        |
|     | 0 0  0  0  -z 0  0  w  |        |
|     | 0 w  0  0  0  y  x  -z |        |
|     | 0 0  0  w  0  x  -z y  |        |
|     | 0 0  w  0  0  -z -y -x |        |
|     | w -z -y -x 0  0  0  0  |        |
|                                       |
|o8 : NCMatrix                          |
+---------------------------------------+
|i9 : M4 = rightKernel(M3,1)            |
|                                       |
|o9 = | -w 0  0  0  0  0  0  0 |        |
|     | -y 0  w  0  0  0  0  0 |        |
|     | -x 0  0  -w 0  0  0  0 |        |
|     | z  -w 0  0  0  0  0  0 |        |
|     | 0  z  -x -y 0  0  -w 0 |        |
|     | 0  -y z  -x -w 0  0  0 |        |
|     | 0  x  y  z  0  -w 0  0 |        |
|     | 0  0  0  0  x  y  z  w |        |
|                                       |
|o9 : NCMatrix                          |
+---------------------------------------+
|i10 : rightKernelBergman(M3)           |
|--Calling Bergman for NCGB calculation.|
|Complete!                              |
|--Calling Bergman for NCGB calculation.|
|Complete!                              |
|                                       |
|o10 = | 0 0  0  0  0  0  0  w  |       |
|      | 0 0  0  0  0  -w 0  y  |       |
|      | 0 0  0  0  w  0  0  x  |       |
|      | 0 0  0  0  0  0  w  -z |       |
|      | 0 w  0  0  y  x  -z 0  |       |
|      | 0 0  0  w  x  -z y  0  |       |
|      | 0 0  w  0  -z -y -x 0  |       |
|      | w -z -y -x 0  0  0  0  |       |
|                                       |
|o10 : NCMatrix                         |
+---------------------------------------+

See also
========

  * rightKernelBergman -- Methods for computing
    kernels of matrices over noncommutative rings using Bergman

Ways to use rightKernel :
=========================

  * "rightKernel(NCMatrix,ZZ)"

For the programmer
==================

The object rightKernel, is a method function with options (Macaulay2Doc).

rightKernelBergman -- Methods for computing kernels of matrices over noncommutative rings using Bergman
*******************************************************************************************************

Synopsis
========

  * Usage:
        rightKernelBergman(M,DegreeLimit=>n)
  * Inputs:
      * M, an instance of the type NCMatrix, a homogeneous
        matrix interpreted as a map of free right modules
  * Optional inputs (Macaulay2Doc),:
      * DegreeLimit => an integer (Macaulay2Doc), default value 10,
        the maximum degree in which to compute the kernel
  * Outputs:
      * an instance of the type NCMatrix, the kernel of the
        matrix (considered as a right module map) to degree n

Description
===========

Let M be a matrix with homogeneous entries in an NCRing. If the degrees of the
entries of M satisfy certain consistency conditions, one can define a graded
homomorphism of free right modules via left multiplication by M. If
isHomogeneous(M) returns true, these conditions have been verified for M and M
is a valid input for rightKernelBergman. Otherwise, an error is returned
stating that M is not homogeneous. To set the isHomogeneous flag to true, use
assignDegrees.

For valid inputs, this method computes the first n homogeneous components of
the (right) kernel of the homomorphism determined by M. If n is not specified
by the user, the default maximum degree is 10. The method returns a minimal set
of generators for the kernel in these degrees.

The results of this command are cached in the input matrix M in
M.cache#rightKernel, and the maximum degree used in this computation is in
M.cache#rightKernelDegreeLimit.

+-----------------------------------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})                               |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o1 = B                                                                       |
|                                                                             |
|o1 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : A = ambient B                                                           |
|                                                                             |
|o2 = A                                                                       |
|                                                                             |
|o2 : NCPolynomialRing                                                        |
+-----------------------------------------------------------------------------+
|i3 : g = -y^3-x*y*z+y*x*z+x^3                                                |
|                                                                             |
|       3          3                                                          |
|o3 = -y +yxz-xyz+x                                                           |
|                                                                             |
|o3 : A                                                                       |
+-----------------------------------------------------------------------------+
|i4 : C = A/(ideal B + ncIdeal g)                                             |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o4 = C                                                                       |
|                                                                             |
|o4 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i5 : M3 = ncMatrix {{x,y,z,0}, {-y*z-2*x^2,-y*x,z*x-x*z,x},{x*y-2*y*x,x*z,-x^|
|                                                                             |
|o5 = | x          y    z         0 |                                         |
|     | -y*z-2*x^2 -y*x y^2-2*x*z x |                                         |
|     | -2*y*x+x*y x*z  -x^2      y |                                         |
|     | -2*y^2+x*z x^2  -x*y      z |                                         |
|                                                                             |
|o5 : NCMatrix                                                                |
|-----------------------------------------------------------------------------|
|2,y}, {-y^2-z*x,x^2,-x*y,z}}                                                 |
+-----------------------------------------------------------------------------+
|i6 : assignDegrees(M3,{1,0,0,0},{2,2,2,1})                                   |
|                                                                             |
|o6 = | x          y    z         0 |                                         |
|     | -y*z-2*x^2 -y*x y^2-2*x*z x |                                         |
|     | -2*y*x+x*y x*z  -x^2      y |                                         |
|     | -2*y^2+x*z x^2  -x*y      z |                                         |
|                                                                             |
|o6 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i7 : ker1M3 = rightKernelBergman(M3)                                         |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o7 = | -z     -x     y            -y*z-x^2  |                                |
|     | y      z      x            y^2       |                                |
|     | -x     y      -z           2*y*x-x*y |                                |
|     | -2*y^2 -2*x^2 -2*y*x+2*x*y -2*x*y*z  |                                |
|                                                                             |
|o7 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i8 : M3*ker1M3 == 0                                                          |
|                                                                             |
|o8 = true                                                                    |
+-----------------------------------------------------------------------------+
|i9 : ker2M3 = rightKernelBergman(ker1M3)                                     |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o9 = | -y x^2  -x*z       -x*y       |                                       |
|     | x  y^2  -y*x+2*x*y -y*z+2*x^2 |                                       |
|     | z  -x*y x^2        -x*z       |                                       |
|     | 0  -z   -y         -x         |                                       |
|                                                                             |
|o9 : NCMatrix                                                                |
+-----------------------------------------------------------------------------+
|i10 : ker1M3*ker2M3 == 0                                                     |
|                                                                             |
|o10 = true                                                                   |
+-----------------------------------------------------------------------------+
|i11 : ker3M3 = rightKernelBergman(ker2M3)                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o11 = | 0  -2*y*x -2*y^2+2*x*z -y*x*z+x^3 |                                  |
|      | -y -z     -x           -x*y       |                                  |
|      | -z x      y            x*z        |                                  |
|      | x  y      -z           0          |                                  |
|                                                                             |
|o11 : NCMatrix                                                               |
+-----------------------------------------------------------------------------+
|i12 : ker2M3*ker3M3 == 0                                                     |
|                                                                             |
|o12 = true                                                                   |
+-----------------------------------------------------------------------------+

See also
========

  * isHomogeneous (Macaulay2Doc) -- whether something is
    homogeneous (graded)
  * assignDegrees -- Weights entries of a matrix to make
    associated map of free modules graded
  * rightKernel -- Method for computing kernels of matrices
    over noncommutative rings in a given degree without using Bergman

Ways to use rightKernelBergman :
================================

  * "rightKernelBergman(NCMatrix)"

For the programmer
==================

The object rightKernelBergman, is a method function with options (Macaulay2Doc).

ring(NCIdeal) -- Returns the ring of an NCIdeal or NCGroebnerBasis
******************************************************************

Synopsis
========

  * Function: ring (Macaulay2Doc),
  * Usage:
        A = ring I
  * Inputs:
      * I, an instance of the type NCIdeal,
  * Outputs:
      * A, an instance of the type NCRing,

Description
===========

Returns the ring of an NCIdeal.

+---------------------------------------------------+
|i1 : A = QQ{x,y,z}                                 |
|                                                   |
|o1 = A                                             |
|                                                   |
|o1 : NCPolynomialRing                              |
+---------------------------------------------------+
|i2 : p = y*z + z*y - x^2                           |
|                                                   |
|            2                                      |
|o2 = zy+yz-x                                       |
|                                                   |
|o2 : A                                             |
+---------------------------------------------------+
|i3 : q = x*z + z*x - y^2                           |
|                                                   |
|         2                                         |
|o3 = zx-y +xz                                      |
|                                                   |
|o3 : A                                             |
+---------------------------------------------------+
|i4 : r = z^2 - x*y - y*x                           |
|                                                   |
|      2                                            |
|o4 = z -yx-xy                                      |
|                                                   |
|o4 : A                                             |
+---------------------------------------------------+
|i5 : I = ncIdeal{p,q,r}                            |
|                                                   |
|                             2      2      2       |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                                   |
|o5 : NCIdeal                                       |
+---------------------------------------------------+
|i6 : ring I                                        |
|                                                   |
|o6 = A                                             |
|                                                   |
|o6 : NCPolynomialRing                              |
+---------------------------------------------------+

Ways to use this method:
========================

  * "ring(NCGroebnerBasis)"
  * ring(NCIdeal) -- Returns the ring of an NCIdeal
    or NCGroebnerBasis

ring(NCLeftIdeal) -- Returns the ring of an NCLeftIdeal
*******************************************************

Synopsis
========

  * Function: ring (Macaulay2Doc),
  * Usage:
        A = ring I
  * Inputs:
      * I, an instance of the type NCLeftIdeal,
  * Outputs:
      * A, an instance of the type NCRing,

Description
===========

Returns the ring of an NCLeftIdeal.

+----------------------------------------------+
|i1 : A = QQ{x,y,z}                            |
|                                              |
|o1 = A                                        |
|                                              |
|o1 : NCPolynomialRing                         |
+----------------------------------------------+
|i2 : p = y*z + z*y - x^2                      |
|                                              |
|            2                                 |
|o2 = zy+yz-x                                  |
|                                              |
|o2 : A                                        |
+----------------------------------------------+
|i3 : q = x*z + z*x - y^2                      |
|                                              |
|         2                                    |
|o3 = zx-y +xz                                 |
|                                              |
|o3 : A                                        |
+----------------------------------------------+
|i4 : r = z^2 - x*y - y*x                      |
|                                              |
|      2                                       |
|o4 = z -yx-xy                                 |
|                                              |
|o4 : A                                        |
+----------------------------------------------+
|i5 : I = ncLeftIdeal{p,q,r}                   |
|                                              |
|                        2      2      2       |
|o5 = Left ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                              |
|o5 : NCLeftIdeal                              |
+----------------------------------------------+
|i6 : ring I                                   |
|                                              |
|o6 = A                                        |
|                                              |
|o6 : NCPolynomialRing                         |
+----------------------------------------------+

Ways to use this method:
========================

  * ring(NCLeftIdeal) -- Returns the ring of an
    NCLeftIdeal

ring(NCMatrix) -- Gives the ring of the NCMatrix
************************************************

Synopsis
========

  * Function: ring (Macaulay2Doc),
  * Usage:
        L = ring M
  * Inputs:
      * M, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCRing,

Description
===========

This command returns the ring over which the NCMatrix is defined.

+---------------------------------------+
|i1 : A = QQ{a,b,c,d}                   |
|                                       |
|o1 = A                                 |
|                                       |
|o1 : NCPolynomialRing                  |
+---------------------------------------+
|i2 : M = ncMatrix {{a,b,c,d},{b,c,d,a}}|
|                                       |
|o2 = | a b c d |                       |
|     | b c d a |                       |
|                                       |
|o2 : NCMatrix                          |
+---------------------------------------+
|i3 : ring M                            |
|                                       |
|o3 = A                                 |
|                                       |
|o3 : NCPolynomialRing                  |
+---------------------------------------+

Ways to use this method:
========================

  * ring(NCMatrix) -- Gives the ring of the NCMatrix

ring(NCRightIdeal) -- Returns the ring of an NCRightIdeal
*********************************************************

Synopsis
========

  * Function: ring (Macaulay2Doc),
  * Usage:
        A = ring I
  * Inputs:
      * I, an instance of the type NCRightIdeal,
  * Outputs:
      * A, an instance of the type NCRing,

Description
===========

Returns the ring of an NCRightIdeal.

+-----------------------------------------------+
|i1 : A = QQ{x,y,z}                             |
|                                               |
|o1 = A                                         |
|                                               |
|o1 : NCPolynomialRing                          |
+-----------------------------------------------+
|i2 : p = y*z + z*y - x^2                       |
|                                               |
|            2                                  |
|o2 = zy+yz-x                                   |
|                                               |
|o2 : A                                         |
+-----------------------------------------------+
|i3 : q = x*z + z*x - y^2                       |
|                                               |
|         2                                     |
|o3 = zx-y +xz                                  |
|                                               |
|o3 : A                                         |
+-----------------------------------------------+
|i4 : r = z^2 - x*y - y*x                       |
|                                               |
|      2                                        |
|o4 = z -yx-xy                                  |
|                                               |
|o4 : A                                         |
+-----------------------------------------------+
|i5 : I = ncRightIdeal{p,q,r}                   |
|                                               |
|                         2      2      2       |
|o5 = Right ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                               |
|o5 : NCRightIdeal                              |
+-----------------------------------------------+
|i6 : ring I                                    |
|                                               |
|o6 = A                                         |
|                                               |
|o6 : NCPolynomialRing                          |
+-----------------------------------------------+

Ways to use this method:
========================

  * ring(NCRightIdeal) -- Returns the ring of an
    NCRightIdeal

ring(NCRingElement) -- Returns the NCRing of an NCRingElement
*************************************************************

Synopsis
========

  * Function: ring (Macaulay2Doc),
  * Usage:
        A = ring f
  * Inputs:
      * f, an instance of the type NCRingElement,
  * Outputs:
      * A, an instance of the type NCRing,

Description
===========

Returns the ring of an NCRingElement

+---------------------+
|i1 : A = QQ{x,y,z,w} |
|                     |
|o1 = A               |
|                     |
|o1 : NCPolynomialRing|
+---------------------+
|i2 : f = x^2+y^2+z^3 |
|                     |
|      3  2  2        |
|o2 = z +y +x         |
|                     |
|o2 : A               |
+---------------------+
|i3 : ring f          |
|                     |
|o3 = A               |
|                     |
|o3 : NCPolynomialRing|
+---------------------+

Ways to use this method:
========================

  * ring(NCRingElement) -- Returns the NCRing
    of an NCRingElement

RingElement * NCMatrix -- Product of NCMatrices
***********************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        L = f*M
  * Inputs:
      * f, a ring element (Macaulay2Doc),
      * M, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command allows for the scaling of an NCMatrix by an element in the base
ring.

+--------------------------------------------------+
|i1 : R = frac(QQ[a])                              |
|                                                  |
|o1 = R                                            |
|                                                  |
|o1 : FractionField                                |
+--------------------------------------------------+
|i2 : B = skewPolynomialRing(R,a,{x,y,z})          |
|                                                  |
|o2 = B                                            |
|                                                  |
|o2 : NCQuotientRing                               |
+--------------------------------------------------+
|i3 : M = ncMatrix {{x, y, z}}                     |
|                                                  |
|o3 = | x y z |                                    |
|                                                  |
|o3 : NCMatrix                                     |
+--------------------------------------------------+
|i4 : sigma = ncMap(B,B,{y,z,x})                   |
|                                                  |
|o4 = NCRingMap B <--- B                           |
|                                                  |
|o4 : NCRingMap                                    |
+--------------------------------------------------+
|i5 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}|
|                                                  |
|o5 = | x y z |                                    |
|     | y z x |                                    |
|     | z x y |                                    |
|                                                  |
|o5 : NCMatrix                                     |
+--------------------------------------------------+
|i6 : a*N                                          |
|                                                  |
|o6 = | a*x a*y a*z |                              |
|     | a*y a*z a*x |                              |
|     | a*z a*x a*y |                              |
|                                                  |
|o6 : NCMatrix                                     |
+--------------------------------------------------+

Ways to use this method:
========================

  * RingElement * NCMatrix -- Product of
    NCMatrices

setWeights -- Set a nonstandard grading for a NCRing.
*****************************************************

Synopsis
========

  * Usage:
        setWeights(A,degList)
  * Inputs:
      * A, an instance of the type NCRing,
      * degList, a list (Macaulay2Doc), a list of integer weights
        to be assigned to the generators of A
  * Outputs:
      * an instance of the type NCRing,

Description
===========

This method enables the user to work with rings which are not naturally graded
(the generators are not all degree 1). The user should be aware that  methods
which call Bergman may not work with nonstandard gradings. Perhaps the most
important example is hilbertBergman, which throws an error. Instead, use
hilbertSeries (Macaulay2Doc).

+-------------------------------------+
|i1 : A=QQ{x,y,z}                     |
|                                     |
|o1 = A                               |
|                                     |
|o1 : NCPolynomialRing                |
+-------------------------------------+
|i2 : w=x^3-y^2                       |
|                                     |
|       2  3                          |
|o2 = -y +x                           |
|                                     |
|o2 : A                               |
+-------------------------------------+
|i3 : isHomogeneous w                 |
|                                     |
|o3 = false                           |
+-------------------------------------+
|i4 : setWeights(A, {2,3,1})          |
|                                     |
|o4 = A                               |
|                                     |
|o4 : NCPolynomialRing                |
+-------------------------------------+
|i5 : isHomogeneous w                 |
|                                     |
|o5 = true                            |
+-------------------------------------+
|i6 : C = QQ{a,b,c}                   |
|                                     |
|o6 = C                               |
|                                     |
|o6 : NCPolynomialRing                |
+-------------------------------------+
|i7 : g = ncMap(C,A,{a^3,b^2,a+b,a-b})|
|                                     |
|o7 = NCRingMap C <--- A              |
|                                     |
|o7 : NCRingMap                       |
+-------------------------------------+
|i8 : isHomogeneous g                 |
|                                     |
|o8 = false                           |
+-------------------------------------+
|i9 : setWeights(A,{3,2,1,1})         |
|                                     |
|o9 = A                               |
|                                     |
|o9 : NCPolynomialRing                |
+-------------------------------------+
|i10 : isHomogeneous g                |
|                                     |
|o10 = true                           |
+-------------------------------------+

See also
========

  * isHomogeneous (Macaulay2Doc) -- whether something is
    homogeneous (graded)

Ways to use setWeights :
========================

  * "setWeights(NCRing,List)"

For the programmer
==================

The object setWeights, is a method function (Macaulay2Doc).

size(NCRingElement) -- Returns the number of terms of an NCRingElement
**********************************************************************

Synopsis
========

  * Function: size (Macaulay2Doc),
  * Usage:
        n = size f
  * Inputs:
      * f, an instance of the type NCRingElement,
  * Outputs:
      * n, an integer (Macaulay2Doc),

Description
===========

Returns the number of terms of an NCRingElement.

+---------------------+
|i1 : A = QQ{x,y,z,w} |
|                     |
|o1 = A               |
|                     |
|o1 : NCPolynomialRing|
+---------------------+
|i2 : f = x^2+y^2+z^3 |
|                     |
|      3  2  2        |
|o2 = z +y +x         |
|                     |
|o2 : A               |
+---------------------+
|i3 : size f          |
|                     |
|o3 = 3               |
+---------------------+

Ways to use this method:
========================

  * size(NCRingElement) -- Returns the number
    of terms of an NCRingElement

skewPolynomialRing -- Defines a skew polynomial ring via a skewing matrix
*************************************************************************

Synopsis
========

  * Usage:
        B = skewPolynomialRing(R,M,L)
  * Inputs:
      * R, a ring (Macaulay2Doc),
      * M, a matrix (Macaulay2Doc),
      * L, a list (Macaulay2Doc),
  * Outputs:
      * B, an instance of the type NCRing,

Description
===========

This method constructs a skew polynomial ring with coefficients in the ring R
and generators from the list L. A valid input matrix is a square matrix over R
with at least #L rows such that M_{ij} = M_{ji}^{(-1)} and M_{ii}=1. The
relations of the resulting ring have the form g_i*g_j - M_{ij}*g_j*g_i. If R is
a Bergman coefficient ring, an NCGroebnerBasis is computed for B.

+--------------------------------------------------------+
|i1 : R = QQ[q]/ideal{q^4+q^3+q^2+q+1}                   |
|                                                        |
|o1 = R                                                  |
|                                                        |
|o1 : QuotientRing                                       |
+--------------------------------------------------------+
|i2 : M = matrix{{1,q,q},{q^4,1,1},{q^4,1,1}}            |
|                                                        |
|o2 = | 1          q q |                                 |
|     | -q3-q2-q-1 1 1 |                                 |
|     | -q3-q2-q-1 1 1 |                                 |
|                                                        |
|             3       3                                  |
|o2 : Matrix R  <--- R                                   |
+--------------------------------------------------------+
|i3 : B = skewPolynomialRing(R,M,{x,y,z})                |
|                                                        |
|o3 = B                                                  |
|                                                        |
|o3 : NCQuotientRing                                     |
+--------------------------------------------------------+
|i4 : x*y == q^4*y*x                                     |
|                                                        |
|o4 = true                                               |
+--------------------------------------------------------+
|i5 : N = matrix{{1,1,1,1},{1,1,1,1},{1,1,1,1},{1,1,1,1}}|
|                                                        |
|o5 = | 1 1 1 1 |                                        |
|     | 1 1 1 1 |                                        |
|     | 1 1 1 1 |                                        |
|     | 1 1 1 1 |                                        |
|                                                        |
|              4        4                                |
|o5 : Matrix ZZ  <--- ZZ                                 |
+--------------------------------------------------------+
|i6 : C = skewPolynomialRing(QQ,promote(N,QQ), {a,b,c,d})|
|--Calling Bergman for NCGB calculation.                 |
|Complete!                                               |
|                                                        |
|o6 = C                                                  |
|                                                        |
|o6 : NCQuotientRing                                     |
+--------------------------------------------------------+
|i7 : isCommutative C                                    |
|                                                        |
|o7 = true                                               |
+--------------------------------------------------------+
|i8 : isCommutative B                                    |
|                                                        |
|o8 = false                                              |
+--------------------------------------------------------+
|i9 : Bop = oppositeRing B                               |
|                                                        |
|o9 = Bop                                                |
|                                                        |
|o9 : NCQuotientRing                                     |
+--------------------------------------------------------+
|i10 : y*x == q^4*x*y                                    |
|                                                        |
|o10 = true                                              |
+--------------------------------------------------------+

See also
========

  * oppositeRing -- Creates the opposite ring of a
    noncommutative ring

Ways to use skewPolynomialRing :
================================

  * "skewPolynomialRing(Ring,Matrix,List)"
  * "skewPolynomialRing(Ring,QQ,List)" -- see
    skewPolynomialRing(Ring,RingElement,List),
    -- Defines a skew
    polynomial ring via a scaling factor
  * skewPolynomialRing(Ring,RingElement,List)
    -- Defines a skew
    polynomial ring via a scaling factor
  * "skewPolynomialRing(Ring,ZZ,List)" -- see
    skewPolynomialRing(Ring,RingElement,List),
    -- Defines a skew
    polynomial ring via a scaling factor

For the programmer
==================

The object skewPolynomialRing, is a method function (Macaulay2Doc).

skewPolynomialRing(Ring,RingElement,List) -- Defines a skew polynomial ring via a scaling factor
************************************************************************************************

Synopsis
========

  * Function: skewPolynomialRing,
  * Usage:
        skewPolynomialRing(R,f,L)
  * Inputs:
      * R, a ring (Macaulay2Doc),
      * f, a ring element (Macaulay2Doc), or an integer or a
        rational number
      * L, a list (Macaulay2Doc),
  * Outputs:
      * an instance of the type NCRing,

Description
===========

This method constructs a skew polynomial ring with coefficient ring R and
generators elements of L. The relations all have the form a*b - f*b*a where a
and b are in L. If R is a Bergman coefficient ring, an NCGroebnerBasis is
computed for B.

+-----------------------------------------------------+
|i1 : R = QQ[q]/ideal{q^4+q^3+q^2+q+1}                |
|                                                     |
|o1 = R                                               |
|                                                     |
|o1 : QuotientRing                                    |
+-----------------------------------------------------+
|i2 : A = skewPolynomialRing(R,promote(2,R),{x,y,z,w})|
|                                                     |
|o2 = A                                               |
|                                                     |
|o2 : NCQuotientRing                                  |
+-----------------------------------------------------+
|i3 : x*y == 2*y*x                                    |
|                                                     |
|o3 = true                                            |
+-----------------------------------------------------+
|i4 : B = skewPolynomialRing(R,q,{x,y,z,w})           |
|                                                     |
|o4 = B                                               |
|                                                     |
|o4 : NCQuotientRing                                  |
+-----------------------------------------------------+
|i5 : x*y == q*y*x                                    |
|                                                     |
|o5 = true                                            |
+-----------------------------------------------------+
|i6 : Bop = oppositeRing B                            |
|                                                     |
|o6 = Bop                                             |
|                                                     |
|o6 : NCQuotientRing                                  |
+-----------------------------------------------------+
|i7 : y*x == q*x*y                                    |
|                                                     |
|o7 = true                                            |
+-----------------------------------------------------+
|i8 : C = skewPolynomialRing(QQ,2_QQ, {x,y,z,w})      |
|--Calling Bergman for NCGB calculation.              |
|Complete!                                            |
|                                                     |
|o8 = C                                               |
|                                                     |
|o8 : NCQuotientRing                                  |
+-----------------------------------------------------+
|i9 : x*y == 2*y*x                                    |
|                                                     |
|o9 = true                                            |
+-----------------------------------------------------+
|i10 : D = skewPolynomialRing(QQ,1_QQ, {x,y,z,w})     |
|--Calling Bergman for NCGB calculation.              |
|Complete!                                            |
|                                                     |
|o10 = D                                              |
|                                                     |
|o10 : NCQuotientRing                                 |
+-----------------------------------------------------+
|i11 : isCommutative C                                |
|                                                     |
|o11 = false                                          |
+-----------------------------------------------------+
|i12 : isCommutative D                                |
|                                                     |
|o12 = true                                           |
+-----------------------------------------------------+
|i13 : Cop = oppositeRing C                           |
|--Calling Bergman for NCGB calculation.              |
|Complete!                                            |
|                                                     |
|o13 = Cop                                            |
|                                                     |
|o13 : NCQuotientRing                                 |
+-----------------------------------------------------+
|i14 : y*x == 2*x*y                                   |
|                                                     |
|o14 = true                                           |
+-----------------------------------------------------+

See also
========

  * oppositeRing -- Creates the opposite ring of a
    noncommutative ring
  * skewPolynomialRing -- Defines a skew polynomial
    ring via a skewing matrix

Ways to use this method:
========================

  * "skewPolynomialRing(Ring,QQ,List)"
  * skewPolynomialRing(Ring,RingElement,List)
    -- Defines a skew
    polynomial ring via a scaling factor
  * "skewPolynomialRing(Ring,ZZ,List)"

source(NCRingMap) -- Source of a map
************************************

Synopsis
========

  * Function: source (Macaulay2Doc),

Description
===========

Gives the source of an NCRingMap.

See also
========

  * target(NCRingMap) -- Target of a map

Ways to use this method:
========================

  * source(NCRingMap) -- Source of a map

sparseCoeffs -- Converts ring elements into vectors over the coefficient ring
*****************************************************************************

Synopsis
========

  * Usage:
        sparseCoeffs L
  * Inputs:
      * L, an instance of the type NCRingElement, or a
        List (Macaulay2Doc), of NCRingElements
  * Optional inputs (Macaulay2Doc),:
      * Monomials => a list (Macaulay2Doc), default value null, a
        list of monomials to use as a basis for computing coordinate vectors
  * Outputs:
      * a matrix (Macaulay2Doc),

Description
===========

This method converts a list of ring elements to coordinate vectors - returned
as a matrix - relative to a list of monomilas. If the user does not supply a
monomial list, the list is taken to be the monomials occurring in the elements
of the list (with repetition).

+-----------------------------------------------+
|i1 : A=QQ{a, b, c, d, e, f, g, h}              |
|                                               |
|o1 = A                                         |
|                                               |
|o1 : NCPolynomialRing                          |
+-----------------------------------------------+
|i2 : F = a^2+b^2+c^2+d^2+e^2+f^2+g^2+h^2;      |
+-----------------------------------------------+
|i3 : sparseCoeffs(F)                           |
|                                               |
|o3 = | 1 |                                     |
|     | 1 |                                     |
|     | 1 |                                     |
|     | 1 |                                     |
|     | 1 |                                     |
|     | 1 |                                     |
|     | 1 |                                     |
|     | 1 |                                     |
|                                               |
|              8        1                       |
|o3 : Matrix QQ  <--- QQ                        |
+-----------------------------------------------+
|i4 : bas = flatten entries basis(2,A);         |
+-----------------------------------------------+
|i5 : #bas                                      |
|                                               |
|o5 = 64                                        |
+-----------------------------------------------+
|i6 : sparseCoeffs(F,Monomials=>bas)            |
|                                               |
|o6 = | 1 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 1 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 1 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 1 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 1 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 1 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 1 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 0 |                                     |
|     | 1 |                                     |
|                                               |
|              64        1                      |
|o6 : Matrix QQ   <--- QQ                       |
+-----------------------------------------------+
|i7 : sparseCoeffs(toList (10:F),Monomials=>bas)|
|                                               |
|o7 = | 1 1 1 1 1 1 1 1 1 1 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 1 1 1 1 1 1 1 1 1 1 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 1 1 1 1 1 1 1 1 1 1 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 1 1 1 1 1 1 1 1 1 1 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 1 1 1 1 1 1 1 1 1 1 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 1 1 1 1 1 1 1 1 1 1 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 1 1 1 1 1 1 1 1 1 1 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 0 0 0 0 0 0 0 0 0 0 |                   |
|     | 1 1 1 1 1 1 1 1 1 1 |                   |
|                                               |
|              64        10                     |
|o7 : Matrix QQ   <--- QQ                       |
+-----------------------------------------------+

Ways to use sparseCoeffs :
==========================

  * "sparseCoeffs(List)"
  * "sparseCoeffs(NCRingElement)"

For the programmer
==================

The object sparseCoeffs, is a method function with options (Macaulay2Doc).

support(NCRingElement) -- Returns the variables appearing in the NCRingElement
******************************************************************************

Synopsis
========

  * Function: support (Macaulay2Doc),
  * Usage:
        sup = support f
  * Inputs:
      * f, an instance of the type NCRingElement,
  * Outputs:
      * sup, a list (Macaulay2Doc),

Description
===========

Returns the variables appearing in f (as elements of the ring of f).

+---------------------+
|i1 : A = QQ{x,y,z,w} |
|                     |
|o1 = A               |
|                     |
|o1 : NCPolynomialRing|
+---------------------+
|i2 : f = x^2+y^2+z^3 |
|                     |
|      3  2  2        |
|o2 = z +y +x         |
|                     |
|o2 : A               |
+---------------------+
|i3 : sup = support f |
|                     |
|o3 = {y, x, z}       |
|                     |
|o3 : List            |
+---------------------+
|i4 : first sup       |
|                     |
|o4 = y               |
|                     |
|o4 : A               |
+---------------------+

Ways to use this method:
========================

  * support(NCRingElement) -- Returns the
    variables appearing in the NCRingElement

target(NCRingMap) -- Target of a map
************************************

Synopsis
========

  * Function: target (Macaulay2Doc),

Description
===========

Gives the target of an NCRingMap.

See also
========

  * source(NCRingMap) -- Source of a map

Ways to use this method:
========================

  * target(NCRingMap) -- Target of a map

terms(NCRingElement) -- Returns the terms of an NCRingElement
*************************************************************

Synopsis
========

  * Function: terms (Macaulay2Doc),
  * Usage:
        t = terms f
  * Inputs:
      * f, an instance of the type NCRingElement,
  * Outputs:
      * t, a list (Macaulay2Doc),

Description
===========

Returns the list of terms that make up the NCRingElement.  It is a list of
NCRingElements.

+----------------------+
|i1 : A = QQ{x,y,z,w}  |
|                      |
|o1 = A                |
|                      |
|o1 : NCPolynomialRing |
+----------------------+
|i2 : f = 2*x^2+y^2+z^3|
|                      |
|      3  2   2        |
|o2 = z +y +2x         |
|                      |
|o2 : A                |
+----------------------+
|i3 : t = terms f      |
|                      |
|       2    2   3     |
|o3 = {y , 2x , z }    |
|                      |
|o3 : List             |
+----------------------+
|i4 : first t          |
|                      |
|      2               |
|o4 = y                |
|                      |
|o4 : A                |
+----------------------+

Ways to use this method:
========================

  * terms(NCRingElement) -- Returns the terms
    of an NCRingElement

threeDimSklyanin -- Defines a three-dimensional Sklyanin with given parameters
******************************************************************************

Synopsis
========

  * Usage:
        threeDimSklyanin(R,params,varList)
  * Inputs:
      * R, a ring (Macaulay2Doc),
      * params, a list (Macaulay2Doc),
      * varList, a list (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * DegreeLimit (missing documentation) => an integer (Macaulay2Doc),
        default value 5, null
  * Outputs:
      * an instance of the type NCRing,

Description
===========

This method constructs a three dimensional Sklyanin algebra with parameters
from the params list, and variables from varList (see here (see
http:///arxiv.org//abs//1107.2953 )). If either list is not length three, then
an error is thrown.  The generic such algebra does not have a finite Groebner
basis, so the optional parameter DegreeLimit has been defaulted to 5.  If only
one list is provided, it is used for the variable names, and a random choice
for each parameter is chosen.

The following example is a PI algebra, and has a finite Groebner basis.

+----------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})|
|--Calling Bergman for NCGB calculation.       |
|Complete!                                     |
|                                              |
|o1 = B                                        |
|                                              |
|o1 : NCQuotientRing                           |
+----------------------------------------------+
|i2 : ncGroebnerBasis ideal B                  |
|                                              |
|      2    2                2                 |
|o2 = y x-xy ; Lead Term = (y x, 1)            |
|       2  2                  2                |
|     yx -x y; Lead Term = (yx , 1)            |
|         2                                    |
|     zx-y +xz; Lead Term = (zx, 1)            |
|            2                                 |
|     zy+yz-x ; Lead Term = (zy, 1)            |
|      2                      2                |
|     z -yx-xy; Lead Term = (z , 1)            |
|                                              |
|o2 : NCGroebnerBasis                          |
+----------------------------------------------+

This is not generically true, however:

+-----------------------------------------------------------------------------+
|i3 : C = threeDimSklyanin(QQ,{a,b,c})                                        |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o3 = C                                                                       |
|                                                                             |
|o3 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i4 : ncGroebnerBasis ideal C                                                 |
|                                                                             |
|           4049035857  2    479504274903  4 513457984      324   3   10609   |
|o4 = babac+----------ba bc+-------------ba +---------ababc+---aba - ------a  |
|           7406276800      1540505574400     80115975      103      173056   |
|             572085999   2 2   7469841911  3   6551866359 2 3  671915007  2  |
|     babab- -----------ba b - -----------ba c+-----------a b +-----------a   |
|            59825459200       29912729600     59825459200     29912729600    |
|         2   617137  2     561286   3   9518912       617137   2   103 2     |
|     baba - -------ba ba- --------ba b+--------ababa+-------aba b- ---a bab  |
|            7000425       80115975     80115975      8901775        81       |
|      4  1664      103  3  9    2   10609 2    86425 3                 4     |
|     b - ----babc- ---ba +---aba - ------a ba- -----a b; Lead Term = (b , 1  |
|          729      104    104      682344      75816                         |
|      2 2                      2                                             |
|     c +-ba+2ab; Lead Term = (c , 1)                                         |
|        9                                                                    |
|            9 2                                                              |
|     cb+9bc+-a ; Lead Term = (cb, 1)                                         |
|            2                                                                |
|        1 2 1                                                                |
|     ca+-b +-ac; Lead Term = (ca, 1)                                         |
|        2   9                                                                |
|      2  832     1  2  208 2                 2                               |
|     b a+---bab- -ab - ---a c; Lead Term = (b a, 1)                          |
|          81     9      81                                                   |
|      2  103  2   4      103 2                 2                             |
|     b c+---ba - --aba- ----a b; Lead Term = (b c, 1)                        |
|         208     81     1872                                                 |
|        2  926721   2    927   3  1458     80887239 2   96408 4              |
|     bab +--------ba c- -----ab +-----abac+--------a bc+-----a ; Lead Term   |
|          35952800      86425    86425     35952800     86425                |
|                                                                             |
|o4 : NCGroebnerBasis                                                         |
|-----------------------------------------------------------------------------|
|2  2  6956383927  3    63565111 4                                            |
| ba +------------a ba+---------a b; Lead Term = (babac, 1)                   |
|     149977105200     161787600                                              |
|       75087  3     75087 5                                                  |
|bac- --------a bc- ------a ; Lead Term = (babab, 1)                          |
|     35952800      691400                                                    |
| 10874 3 2 2379728 4                    2                                    |
|+-----a b +-------a c; Lead Term = (baba , 1)                                |
| 86425     7000425                                                           |
|                                                                             |
|)                                                                            |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|      2                                                                      |
|= (bab , 1)                                                                  |
+-----------------------------------------------------------------------------+

In all cases, there is a degree three central regular element (a formula for
which is given in the paper referenced above).

+------------------------------------------------+
|i5 : centralElements(B,3)                       |
|                                                |
|o5 = | y^3-y*x*z+x*y*z-x^3 |                    |
|                                                |
|o5 : NCMatrix                                   |
+------------------------------------------------+
|i6 : centralElements(C,3)                       |
|                                                |
|o6 = | -1/2*b^3+81/103*b*a*c+a*b*c-729/206*a^3 ||
|                                                |
|o6 : NCMatrix                                   |
+------------------------------------------------+

These algebras also all AS-regular and as such have the same Hilbert series as
a commutative polynomial algebra in three variables, as we can see here:

+--------------------------------------------------------------------------+
|i7 : hilbertBergman B                                                     |
|--Calling bergman for HS computation.                                     |
|Complete!                                                                 |
|                                                                          |
|                2      3      4      5      6      7      8      9      10|
|o7 = 1 + 3T + 6T  + 10T  + 15T  + 21T  + 28T  + 36T  + 45T  + 55T  + 66T  |
|                                                                          |
|o7 : ZZ[T]                                                                |
+--------------------------------------------------------------------------+
|i8 : hilbertBergman(C,DegreeLimit=>5)                                     |
|--Calling bergman for HS computation.                                     |
|Complete!                                                                 |
|                                                                          |
|                2      3      4      5                                    |
|o8 = 1 + 3T + 6T  + 10T  + 15T  + 21T                                     |
|                                                                          |
|o8 : ZZ[T]                                                                |
+--------------------------------------------------------------------------+

Ways to use threeDimSklyanin :
==============================

  * "threeDimSklyanin(Ring,List)"
  * "threeDimSklyanin(Ring,List,List)"

For the programmer
==================

The object threeDimSklyanin, is a method function with options (Macaulay2Doc).

toM2Ring -- Compute the abelianization of an NCRing and returns a Ring.
***********************************************************************

Synopsis
========

  * Usage:
        S = toM2Ring R
  * Inputs:
      * R, an instance of the type NCRing,
  * Optional inputs (Macaulay2Doc),:
      * SkewCommutative => a Boolean value (Macaulay2Doc),
        default value false
  * Outputs:
      * S, a ring (Macaulay2Doc),

Description
===========

This method takes an NCRing and returns the quotient of a commutative
polynomial ring (or an exterior algebra, if SkewCommutative=>true) on the same
generators by the defining relations of the input ring.

+-------------------------------------------------+
|i1 : A = skewPolynomialRing(QQ,(-1)_QQ,{w,x,y,z})|
|--Calling Bergman for NCGB calculation.          |
|Complete!                                        |
|                                                 |
|o1 = A                                           |
|                                                 |
|o1 : NCQuotientRing                              |
+-------------------------------------------------+
|i2 : x*y-y*x                                     |
|                                                 |
|o2 = 2xy                                         |
|                                                 |
|o2 : A                                           |
+-------------------------------------------------+
|i3 : w^2                                         |
|                                                 |
|      2                                          |
|o3 = w                                           |
|                                                 |
|o3 : A                                           |
+-------------------------------------------------+
|i4 : B = toM2Ring(A)                             |
|                                                 |
|o4 = B                                           |
|                                                 |
|o4 : QuotientRing                                |
+-------------------------------------------------+
|i5 : x*y-y*x                                     |
|                                                 |
|o5 = 0                                           |
|                                                 |
|o5 : B                                           |
+-------------------------------------------------+
|i6 : w^2                                         |
|                                                 |
|      2                                          |
|o6 = w                                           |
|                                                 |
|o6 : B                                           |
+-------------------------------------------------+
|i7 : C = toM2Ring(A,SkewCommutative=>true)       |
|                                                 |
|o7 = C                                           |
|                                                 |
|o7 : PolynomialRing, 4 skew commutative variables|
+-------------------------------------------------+
|i8 : x*y-y*x                                     |
|                                                 |
|o8 = 2x*y                                        |
|                                                 |
|o8 : C                                           |
+-------------------------------------------------+
|i9 : w^2                                         |
|                                                 |
|o9 = 0                                           |
|                                                 |
|o9 : C                                           |
+-------------------------------------------------+

See also
========

  * toNCRing -- Converts a Ring to an NCRing

Ways to use toM2Ring :
======================

  * "toM2Ring(NCRing)"

For the programmer
==================

The object toM2Ring, is a method function with options (Macaulay2Doc).

toNCRing -- Converts a Ring to an NCRing
****************************************

Synopsis
========

  * Usage:
        S = toNCRing R
  * Inputs:
      * R, a ring (Macaulay2Doc),
  * Outputs:
      * S, an instance of the type NCRing,

Description
===========

This function converts commutative rings and quotients of exterior algebras
created by Macaulay2 to the type of an NCRing. An error is returned if the
input ring has some commutative and some skew-commutative generators.

+-----------------------------------------------------------------------------+
|i1 : R = QQ[a,b,c,d]                                                         |
|                                                                             |
|o1 = R                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : I = ideal(a*d-b*c)                                                      |
|                                                                             |
|o2 = ideal(- b*c + a*d)                                                      |
|                                                                             |
|o2 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+
|i3 : S = R/I                                                                 |
|                                                                             |
|o3 = S                                                                       |
|                                                                             |
|o3 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i4 : S' = toNCRing(S)                                                        |
|--Calling Bergman for NCGB calculation.                                      |
|Complete!                                                                    |
|                                                                             |
|o4 = S'                                                                      |
|                                                                             |
|o4 : NCQuotientRing                                                          |
+-----------------------------------------------------------------------------+
|i5 : ideal S'                                                                |
|                                                                             |
|o5 = Two-sided ideal {-ba+ab, -ca+ac, -cb+bc, -da+ad, -db+bd, -dc+cd, -bc+ad}|
|                                                                             |
|o5 : NCIdeal                                                                 |
+-----------------------------------------------------------------------------+

See also
========

  * toM2Ring -- Compute the abelianization of an NCRing and
    returns a Ring.

Ways to use toNCRing :
======================

  * "toNCRing(Ring)"

For the programmer
==================

The object toNCRing, is a method function (Macaulay2Doc).

toString(NCRingElement) -- Converts an NCRingElement to a string
****************************************************************

Synopsis
========

  * Function: toString (Macaulay2Doc),
  * Usage:
        str = toString f
  * Inputs:
      * f, an instance of the type NCRingElement,
  * Outputs:
      * str, a string (Macaulay2Doc),

Description
===========

Converts an NCRingElement to a string.  This should be readable by both
Macaulay2 as well as Bergman.

+---------------------+
|i1 : A = QQ{x,y,z,w} |
|                     |
|o1 = A               |
|                     |
|o1 : NCPolynomialRing|
+---------------------+
|i2 : f = x^2+y^2+z^3 |
|                     |
|      3  2  2        |
|o2 = z +y +x         |
|                     |
|o2 : A               |
+---------------------+
|i3 : toString f      |
|                     |
|o3 = z^3+y^2+x^2     |
+---------------------+

Ways to use this method:
========================

  * toString(NCRingElement) -- Converts an
    NCRingElement to a string

transpose(NCMatrix) -- Transposes an NCMatrix
*********************************************

Synopsis
========

  * Function: transpose (Macaulay2Doc),
  * Usage:
        L = transpose M
  * Inputs:
      * M, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command transposes an NCMatrix

+---------------------------------------+
|i1 : A = QQ{a,b,c,d}                   |
|                                       |
|o1 = A                                 |
|                                       |
|o1 : NCPolynomialRing                  |
+---------------------------------------+
|i2 : M = ncMatrix {{a,b,c,d},{b,c,d,a}}|
|                                       |
|o2 = | a b c d |                       |
|     | b c d a |                       |
|                                       |
|o2 : NCMatrix                          |
+---------------------------------------+
|i3 : N = M || 2*M || -3*M              |
|                                       |
|o3 = | a    b    c    d    |           |
|     | b    c    d    a    |           |
|     | 2*a  2*b  2*c  2*d  |           |
|     | 2*b  2*c  2*d  2*a  |           |
|     | -3*a -3*b -3*c -3*d |           |
|     | -3*b -3*c -3*d -3*a |           |
|                                       |
|o3 : NCMatrix                          |
+---------------------------------------+
|i4 : transpose N                       |
|                                       |
|o4 = | a b 2*a 2*b -3*a -3*b |         |
|     | b c 2*b 2*c -3*b -3*c |         |
|     | c d 2*c 2*d -3*c -3*d |         |
|     | d a 2*d 2*a -3*d -3*a |         |
|                                       |
|o4 : NCMatrix                          |
+---------------------------------------+

Ways to use this method:
========================

  * transpose(NCMatrix) -- Transposes an
    NCMatrix

twoSidedNCGroebnerBasisBergman -- Calls Bergman to compute a two sided noncommutative Groebner Basis.
*****************************************************************************************************

Synopsis
========

  * Usage:
        twoSidedNCGroebnerBasisBergman I
  * Inputs:
      * I, an instance of the type NCIdeal, or a List (Macaulay2Doc),
        of NCRingElements
  * Optional inputs (Macaulay2Doc),:
      * DegreeLimit => an integer (Macaulay2Doc), default value 10,
        specifies the maximum degree for the Groebner basis calculation
      * NumModuleVars => an integer (Macaulay2Doc), default value 0,
        specifies the number of module variables in the ring of the Groebner
        basis
      * MakeMonic => a Boolean value (Macaulay2Doc), default
        value true, specifies whether the Bergman output should be made monic
      * CacheBergmanGB => a Boolean value (Macaulay2Doc),
        default value true, specifies whether or not to cache the Groebner
        basis for later use
  * Outputs:
      * an instance of the type NCGroebnerBasis,

Description
===========

This command calls the computer algebra system Bergman to compute a
noncommutative Groebner basis.

Since Groebner bases in the tensor algebra need not be finitely generated, one
should specify a degree limit on the computation unless one has a reason to
believe the Groebner basis is finite.

+---------------------------------------------------+
|i1 : A = QQ{x,y,z}                                 |
|                                                   |
|o1 = A                                             |
|                                                   |
|o1 : NCPolynomialRing                              |
+---------------------------------------------------+
|i2 : p = y*z + z*y - x^2                           |
|                                                   |
|            2                                      |
|o2 = zy+yz-x                                       |
|                                                   |
|o2 : A                                             |
+---------------------------------------------------+
|i3 : q = x*z + z*x - y^2                           |
|                                                   |
|         2                                         |
|o3 = zx-y +xz                                      |
|                                                   |
|o3 : A                                             |
+---------------------------------------------------+
|i4 : r = z^2 - x*y - y*x                           |
|                                                   |
|      2                                            |
|o4 = z -yx-xy                                      |
|                                                   |
|o4 : A                                             |
+---------------------------------------------------+
|i5 : I = ncIdeal {p,q,r}                           |
|                                                   |
|                             2      2      2       |
|o5 = Two-sided ideal {zy+yz-x , zx-y +xz, z -yx-xy}|
|                                                   |
|o5 : NCIdeal                                       |
+---------------------------------------------------+
|i6 : Igb = twoSidedNCGroebnerBasisBergman I        |
|--Calling Bergman for NCGB calculation.            |
|Complete!                                          |
|                                                   |
|      2    2                2                      |
|o6 = y x-xy ; Lead Term = (y x, 1)                 |
|       2  2                  2                     |
|     yx -x y; Lead Term = (yx , 1)                 |
|         2                                         |
|     zx-y +xz; Lead Term = (zx, 1)                 |
|            2                                      |
|     zy+yz-x ; Lead Term = (zy, 1)                 |
|      2                      2                     |
|     z -yx-xy; Lead Term = (z , 1)                 |
|                                                   |
|o6 : NCGroebnerBasis                               |
+---------------------------------------------------+

Ways to use twoSidedNCGroebnerBasisBergman :
============================================

  * "twoSidedNCGroebnerBasisBergman(List)"
  * "twoSidedNCGroebnerBasisBergman(NCIdeal)"

For the programmer
==================

The object twoSidedNCGroebnerBasisBergman,
is a method function with options (Macaulay2Doc).

use(NCRing) -- Brings the variables of a particular NCRing in scope
*******************************************************************

Synopsis
========

  * Function: use (Macaulay2Doc),
  * Usage:
        use A
  * Inputs:
      * A, an instance of the type NCRing,

Description
===========

This function brings the variables of a particular NCRing in scope. For an
illustration:

+-----------------------------------------------+
|i1 : A = QQ{x,y,z}                             |
|                                               |
|o1 = A                                         |
|                                               |
|o1 : NCPolynomialRing                          |
+-----------------------------------------------+
|i2 : coefficientRing A                         |
|                                               |
|o2 = QQ                                        |
|                                               |
|o2 : Ring                                      |
+-----------------------------------------------+
|i3 : B = skewPolynomialRing(QQ,(-1)_QQ,{x,y,z})|
|--Calling Bergman for NCGB calculation.        |
|Complete!                                      |
|                                               |
|o3 = B                                         |
|                                               |
|o3 : NCQuotientRing                            |
+-----------------------------------------------+
|i4 : x                                         |
|                                               |
|o4 = x                                         |
|                                               |
|o4 : B                                         |
+-----------------------------------------------+

As you can see, at this point the interpreter treats x,y and z as elements of
B.  To go back to A, we run the command use A:

+---------------------+
|i5 : use A           |
|                     |
|o5 = A               |
|                     |
|o5 : NCPolynomialRing|
+---------------------+
|i6 : x               |
|                     |
|o6 = x               |
|                     |
|o6 : A               |
+---------------------+

Ways to use this method:
========================

  * use(NCRing) -- Brings the variables of a particular
    NCRing in scope

ZZ * NCMatrix -- Product of NCMatrices
**************************************

Synopsis
========

  * Operator: * (Macaulay2Doc),
  * Usage:
        L = a*M
  * Inputs:
      * a, an integer (Macaulay2Doc),
      * M, an instance of the type NCMatrix,
  * Outputs:
      * L, an instance of the type NCMatrix,

Description
===========

This command allows for the scaling of an NCMatrix, by an
element in ZZ (Macaulay2Doc).

+--------------------------------------------------+
|i1 : B = threeDimSklyanin(QQ,{1,1,-1},{x,y,z})    |
|--Calling Bergman for NCGB calculation.           |
|Complete!                                         |
|                                                  |
|o1 = B                                            |
|                                                  |
|o1 : NCQuotientRing                               |
+--------------------------------------------------+
|i2 : M = ncMatrix {{x, y, z}}                     |
|                                                  |
|o2 = | x y z |                                    |
|                                                  |
|o2 : NCMatrix                                     |
+--------------------------------------------------+
|i3 : sigma = ncMap(B,B,{y,z,x})                   |
|                                                  |
|o3 = NCRingMap B <--- B                           |
|                                                  |
|o3 : NCRingMap                                    |
+--------------------------------------------------+
|i4 : N = ncMatrix {{M},{sigma M}, {sigma sigma M}}|
|                                                  |
|o4 = | x y z |                                    |
|     | y z x |                                    |
|     | z x y |                                    |
|                                                  |
|o4 : NCMatrix                                     |
+--------------------------------------------------+
|i5 : 3*N                                          |
|                                                  |
|o5 = | 3*x 3*y 3*z |                              |
|     | 3*y 3*z 3*x |                              |
|     | 3*z 3*x 3*y |                              |
|                                                  |
|o5 : NCMatrix                                     |
+--------------------------------------------------+

Ways to use this method:
========================

  * ZZ * NCMatrix -- Product of NCMatrices