Crystal graphs and plots¶
crystal ¶
crystal.py¶
Combinatorial model of the Kashiwara crystal B(n) for U_q(sl_2).
In the q -> 0 limit, the basis vectors of V_n become the combinatorial objects {b_0, b_1, ..., b_n}. The generators E and F reduce to partial maps:
tilde_f(b_k) = b_{k+1}, for k < n; tilde_f(b_n) = None
tilde_e(b_k) = b_{k-1}, for k > 0; tilde_e(b_0) = None
Weight map: wt(b_k) = n - 2k.
This module constructs the crystal as a directed labelled graph: nodes carry (name, weight) pairs, and edges are tilde_f arrows.
CrystalNode
dataclass
¶
A single crystal node in B(n).
Source code in quantum_group/crystal.py
28 29 30 31 32 33 | |
build_crystal ¶
build_crystal(n: int) -> nx.DiGraph
Construct the crystal graph B(n).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
Highest weight (dimension = n + 1). n >= 0. |
required |
Returns:
| Type | Description |
|---|---|
DiGraph
|
Each node "b_k" (str) has 'index', 'weight' and 'label' attributes. Edges are tilde_f arrows (b_k -> b_{k+1}). |
Source code in quantum_group/crystal.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
crystal_nodes ¶
crystal_nodes(n: int) -> list[CrystalNode]
Return the nodes of B(n) as a list of CrystalNode objects.
Source code in quantum_group/crystal.py
66 67 68 69 70 | |
f_tilde ¶
f_tilde(node: CrystalNode, n: int) -> CrystalNode | None
Apply the crystal operator tilde_f.
Source code in quantum_group/crystal.py
73 74 75 76 77 78 | |
e_tilde ¶
e_tilde(node: CrystalNode, n: int) -> CrystalNode | None
Apply the crystal operator tilde_e.
Source code in quantum_group/crystal.py
81 82 83 84 85 86 | |
crystal_string ¶
crystal_string(n: int) -> str
Return B(n) as text: b_0 -f-> b_1 -f-> ... -f-> b_n.
Source code in quantum_group/crystal.py
89 90 91 92 | |
visualization ¶
visualization.py¶
Visualization of U_q(sl_2) representations and crystals.
Two kinds of diagrams:
-
Weight diagram — The K-weights of V_n (n - 2k, k = 0..n) are plotted as points on a number line. This has the same structure as the classical sl_2 weight diagram; q changes the base of the eigenvalues but not the pattern of exponents.
-
Crystal graph — NetworkX draws the crystal B(n) as a directed path b_0 -> b_1 -> ... -> b_n.
All functions return a Matplotlib Figure; the caller handles display or saving.
plot_weight_diagram ¶
plot_weight_diagram(n: int, ax: Axes | None = None) -> plt.Figure
Plot the weight diagram of V_n as points on a number line.
The weights are n, n-2, ..., -n+2, -n.
Source code in quantum_group/visualization.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
plot_crystal_graph ¶
plot_crystal_graph(n: int, ax: Axes | None = None) -> plt.Figure
Plot the crystal graph B(n) as a horizontal directed path.
Source code in quantum_group/visualization.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
plot_combined ¶
plot_combined(n: int) -> plt.Figure
Plot both the weight diagram and crystal graph in one call.
Source code in quantum_group/visualization.py
103 104 105 106 107 108 109 | |