Skip to content

Hopf structure

hopf

hopf.py

Hopf algebra structure of U_q(sl_2): coproduct Δ, counit ε, antipode S.

Definitions (on generators)
Δ(E) = E ⊗ 1 + K ⊗ E
Δ(F) = F ⊗ K^{-1} + 1 ⊗ F
Δ(K) = K ⊗ K
Δ(K^{-1}) = K^{-1} ⊗ K^{-1}

ε(E) = 0,  ε(F) = 0,  ε(K) = 1,  ε(K^{-1}) = 1

S(E) = -K^{-1} E
S(F) = -F K
S(K) = K^{-1}
S(K^{-1}) = K

Hopf axioms (checkable as matrices on a representation V):

(H1)  Coassociativity: (Δ ⊗ id) Δ(X) = (id ⊗ Δ) Δ(X)
(H2)  Counit: (ε ⊗ id) Δ(X) = X = (id ⊗ ε) Δ(X)
(H3)  Antipode: μ ∘ (S ⊗ id) ∘ Δ(X) = ε(X) · 1 = μ ∘ (id ⊗ S) ∘ Δ(X)

Here μ denotes matrix multiplication (algebra multiplication).

Given a Representation object, this module checks the three axioms for each generator using Kronecker products (matrix tensor products).

coproduct

coproduct(rep: Representation) -> dict[str, sp.Matrix]

Return the matrix representation of Δ(X) on V ⊗ V.

For a representation V, compute the matrix from the formulas using the standard Kronecker basis order: the first V index changes slowly and the second changes quickly.

Source code in quantum_group/hopf.py
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
def coproduct(rep: Representation) -> dict[str, sp.Matrix]:
    """Return the matrix representation of Δ(X) on V ⊗ V.

    For a representation V, compute the matrix from the formulas using the
    standard Kronecker basis order: the first V index changes slowly and the
    second changes quickly.
    """
    I = sp.eye(rep.dim)

    return {
        "E": kron(rep.E, I) + kron(rep.K, rep.E),
        "F": kron(rep.F, rep.K_inv) + kron(I, rep.F),
        "K": kron(rep.K, rep.K),
        "K_inv": kron(rep.K_inv, rep.K_inv),
    }

counit

counit() -> dict[str, sp.Expr]

Return the counit ε: U_q(sl_2) -> Q(q) on generators.

Source code in quantum_group/hopf.py
63
64
65
66
67
68
69
70
def counit() -> dict[str, sp.Expr]:
    """Return the counit ε: U_q(sl_2) -> Q(q) on generators."""
    return {
        "E": sp.Integer(0),
        "F": sp.Integer(0),
        "K": sp.Integer(1),
        "K_inv": sp.Integer(1),
    }

antipode

antipode(rep: Representation) -> dict[str, sp.Matrix]

Return the matrix representation of S(X) on V.

Source code in quantum_group/hopf.py
73
74
75
76
77
78
79
80
def antipode(rep: Representation) -> dict[str, sp.Matrix]:
    """Return the matrix representation of S(X) on V."""
    return {
        "E": -rep.K_inv * rep.E,
        "F": -rep.F * rep.K,
        "K": rep.K_inv,
        "K_inv": rep.K,
    }

verify_counit

verify_counit(rep: Representation) -> dict[str, HopfAxiomCheck]

Check (ε ⊗ id) Δ(X) = X = (id ⊗ ε) Δ(X).

The counit ε is scalar-valued, and ε ⊗ id contracts a tensor from V ⊗ V to V. For n-dimensional V, Δ(X) is an n²×n² matrix. To apply ε ⊗ id, we need a decomposition Δ(X) = Σ X_(1) ⊗ X_(2), rather than just its matrix. The construction uses the known formula for each generator, Δ(X) = Σ A_i ⊗ B_i.

Source code in quantum_group/hopf.py
101
102
103
104
105
106
107
108
109
110
def verify_counit(rep: Representation) -> dict[str, HopfAxiomCheck]:
    """Check (ε ⊗ id) Δ(X) = X = (id ⊗ ε) Δ(X).

    The counit ε is scalar-valued, and ε ⊗ id contracts a tensor from
    V ⊗ V to V. For n-dimensional V, Δ(X) is an n²×n² matrix. To apply
    ε ⊗ id, we need a decomposition Δ(X) = Σ X_(1) ⊗ X_(2), rather than
    just its matrix. The construction uses the known formula for each
    generator, Δ(X) = Σ A_i ⊗ B_i.
    """
    return _verify_counit_via_labels(rep)

verify_antipode

verify_antipode(rep: Representation) -> dict[str, HopfAxiomCheck]

Check μ ∘ (S ⊗ id) ∘ Δ(X) = ε(X) · I = μ ∘ (id ⊗ S) ∘ Δ(X).

The results are n×n matrix equations on V.

Source code in quantum_group/hopf.py
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
def verify_antipode(rep: Representation) -> dict[str, HopfAxiomCheck]:
    """Check μ ∘ (S ⊗ id) ∘ Δ(X) = ε(X) · I = μ ∘ (id ⊗ S) ∘ Δ(X).

    The results are n×n matrix equations on V.
    """
    n = rep.dim
    I = sp.eye(n)
    eps = counit()
    S = antipode(rep)
    label_to_mat = {"E": rep.E, "F": rep.F, "K": rep.K,
                    "K_inv": rep.K_inv, "1": I}
    label_to_S = {"E": S["E"], "F": S["F"], "K": S["K"],
                  "K_inv": S["K_inv"], "1": I}

    decompositions = {
        "E": [("E", "1"), ("K", "E")],
        "F": [("F", "K_inv"), ("1", "F")],
        "K": [("K", "K")],
        "K_inv": [("K_inv", "K_inv")],
    }

    results: dict[str, HopfAxiomCheck] = {}
    for X, terms in decompositions.items():
        # μ ∘ (S ⊗ id) ∘ Δ(X) = Σ S(X1_i) · X2_i
        left = sum((label_to_S[a] * label_to_mat[b]
                    for (a, b) in terms), sp.zeros(n, n))
        # μ ∘ (id ⊗ S) ∘ Δ(X) = Σ X1_i · S(X2_i)
        right = sum((label_to_mat[a] * label_to_S[b]
                     for (a, b) in terms), sp.zeros(n, n))
        target = sp.Integer(eps[X]) * I
        ok_left = sp.simplify(left - target) == sp.zeros(n, n)
        ok_right = sp.simplify(right - target) == sp.zeros(n, n)
        results[X] = HopfAxiomCheck(
            name=f"Antipode ({X})",
            holds=bool(ok_left and ok_right),
        )
    return results

verify_coassociativity

verify_coassociativity(rep: Representation) -> dict[str, HopfAxiomCheck]

Check (Δ ⊗ id) Δ(X) = (id ⊗ Δ) Δ(X) on V ⊗ V ⊗ V.

This follows from the definition of Δ, but gives an explicit matrix-level verification.

Source code in quantum_group/hopf.py
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
def verify_coassociativity(rep: Representation) -> dict[str, HopfAxiomCheck]:
    """Check (Δ ⊗ id) Δ(X) = (id ⊗ Δ) Δ(X) on V ⊗ V ⊗ V.

    This follows from the definition of Δ, but gives an explicit matrix-level
    verification.
    """
    n = rep.dim
    I = sp.eye(n)
    Delta = coproduct(rep)

    # (Δ ⊗ id) Δ(X): apply Δ to the left factor of the n² x n² matrix Δ(X).
    # Use the labelled decomposition Δ(X) = Σ A_i ⊗ B_i, then apply Δ to A_i.

    decompositions = {
        "E": [("E", "1"), ("K", "E")],
        "F": [("F", "K_inv"), ("1", "F")],
        "K": [("K", "K")],
        "K_inv": [("K_inv", "K_inv")],
    }
    label_to_mat = {"E": rep.E, "F": rep.F, "K": rep.K,
                    "K_inv": rep.K_inv, "1": I}
    label_to_Delta = {
        "E": Delta["E"],
        "F": Delta["F"],
        "K": Delta["K"],
        "K_inv": Delta["K_inv"],
        "1": kron(I, I),
    }

    results: dict[str, HopfAxiomCheck] = {}
    for X, terms in decompositions.items():
        # Left: Σ Δ(A_i) ⊗ B_i  (n^3 x n^3)
        left = sum((kron(label_to_Delta[a], label_to_mat[b])
                    for (a, b) in terms), sp.zeros(n**3, n**3))
        # Right: Σ A_i ⊗ Δ(B_i)
        right = sum((kron(label_to_mat[a], label_to_Delta[b])
                     for (a, b) in terms), sp.zeros(n**3, n**3))
        diff = sp.simplify(left - right)
        ok = diff == sp.zeros(n**3, n**3)
        results[X] = HopfAxiomCheck(
            name=f"Coassociativity ({X})",
            holds=bool(ok),
        )
    return results

verify_all_hopf_axioms

verify_all_hopf_axioms(rep: Representation) -> dict[str, dict[str, HopfAxiomCheck]]

Check all Hopf axioms on V and return grouped results.

Source code in quantum_group/hopf.py
235
236
237
238
239
240
241
def verify_all_hopf_axioms(rep: Representation) -> dict[str, dict[str, HopfAxiomCheck]]:
    """Check all Hopf axioms on V and return grouped results."""
    return {
        "coassociativity": verify_coassociativity(rep),
        "counit": _verify_counit_via_labels(rep),
        "antipode": verify_antipode(rep),
    }