Skip to content

Commit

Permalink
Add examples for my original algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
kaashif committed May 7, 2020
1 parent cf35482 commit 71dfb72
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 11 deletions.
44 changes: 44 additions & 0 deletions examples/mymethod.g
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#! @BeginChunk Example_REPN_ComputeUsingMyMethod
#! @BeginExample
G := SymmetricGroup(4);;
irreps := IrreducibleRepresentations(G);;
rho := DirectSumOfRepresentations([irreps[4], irreps[5]]);;
# Jumble rho up a bit so it's not so easy for the library.
A := [ [ 3, -3, 2, -4, 0, 0 ], [ 4, 0, 1, -5, 1, 0 ], [ -3, -1, -2, 4, -1, -2 ],
[ 4, -4, -1, 5, -3, -1 ], [ 3, -2, 1, 0, 0, 0 ], [ 4, 2, 4, -1, -2, 1 ] ];
rho := ComposeHomFunction(rho, B -> A^-1 * B * A);
# We've constructed rho from two degree 3 irreps, so there are a few
# things we can check for correctness:
decomposition := REPN_ComputeUsingMyMethod(rho);;
# Two distinct irreps, so the centralizer has dimension 2
Length(decomposition.centralizer_basis) = 2;
#! true
# Two distinct irreps i.e. two invariant subspaces
Length(decomposition.decomposition) = 2;
#! true
# All subspaces are dimension 3
ForAll(decomposition.decomposition, Vs -> Length(Vs) = 1 and Dimension(Vs[1]) = 3);
#! true
# And finally, check that the block diagonalized representation
# computed is actually isomorphic to rho:
AreRepsIsomorphic(rho, decomposition.diagonal_rep);
#! true
#! @EndExample
#! @EndChunk

#! @BeginChunk Example_REPN_ComputeUsingMyMethodCanonical
#! @BeginExample
# This is the same example as before, but splits into canonical
# summands internally. It gives exactly the same results, up to
# isomorphism.
other_decomposition := REPN_ComputeUsingMyMethodCanonical(rho);;
Length(other_decomposition.centralizer_basis) = 2;
#! true
Length(other_decomposition.decomposition) = 2;
#! true
ForAll(other_decomposition.decomposition, Vs -> Length(Vs) = 1 and Dimension(Vs[1]) = 3);
#! true
AreRepsIsomorphic(rho, other_decomposition.diagonal_rep);
#! true
#! @EndExample
#! @EndChunk
26 changes: 15 additions & 11 deletions lib/mymethod.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,21 @@

#! @Section Algorithms due to the authors

#! @Arguments rho
#!
#! @Returns A record in the same format as <Ref
#! Attr="REPN_ComputeUsingSerre" Label="for IsGroupHomomorphism" />
#!
#! @Description Computes the same values as <Ref
#! Attr="REPN_ComputeUsingSerre" Label="for IsGroupHomomorphism" />,
#! taking the same options. The heavy lifting of this method is done
#! by <Ref Func="LinearRepresentationIsomorphism" />, where there are
#! some further options that can be passed to influence algorithms
#! used.
DeclareAttribute( "REPN_ComputeUsingMyMethod", IsGroupHomomorphism );

#! @Arguments rho
#!
#! <P/>
#! @InsertChunk Example_REPN_ComputeUsingMyMethod
#! <P/>
#! @Arguments rho
#! @Returns A record in the same format as <Ref
#! Attr="REPN_ComputeUsingMyMethod" Label="for IsGroupHomomorphism"
#! />.
#!
#! Attr="REPN_ComputeUsingSerre" Label="for IsGroupHomomorphism" />
DeclareAttribute( "REPN_ComputeUsingMyMethod", IsGroupHomomorphism );

#! @Description Performs the same computation as <Ref
#! Attr="REPN_ComputeUsingMyMethod" Label="for IsGroupHomomorphism"
#! />, but first splits the representation into canonical summands
Expand All @@ -31,4 +27,12 @@ DeclareAttribute( "REPN_ComputeUsingMyMethod", IsGroupHomomorphism );
#! If the option `parallel` is given, the decomposition of canonical
#! summands into irreps is done in parallel, which could be much
#! faster.
#!
#! <P/>
#! @InsertChunk Example_REPN_ComputeUsingMyMethodCanonical
#! <P/>
#! @Arguments rho
#! @Returns A record in the same format as <Ref
#! Attr="REPN_ComputeUsingMyMethod" Label="for IsGroupHomomorphism"
#! />.
DeclareAttribute( "REPN_ComputeUsingMyMethodCanonical", IsGroupHomomorphism );

0 comments on commit 71dfb72

Please sign in to comment.