Ejemplo n.º 1
0
        public void Cobwebs_AreSelfInjective_WithUnusualFirstVertex()
        {
            const int FirstVertex = -123;
            var       qps         = Utility.InfiniteRange(5, 2).Select(k => UsefulQPs.GetCobwebQP(k, FirstVertex)).TakeWhile(qp => qp.Quiver.Vertices.Count < 30);

            AssertAreSelfInjective(qps);
        }
Ejemplo n.º 2
0
        public void ComputeMaximalNonzeroEquivalenceClassRepresentativesStartingAt_Cobweb5()
        {
            var settings = GetSettings(detectNonCancellativity: false);
            var qp       = UsefulQPs.GetCobwebQP(5, 0);

            DoSetup(qp, out var ruleTree);
            var representativePaths = Computer.ComputeMaximalNonzeroEquivalenceClassRepresentativesStartingAt(qp.Quiver, 0, ruleTree, settings).MaximalNonzeroEquivalenceClassRepresentatives.ToList();

            Assert.That(representativePaths, Has.Count.EqualTo(1));
            Assert.That(representativePaths.Single().EndingPoint, Is.EqualTo(2));
        }
Ejemplo n.º 3
0
        public void StartGenerationFromBase_ThrowsGeneratorException_IfTooFewExplicitArrowPairs()
        {
            // The cobweb quiver has 5 implicit arrow pairs for the boundary layer
            var quiverInPlane = UsefulQuiversInPlane.GetCobwebQuiverInPlane(5, 50, firstVertex: 1);
            var potential     = UsefulQPs.GetCobwebQP(5).Potential;
            var boundaryLayer = Enumerable.Range(6, 10);
            var layerType     = CreateLayerType(10, 4, 20); // 4 < 5 explicit arrow pairs

            Assert.That(
                () => generator.StartGenerationFromBase(quiverInPlane, potential, boundaryLayer, layerType, nextVertex: 16),
                Throws.InstanceOf <GeneratorException>());
        }
Ejemplo n.º 4
0
        public void TryStartGenerationFromBase_ReturnsFalse_IfTooFewExplicitArrowPairs()
        {
            // The cobweb quiver has 5 implicit arrow pairs for the boundary layer
            var quiverInPlane = UsefulQuiversInPlane.GetCobwebQuiverInPlane(5, 50, firstVertex: 1);
            var potential     = UsefulQPs.GetCobwebQP(5).Potential;
            var boundaryLayer = Enumerable.Range(6, 10);
            var layerType     = CreateLayerType(10, 4, 20); // 4 < 5 explicit arrow pairs

            var result = generator.TryStartGenerationFromBase(quiverInPlane, potential, boundaryLayer, layerType, nextVertex: 16, out var nextCompositionParameters);

            Assert.That(result, Is.False);
            Assert.That(nextCompositionParameters, Is.Null);
        }
Ejemplo n.º 5
0
        public void QuiverGeneration_WithStartGenerationFromBase_GeneratesOddFlower5FromCobweb5Correctly()
        {
            var quiverInPlane = UsefulQuiversInPlane.GetCobwebQuiverInPlane(5, 50, firstVertex: 1);
            var qp            = UsefulQPs.GetCobwebQP(5, firstVertex: 1);
            var potential     = qp.Potential;
            var boundaryLayer = UsefulQPs.GetVerticesInCobwebQPLayer(5, 1, firstVertex: 1);
            var layerType     = CreateLayerType(10, 5, 20); // 5 arrow pairs, all implicit

            generator.StartGenerationFromBase(quiverInPlane, potential, boundaryLayer, layerType, nextVertex: qp.Quiver.Vertices.Count + 1);
            generator.SupplyComposition(CreateComposition(Utility.RepeatMany(5, 1, 1))); // No choice for the 5 arrow pairs
            generator.SupplyComposition(CreateComposition(Utility.RepeatMany(5, 3, 3))); // 2 steps left and right (both of which can be 0)

            var output = generator.EndGeneration();

            qp        = output.QP;
            potential = qp.Potential;
            var expectedPotential = CreatePotential(new Dictionary <DetachedCycle <int>, int>
            {
                { CreateDetachedCycle(1, 2, 3, 4, 5, 1), +1 },

                { CreateDetachedCycle(1, 2, 7, 6, 1), -1 },
                { CreateDetachedCycle(2, 3, 9, 8, 2), -1 },
                { CreateDetachedCycle(3, 4, 11, 10, 3), -1 },
                { CreateDetachedCycle(4, 5, 13, 12, 4), -1 },
                { CreateDetachedCycle(5, 1, 15, 14, 5), -1 },

                { CreateDetachedCycle(1, 15, 6, 1), +1 },
                { CreateDetachedCycle(2, 7, 8, 2), +1 },
                { CreateDetachedCycle(3, 9, 10, 3), +1 },
                { CreateDetachedCycle(4, 11, 12, 4), +1 },
                { CreateDetachedCycle(5, 13, 14, 5), +1 },

                { CreateDetachedCycle(6, 18, 17, 16, 15, 6), -1 },
                { CreateDetachedCycle(8, 22, 21, 20, 7, 8), -1 },
                { CreateDetachedCycle(10, 26, 25, 24, 9, 10), -1 },
                { CreateDetachedCycle(12, 30, 29, 28, 11, 12), -1 },
                { CreateDetachedCycle(14, 34, 33, 32, 13, 14), -1 },

                { CreateDetachedCycle(6, 18, 19, 20, 7, 6), +1 },
                { CreateDetachedCycle(8, 22, 23, 24, 9, 8), +1 },
                { CreateDetachedCycle(10, 26, 27, 28, 11, 10), +1 },
                { CreateDetachedCycle(12, 30, 31, 32, 13, 12), +1 },
                { CreateDetachedCycle(14, 34, 35, 16, 15, 14), +1 },
            });

            Assert.That(potential, Is.EqualTo(expectedPotential));
        }
Ejemplo n.º 6
0
        public void Cobwebs_AreSelfInjective()
        {
            var qps = Utility.InfiniteRange(5, 2).Select(k => UsefulQPs.GetCobwebQP(k)).TakeWhile(qp => qp.Quiver.Vertices.Count < 30);

            AssertAreSelfInjective(qps);
        }