Intertwiner#
- class discopy.hopf.Intertwiner(inside, dom, cod, _scan=True)[source]#
Bases:
discopy.utils.Result,discopy.tensor.Diagram,discopy.abc.RibbonCategoryThe ribbon category \(\mathrm{Rep}(H)\) of representations of the class parameter
algebra: given aAlgebraH, the classIntertwiner[H]is a category oftensor.Diagrams whose objects areRepresentation[H], andalgebrais accessible on both the class and its instances. Its ribbon structure is given by its classmethods — the braiding isbraid()(the R-matrix acting on the two strands, then a swap), thetwist()is the trace of the self-braiding, and the (co)evaluationscups()/caps()pair a module with its dualRepresentation.r, twisting by the pivotal element of the algebra when it is non-trivial.An intertwiner can also be built from concrete data:
Intertwiner[H](array, dom, cod)wraps the array in a single box, as for atensor.Tensor— this is how a ribbonFunctormaps its generating boxes.Example
An intertwiner
fbetween modules is a map that commutes with the action, \(f \circ \rho_V = \rho_W \circ (1_H \otimes f)\). We check this axiom for the braid on \(V \otimes V\), whose product action \(\rho_{V \otimes V}\) goes through the comultiplication (seeRepresentation.tensor()), and draw the left-hand side as thetensor.CMapit contracts to:>>> import numpy as np >>> D = Double(Algebra.cyclic(2)) >>> e = Representation[D].anyon(0, -1) >>> m = Representation[D].anyon(1, 1) >>> V = Representation[D].direct_sum([e, m]) >>> action = (V @ V).action >>> braid = Intertwiner[D].braid(V, V) >>> lhs, rhs = action >> braid, Id(D.ty) @ braid >> action >>> assert lhs.eval(dtype=complex).is_close(rhs.eval(dtype=complex)) >>> lhs.to_map().draw( ... doctest='docs/_static/hopf/intertwiner.dot')
The braid contracts to the braiding matrix of the toric code:
>>> matrix = braid.eval(dtype=complex).array.reshape(4, 4) >>> assert np.allclose(matrix, [[1, 0, 0, 0], [0, 0, -1, 0], ... [0, 1, 0, 0], [0, 0, 0, 1]])
- Parameters:
dom (C0)
cod (C0)
- classmethod braid(left, right, is_dagger=False)[source]#
The braiding \(V \otimes W \to W \otimes V\) (its inverse \(R^{-1} = (S \otimes 1) R\) when
is_dagger): the R-matrix acting on the two strands, i.e. \((\rho_V \otimes \rho_W)(R)\), then a swap. Raises aValueErrorif the algebra has no R-matrix.
- classmethod twist(dom)[source]#
The twist of
dom: the action of the ribbon elementAlgebra.ribbon_element.
- classmethod cups(left, right)[source]#
The evaluation of a module against its dual. When
rightis the right dual ofleft— read off theactionof the two modules, so that the standardrigid.Functordispatch applies unchanged — this is the pivotal evaluation, twisting the dual leg by the inverse of the pivotal element; the pairing of a dual against its module is the plain one. Both coincide whenever the pivotal element is trivial.
- classmethod caps(left, right)[source]#
The coevaluation of a module against its dual. When
rightis the right dual ofleftthis is the plain copairing; a dual followed by its module — read off theactionof the two modules, as forcups()— is the pivotal coevaluation, twisting the module leg by the inverse of the pivotal element. Both coincide whenever the pivotal element is trivial.