working on apln only
This commit is contained in:
parent
3d00994a03
commit
95c017f3ce
@ -43,11 +43,6 @@ class AplN(DifferentialGCAlgebra_multigraded, UniqueRepresentation):
|
|||||||
- ``A`` -- a multi-graded commutative algebra
|
- ``A`` -- a multi-graded commutative algebra
|
||||||
- ``differential`` -- the differential rules
|
- ``differential`` -- the differential rules
|
||||||
|
|
||||||
TESTS::
|
|
||||||
|
|
||||||
sage: 2
|
|
||||||
2
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, A, differential):
|
def __init__(self, A, differential):
|
||||||
@ -58,11 +53,6 @@ class AplN(DifferentialGCAlgebra_multigraded, UniqueRepresentation):
|
|||||||
|
|
||||||
- ``A`` -- a multi-graded commutative algebra
|
- ``A`` -- a multi-graded commutative algebra
|
||||||
- ``differential`` -- a differential
|
- ``differential`` -- a differential
|
||||||
|
|
||||||
TESTS::
|
|
||||||
|
|
||||||
sage: 2
|
|
||||||
2
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.n = len(A._names) // 2 - 1
|
self.n = len(A._names) // 2 - 1
|
||||||
@ -74,10 +64,6 @@ class AplN(DifferentialGCAlgebra_multigraded, UniqueRepresentation):
|
|||||||
"""
|
"""
|
||||||
Return the base string representation of ``self``.
|
Return the base string representation of ``self``.
|
||||||
|
|
||||||
TESTS::
|
|
||||||
|
|
||||||
sage: 2
|
|
||||||
2
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
s = DifferentialGCAlgebra._base_repr(self)
|
s = DifferentialGCAlgebra._base_repr(self)
|
||||||
@ -87,15 +73,18 @@ class AplN(DifferentialGCAlgebra_multigraded, UniqueRepresentation):
|
|||||||
|
|
||||||
def integrand(self, value):
|
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:
|
OUTPUT:
|
||||||
- A polynomial
|
- An element of the algebra Apl(n)
|
||||||
|
|
||||||
TESTS::
|
TESTS::
|
||||||
|
|
||||||
sage: 2
|
sage: apl = AlgebraPL(2)
|
||||||
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())):
|
if (value in QQ) or ((value in A) and (value.degree().is_zero())):
|
||||||
return value*factorial(self.n)*prod(self.gens()[self.n+2:])
|
return value*factorial(self.n)*prod(self.gens()[self.n+2:])
|
||||||
|
|||||||
23
test_aplK.py
Normal file
23
test_aplK.py
Normal file
@ -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
|
||||||
|
#############################################
|
||||||
20
test_minimal_model.py
Normal file
20
test_minimal_model.py
Normal file
@ -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)
|
||||||
Loading…
Reference in New Issue
Block a user