Regina 7.3 Calculation Engine
|
Represents a finitely generated abelian group given by a chain complex. More...
#include <algebra/markedabeliangroup.h>
Public Member Functions | |
MarkedAbelianGroup (MatrixInt M, MatrixInt N) | |
Creates a marked abelian group from a chain complex. More... | |
MarkedAbelianGroup (MatrixInt M, MatrixInt N, Integer pcoeff) | |
Creates a marked abelian group from a chain complex with coefficients in Z_p. More... | |
MarkedAbelianGroup (size_t rank, const Integer &p) | |
Creates a free Z_p -module of a given rank using the direct sum of the standard chain complex 0 --> Z --p--> Z --> 0 . More... | |
MarkedAbelianGroup (const MarkedAbelianGroup &)=default | |
Creates a clone of the given group. More... | |
MarkedAbelianGroup (MarkedAbelianGroup &&) noexcept=default | |
Moves the contents of the given group to this new group. More... | |
MarkedAbelianGroup & | operator= (const MarkedAbelianGroup &)=default |
Sets this to be a clone of the given group. More... | |
MarkedAbelianGroup & | operator= (MarkedAbelianGroup &&) noexcept=default |
Moves the contents of the given group to this group. More... | |
void | swap (MarkedAbelianGroup &other) noexcept |
Swaps the contents of this and the given group. More... | |
const MatrixInt & | m () const |
Returns the "right" matrix that was used to define the chain complex. More... | |
const MatrixInt & | n () const |
Returns the "left" matrix that was used to define the chain complex. More... | |
const Integer & | coefficients () const |
Returns the coefficients used for the computation of homology. More... | |
size_t | rank () const |
Returns the rank of the group. More... | |
size_t | torsionRank (const Integer °ree) const |
Returns the rank in the group of the torsion term of given degree. More... | |
size_t | torsionRank (unsigned long degree) const |
Returns the rank in the group of the torsion term of given degree. More... | |
size_t | countInvariantFactors () const |
Returns the number of invariant factors that describe the torsion elements of this group. More... | |
AbelianGroup | unmarked () const |
Returns just the underlying abelian group, without any of the chain complex information. More... | |
size_t | ccRank () const |
Returns the rank of the chain complex supporting the homology computation. More... | |
size_t | snfRank () const |
Returns the minimum number of generators for this group. More... | |
const Integer & | invariantFactor (size_t index) const |
Returns the given invariant factor describing the torsion elements of this group. More... | |
bool | isTrivial () const |
Determines whether this is the trivial (zero) group. More... | |
bool | isZ () const |
Determines whether this is the infinite cyclic group (Z). More... | |
bool | isIsomorphicTo (const MarkedAbelianGroup &other) const |
Determines whether this and the given abelian group are isomorphic. More... | |
bool | operator== (const MarkedAbelianGroup &other) const |
Determines whether this and the given group were formed from identical chain complex constructions. More... | |
bool | operator!= (const MarkedAbelianGroup &other) const |
Determines whether this and the given group were formed from different chain complex constructions. More... | |
Vector< Integer > | freeRep (size_t index) const |
Returns the requested free generator of this group, represented in the original chain complex defining the group. More... | |
Vector< Integer > | torsionRep (size_t index) const |
Returns the requested generator of the torsion subgroup, represented in the original chain complex defining the group. More... | |
Vector< Integer > | ccRep (const Vector< Integer > &snf) const |
A combination of freeRep and torsionRep, this routine takes a group element expressed in SNF coordinates and returns a corresponding vector in the original chain complex. More... | |
Vector< Integer > | ccRep (size_t snfGen) const |
A combination of freeRep() and torsionRep() that expresses a group element as a vector in the original chain complex. More... | |
Vector< Integer > | snfRep (const Vector< Integer > &cycle) const |
Expresses the given cycle as a combination of free and torsion generators. More... | |
Vector< Integer > | cycleProjection (const Vector< Integer > &ccelt) const |
Projects an element of the chain complex to the subspace of cycles. More... | |
Vector< Integer > | cycleProjection (size_t ccindx) const |
Projects a standard basis vector of the chain complex to the subspace of cycles. More... | |
bool | isCycle (const Vector< Integer > &chain) const |
Determines whether the given vector represents a cycle in the chain complex. More... | |
Vector< Integer > | boundaryOf (const Vector< Integer > &chain) const |
Computes the differential of the given vector in the chain complex whose kernel is the cycles. More... | |
bool | isBoundary (const Vector< Integer > &chain) const |
Determines whether the given vector represents a boundary in the chain complex. More... | |
Vector< Integer > | asBoundary (const Vector< Integer > &bdry) const |
Expresses the given vector as a boundary in the chain complex. More... | |
size_t | cycleRank () const |
Returns the number of generators of the kernel of M, where M is the "right" matrix used to define the chain complex. More... | |
Vector< Integer > | cycleGen (size_t index) const |
Returns the requested generator of the cycles, i.e., the kernel of the "right" matrix M in the chain complex. More... | |
MarkedAbelianGroup | torsionSubgroup () const |
Returns the torsion subgroup of this group. More... | |
HomMarkedAbelianGroup | torsionInclusion () const |
Returns a map representing the inclusion of the torsion subgroup into this group. More... | |
void | writeTextShort (std::ostream &out, bool utf8=false) const |
Writes a short text representation of this object to the given output stream. More... | |
void | writeTextLong (std::ostream &out) const |
A default implementation for detailed output. More... | |
std::string | str () const |
Returns a short text representation of this object. More... | |
std::string | utf8 () const |
Returns a short text representation of this object using unicode characters. More... | |
std::string | detail () const |
Returns a detailed text representation of this object. More... | |
Friends | |
class | HomMarkedAbelianGroup |
Represents a finitely generated abelian group given by a chain complex.
This class is initialized with a chain complex. The chain complex is given in terms of two integer matrices M and N such that M×N=0. These matrices should be thought of as acting on column vectors: this means for example that the product B×A
applies the linear transformation A, then the linear transformation B. This is consistent with the convention that Regina uses for for multiplying permutations.
The abelian group that this class computes is the kernel of M modulo the image of N. In other words, we compute the homology of the chain complex Z^a --N--> Z^b --M--> Z^c
, where a = N.columns(), b = M.columns() = N.rows(), and c = M.rows(). An additional constructor allows you to take the homology with coefficients in an arbitrary cyclic group.
Like the simpler class AbelianGroup, this group will be isomorphic to some Z_{d0} + ... + Z_{dk} + Z^r
, where:
This class allows you to retrieve the invariant factors, the rank, and the corresponding vectors in the kernel of M. Moreover, given a vector in the kernel of M, it decribes the homology class of the vector (the free part, and its position in the invariant factors).
The purpose of this class is to not just represent homology groups, but also to support coordinates on the group allowing for the construction of homomorphisms, and keeping track of subgroups.
This routine makes frequent use of two coordinate systems:
Be aware that the choice of torsion and free generators is typically not unique, and this will affect the results of many member functions of this class. These choices are subject to change between different versions of Regina; in particular, they depend upon the particular algorithm used for computing Smith normal forms.
Some routines in this class refer to the internal presentation matrix. This is a proper presentation matrix for the abelian group; if you are looking at the implementation details, this refers to the matrix pres, created by taking the product MRi_ * N
and then removing the first rankM_ rows.
This class implements C++ move semantics and adheres to the C++ Swappable requirement. It is designed to avoid deep copies wherever possible, even when passing or returning objects by value.
Creates a marked abelian group from a chain complex.
This constructor assumes you are interested in homology with integer coefficents.
The abelian group is the kernel of M modulo the image of N. See the class notes for further details.
InvalidArgument | The number of columns in M does not match the number of rows in N. |
M | the ‘right’ matrix in the chain complex; that is, the matrix that one takes the kernel of when computing homology. |
N | the ‘left’ matrix in the chain complex; that is, the matrix that one takes the image of when computing homology. |
Creates a marked abelian group from a chain complex with coefficients in Z_p.
The abelian group is the kernel of M modulo the image of N. See the class notes for further details.
InvalidArgument | The number of columns in M does not match the number of rows in N. |
M | the ‘right’ matrix in the chain complex; that is, the matrix that one takes the kernel of when computing homology. |
N | the ‘left’ matrix in the chain complex; that is, the matrix that one takes the image of when computing homology. |
pcoeff | specifies the coefficient ring, Z_pcoeff. This must be non-negative; a value of 0 indicates that you are using integer coefficients (in which case it is more efficient to use the constructor that just takes two matrices). |
regina::MarkedAbelianGroup::MarkedAbelianGroup | ( | size_t | rank, |
const Integer & | p | ||
) |
Creates a free Z_p
-module of a given rank using the direct sum of the standard chain complex 0 --> Z --p--> Z --> 0
.
This group is isomorphic to n Z_p
. Moreover, if constructed using the matrices-with-coefficients constructor, M would be zero and N would be diagonal and square with p down the diagonal.
rank | the rank of the group as a Z_p-module. That is, if the group is n Z_p , then rank should be n. |
p | describes the type of ring that we use to talk about the "free" module. |
|
default |
Creates a clone of the given group.
|
defaultnoexcept |
Moves the contents of the given group to this new group.
This is a fast (constant time) operation.
The group that was passed will no longer be usable.
Expresses the given vector as a boundary in the chain complex.
N×v != bdry
as elements of TOR are not in the image of N. In this case, (bdry - N×v
) represents the projection to TOR.InvalidArgument | The given vector is not a boundary. |
bdry | a boundary vector, given in chain complex coordinates. |
N×v=bdry
. Computes the differential of the given vector in the chain complex whose kernel is the cycles.
In other words, this routine returns M×chain
, where M is the "right" matrix passed to the class constructor.
InvalidArgument | The given vector is not in chain complex coordinates; that is, its length is not M.columns(). |
chain | any vector in chain complex coordinates. |
|
inline |
Returns the rank of the chain complex supporting the homology computation.
This is the dimension of a vector in chain complex coordinates. In the class notes, this is given by M.columns() and N.rows(), where M and N are the matrices used to define the chain complex.
A combination of freeRep and torsionRep, this routine takes a group element expressed in SNF coordinates and returns a corresponding vector in the original chain complex.
This routine is, in some sense, an inverse to snfRep().
InvalidArgument | The size of the given vector was not precisely snfRank(). |
snf | any vector in SNF coordinates. |
A combination of freeRep() and torsionRep() that expresses a group element as a vector in the original chain complex.
This is similar to the variant of ccRep() that takes a vector as input, but it assumes that your input is a standard basis vector from SNF coordinates. Calling ccRep(snfGen) is equivalent to passing the (snfGen)th unit vector to ccRep().
InvalidArgument | The given index was greater than or equal to the number of generators in SNF coordinates (i.e., greater than or equal to snfRank()). |
snfGen | specifies which standard basis vector to use from SNF coordinates; this must be between 0 and snfRank()-1 inclusive. |
|
inline |
Returns the coefficients used for the computation of homology.
That is, this routine returns the integer p where we use coefficients in Z_p. If we use coefficients in the integers Z, then this routine returns 0.
|
inline |
Returns the number of invariant factors that describe the torsion elements of this group.
This is the minimal number of torsion generators. See the MarkedAbelianGroup class notes for further details.
Returns the requested generator of the cycles, i.e., the kernel of the "right" matrix M in the chain complex.
InvalidArgument | The argument index was out of range (i.e., greater than or equal to cycleRank()). |
index | indicates which generator to return; this must be between 0 and cycleRank()-1 inclusive. |
Vector< Integer > regina::MarkedAbelianGroup::cycleProjection | ( | const Vector< Integer > & | ccelt | ) | const |
Projects an element of the chain complex to the subspace of cycles.
InvalidArgument | The length of the given vector was not the dimension of the chain complex (i.e., the number of chain complex coordinates). |
ccelt | any vector in chain complex coordinates. |
Projects a standard basis vector of the chain complex to the subspace of cycles.
InvalidArgument | The index ccindx was greater than or equal to the dimension of the chain complex (i.e., ccRank()). |
ccindx | the index of the standard basis vector in chain complex coordinates. |
|
inline |
Returns the number of generators of the kernel of M, where M is the "right" matrix used to define the chain complex.
|
inherited |
Returns a detailed text representation of this object.
This text may span many lines, and should provide the user with all the information they could want. It should be human-readable, should not contain extremely long lines (which cause problems for users reading the output in a terminal), and should end with a final newline. There are no restrictions on the underlying character set.
Returns the requested free generator of this group, represented in the original chain complex defining the group.
The generator will be presented in chain complex coordinates.
InvalidArgument | The argument index is out of range (i.e., greater than or equal to rank()). |
index | specifies which free generator to look up; this must be between 0 and rank()-1 inclusive. |
|
inline |
Returns the given invariant factor describing the torsion elements of this group.
See the MarkedAbelianGroup class notes for further details.
If the invariant factors are d0|d1|...|dn, this routine will return di where i is the value of parameter index.
index | the index of the invariant factor to return; this must be between 0 and countInvariantFactors()-1 inclusive. |
Determines whether the given vector represents a boundary in the chain complex.
chain | any vector in chain complex coordinates. |
true
if and only if the given vector represents a boundary. Determines whether the given vector represents a cycle in the chain complex.
chain | any vector in chain complex coordinates. |
true
if and only if the given vector represents a cycle.
|
inline |
Determines whether this and the given abelian group are isomorphic.
other | the group with which this should be compared. |
true
if and only if the two groups are isomorphic.
|
inline |
Determines whether this is the trivial (zero) group.
true
if and only if this is the trivial group.
|
inline |
Determines whether this is the infinite cyclic group (Z).
true
if and only if this is the infinite cyclic group.
|
inline |
Returns the "right" matrix that was used to define the chain complex.
Our group was defined as the kernel of M modulo the image of N. This is the matrix M.
This is the matrix M that was originally passed to the class constructor. See the class overview for further details on matrices M and N and their roles in defining the chain complex.
|
inline |
Returns the "left" matrix that was used to define the chain complex.
Our group was defined as the kernel of M modulo the image of N. This is the matrix N.
This is the matrix N that was originally passed to the class constructor. See the class overview for further details on matrices M and N and their roles in defining the chain complex.
|
inline |
Determines whether this and the given group were formed from different chain complex constructions.
This is not an isomorphism test. For this comparison to return false
(i.e., for the chain complex constructions to be considered identical), both groups must have been constructed from identical matrices M and N, using homology with the same coefficients.
other | the group with which this should be compared. |
true
if and only if the this and the given group do not have identical chain complex definitions.
|
default |
Sets this to be a clone of the given group.
|
defaultnoexcept |
Moves the contents of the given group to this group.
This is a fast (constant time) operation.
The group that was passed will no longer be usable.
|
inline |
Determines whether this and the given group were formed from identical chain complex constructions.
This is not an isomorphism test. For this comparison to return true
, both groups must have been constructed from identical matrices M and N, using homology with the same coefficients.
other | the group with which this should be compared. |
true
if and only if the this and the given group have identical chain complex definitions.
|
inline |
Returns the rank of the group.
This is the number of included copies of Z.
Equivalently, the rank is the maximum number of linearly independent elements, and it indicates the size of the largest free abelian subgroup. The rank effectively ignores all torsion elements.
|
inline |
Returns the minimum number of generators for this group.
This is the dimension of a vector in SNF coordinates. It will always be equal to rank() + countInvariantFactors().
Expresses the given cycle as a combination of free and torsion generators.
This routine takes a single argument cycle, which should be a cycle in chain complex coordinates. This routine then returns this cycle as a group element, expressed in SNF coordinates. See the class notes for a full explanation of what these concepts mean.
In the vector that is returned, the coordinates that hold coefficients for the torsion generators will be non-negative integers modulo the corresponding invariant factors d1, ..., dk.
Specifically, using the notation from the class notes, suppose cycle belongs to ker(M) and snfRep(cycle) returns the vector (b1, ..., bk, a1, ..., ar). Suppose furthermore that the free generators returned by freeRep(0..(r-1)) are f1, ..., fr respectively, and that the torsion generators returned by torsionRep(0..(k-1)) are t1, ..., tk respectively. Then cycle = b1.t1 + ... + bk.tk + a1.f1 + ... + ar.fr modulo img(N).
InvalidArgument | The given vector was the wrong size, or is not a cycle (i.e., not in the kernel of M). |
cycle | a cycle, presented in chain complex coordinates. |
|
inherited |
Returns a short text representation of this object.
This text should be human-readable, should use plain ASCII characters where possible, and should not contain any newlines.
Within these limits, this short text ouptut should be as information-rich as possible, since in most cases this forms the basis for the Python __str__()
and __repr__()
functions.
__str__()
will use precisely this function, and for most classes the Python __repr__()
function will incorporate this into its output.
|
noexcept |
Swaps the contents of this and the given group.
other | the group whose contents should be swapped with this. |
HomMarkedAbelianGroup regina::MarkedAbelianGroup::torsionInclusion | ( | ) | const |
Returns a map representing the inclusion of the torsion subgroup into this group.
size_t regina::MarkedAbelianGroup::torsionRank | ( | const Integer & | degree | ) | const |
Returns the rank in the group of the torsion term of given degree.
If the given degree is d, this routine will return the largest m for which mZ_d is a subgroup of this group.
For instance, if this group is Z_6+Z_12, the torsion term of degree 2 has rank 2 (one occurrence in Z_6 and one in Z_12), and the torsion term of degree 4 has rank 1 (one occurrence in Z_12).
degree | the degree of the torsion term to query. |
|
inline |
Returns the rank in the group of the torsion term of given degree.
If the given degree is d, this routine will return the largest m for which mZ_d is a subgroup of this group.
For instance, if this group is Z_6+Z_12, the torsion term of degree 2 has rank 2 (one occurrence in Z_6 and one in Z_12), and the torsion term of degree 4 has rank 1 (one occurrence in Z_12).
degree | the degree of the torsion term to query. |
Returns the requested generator of the torsion subgroup, represented in the original chain complex defining the group.
The generator will be presented in chain complex coordinates.
InvalidArgument | The argument index is out of range (i.e., greater than or equal to countInvariantFactors()). |
index | specifies which generator in the torsion subgroup; this must be between 0 and countInvariantFactors()-1 inclusive. |
MarkedAbelianGroup regina::MarkedAbelianGroup::torsionSubgroup | ( | ) | const |
Returns the torsion subgroup of this group.
|
inline |
Returns just the underlying abelian group, without any of the chain complex information.
|
inherited |
Returns a short text representation of this object using unicode characters.
Like str(), this text should be human-readable, should not contain any newlines, and (within these constraints) should be as information-rich as is reasonable.
Unlike str(), this function may use unicode characters to make the output more pleasant to read. The string that is returned will be encoded in UTF-8.
|
inlineinherited |
A default implementation for detailed output.
This routine simply calls T::writeTextShort() and appends a final newline.
out | the output stream to which to write. |
void regina::MarkedAbelianGroup::writeTextShort | ( | std::ostream & | out, |
bool | utf8 = false |
||
) | const |
Writes a short text representation of this object to the given output stream.
The text representation will be of the form 3 Z + 4 Z_2 + Z_120
. The torsion elements will be written in terms of the invariant factors of the group, as described in the MarkedAbelianGroup notes.
out | the stream to write to. |
utf8 | if true , then richer unicode characters will be used to make the output more pleasant to read. In particular, the output will use subscript digits and the blackboard bold Z. |