shh.homolalg
Class QvspMorphism

Object
  extended byQvspMorphism
All Implemented Interfaces:
ExactCategoryMorphism, Morphism

public class QvspMorphism
extends Object
implements ExactCategoryMorphism

A morphism of Qvsps. It is a linear map from the Qvsp given by getSource() to the Qvsp given by getTarget(), with matrix getMatrix().

While the morphism is between rational vector spaces, the present implementation uses matrices with integer entries. The method getMatrix() always returns a CSparse, and methods that work on QvspMorphisms may assume that all the non-zero matrix entries are in SparseEltZ. The return value of getMatrix() is always non-null in this class, but may be null for subclasses.

For a pair of morphisms, equals(java.lang.Object) works as expected, as long as the two sources and the two targets satisfy equals(java.lang.Object). However, hashCode() is not yet implemented.

Author:
Mark McConnell

Constructor Summary
QvspMorphism(Qvsp source, Qvsp target, CSparse matrix)
          Constructor.
 
Method Summary
 Morphism compose(Morphism f)
          Returns the composition in the following diagram.
 void destroyAllButCokernel()
          Provides a more efficient way of computing the cokernel and related morphisms, at the price of destroying this morphism itself.
 void destroyAllButKernel()
          Provides a more efficient way of computing the kernel and related morphisms, at the price of destroying this morphism itself.
 QvspMorphism dual()
          If this is a QvspMorphism VW with matrix A, then dual() returns a QvspMorphism WV whose matrix is the transpose of A.
 boolean equals(Object o)
          Works as expected, as long as the two sources and the two targets satisfy equals(java.lang.Object).
 ExactCategoryMorphism getCoimage()
          See the comment on ExactCategoryMorphism.
 ExactCategoryMorphism getCoimSection()
          See the comment on ExactCategoryMorphism.
 ExactCategoryMorphism getCoimToIm()
          The bottom arrow (the isomorphism) in the comment on ExactCategoryMorphism.
 ExactCategoryMorphism getCokernel()
          See the comment on ExactCategoryMorphism.
 ExactCategoryMorphism getCokerSection()
          See the comment on ExactCategoryMorphism.
 ExactCategoryMorphism getImage()
          See the comment on ExactCategoryMorphism.
 ExactCategoryMorphism getImRetraction()
          See the comment on ExactCategoryMorphism.
 Morphism getInverse()
          Unsupported at this time (sorry).
 ExactCategoryMorphism getKernel()
          See the comment on ExactCategoryMorphism.
 ExactCategoryMorphism getKerRetraction()
          See the comment on ExactCategoryMorphism.
protected  CSparse getMatrix()
          See the comment on the class.
 MPDQ getMPDQ()
          Returns an MPDQ holding the Smith normal form for the underlying matrix.
 String getName()
          Returns the name set by setName(java.lang.String), or null if none has been set.
 Obj getSource()
          Returns the source (the domain) of this morphism.
 Obj getTarget()
          Returns the target (sometimes called the range or codomain) of this morphism.
 int hashCode()
          Unsupported at this time (sorry).
 boolean isCompositionZero(ExactCategoryMorphism f)
          Whether the composition of this and f (see the diagram for Morphism.compose(shh.homolalg.Morphism)) is a zero morphism.
 boolean isEpic()
          Whether this is an epimorphism.
 boolean isIsomorphism()
          Whether this has an inverse morphism.
 boolean isMonic()
          Whether this is a monomorphism.
 boolean isZero()
          Whether this is a zero morphism.
static void main(String[] args)
          Tests the factorization in ExactCategoryMorphism.
 int rank()
          The rank of this morphism.
 void setName(String name)
          Sets the name.
 String torsion()
          Returns a pretty-print version of the elementary divisors of the underlying matrix over Z.
 String toString()
          Returns the name, if one has been set by setName(java.lang.String); otherwise, returns a printed representation, including the matrix if it is small enough.
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QvspMorphism

public QvspMorphism(Qvsp source,
                    Qvsp target,
                    CSparse matrix)
Constructor. It is an error if any argument is null.

Method Detail

getMatrix

protected CSparse getMatrix()
See the comment on the class.


getName

public final String getName()
Returns the name set by setName(java.lang.String), or null if none has been set. See toString().


setName

public final void setName(String name)
Sets the name. See toString().


toString

public String toString()
Returns the name, if one has been set by setName(java.lang.String); otherwise, returns a printed representation, including the matrix if it is small enough.


getMPDQ

public MPDQ getMPDQ()
Returns an MPDQ holding the Smith normal form for the underlying matrix. Takes care to evaluate it only once. This is the time- and space-consuming step for large matrices.


getSource

public Obj getSource()
Returns the source (the domain) of this morphism. The return type is really Qvsp.

Specified by:
getSource in interface Morphism

getTarget

public Obj getTarget()
Returns the target (sometimes called the range or codomain) of this morphism. The return type is really Qvsp.

Specified by:
getTarget in interface Morphism

compose

public Morphism compose(Morphism f)
Description copied from interface: Morphism
Returns the composition in the following diagram.

       U <------- T <------- S
           this         f

       

The implementation must satisfy the axioms of a category. For instance, composition must be associative.

The implementation may throw an IllegalArgumentException if the source of this and the target of f are not equal in the sense of equals.

The implementation may throw an UnsupportedOperationException if the morphisms are not composable, e.g., if they're from different categories.

Specified by:
compose in interface Morphism

equals

public boolean equals(Object o)
Works as expected, as long as the two sources and the two targets satisfy equals(java.lang.Object). However, hashCode() is not yet implemented.


hashCode

public int hashCode()
Unsupported at this time (sorry).

Throws:
UnsupportedOperationException - Always.

isMonic

public boolean isMonic()
Description copied from interface: Morphism
Whether this is a monomorphism.

Specified by:
isMonic in interface Morphism

isEpic

public boolean isEpic()
Description copied from interface: Morphism
Whether this is an epimorphism.

Specified by:
isEpic in interface Morphism

isIsomorphism

public boolean isIsomorphism()
Description copied from interface: Morphism
Whether this has an inverse morphism. Compare Morphism.getInverse().

Specified by:
isIsomorphism in interface Morphism

getInverse

public Morphism getInverse()
Unsupported at this time (sorry).

Specified by:
getInverse in interface Morphism
Throws:
UnsupportedOperationException - Always.

isZero

public boolean isZero()
Description copied from interface: ExactCategoryMorphism
Whether this is a zero morphism.

Specified by:
isZero in interface ExactCategoryMorphism

isCompositionZero

public boolean isCompositionZero(ExactCategoryMorphism f)
Description copied from interface: ExactCategoryMorphism
Whether the composition of this and f (see the diagram for Morphism.compose(shh.homolalg.Morphism)) is a zero morphism. Is expected to be more efficient than just computing the composition and calling ExactCategoryMorphism.isZero() on it.

Specified by:
isCompositionZero in interface ExactCategoryMorphism

rank

public int rank()
The rank of this morphism.


torsion

public String torsion()
Returns a pretty-print version of the elementary divisors of the underlying matrix over Z.


getKernel

public ExactCategoryMorphism getKernel()
Description copied from interface: ExactCategoryMorphism
See the comment on ExactCategoryMorphism.

Specified by:
getKernel in interface ExactCategoryMorphism

getKerRetraction

public ExactCategoryMorphism getKerRetraction()
Description copied from interface: ExactCategoryMorphism
See the comment on ExactCategoryMorphism.

Specified by:
getKerRetraction in interface ExactCategoryMorphism

getCokernel

public ExactCategoryMorphism getCokernel()
Description copied from interface: ExactCategoryMorphism
See the comment on ExactCategoryMorphism.

Specified by:
getCokernel in interface ExactCategoryMorphism

getCokerSection

public ExactCategoryMorphism getCokerSection()
Description copied from interface: ExactCategoryMorphism
See the comment on ExactCategoryMorphism.

Specified by:
getCokerSection in interface ExactCategoryMorphism

getCoimage

public ExactCategoryMorphism getCoimage()
Description copied from interface: ExactCategoryMorphism
See the comment on ExactCategoryMorphism.

Specified by:
getCoimage in interface ExactCategoryMorphism

getCoimSection

public ExactCategoryMorphism getCoimSection()
Description copied from interface: ExactCategoryMorphism
See the comment on ExactCategoryMorphism.

Specified by:
getCoimSection in interface ExactCategoryMorphism

getImage

public ExactCategoryMorphism getImage()
Description copied from interface: ExactCategoryMorphism
See the comment on ExactCategoryMorphism.

Specified by:
getImage in interface ExactCategoryMorphism

getImRetraction

public ExactCategoryMorphism getImRetraction()
Description copied from interface: ExactCategoryMorphism
See the comment on ExactCategoryMorphism.

Specified by:
getImRetraction in interface ExactCategoryMorphism

getCoimToIm

public ExactCategoryMorphism getCoimToIm()
Description copied from interface: ExactCategoryMorphism
The bottom arrow (the isomorphism) in the comment on ExactCategoryMorphism.

Specified by:
getCoimToIm in interface ExactCategoryMorphism

dual

public QvspMorphism dual()
If this is a QvspMorphism VW with matrix A, then dual() returns a QvspMorphism WV whose matrix is the transpose of A.

Strictly speaking, the dual should be a morphism W*V*. We identify V with V* and W with W* under the standard dot product.


main

public static void main(String[] args)
Tests the factorization in ExactCategoryMorphism.

Parameters:
args - m n entry0 entry1 ... We create an m-by-n matrix and feed the entries into it using CSparse.userInputMatrix(java.util.List). We then test the corresponding morphism. The entries must be ints.

destroyAllButKernel

public void destroyAllButKernel()
Provides a more efficient way of computing the kernel and related morphisms, at the price of destroying this morphism itself. After this method is called, getKernel(), getKerRetraction(), getCoimage(), getCoimSection() and rank() will return correct results. However, getMatrix() will be wrong, as will most compositions computed with this morphism. In fact, after calling this method, it's recommend that you grab the kernel and related morphisms if you need them, then throw this to the garbage collector.

If an MPDQ has already been created for this morphism, the present method does nothing.


destroyAllButCokernel

public void destroyAllButCokernel()
Provides a more efficient way of computing the cokernel and related morphisms, at the price of destroying this morphism itself. After this method is called, getCokernel(), getCokerSection(), getImage(), getImRetraction() and rank() will return correct results. However, getMatrix() will be wrong, as will most compositions computed with this morphism. In fact, after calling this method, it's recommend that you grab the cokernel and related morphisms if you need them, then throw this to the garbage collector.

If an MPDQ has already been created for this morphism, the present method does nothing.