private HashSet <CubeAction> ObtainGeneratorsOfStablizerSubgroupIncrementally( CubeAction newGenerator, HashSet <BlockSet> newStates) { var newSubgroupGenerators = new HashSet <CubeAction>(); foreach (var generator in Generators) { bool isNewGenerator = generator.Equals(newGenerator); foreach (var state in OrbitToCoset.Keys) { var leftCoset = OrbitToCoset[state]; Utils.DebugAssert(leftCoset != null); if (!isNewGenerator && !newStates.Contains(state)) { // Old generator, old coset state continue; } var subgroupGenerator = ObtainGeneratorOfStablizerSubgroup(generator, leftCoset); if (!subgroupGenerator.Equals(new CubeAction()) && !newSubgroupGenerators.Contains(subgroupGenerator)) { Utils.DebugAssert(ToStablize.IsStablizedBy(subgroupGenerator)); newSubgroupGenerators.Add(subgroupGenerator); /* No need to print because we don't know whether the generator is redundant here. */ } } } return(newSubgroupGenerators); }
private CubeAction DetermineBelongingCoset(CubeAction e) { var eState = new BlockSet(ToStablize); e.Act(eState.State); if (!OrbitToCoset.ContainsKey(eState)) { return(null); } var cosetRepresentative = OrbitToCoset[eState]; if (Utils.ShouldVerify()) { { var cosetReprState = new BlockSet(ToStablize); cosetRepresentative.Act(cosetReprState.State); Utils.DebugAssert(cosetReprState.Equals(eState)); } { // States in orbit 1-to-1 maps to each *left* coset (gH). I.e. // iff. e^(-1) * cosetRepresentative stablizes the BlockSet being // observed. This deduces that, group actions in same *left* // coset, always act the BlockSet being observed to the same state. var reCosetRep = e.Reverse().Mul(cosetRepresentative); Utils.DebugAssert(Stablized.IsStablizedBy(reCosetRep)); } { // Iff. e * cosetRepresentative^(-1) stablizes the BlockSet being // observed. This is the condition for *right* coset. It is not what // we need here, and group actions in same *right* coset, may act the // BlockSet being observed to different states. var eRCosetRep = e.Mul(cosetRepresentative.Reverse()); // Utils.DebugAssert(observed.IsStablizedBy(eRCosetRep)); // Doesn't hold } } return(cosetRepresentative); }