coxeter — Coxeter group construction and orbit expansion#
Coxeter group construction, finite-type classification, and BFS enumeration.
Provides the mathematical foundation for Weyl orbit expansion in the extended Kahler cone construction. Functions include:
matrix_period: Multiplicative order of an integer matrixcoxeter_reflection: Reflection matrix from arXiv:2212.10573 Eq. (4.6)coxeter_element: Product of reflection matrices (the Coxeter element)coxeter_order_matrix: Compute m_ij = order(M_i M_j)coxeter_bilinear_form: B_ij = -cos(pi/m_ij)is_finite_type: Positive-definiteness check of the bilinear formclassify_coxeter_type: Decompose into irreducible components and classifycoxeter_group_order: \(|W|\) from closed-form formulas per typeenumerate_coxeter_group: Streaming BFS on the Cayley graph
See arXiv:2212.10573 Section 4.3 for the role of Coxeter groups in the extended Kahler cone construction.
Moved from cybir.core.util: matrix_period, coxeter_reflection,
and coxeter_matrix (renamed to coxeter_element).
- apply_coxeter_orbit(ekc, reflections='ekc', phases=True)#
Expand the fundamental domain via Coxeter group orbit.
Enumerates the full Coxeter group from the selected reflection set and applies every non-identity group element to every fundamental- domain phase and edge, producing the extended/hyperextended Kahler cone.
- Parameters:
ekc (CYBirationalClass) – Must have
construct_phasescompleted. Modified in place.reflections (str or iterable, optional) –
Which reflections to use for orbit expansion:
'ekc'(default): symmetric flop reflections only (produces EKC)'hekc': sym flop + SU2_NONGENERIC_CS (produces HEKC)'all': all Coxeter reflections (full group)Custom iterable of reflection matrices
phases (bool, optional) – If
True(default), create full reflected phase objects and graph edges. IfFalse, only accumulate cone generators (faster, less memory). See D-13.
Notes
The algorithm (per D-10 through D-14):
Select reflection set based on
reflectionsparameter (D-04)Check finite type via positive definiteness (D-06)
Classify and compute expected order (D-05)
Memory estimation (D-07)
Streaming BFS: for each group element g (skip identity): - Reflect each fundamental phase (phases=True only) - Accumulate Kahler rays, terminal wall curves, zero-vol divisors - Reflect each fundamental edge (D-12)
No deduplication of reflected phases (D-11).
See arXiv:2212.10573 Section 4.3.
- classify_coxeter_type(order_matrix)#
Classify a Coxeter group by decomposing into irreducible components.
Decomposes the Coxeter graph into connected components and classifies each against known Dynkin diagrams.
- Parameters:
order_matrix (numpy.ndarray) – Coxeter order matrix (symmetric, integer, diagonal = 1).
- Returns:
list of tuple – Each tuple is
(type_string, rank, order)for one irreducible component.
Notes
See arXiv:2212.10573 Section 4.3. For reducible groups, the total order is the product of the component orders.
- coxeter_bilinear_form(order_matrix)#
Compute the bilinear form B_ij = -cos(pi / m_ij).
This is the standard bilinear form associated with a Coxeter group. The group is finite if and only if B is positive definite.
- Parameters:
order_matrix (numpy.ndarray) – Coxeter order matrix (symmetric, integer, diagonal = 1).
- Returns:
numpy.ndarray – Real symmetric matrix.
Notes
See arXiv:2212.10573 Section 4.3 and Wikipedia: Coxeter group.
- coxeter_element(reflections)#
Compute the Coxeter element from a list of reflection matrices.
The Coxeter element is the ordered product \(M_1 M_2 \cdots M_n\) of the individual reflections. See arXiv:2212.10573 Section 4 for the role of the Coxeter element in determining the extended Kahler cone structure.
- Parameters:
reflections (list of numpy.ndarray) – Reflection matrices to multiply.
- Returns:
numpy.ndarray – The Coxeter element (product of all reflections).
- Raises:
ValueError – If reflections is empty.
Notes
Renamed from
coxeter_matrix(per P-04). The old name is kept as a deprecated alias.
- coxeter_group_order(type_list)#
Compute the order \(|W|\) of a Coxeter group from its type classification.
For reducible groups, the order is the product of the orders of the irreducible components.
- Parameters:
type_list (list of tuple) – Output of
classify_coxeter_type(): list of(type_string, rank, order)tuples.- Returns:
int – The order \(|W|\) of the Coxeter group.
Notes
See arXiv:2212.10573 Section 4.3.
- coxeter_order_matrix(reflections)#
Compute the Coxeter order matrix m_ij = order(M_i M_j).
Diagonal entries are 1 (since \(M_i^2 = I\) for reflections). Off-diagonal entry m_ij is the order of the product \(M_i M_j\).
- Parameters:
reflections (list of numpy.ndarray) – Integer reflection matrices.
- Returns:
numpy.ndarray – Symmetric integer matrix with m_ii = 1.
Notes
See arXiv:2212.10573 Section 4.3. The Coxeter order matrix encodes the presentation of the Coxeter group: generators \(s_i\) with relations \((s_i s_j)^{m_{ij}} = 1\).
- coxeter_reflection(divisor, curve)#
Compute the Coxeter reflection matrix for a given divisor and curve.
Implements the reflection
\[M_{ab} = \delta_{ab} - 2 \frac{\mathcal{C}_a D_b}{\mathcal{C} \cdot D}\]from arXiv:2212.10573 Eq. (4.6). The reflection satisfies \(M \mathcal{C} = -\mathcal{C}\).
When \(\mathcal{C} \cdot D = 0\) the reflection is undefined and the identity matrix is returned.
- Parameters:
divisor (numpy.ndarray) – Divisor class \(D_a\).
curve (numpy.ndarray) – Curve class \(\mathcal{C}_a\).
- Returns:
numpy.ndarray – Reflection matrix of shape
(h11, h11).
Notes
The outer product order is \(\mathcal{C}_a D_b\) (curve x divisor), not \(D_a \mathcal{C}_b\). Getting this wrong flips which vector is reflected.
- enumerate_coxeter_group(generators, expected_order=None, max_memory_bytes=500000000)#
Enumerate all elements of a finite Coxeter group via BFS.
Performs breadth-first search on the Cayley graph, starting from the identity and right-multiplying by each generator. Yields group elements as int64 matrices in BFS order (identity first).
- Parameters:
generators (list of numpy.ndarray) – Integer reflection matrices (generators of the Coxeter group).
expected_order (int, optional) – Expected \(|W|\) from type classification. Used for memory estimation and as a sanity check.
max_memory_bytes (int, optional) – Memory cap for the seen-set. Default 500 MB. A warning is logged if the estimated memory exceeds this.
- Yields:
numpy.ndarray – Group elements (int64 matrices) in BFS order.
Notes
The BFS uses right-multiplication: if g is a discovered group element and M_i is a generator, then
g @ M_iis a new candidate. This is consistent with generators acting on the LEFT of column vectors (Pitfall 4 in RESEARCH.md).All arithmetic is performed in int64 to prevent float drift (Pitfall 2). The seen-set stores byte representations of int64 matrices.
See arXiv:2212.10573 Section 4.3 for the Coxeter group structure.
- is_finite_type(order_matrix)#
Check if the Coxeter group is finite via positive definiteness.
A Coxeter group is finite if and only if the bilinear form \(B_{ij} = -\cos(\pi / m_{ij})\) is positive definite.
- Parameters:
order_matrix (numpy.ndarray) – Coxeter order matrix.
- Returns:
bool –
Trueif the Coxeter group is finite.
Notes
Uses
np.linalg.eigvalshwith tolerance1e-10to handle numerical noise. See arXiv:2212.10573 Section 4.3.
- matrix_period(M, max_iter=200)#
Compute the multiplicative period of an integer matrix.
Finds the smallest positive integer k such that \(M^k = I\). Uses exact integer arithmetic (
int64) to avoid float drift (per P-03 in RESEARCH.md).- Parameters:
M (numpy.ndarray) – Square integer matrix.
max_iter (int, optional) – Maximum power to check (default
200).
- Returns:
int – The period k.
- Raises:
ValueError – If no period is found within max_iter.
Notes
See arXiv:2212.10573 Section 4.3 for the use of matrix periods in computing Coxeter order matrices. The original implementation used float64 arithmetic with
np.allclose; this version uses exactint64comparison to prevent BFS drift (Pitfall 2).
- reflect_phase_data(phase, g, label=None)#
Apply a Coxeter group element to a CalabiYauLite phase.
Transforms intersection numbers, second Chern class, and cones according to the index conventions in D-08/D-09:
\(\kappa'_{xyz} = g_{xa}\, g_{yb}\, g_{zc}\, \kappa_{abc}\) (g acts on Mori-space indices)
\(c'_2 = g \cdot c_2\)
Kahler cone rays:
old_rays @ inv(g)(row-vector convention)Mori cone: dual of the new Kahler cone
For individual reflections
g^{-1} = g, but for productsg^{-1} \neq gin general (D-09).- Parameters:
phase (CalabiYauLite) – Phase to reflect.
g (numpy.ndarray) – Integer group element matrix of shape
(h11, h11).label (str, optional) – Label for the new phase.
- Returns:
CalabiYauLite – New phase with transformed data.
- Raises:
AssertionError – If
inv(g)is not an integer matrix (T-04-04 mitigation).
Notes
See arXiv:2212.10573 Section 4.3 and D-08, D-09 in CONTEXT.md.
- to_fundamental_domain(point, reflections, curves, max_iter=1000)#
Map a point to the fundamental domain via chamber walk.
Repeatedly scans the wall-defining curves; if
point @ curve < 0for any curve, reflects the point through that wall (and accumulates the group element). Stops when the point has non-negative pairing with all curves.- Parameters:
point (array_like) – Point in Mori space.
reflections (list of numpy.ndarray) – Symmetric-flop reflection matrices, one per wall.
curves (list of array_like) – Contraction curves defining the walls (same order as reflections).
max_iter (int, optional) – Maximum number of reflections before raising. Default 1000.
- Returns:
(numpy.ndarray, numpy.ndarray) –
(fundamental_domain_point, group_element)where the group element g satisfiesg @ fundamental_domain_point == original_point.- Raises:
RuntimeError – If max_iter is exceeded (safety bound, T-04-07 mitigation).
Notes
See arXiv:2212.10573 Section 4.3 for the chamber walk algorithm. The fundamental domain is the region where
point @ curve >= 0for all symmetric-flop contraction curves.