sources/headers/BNAlgebra.h file

declares the Bar-Natan algebra $\mathcal{B}$ from [4]

The Bar-Natan algebra $\mathcal{B}$ is implemented as a category in terms of objects (BNObj) and morphisms between them (BNMor, Label). We also use the classes defined here to implement the free polynomial ring $k[H]$ , namely we regard it as the subalgebra $\langle \mathrm{id}_\bullet,D_\bullet,D_\bullet^2, D_\bullet^3,\dots\rangle$ of $\mathcal{B}$ based at the idempotent ●.

Classes

template<typename Coeff>
class BNMor
morphism of the Bar-Natan algebra $\mathcal{B}$
class BNObj
object of the Bar-Natan algebra $\mathcal{B}$
template<typename Coeff>
class Label
auxillary class for the definition of BNMor

Typedefs

using Idem = bool
idempotent of the Bar-Natan algebra $\mathcal{B}$ : true = 1 = ● (= b = ⦁ = ⬮) and false = 0 = ○ (= c = ∘ = ⬯).

Functions

auto arrow_is_shorter(const int& a, const int& b) -> bool
false if a=0; otherwise true if |a|<|b|, assuming both have the same sign. This function is needed in the arrow pushing algorithm.
template<typename Coeff>
auto BNMorNonZero(const int& row, const int& col, const BNMor<Coeff>& value) -> bool
true if morphism is zero; this function is needed by the Eigen Template Library
template<typename Coeff>
auto label_is_zero(const Label<Coeff>& label) -> bool
true if the coefficient of the label is zero. This function is used in BNMor::simplify().