Representation#

class discopy.hopf.Representation(dim=None, action=None)[source]#

Bases: discopy.abc.Result, discopy.frobenius.Dim

A finite-dimensional (left) module over the class parameter algebra: given a Algebra H, the class Representation[H] is the type of objects of \(\mathrm{Rep}(H)\), the category Intertwiner[H], and algebra is accessible on both the class and its instances. A representation is a tensor.Diminside is the underlying vector space \(V\) — carrying its action diagram \(H \otimes V \to V\) (with V = action.cod), which the ribbon classmethods of Intertwiner read off.

Parameters:
  • dim – The underlying vector space \(V\) as a single tensor.Dim, Dim(1) by default.

  • action – The action diagram \(H \otimes V \to V\); when not given, the trivial action algebra.counit @ Id(dim).

The product of representations (tensor()) acts through the comultiplication and the adjoints l, r are the dual module with the action twisted by \(S^{-1}\) and \(S\). Equality is that of the underlying tensor.Dim: two modules on the same space are distinguished by their action, not by ==.

A representation satisfies the two module axioms as diagram equations (is_module()): the action is associative over mult and unital over unit. Here is the associativity axiom (mult @ V) >> action == (H @ action) >> action for a direct sum of two anyon modules of \(D(\mathbb{Z}/2)\), with the left-hand side drawn as the tensor.CMap it contracts to:

>>> D = Double(Algebra.cyclic(2))
>>> e = Representation[D].anyon(0, -1)
>>> m = Representation[D].anyon(1, 1)
>>> V = Representation[D].direct_sum([e, m])
>>> assert V.algebra == D
>>> assert V.is_module() and V == Dim(2)
>>> ty = V.action.cod
>>> (D.mult @ ty >> V.action).to_map().draw(  
...     doctest='docs/_static/hopf/module.dot')

graph cmap { graph [bgcolor="white", fontname="DejaVu Sans", layout="dot", margin="0.04", outputorder="edgesfirst", overlap="false", rankdir="TB", splines="true"]; node [color="black", fontname="DejaVu Sans", fontsize="12", margin="0", shape="plain"]; edge [color="black", fontname="DejaVu Sans", fontsize="9", headclip="true", penwidth="1.4", tailclip="true"]; v0 [label=<<TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"><TR><TD PORT="p5" TOOLTIP="dom 0: Dim(2) (up, up)" BORDER="0" CELLPADDING="0" COLSPAN="2" WIDTH="36" HEIGHT="0"></TD></TR><TR><TD BORDER="1" CELLPADDING="6" COLSPAN="2" WIDTH="36">Δ</TD></TR><TR><TD PORT="p7" TOOLTIP="cod 0: Dim(2) (down, down)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD><TD PORT="p6" TOOLTIP="cod 1: Dim(2) (down, down)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD></TR></TABLE>>]; v1 [label=<<TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"><TR><TD PORT="p8" TOOLTIP="dom 0: Dim(2) (up, up)" BORDER="0" CELLPADDING="0" COLSPAN="2" WIDTH="36" HEIGHT="0"></TD></TR><TR><TD BORDER="1" CELLPADDING="6" COLSPAN="2" WIDTH="36">Δ</TD></TR><TR><TD PORT="p10" TOOLTIP="cod 0: Dim(2) (down, down)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD><TD PORT="p9" TOOLTIP="cod 1: Dim(2) (down, down)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD></TR></TABLE>>]; v2 [label=<<TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"><TR><TD PORT="p11" TOOLTIP="dom 0: Dim(2) (up, up)" BORDER="0" CELLPADDING="0" COLSPAN="2" WIDTH="36" HEIGHT="0"></TD></TR><TR><TD BORDER="1" CELLPADDING="6" COLSPAN="2" WIDTH="36">∇</TD></TR><TR><TD PORT="p13" TOOLTIP="cod 0: Dim(2) (down, down)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD><TD PORT="p12" TOOLTIP="cod 1: Dim(2) (down, down)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD></TR></TABLE>>]; v3 [label=<<TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"><TR><TD PORT="p14" TOOLTIP="dom 0: Dim(2) (up, up)" BORDER="0" CELLPADDING="0" COLSPAN="2" WIDTH="36" HEIGHT="0"></TD></TR><TR><TD BORDER="1" CELLPADDING="6" COLSPAN="2" WIDTH="36">∇</TD></TR><TR><TD PORT="p16" TOOLTIP="cod 0: Dim(2) (down, down)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD><TD PORT="p15" TOOLTIP="cod 1: Dim(2) (down, down)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD></TR></TABLE>>]; v4 [label=<<TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"><TR><TD PORT="p17" TOOLTIP="dom 0: Dim(2) (up, up)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD></TR><TR><TD BORDER="1" CELLPADDING="6" COLSPAN="1" WIDTH="18">S⁻¹</TD></TR><TR><TD PORT="p18" TOOLTIP="cod 0: Dim(2) (down, down)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD></TR></TABLE>>]; v5 [label=<<TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"><TR><TD PORT="p19" TOOLTIP="dom 0: Dim(2) (up, up)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD><TD PORT="p20" TOOLTIP="dom 1: Dim(2) (up, up)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD></TR><TR><TD BORDER="1" CELLPADDING="6" COLSPAN="2" WIDTH="36">Δ</TD></TR><TR><TD PORT="p21" TOOLTIP="cod 0: Dim(2) (down, down)" BORDER="0" CELLPADDING="0" COLSPAN="2" WIDTH="36" HEIGHT="0"></TD></TR></TABLE>>]; v6 [label=<<TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"><TR><TD PORT="p22" TOOLTIP="dom 0: Dim(2) (up, up)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD><TD PORT="p23" TOOLTIP="dom 1: Dim(2) (up, up)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD></TR><TR><TD BORDER="1" CELLPADDING="6" COLSPAN="2" WIDTH="36">∇</TD></TR><TR><TD PORT="p24" TOOLTIP="cod 0: Dim(2) (down, down)" BORDER="0" CELLPADDING="0" COLSPAN="2" WIDTH="36" HEIGHT="0"></TD></TR></TABLE>>]; v7 [label=<<TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"><TR><TD PORT="p25" TOOLTIP="dom 0: Dim(2) (up, up)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD><TD PORT="p26" TOOLTIP="dom 1: Dim(2) (up, up)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD><TD PORT="p27" TOOLTIP="dom 2: Dim(2) (up, up)" BORDER="0" CELLPADDING="0" COLSPAN="1" WIDTH="18" HEIGHT="0"></TD></TR><TR><TD BORDER="1" CELLPADDING="6" COLSPAN="3" WIDTH="54">ρ</TD></TR><TR><TD PORT="p28" TOOLTIP="cod 0: Dim(2) (down, down)" BORDER="0" CELLPADDING="0" COLSPAN="3" WIDTH="54" HEIGHT="0"></TD></TR></TABLE>>]; input [label=<<TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"><TR><TD PORT="p0" TOOLTIP="input 0: Dim(2)" BORDER="0" CELLPADDING="4"></TD><TD PORT="p1" TOOLTIP="input 1: Dim(2)" BORDER="0" CELLPADDING="4"></TD><TD PORT="p2" TOOLTIP="input 2: Dim(2)" BORDER="0" CELLPADDING="4"></TD><TD PORT="p3" TOOLTIP="input 3: Dim(2)" BORDER="0" CELLPADDING="4"></TD><TD PORT="p4" TOOLTIP="input 4: Dim(2)" BORDER="0" CELLPADDING="4"></TD></TR></TABLE>>]; output [label=<<TABLE BORDER="0" CELLBORDER="0" CELLSPACING="0"><TR><TD PORT="p29" TOOLTIP="output 0: Dim(2)" BORDER="0" CELLPADDING="4"></TD></TR></TABLE>>]; { rank=min; input; } { rank=max; output; } input:p0:s -- v5:p19:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; input:p1:s -- v0:p5:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; input:p2:s -- v2:p11:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; input:p3:s -- v6:p23:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; input:p4:s -- v7:p27:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; v0:p6:s -- v4:p17:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; v0:p7:s -- v1:p8:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; v1:p9:s -- v6:p22:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; v1:p10:s -- v2:p12:s [label="Dim(2)", labeldistance="1.6", len="0.85"]; v2:p13:s -- v3:p14:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; v3:p15:s -- v5:p20:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; v3:p16:s -- v4:p18:s [label="Dim(2)", labeldistance="1.6", len="0.85"]; v5:p21:s -- v7:p25:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; v6:p24:s -- v7:p26:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; v7:p28:s -- output:p29:n [label="Dim(2)", labeldistance="1.6", len="0.85"]; }

tensor(*others)[source]#

The product of representations: the underlying spaces concatenate as for a tensor.Dim and the product of modules acts through the comultiplication, \(\rho_{V \otimes W} = (\rho_V \otimes \rho_W) (\Delta \otimes 1_{V \otimes W})\). A plain tensor.Dim factor is taken as the trivial representation.

>>> D = Double(Algebra.cyclic(2))
>>> e = Representation[D].anyon(0, -1)
>>> m = Representation[D].anyon(1, 1)
>>> assert (e @ m).is_module() and (e @ Dim(2)).is_module()
dual(antipode)[source]#

The dual module \(V^*\) with \(\rho^*(h) = \rho(S h)^T\) for the given antipode diagram \(S\): the transpose() of the twisted action, with the algebra wire bent back to the domain. The legs of \(V^*\) come out in reversed order.

property r#

The right dual, dual() for the antipode.

>>> H = Algebra.sweedler()
>>> assert Representation[H].regular().r.is_module()
property l#

The left dual, dual() for the inverse antipode — it differs from r unless \(S^2 = 1\).

>>> H = Algebra.sweedler()
>>> assert Representation[H].regular().l.is_module()
qdim()[source]#

The quantum dimension: the value of a loop coloured by V, i.e. the (co)evaluation \(\cup \circ \cap\) in Intertwiner.

is_module()[source]#

Whether action is a representation: the two module axioms hold as diagram equations — the action is associative over mult and unital over unit. See the axiom drawn in the class docstring.

classmethod regular()[source]#

The regular representation, acting on H by mult.

classmethod anyon(flux, charge)[source]#

A one-dimensional anyon module of the quantum double of a cyclic group algebra: the group element e_a acts by charge ** a in the flux sector flux.

classmethod direct_sum(reps)[source]#

The direct sum of modules over one algebra, acting block-diagonally.

>>> D = Double(Algebra.cyclic(2))
>>> e = Representation[D].anyon(0, -1)
>>> m = Representation[D].anyon(1, 1)
>>> V = Representation[D].direct_sum([e, m])
>>> assert V.is_module() and V == Dim(2)