diff --git a/formatted/AplN.py b/formatted/AplN.py index 4d2d0f2..4936bec 100644 --- a/formatted/AplN.py +++ b/formatted/AplN.py @@ -42,12 +42,7 @@ class AplN(DifferentialGCAlgebra_multigraded, UniqueRepresentation): - ``A`` -- a multi-graded commutative algebra - ``differential`` -- the differential rules - - TESTS:: - - sage: 2 - 2 - + """ def __init__(self, A, differential): @@ -58,11 +53,6 @@ class AplN(DifferentialGCAlgebra_multigraded, UniqueRepresentation): - ``A`` -- a multi-graded commutative algebra - ``differential`` -- a differential - - TESTS:: - - sage: 2 - 2 """ self.n = len(A._names) // 2 - 1 @@ -73,11 +63,7 @@ class AplN(DifferentialGCAlgebra_multigraded, UniqueRepresentation): def _base_repr(self): """ Return the base string representation of ``self``. - - TESTS:: - - sage: 2 - 2 + """ s = DifferentialGCAlgebra._base_repr(self) @@ -87,15 +73,18 @@ class AplN(DifferentialGCAlgebra_multigraded, UniqueRepresentation): def integrand(self, value): """ - Returns a polynomial whose definite integral is equal to 'value' + Returns a polynomial whose definite integral is equals to 'value' OUTPUT: - - A polynomial + - An element of the algebra Apl(n) - TESTS:: + TESTS:: - sage: 2 - 2 + sage: apl = AlgebraPL(2) + sage: value = 5 + sage: p = apl.integrand(value) + sage: p.integral()==value + True """ if (value in QQ) or ((value in A) and (value.degree().is_zero())): return value*factorial(self.n)*prod(self.gens()[self.n+2:]) diff --git a/test_aplK.py b/test_aplK.py new file mode 100644 index 0000000..12e54f3 --- /dev/null +++ b/test_aplK.py @@ -0,0 +1,23 @@ +############################################# +# TEST +print("TEST AlgebraAplK") +S = SimplicialComplex([[0,1,2]],is_mutable=False) +A = AlgebraAplK(S) +print("Test check if the assignation is valid") +s0 = SimplicialAlgebraplN(0) +s0.inject_variables() +p0 = s0(2) +p1 = s0(1) +p2 = s0(3) +s1 = SimplicialAlgebraplN(1) +s1.inject_variables() +p01 = 2*t0+t1 +p02 = 2*t0+3*t1 +p12 = t0+3*t1 +s2 = SimplicialAlgebraplN(2) +s2.inject_variables() +p012 = 2-t1+t2 +values = {(0,): p0, (1,): p1, (2,): p2, (0,1): p01, (0,2): p02, (1,2): p12, (0,1,2): p012} +e1 = A._element_constructor_(values) +e1 +############################################# diff --git a/test_minimal_model.py b/test_minimal_model.py new file mode 100644 index 0000000..1224e78 --- /dev/null +++ b/test_minimal_model.py @@ -0,0 +1,20 @@ +from sage.all import * +load('aplK.py') +load('minimalModel.py') +####################################################### +# TESTS +S1 = simplicial_complexes.Sphere(2) +S2 = simplicial_complexes.Sphere(3) +S = S1.wedge(S2, is_mutable=False) +#S = simplicial_complexes.K3Surface() +print("Complejo simplicial") +print(S.facets()) +####################################################### +#S = simplicial_complexes.ComplexProjectivePlane() +####################################################### +# S = simplicial_complexes.BrucknerGrunbaumSphere() +####################################################### +# S = simplicial_complexes.ProjectivePlane().wedge(simplicial_complexes.Sphere(2), is_mutable=False) +####################################################### +[sullivan_model, model_morphism, cohomology_correspondence] = minimal_model(S, max_depth=5, max_dim=8) +print(sullivan_model)