sources/headers/Cob.h file

declares the universal cobordism category from [1]

The universal cobordism category is implemented as a category in terms of objects (CobObj) and morphisms between them (CobMor, Deco).

Classes

class Arcs
wrapper for arc representation of tangles
template<typename Coeff>
class CobMor
morphism in the cobordism category
class CobObj
a crossingless two-sided (top/bottom) tangle, ie object of the cobordism category
template<typename Coeff>
class Deco
auxillary class for the definition of CobMor
struct PCA
Wrapper class for some precomputed data needed for the multiplication of CobMor.

Typedefs

using Dots = std::vector<bool>
container type for dot decoration of cobordisms: the $i^\text{th}$ entry is true iff the $i^\text{th}$ component of a cobordism carries a dot.
using TE = uint8_t
tangle end of a two-sided (top/bottom) tangle; tangle ends are enumerated, starting at 0, from the top left to the top right, then bottom left to bottom right.

Functions

template<typename Coeff>
auto CobNonZero(const int& row, const int& col, const CobMor<Coeff>& value) -> bool
true if morphism is zero; this function is needed by the Eigen Template Library
template<typename Coeff>
auto deco_is_zero(const Deco<Coeff>& deco) -> bool
true if the coefficient is 0; this function is used in CobMor::simplify().
void expand_gens_if_needed(const int& n)
computes more entries for PCA::gens if PCA::max_strands < n
void expand_vec_if_needed(const int& n)
computes more entries for PCA::vec if PCA::max < n
auto new_order_new2old(const IndexLL& new_comps, const IndexL& comp_names) -> IndexL
compute new order for comp_names
auto to_BNObj(const TE& strands, const TE& top, const size_t& index) -> bool
true if 2-ended tangle or (4-ended tangle and horizontal), false if (4-ended tangle and vertical); raises error for any other cases.

Function documentation

template<typename Coeff>
bool deco_is_zero(const Deco<Coeff>& deco)

true if the coefficient is 0; this function is used in CobMor::simplify().

check if zero; used in CobMor::simplify().

IndexL new_order_new2old(const IndexLL& new_comps, const IndexL& comp_names)

compute new order for comp_names

the output 'new_order' can be used as a function

new_order[new_index] = old_index

to reference elements in comp_names by their new indices; primarily used for reordering components and deco.dots.

Assumptions:

  • in AddCapMixed: (if the number of components is the same)

    comp_names should be a permutation of the first entries of each new_comp in new_comps.

  • In AddCap11:

    Case 1: One component is split into two. Then the larger comp_name cannot be found in comp_names, so the number of old components is returned in that index.

    Case 2: Two component are merged. Then at the index of the merged component, the smaller of the two old_indices is returned.