Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'u/tscrim/rc_bij_pdf' into public/combinat/rigged_config…
Browse files Browse the repository at this point in the history
…urations/methods-15560
  • Loading branch information
Travis Scrimshaw committed Jun 11, 2014
2 parents 43da3ef + 54f1a4a commit e103d1e
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 10 deletions.
27 changes: 25 additions & 2 deletions src/sage/combinat/rigged_configurations/bij_abstract_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ def __init__(self, RC_element):
# TODO: Convert from cur_partitions to rigged_con
self.cur_partitions = deepcopy(list(self.rigged_con)[:])

# This is a dummy edge to start the process
cp = RC_element.__copy__()
cp.set_immutable()
self._graph = [ [[], (cp, 0)] ]

# Compute the current L matrix
# self.L = {}
# for dim in self.rigged_con.parent().dims:
Expand Down Expand Up @@ -341,15 +346,17 @@ def __eq__(self, rhs):
"""
return isinstance(rhs, RCToKRTBijectionAbstract)

def run(self, verbose=False):
def run(self, verbose=False, build_graph=False):
"""
Run the bijection from rigged configurations to tensor product of KR
tableaux.
INPUT:
- ``verbose`` -- (Default: ``False``) Display each step in the
- ``verbose`` -- (default: ``False``) display each step in the
bijection
- ``build_graph`` -- (default: ``False``) build the graph of each
step in the bijection
EXAMPLES::
Expand Down Expand Up @@ -390,6 +397,10 @@ def run(self, verbose=False):
for a in range(self.n):
self._update_vacancy_numbers(a)

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), 'ls'])

while self.cur_dims[0][0] > 0:
if verbose:
print("====================")
Expand All @@ -404,8 +415,20 @@ def run(self, verbose=False):
# Make sure we have a crystal letter
ret_crystal_path[-1].append(letters(b)) # Append the rank

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), letters(b)])

self.cur_dims.pop(0) # Pop off the leading column

if build_graph:
self._graph.pop(0) # Remove the dummy at the start
from sage.graphs.digraph import DiGraph
from sage.graphs.dot2tex_utils import have_dot2tex
self._graph = DiGraph(self._graph)
if have_dot2tex():
self._graph.set_latex_options(format="dot2tex", edge_labels=True)

# Basic check to make sure we end with the empty configuration
#tot_len = sum([len(rp) for rp in self.cur_partitions])
#if tot_len != 0:
Expand Down
38 changes: 36 additions & 2 deletions src/sage/combinat/rigged_configurations/bij_type_B.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,17 @@ class RCToKRTBijectionTypeB(RCToKRTBijectionTypeC):
Specific implementation of the bijection from rigged configurations to
tensor products of KR tableaux for type `B_n^{(1)}`.
"""
def run(self, verbose=False):
def run(self, verbose=False, build_graph=False):
"""
Run the bijection from rigged configurations to tensor product of KR
tableaux for type `B_n^{(1)}`.
INPUT:
- ``verbose`` -- (Default: ``False``) Display each step in the
- ``verbose`` -- (default: ``False``) display each step in the
bijection
- ``build_graph`` -- (default: ``False``) build the graph of each
step in the bijection
EXAMPLES::
Expand Down Expand Up @@ -589,6 +591,10 @@ def run(self, verbose=False):
bij.cur_partitions[i]._list[j] *= 2
bij.cur_partitions[i].rigging[j] *= 2
bij.cur_partitions[i].vacancy_numbers[j] *= 2

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), '2x'])

# Perform the type A_{2n-1}^{(2)} bijection

Expand All @@ -603,6 +609,10 @@ def run(self, verbose=False):
# All it does is update the vacancy numbers on the RC side
for a in range(self.n):
bij._update_vacancy_numbers(a)

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), 'ls'])

while bij.cur_dims[0][0] > 0:
if verbose:
Expand All @@ -617,6 +627,10 @@ def run(self, verbose=False):
# Make sure we have a crystal letter
ret_crystal_path[-1].append(letters(b)) # Append the rank

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), letters(b)])

bij.cur_dims.pop(0) # Pop off the leading column

self.cur_dims.pop(0) # Pop off the spin rectangle
Expand All @@ -639,6 +653,10 @@ def run(self, verbose=False):
self.cur_partitions[i]._list[j] //= 2
self.cur_partitions[i].rigging[j] //= 2
self.cur_partitions[i].vacancy_numbers[j] //= 2

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), '1/2x'])
else:
# Perform the regular type B_n^{(1)} bijection

Expand All @@ -662,6 +680,10 @@ def run(self, verbose=False):
for a in range(self.n):
self._update_vacancy_numbers(a)

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), '2x'])

while self.cur_dims[0][0] > 0:
if verbose:
print("====================")
Expand All @@ -676,8 +698,20 @@ def run(self, verbose=False):
# Make sure we have a crystal letter
ret_crystal_path[-1].append(letters(b)) # Append the rank

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), letters(b)])

self.cur_dims.pop(0) # Pop off the leading column

if build_graph:
self._graph.pop(0) # Remove the dummy at the start
from sage.graphs.digraph import DiGraph
from sage.graphs.dot2tex_utils import have_dot2tex
self._graph = DiGraph(self._graph)
if have_dot2tex():
self._graph.set_latex_options(format="dot2tex", edge_labels=True)

return self.KRT(pathlist=ret_crystal_path)

def next_state(self, height):
Expand Down
36 changes: 34 additions & 2 deletions src/sage/combinat/rigged_configurations/bij_type_D.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,15 +414,17 @@ class RCToKRTBijectionTypeD(RCToKRTBijectionTypeA):
r"""
Specific implementation of the bijection from rigged configurations to tensor products of KR tableaux for type `D_n^{(1)}`.
"""
def run(self, verbose=False):
def run(self, verbose=False, build_graph=False):
"""
Run the bijection from rigged configurations to tensor product of KR
tableaux for type `D_n^{(1)}`.
INPUT:
- ``verbose`` -- (Default: ``False``) Display each step in the
- ``verbose`` -- (default: ``False``) display each step in the
bijection
- ``build_graph`` -- (default: ``False``) build the graph of each
step in the bijection
EXAMPLES::
Expand Down Expand Up @@ -455,6 +457,10 @@ def run(self, verbose=False):
for a in range(self.n):
self._update_vacancy_numbers(a)

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), 'ls'])

# Check to see if we are a spinor
if dim[0] >= self.n - 1:
if verbose:
Expand All @@ -465,6 +471,11 @@ def run(self, verbose=False):
print("--------------------\n")
print("Applying doubling map")
self.doubling_map()

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), '2x'])

if dim[0] == self.n - 1:
if verbose:
print("====================")
Expand All @@ -477,6 +488,10 @@ def run(self, verbose=False):
b = -self.n
ret_crystal_path[-1].append(letters(b)) # Append the rank

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), letters(b)])

while self.cur_dims[0][0] > 0:
if verbose:
print("====================")
Expand All @@ -496,6 +511,10 @@ def run(self, verbose=False):
# Make sure we have a crystal letter
ret_crystal_path[-1].append(letters(b)) # Append the rank

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), letters(b)])

self.cur_dims.pop(0) # Pop off the leading column

# Check to see if we were a spinor
Expand All @@ -508,6 +527,19 @@ def run(self, verbose=False):
print("--------------------\n")
print("Applying halving map")
self.halving_map()

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), '1/2x'])

if build_graph:
self._graph.pop(0) # Remove the dummy at the start
from sage.graphs.digraph import DiGraph
from sage.graphs.dot2tex_utils import have_dot2tex
self._graph = DiGraph(self._graph)
if have_dot2tex():
self._graph.set_latex_options(format="dot2tex", edge_labels=True)

return self.KRT(pathlist=ret_crystal_path)

def next_state(self, height):
Expand Down
31 changes: 29 additions & 2 deletions src/sage/combinat/rigged_configurations/bij_type_D_twisted.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,17 @@ class RCToKRTBijectionTypeDTwisted(RCToKRTBijectionTypeD, RCToKRTBijectionTypeA2
Specific implementation of the bijection from rigged configurations to
tensor products of KR tableaux for type `D_{n+1}^{(2)}`.
"""
def run(self, verbose=False):
def run(self, verbose=False, build_graph=False):
"""
Run the bijection from rigged configurations to tensor product of KR
tableaux for type `D_{n+1}^{(2)}`.
INPUT:
- ``verbose`` -- (Default: ``False``) Display each step in the
- ``verbose`` -- (default: ``False``) display each step in the
bijection
- ``build_graph`` -- (default: ``False``) build the graph of each
step in the bijection
EXAMPLES::
Expand Down Expand Up @@ -351,6 +353,10 @@ def run(self, verbose=False):
for a in range(self.n):
self._update_vacancy_numbers(a)

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), 'ls'])

# Check to see if we are a spinor
if dim[0] == self.n:
if verbose:
Expand All @@ -362,6 +368,10 @@ def run(self, verbose=False):
print("Applying doubling map")
self.doubling_map()

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), '2x'])

while self.cur_dims[0][0] > 0:
if verbose:
print("====================")
Expand All @@ -376,6 +386,10 @@ def run(self, verbose=False):
# Make sure we have a crystal letter
ret_crystal_path[-1].append(letters(b)) # Append the rank

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), letters(b)])

self.cur_dims.pop(0) # Pop off the leading column

# Check to see if we were a spinor
Expand All @@ -388,6 +402,19 @@ def run(self, verbose=False):
print("--------------------\n")
print("Applying halving map")
self.halving_map()

if build_graph:
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions])
self._graph.append([self._graph[-1][1], (y, len(self._graph)), '1/2x'])

if build_graph:
self._graph.pop(0) # Remove the dummy at the start
from sage.graphs.digraph import DiGraph
from sage.graphs.dot2tex_utils import have_dot2tex
self._graph = DiGraph(self._graph)
if have_dot2tex():
self._graph.set_latex_options(format="dot2tex", edge_labels=True)

return self.KRT(pathlist=ret_crystal_path)

def next_state(self, height):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def check(self):
if vac_num < partition.rigging[i]:
raise ValueError("rigging can be at most the vacancy number")

def to_tensor_product_of_kirillov_reshetikhin_tableaux(self, display_steps=False):
def to_tensor_product_of_kirillov_reshetikhin_tableaux(self, display_steps=False, build_graph=False):
r"""
Perform the bijection from this rigged configuration to a tensor
product of Kirillov-Reshetikhin tableaux given in [RigConBijection]_
Expand All @@ -510,6 +510,8 @@ def to_tensor_product_of_kirillov_reshetikhin_tableaux(self, display_steps=False
- ``display_steps`` -- (default: ``False``) boolean which indicates
if we want to output each step in the algorithm
- ``build_graph` -- (default: ``False``) boolean which indicates
if we want to construct and return a graph of the bijection
OUTPUT:
Expand Down Expand Up @@ -544,7 +546,11 @@ def to_tensor_product_of_kirillov_reshetikhin_tableaux(self, display_steps=False
True
"""
from sage.combinat.rigged_configurations.bijection import RCToKRTBijection
return RCToKRTBijection(self).run(display_steps)
bij = RCToKRTBijection(self)
ret = bij.run(display_steps, build_graph)
if build_graph:
return (ret, bij._graph)
return ret

def to_tensor_product_of_kirillov_reshetikhin_crystals(self, display_steps=False):
r"""
Expand Down

0 comments on commit e103d1e

Please sign in to comment.