Library interface to Kenzo#
Kenzo is a set of lisp functions to compute homology and homotopy groups of topological spaces.
AUTHORS:
Miguel Marco, Ana Romero (2019-01): Initial version
For this interface, Kenzo is loaded into ECL which is itself loaded as a C library in Sage. Kenzo objects in this interface are nothing but wrappers around ECL objects.
- sage.interfaces.kenzo.BicomplexSpectralSequence(l)#
Construct the spectral sequence associated to the bicomplex given by a list of morphisms.
INPUT:
l
– A list of morphisms of chain complexes
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import BicomplexSpectralSequence # optional - kenzo sage: C1 = ChainComplex({1: matrix(ZZ, 0, 2, [])}, degree_of_differential=-1) sage: C2 = ChainComplex({1: matrix(ZZ, 1, 2, [1, 0])},degree_of_differential=-1) sage: C3 = ChainComplex({0: matrix(ZZ, 0,2 , [])},degree_of_differential=-1) sage: M1 = Hom(C2,C1)({1: matrix(ZZ, 2, 2, [2, 0, 0, 2])}) sage: M2 = Hom(C3,C2)({0: matrix(ZZ, 1, 2, [2, 0])}) sage: l = [M1, M2] sage: E = BicomplexSpectralSequence(l) # optional - kenzo sage: E.group(2,0,1) # optional - kenzo Additive abelian group isomorphic to Z/2 + Z sage: E.table(3,0,2,0,2) # optional - kenzo 0 0 0 Z/2 + Z/4 0 0 0 0 Z sage: E.matrix(2,2,0) # optional - kenzo [ 0 0] [-4 0]
- sage.interfaces.kenzo.EilenbergMacLaneSpace(G, n)#
Return the Eilenberg-MacLane space
K(G, n)
as a Kenzo simplicial group.The Eilenberg-MacLane space
K(G, n)
is the space whose has n’th homotopy group isomorphic toG
, and the rest of the homotopy groups are trivial.INPUT:
G
– group. Currently onlyZZ
and the additive group of two elements are supported.n
– the dimension in which the homotopy is not trivial
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import EilenbergMacLaneSpace # optional - kenzo sage: e3 = EilenbergMacLaneSpace(ZZ, 3) # optional - kenzo sage: [e3.homology(i) for i in range(8)] # optional - kenzo [Z, 0, 0, Z, 0, C2, 0, C3] sage: f3 = EilenbergMacLaneSpace(AdditiveAbelianGroup([2]), 3) # optional - kenzo sage: [f3.homology(i) for i in range(8)] # optional - kenzo [Z, 0, 0, C2, 0, C2, C2, C2]
- sage.interfaces.kenzo.KAbstractSimplex(simplex)#
Convert an AbstractSimplex in Sage to an abstract simplex of Kenzo.
INPUT:
simplex
– An AbstractSimplex.
OUTPUT:
An abstract simplex of Kenzo.
EXAMPLES:
sage: from sage.topology.simplicial_set import AbstractSimplex sage: from sage.interfaces.kenzo import ( # optional - kenzo ....: KAbstractSimplex, SAbstractSimplex) sage: SAbSm = AbstractSimplex(1, (2,0,3,2,1), name = 'SAbSm') # optional - kenzo sage: KAbSm = KAbstractSimplex(SAbSm) # optional - kenzo sage: SAbSm2 = SAbstractSimplex(KAbSm, 1) # optional - kenzo sage: SAbSm.degeneracies() == SAbSm2.degeneracies() # optional - kenzo True sage: SAbSm.dimension() == SAbSm2.dimension() # optional - kenzo True
- sage.interfaces.kenzo.KChainComplex(chain_complex)#
Construct a KenzoChainComplex from a ChainComplex of degree = -1 in Sage.
INPUT:
chain_complex
– A ChainComplex of degree = -1
OUTPUT:
A KenzoChainComplex
EXAMPLES:
sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] sage: kenzo_chcm.homology(5) # optional - kenzo Z x Z
- sage.interfaces.kenzo.KChainComplexMorphism(morphism)#
Construct a KenzoChainComplexMorphism from a ChainComplexMorphism in Sage.
INPUT:
morphism
– A morphism of chain complexes
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import KChainComplexMorphism # optional - kenzo sage: C = ChainComplex({0: identity_matrix(ZZ, 1)}) sage: D = ChainComplex({0: zero_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) sage: f = Hom(C,D)({0: identity_matrix(ZZ, 1), 1: zero_matrix(ZZ, 1)}) sage: g = KChainComplexMorphism(f) # optional - kenzo sage: g # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: g.source_complex() # optional - kenzo [K... Chain-Complex] sage: g.target_complex() # optional - kenzo [K... Chain-Complex]
- sage.interfaces.kenzo.KFiniteSimplicialSet(sset)#
Convert a finite SimplicialSet in Sage to a finite simplicial set of Kenzo.
INPUT:
sset
– A finite SimplicialSet.
OUTPUT:
A finite simplicial set of Kenzo.
EXAMPLES:
sage: from sage.topology.simplicial_set import AbstractSimplex, SimplicialSet sage: from sage.interfaces.kenzo import KFiniteSimplicialSet # optional - kenzo sage: s0 = AbstractSimplex(0, name='s0') sage: s1 = AbstractSimplex(0, name='s1') sage: s2 = AbstractSimplex(0, name='s2') sage: s01 = AbstractSimplex(1, name='s01') sage: s02 = AbstractSimplex(1, name='s02') sage: s12 = AbstractSimplex(1, name='s12') sage: s012 = AbstractSimplex(2, name='s012') sage: Triangle = SimplicialSet({s01: (s1, s0),\ ....: s02: (s2, s0), s12: (s2, s1)}, base_point = s0) sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo sage: KTriangle.homology(1) # optional - kenzo Z sage: KTriangle.basis(1) # optional - kenzo ['CELL_1_0', 'CELL_1_1', 'CELL_1_2'] sage: S1 = simplicial_sets.Sphere(1) sage: S3 = simplicial_sets.Sphere(3) sage: KS1vS3 = KFiniteSimplicialSet(S1.wedge(S3)) # optional - kenzo sage: KS1vS3.homology(3) # optional - kenzo Z
- class sage.interfaces.kenzo.KenzoChainComplex(kenzo_object)#
Bases:
KenzoObject
Wrapper to Kenzo chain complexes. Kenzo simplicial sets are a particular case of Kenzo chain complexes.
- basis(dim)#
Return the list of generators of the chain complex associated to the kenzo object
self
in dimensiondim
.INPUT:
dim
– An integer number
OUTPUT:
A list of the form [‘G”dim”G0’, ‘G”dim”G1’, ‘G”dim”G2’, …].
EXAMPLES:
sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] sage: for i in range(6): # optional - kenzo ....: print("Basis in dimension %i: %s" % (i, kenzo_chcm.basis(i))) Basis in dimension 0: ['G0G0', 'G0G1', 'G0G2'] Basis in dimension 1: ['G1G0', 'G1G1'] Basis in dimension 2: None Basis in dimension 3: ['G3G0', 'G3G1'] Basis in dimension 4: ['G4G0', 'G4G1'] Basis in dimension 5: ['G5G0', 'G5G1', 'G5G2']
- differential(dim=None, comb=None)#
Return the differential of a combination.
INPUT:
dim
– An integer number or None (default)comb
– A list representing a formal sum of generators in the module of dimensiondim
or None (default). For example, to represent G7G12 + 3*G7G0 - 5*G7G3 we use the list [3, ‘G7G0’, -5, ‘G7G3’, 1, ‘G7G12’]. Note that the generators must be in ascending order respect to the number after the second G in their representation; the parametercomb
= [1, ‘G7G12’, 3, ‘G7G0’, -5, ‘G7G3’] will produce an error in Kenzo.
OUTPUT:
If
dim
andcomb
are not None, it returns a Kenzo combination representing the differential of the formal combination represented bycomb
in the chain complexself
in dimensiondim
. On the other hand, if \(dim`\) orcomb
(or both) take None value, the differentialKenzoMorphismChainComplex
ofself
is returned.
EXAMPLES:
sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] sage: kenzo_chcm.differential(4, [1, 'G4G0']) # optional - kenzo ----------------------------------------------------------------------{CMBN 3} <1 * G3G0> <3 * G3G1> ------------------------------------------------------------------------------ sage: kenzo_chcm.basis(5) # optional - kenzo ['G5G0', 'G5G1', 'G5G2'] sage: kenzo_chcm.differential(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo ----------------------------------------------------------------------{CMBN 4} <6 * G4G0> <-3 * G4G1> ------------------------------------------------------------------------------
- homology(n)#
Return the
n
’th homology group of the chain complex associated to this kenzo object.INPUT:
n
– the dimension in which compute the homology
OUTPUT:
An homology group.
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: s2 # optional - kenzo [K1 Simplicial-Set] sage: s2.homology(2) # optional - kenzo Z
- identity_morphism()#
Return the identity morphism (degree 0) between
self
and itself.OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: tp = s2.tensor_product(s2) # optional - kenzo sage: idnt = tp.identity_morphism() # optional - kenzo sage: type(idnt) # optional - kenzo <class 'sage.interfaces.kenzo.KenzoChainComplexMorphism'>
- null_morphism(target=None, degree=None)#
Return the null morphism between the chain complexes
self
andtarget
of degreedegree
.INPUT:
target
– A KenzoChainComplex or None (default).degree
– An integer number or None (default).
OUTPUT:
A
KenzoChainComplexMorphism
representing the null morphism betweenself
andtarget
of degreedegree
. Iftarget
takes None value,self
is assumed as the target chain complex; ifdegree
takes None value, 0 is assumed as the degree of the null morphism.
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo sage: tp22 = s2.tensor_product(s2) # optional - kenzo sage: tp22 # optional - kenzo [K... Chain-Complex] sage: tp23 = s2.tensor_product(s3) # optional - kenzo sage: tp23 # optional - kenzo [K... Chain-Complex] sage: null1 = tp22.null_morphism() # optional - kenzo sage: null1 # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: null2 = tp22.null_morphism(target = tp23, degree = -3) # optional - kenzo sage: null2 # optional - kenzo [K... Morphism (degree -3): K... -> K...]
- orgn()#
Return the :orgn slot of Kenzo, which stores as a list the origin of the object
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: l2 = s2.loop_space() # optional - kenzo sage: l2.orgn() # optional - kenzo '(LOOP-SPACE [K... Simplicial-Set])' sage: A = l2.cartesian_product(s2) # optional - kenzo sage: A.orgn() # optional - kenzo '(CRTS-PRDC [K... Simplicial-Group] [K... Simplicial-Set])'
- tensor_product(other)#
Return the tensor product of
self
andother
.INPUT:
other
– The Kenzo object with which to compute the tensor product
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo sage: p = s2.tensor_product(s3) # optional - kenzo sage: type(p) # optional - kenzo <class 'sage.interfaces.kenzo.KenzoChainComplex'> sage: [p.homology(i) for i in range(8)] # optional - kenzo [Z, 0, Z, Z, 0, Z, 0, 0]
- class sage.interfaces.kenzo.KenzoChainComplexMorphism(kenzo_object)#
Bases:
KenzoObject
Wrapper to Kenzo morphisms between chain complexes.
- change_source_target_complex(source=None, target=None)#
Build, from the morphism
self
, a new morphism withsource
andtarget
as source and target Kenzo chain complexes, respectively.INPUT:
source
– A KenzoChainComplex instance or None (default).target
– A KenzoChainComplex instance or None (default).
OUTPUT:
A
KenzoChainComplexMorphism
inheriting fromself
the degree (:degr slot in Kenzo), the algorithm (:intr slot in Kenzo) and the strategy (:strt slot in Kenzo). The source and target slots of this new morphism are given by the parameterssource
andtarget
respectively; if any parameter is ommited, the corresponding slot is inherited fromself
.
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere, KenzoChainComplex # optional - kenzo sage: from sage.libs.ecl import ecl_eval sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo sage: ZCC # optional - kenzo [K... Chain-Complex] sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo sage: tp = s2.tensor_product(s3) # optional - kenzo sage: tp # optional - kenzo [K... Filtered-Chain-Complex] sage: null = ZCC.null_morphism(tp) # optional - kenzo sage: null # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: null.source_complex() # optional - kenzo [K... Chain-Complex] sage: null2 = null.change_source_target_complex(source = tp) # optional - kenzo sage: null2 # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: null2.source_complex() # optional - kenzo [K... Filtered-Chain-Complex]
- composite(object=None)#
Return the composite of
self
and the morphism(s) given by the parameterobject
.INPUT:
object
– A KenzoChainComplexMorphism instance, a KenzoChainComplex instance, a tuple of KenzoChainComplexMorphism and KenzoChainComplex instances, or None (default).
OUTPUT:
A
KenzoChainComplexMorphism
: ifobject
is a KenzoChainComplexMorphism, the composite ofself
andobject
is returned; ifobject
is a KenzoChainComplex, the composite ofself
and the differential morphism ofobject
is returned; ifobject
is a tuple, the composite ofself
and the morphisms or the differential morphisms of the given chain complexes inobject
is returned (ifobject
is None,self
morphism is returned).
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo sage: tp22 = s2.tensor_product(s2) # optional - kenzo sage: tp23 = s2.tensor_product(s3) # optional - kenzo sage: idnt = tp22.identity_morphism() # optional - kenzo sage: idnt # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: null = tp23.null_morphism(target = tp22, degree = 4) # optional - kenzo sage: null # optional - kenzo [K... Morphism (degree 4): K... -> K...] sage: idnt.composite((tp22, null)) # optional - kenzo [K... Morphism (degree 3): K... -> K...]
- degree()#
Return the degree of the morphism.
OUTPUT:
An integer number, the degree of the morphism.
EXAMPLES:
sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo sage: differential_morphism # optional - kenzo [K... Morphism (degree -1): K... -> K...] sage: differential_morphism.degree() # optional - kenzo -1 sage: differential_morphism.composite(differential_morphism).degree() # optional - kenzo -2 sage: kenzo_chcm.null_morphism().degree() # optional - kenzo 0
- destructive_change_source_target_complex(source=None, target=None)#
Modify destructively the morphism
self
takingsource
andtarget
as source and target Kenzo chain complexes ofself
, respectively.INPUT:
source
– A KenzoChainComplex instance or None (default).target
– A KenzoChainComplex instance or None (default).
OUTPUT:
A
KenzoChainComplexMorphism
. The source and target slots ofself
are replaced respectively by the parameterssource
andtarget
; if any parameter is ommited, the corresponding slot is inherited fromself
.
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere, KenzoChainComplex # optional - kenzo sage: from sage.libs.ecl import ecl_eval sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo sage: ZCC # optional - kenzo [K... Chain-Complex] sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo sage: tp = s2.tensor_product(s3) # optional - kenzo sage: tp # optional - kenzo [K... Filtered-Chain-Complex] sage: null = ZCC.null_morphism(tp) # optional - kenzo sage: null # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: null.target_complex() # optional - kenzo [K... Filtered-Chain-Complex] sage: null.destructive_change_source_target_complex(target = ZCC) # optional - kenzo [K... Cohomology-Class on K... of degree 0] sage: null.target_complex() # optional - kenzo [K... Chain-Complex]
- evaluation(dim, comb)#
Apply the morphism on a combination
comb
of dimensiondim
.INPUT:
dim
– An integer numbercomb
– A list representing a formal sum of generators in the module of dimensiondim
. For example, to represent G7G12 + 3*G7G0 - 5*G7G3 we use the list [3, ‘G7G0’, -5, ‘G7G3’, 1, ‘G7G12’]. Note that the generators must be in ascending order respect to the number after the second G in their representation; the parametercomb
= [1, ‘G7G12’, 3, ‘G7G0’, -5, ‘G7G3’] will produce an error in Kenzo.
OUTPUT:
A Kenzo combination representing the result of applying the morphism on the formal combination represented by
comb
in the chain complexself
in dimensiondim
.
EXAMPLES:
sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo sage: differential_morphism # optional - kenzo [K... Morphism (degree -1): K... -> K...] sage: dif_squared = differential_morphism.composite(differential_morphism) # optional - kenzo sage: dif_squared # optional - kenzo [K... Morphism (degree -2): K... -> K...] sage: kenzo_chcm.basis(5) # optional - kenzo ['G5G0', 'G5G1', 'G5G2'] sage: kenzo_chcm.differential(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo ----------------------------------------------------------------------{CMBN 4} <6 * G4G0> <-3 * G4G1> ------------------------------------------------------------------------------ sage: differential_morphism.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo ----------------------------------------------------------------------{CMBN 4} <6 * G4G0> <-3 * G4G1> ------------------------------------------------------------------------------ sage: dif_squared.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo ----------------------------------------------------------------------{CMBN 3} ------------------------------------------------------------------------------ sage: idnt = kenzo_chcm.identity_morphism() # optional - kenzo sage: idx2 = idnt.sum(idnt) # optional - kenzo sage: idnt.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo ----------------------------------------------------------------------{CMBN 5} <1 * G5G0> <2 * G5G2> ------------------------------------------------------------------------------ sage: idx2.evaluation(5, [1, 'G5G0', 2, 'G5G2']) # optional - kenzo ----------------------------------------------------------------------{CMBN 5} <2 * G5G0> <4 * G5G2> ------------------------------------------------------------------------------
- opposite()#
Return the opposite morphism of
self
, i.e., -1 xself
.OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] sage: idnt = kenzo_chcm.identity_morphism() # optional - kenzo sage: idnt # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: opps_id = idnt.opposite() # optional - kenzo sage: opps_id # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] sage: idnt.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo ----------------------------------------------------------------------{CMBN 4} <2 * G4G0> <-5 * G4G1> ------------------------------------------------------------------------------ sage: opps_id.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo ----------------------------------------------------------------------{CMBN 4} <-2 * G4G0> <5 * G4G1> ------------------------------------------------------------------------------
- source_complex()#
Return the source chain complex of the morphism.
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo sage: differential_morphism # optional - kenzo [K... Morphism (degree -1): K... -> K...] sage: differential_morphism.source_complex() # optional - kenzo [K... Chain-Complex]
- substract(object=None)#
Return a morphism, difference of the morphism
self
and the morphism(s) given by the parameterobject
.INPUT:
object
– A KenzoChainComplexMorphism instance, a tuple of KenzoChainComplexMorphism instances or None (default).
OUTPUT:
A
KenzoChainComplexMorphism
, difference of the morphismself
and the morphism(s) given byobject
(ifobject
is None,self
morphism is returned). For example, ifobject
= (mrph1, mrph2, mrph3) the result isself
- mrph1 - mrph2 - mrph3.
EXAMPLES:
sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] sage: idnt = kenzo_chcm.identity_morphism() # optional - kenzo sage: idnt # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: opps_id = idnt.opposite() # optional - kenzo sage: opps_id # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: null = kenzo_chcm.null_morphism() # optional - kenzo sage: null # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: idx2 = idnt.substract(opps_id) # optional - kenzo sage: opps_idx2 = idx2.substract( # optional - kenzo ....: (opps_id, idnt, idnt, null, idx2.substract(opps_id))) sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] sage: idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo ----------------------------------------------------------------------{CMBN 4} <4 * G4G0> <-10 * G4G1> ------------------------------------------------------------------------------ sage: opps_idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo ----------------------------------------------------------------------{CMBN 4} <-4 * G4G0> <10 * G4G1> ------------------------------------------------------------------------------
- sum(object=None)#
Return a morphism, sum of the morphism
self
and the morphism(s) given by the parameterobject
.INPUT:
object
– A KenzoChainComplexMorphism instance, a tuple of KenzoChainComplexMorphism instances or None (default).
OUTPUT:
A
KenzoChainComplexMorphism
, sum of the morphismself
and the morphism(s) given byobject
(ifobject
is None,self
morphism is returned).
EXAMPLES:
sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] sage: idnt = kenzo_chcm.identity_morphism() # optional - kenzo sage: idnt # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: opps_id = idnt.opposite() # optional - kenzo sage: opps_id # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: null = kenzo_chcm.null_morphism() # optional - kenzo sage: null # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: idx2 = idnt.sum(idnt) # optional - kenzo sage: idx5 = idx2.sum( # optional - kenzo ....: (opps_id, idnt, idnt, null, idx2.sum(idnt), opps_id)) sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] sage: idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo ----------------------------------------------------------------------{CMBN 4} <4 * G4G0> <-10 * G4G1> ------------------------------------------------------------------------------ sage: idx5.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo ----------------------------------------------------------------------{CMBN 4} <10 * G4G0> <-25 * G4G1> ------------------------------------------------------------------------------
- target_complex()#
Return the target chain complex of the morphism.
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import KChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: kenzo_chcm = KChainComplex(sage_chcm) # optional - kenzo sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] sage: differential_morphism = kenzo_chcm.differential() # optional - kenzo sage: differential_morphism # optional - kenzo [K... Morphism (degree -1): K... -> K...] sage: differential_morphism.target_complex() # optional - kenzo [K... Chain-Complex]
- class sage.interfaces.kenzo.KenzoObject(kenzo_object)#
Bases:
SageObject
Wrapper to Kenzo objects
INPUT:
kenzo_object
– a wrapper around a Kenzo object (which is an ecl object).
- class sage.interfaces.kenzo.KenzoSimplicialGroup(kenzo_object)#
Bases:
KenzoSimplicialSet
Wrapper around Kenzo simplicial groups.
- classifying_space()#
Return the classifying space.
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import MooreSpace # optional - kenzo sage: m2 = MooreSpace(2,4) # optional - kenzo sage: l2 = m2.loop_space() # optional - kenzo sage: c = l2.classifying_space() # optional - kenzo sage: type(c) # optional - kenzo <class 'sage.interfaces.kenzo.KenzoSimplicialGroup'> sage: [c.homology(i) for i in range(8)] # optional - kenzo [Z, 0, 0, 0, C2, 0, 0, 0]
- class sage.interfaces.kenzo.KenzoSimplicialSet(kenzo_object)#
Bases:
KenzoChainComplex
Wrapper to Kenzo simplicial sets.
In Kenzo, the homology of a simplicial set in computed from its associated chain complex. Hence, this class inherits from \(KenzoChainComplex\).
- cartesian_product(other)#
Return the cartesian product of
self
andother
.INPUT:
other
– the Kenzo simplicial set with which the product is made
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo sage: p = s2.cartesian_product(s3) # optional - kenzo sage: type(p) # optional - kenzo <class 'sage.interfaces.kenzo.KenzoSimplicialSet'> sage: [p.homology(i) for i in range(6)] # optional - kenzo [Z, 0, Z, Z, 0, Z]
- em_spectral_sequence()#
Return the Eilenberg-Moore spectral sequence of
self
.OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: S2 = Sphere(2) # optional - kenzo sage: EMS = S2.em_spectral_sequence() # optional - kenzo sage: EMS.table(0, -2, 2, -2, 2) # optional - kenzo 0 Z 0 0 0 0 0 0 0 0 0 0 Z 0 0 0 0 0 0 0 0 0 0 0 0
Warning
This method assumes that the underlying space is simply connected. You might get wrong answers if it is not.
- homotopy_group(n)#
Return the n’th homotopy group of
self
INPUT:
n
– the dimension of the homotopy group to be computed
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: p = s2.cartesian_product(s2) # optional - kenzo sage: p.homotopy_group(3) # optional - kenzo Multiplicative Abelian group isomorphic to Z x Z
Warning
This method assumes that the underlying space is simply connected. You might get wrong answers if it is not.
- join(other)#
Return the join of
self
andother
.INPUT:
other
– the Kenzo simplicial set with which the join is made
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo sage: j = s2.join(s3) # optional - kenzo sage: type(j) # optional - kenzo <class 'sage.interfaces.kenzo.KenzoSimplicialSet'> sage: [j.homology(i) for i in range(6)] # optional - kenzo [Z, 0, 0, 0, 0, 0]
- loop_space(n=1)#
Return the
n
th iterated loop space.INPUT:
n
– (default: 1) the number of times to iterate the loop space construction
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: l2 = s2.loop_space() # optional - kenzo sage: type(l2) # optional - kenzo <class 'sage.interfaces.kenzo.KenzoSimplicialGroup'> sage: l2 = s2.loop_space() # optional - kenzo sage: [l2.homology(i) for i in range(8)] # optional - kenzo [Z, Z, Z, Z, Z, Z, Z, Z]
- serre_spectral_sequence()#
Return the spectral sequence of
self
.The object self must be created as a cartesian product (twisted or not).
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere sage: S2 = Sphere(2) # optional - kenzo sage: S3 = Sphere(3) # optional - kenzo sage: P = S2.cartesian_product(S3) # optional - kenzo sage: E = P.serre_spectral_sequence() # optional - kenzo sage: E.table(0, 0, 2, 0, 3) # optional - kenzo Z 0 Z 0 0 0 0 0 0 Z 0 Z
Warning
This method assumes that the underlying space is simply connected. You might get wrong answers if it is not.
- smash_product(other)#
Return the smash product of
self
andother
.INPUT:
other
– the Kenzo simplicial set with which the smash product is made
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo sage: s = s2.smash_product(s3) # optional - kenzo sage: type(s) # optional - kenzo <class 'sage.interfaces.kenzo.KenzoSimplicialSet'> sage: [s.homology(i) for i in range(6)] # optional - kenzo [Z, 0, 0, 0, 0, Z]
- suspension()#
Return the suspension of the simplicial set.
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import EilenbergMacLaneSpace # optional - kenzo sage: e3 = EilenbergMacLaneSpace(ZZ, 3) # optional - kenzo sage: s = e3.suspension() # optional - kenzo sage: type(s) # optional - kenzo <class 'sage.interfaces.kenzo.KenzoSimplicialSet'> sage: [s.homology(i) for i in range(6)] # optional - kenzo [Z, 0, 0, 0, Z, 0]
- sw_spectral_sequence()#
Return the Serre sequence of the first step of the Whitehead tower.
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: S3 = Sphere(3) # optional - kenzo sage: E = S3.sw_spectral_sequence() # optional - kenzo sage: T = E.table(0, 0, 4, 0, 4) # optional - kenzo sage: T # optional - kenzo Z 0 0 Z 0 0 0 0 0 0 Z 0 0 Z 0 0 0 0 0 0 Z 0 0 Z 0
- wedge(other)#
Return the wedge of
self
andother
.INPUT:
other
– the Kenzo simplicial set with which the wedge is made
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: s3 = Sphere(3) # optional - kenzo sage: w = s2.wedge(s3) # optional - kenzo sage: type(w) # optional - kenzo <class 'sage.interfaces.kenzo.KenzoSimplicialSet'> sage: [w.homology(i) for i in range(6)] # optional - kenzo [Z, 0, Z, Z, 0, 0]
- class sage.interfaces.kenzo.KenzoSpectralSequence(kenzo_object)#
Bases:
KenzoObject
Wrapper around Kenzo spectral sequences
- differential(p, i, j)#
Return the
(p, i, j)
differential morphism of the spectral sequence.INPUT:
p
– the page.i
– the column of the differential domain.j
– the row of the differential domain.
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: S3 = Sphere(3) # optional - kenzo sage: L = S3.loop_space() # optional - kenzo sage: EMS = L.em_spectral_sequence() # optional - kenzo sage: EMS.table(1,-5,-2,5,8) # optional - kenzo 0 Z Z + Z + Z Z + Z + Z 0 0 0 0 0 0 Z Z + Z 0 0 0 0 sage: EMS.matrix(1, -3, 8) # optional - kenzo [ 2 -2 2] sage: EMS.differential(1, -3, 8) # optional - kenzo Morphism from module over Integer Ring with invariants (0, 0, 0) to module with invariants (0,) that sends the generators to [(2), (-2), (2)]
- group(p, i, j)#
Return the
i,j
’th group of thep
page.INPUT:
p
– the page to take the group from.i
– the column where the group is taken from.j
– the row where the group is taken from.
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: S2 = Sphere(2) # optional - kenzo sage: EMS = S2.em_spectral_sequence() # optional - kenzo sage: EMS.group(0, -1, 2) # optional - kenzo Additive abelian group isomorphic to Z sage: EMS.group(0, -1, 3) # optional - kenzo Trivial group
- matrix(p, i, j)#
Return the matrix that determines the differential from the
i,j
’th group of thep
’th page.INPUT:
p
– the page.i
– the column of the differential domain.j
– the row of the differential domain.
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: S3 = Sphere(3) # optional - kenzo sage: L = S3.loop_space() # optional - kenzo sage: EMS = L.em_spectral_sequence() # optional - kenzo sage: EMS.table(1, -5, -2, 5, 8) # optional - kenzo 0 Z Z + Z + Z Z + Z + Z 0 0 0 0 0 0 Z Z + Z 0 0 0 0 sage: EMS.matrix(1, -2 ,8) # optional - kenzo [ 3 -2 0] [ 3 0 -3] [ 0 2 -3]
- table(p, i1, i2, j1, j2)#
Return a table printing the groups in the
p
page.INPUT:
p
– the page to print.
–
i1
– the first column to print.–
i2
– the last column to print.–
j1
– the first row to print.–
j2
– the last row to print.EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: S2 = Sphere(2) # optional - kenzo sage: EMS = S2.em_spectral_sequence() # optional - kenzo sage: EMS.table(0, -2, 2, -2, 2) # optional - kenzo 0 Z 0 0 0 0 0 0 0 0 0 0 Z 0 0 0 0 0 0 0 0 0 0 0 0
- sage.interfaces.kenzo.MooreSpace(m, n)#
Return the Moore space
M(m, n)
as a Kenzo simplicial set.The Moore space
M(m, n)
is the space whose n’th homology group is isomorphic to the cyclic group of orderm
, and the rest of the homology groups are trivial.INPUT:
m
– A positive integer. The order of the nontrivial homology group.n
– The dimension in which the homology is not trivial
OUTPUT:
A KenzoSimplicialSet
EXAMPLES:
sage: from sage.interfaces.kenzo import MooreSpace # optional - kenzo sage: m24 = MooreSpace(2,4) # optional - kenzo sage: m24 # optional - kenzo [K10 Simplicial-Set] sage: [m24.homology(i) for i in range(8)] # optional - kenzo [Z, 0, 0, 0, C2, 0, 0, 0]
- sage.interfaces.kenzo.SAbstractSimplex(simplex, dim)#
Convert an abstract simplex of Kenzo to an AbstractSimplex.
INPUT:
simplex
– An abstract simplex of Kenzo.dim
– The dimension ofsimplex
.
OUTPUT:
An AbstractSimplex.
EXAMPLES:
sage: from sage.libs.ecl import EclObject, ecl_eval sage: from sage.interfaces.kenzo import ( # optional - kenzo ....: KenzoObject, SAbstractSimplex) sage: KAbSm = KenzoObject(ecl_eval("(ABSM 15 'K)")) # optional - kenzo sage: SAbSm1 = SAbstractSimplex(KAbSm, 2) # optional - kenzo sage: SAbSm2 = SAbstractSimplex(KAbSm, 7) # optional - kenzo sage: SAbSm1.degeneracies() # optional - kenzo [3, 2, 1, 0] sage: SAbSm1.dimension() # optional - kenzo 6 sage: SAbSm2.dimension() # optional - kenzo 11
- sage.interfaces.kenzo.SChainComplex(kchaincomplex, start=0, end=15)#
Convert the KenzoChainComplex
kchcm
(between dimensionsstart
andend
) to a ChainComplex.INPUT:
kchaincomplex
– A KenzoChainComplexstart
– An integer number (optional, default 0)end
– An integer number greater than or equal tostart
(optional, default 15)
OUTPUT:
A ChainComplex
EXAMPLES:
sage: from sage.interfaces.kenzo import KChainComplex, SChainComplex # optional - kenzo sage: m1 = matrix(ZZ, 3, 2, [-1, 1, 3, -4, 5, 6]) sage: m4 = matrix(ZZ, 2, 2, [1, 2, 3, 6]) sage: m5 = matrix(ZZ, 2, 3, [2, 2, 2, -1, -1, -1]) sage: sage_chcm = ChainComplex({1: m1, 4: m4, 5: m5}, degree = -1) # optional - kenzo sage: SChainComplex(KChainComplex(sage_chcm)) == sage_chcm # optional - kenzo True
sage: from sage.interfaces.kenzo import SChainComplex, Sphere # optional - kenzo sage: S4 = Sphere(4) # optional - kenzo sage: C = SChainComplex(S4) # optional - kenzo sage: C # optional - kenzo Chain complex with at most 3 nonzero terms over Integer Ring sage: C._ascii_art_() # optional - kenzo 0 <-- C_4 <-- 0 ... 0 <-- C_0 <-- 0 sage: [C.homology(i) for i in range(6)] # optional - kenzo [Z, 0, 0, 0, Z, 0]
- sage.interfaces.kenzo.SFiniteSimplicialSet(ksimpset, limit)#
Convert the
limit
-skeleton of a finite simplicial set in Kenzo to a finite SimplicialSet in Sage.INPUT:
ksimpset
– A finite simplicial set in Kenzo.limit
– A natural number.
OUTPUT:
A finite SimplicialSet.
EXAMPLES:
sage: from sage.topology.simplicial_set import SimplicialSet sage: from sage.interfaces.kenzo import ( # optional - kenzo ....: AbstractSimplex, KFiniteSimplicialSet, ....: SFiniteSimplicialSet, Sphere) sage: s0 = AbstractSimplex(0, name='s0') # optional - kenzo sage: s1 = AbstractSimplex(0, name='s1') # optional - kenzo sage: s2 = AbstractSimplex(0, name='s2') # optional - kenzo sage: s01 = AbstractSimplex(1, name='s01') # optional - kenzo sage: s02 = AbstractSimplex(1, name='s02') # optional - kenzo sage: s12 = AbstractSimplex(1, name='s12') # optional - kenzo sage: s012 = AbstractSimplex(2, name='s012') # optional - kenzo sage: Triangle = SimplicialSet({s01: (s1, s0), # optional - kenzo ....: s02: (s2, s0), ....: s12: (s2, s1)}, ....: base_point = s0) sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo sage: STriangle = SFiniteSimplicialSet(KTriangle, 1) # optional - kenzo sage: STriangle.homology() # optional - kenzo {0: 0, 1: Z} sage: S1 = simplicial_sets.Sphere(1) # optional - kenzo sage: S3 = simplicial_sets.Sphere(3) # optional - kenzo sage: KS1vS3 = KFiniteSimplicialSet(S1.wedge(S3)) # optional - kenzo sage: SS1vS3 = SFiniteSimplicialSet(KS1vS3, 3) # optional - kenzo sage: SS1vS3.homology() # optional - kenzo {0: 0, 1: Z, 2: 0, 3: Z}
- sage.interfaces.kenzo.Sphere(n)#
Return the
n
dimensional sphere as a Kenzo simplicial set.INPUT:
n
– the dimension of the sphere
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import Sphere # optional - kenzo sage: s2 = Sphere(2) # optional - kenzo sage: s2 # optional - kenzo [K1 Simplicial-Set] sage: [s2.homology(i) for i in range(8)] # optional - kenzo [Z, 0, Z, 0, 0, 0, 0, 0]
- sage.interfaces.kenzo.build_morphism(source_complex, target_complex, degree, algorithm, strategy, orgn)#
Build a morphism of chain complexes by means of the corresponding build-mrph Kenzo function.
INPUT:
source_complex
– The source object as a KenzoChainComplex instancetarget_complex
– The target object as a KenzoChainComplex instancedegree
– An integer number representing the degree of the morphismalgorithm
– A Lisp function defining the mapping (:intr slot in Kenzo)strategy
– The strategy (:strt slot in Kenzo), which must be one of the two stringsgnrt
orcmbn
, depending if thealgorithm
(a Lisp function) uses as arguments a degree and a generator or a combination, respectively.orgn
– A list containing a description about the origin of the morphism
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import (KenzoChainComplex, ....: build_morphism) sage: from sage.libs.ecl import ecl_eval sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo sage: A = build_morphism( # optional - kenzo ....: ZCC, ZCC, -1, ....: ecl_eval("#'(lambda (comb) (cmbn (1- (degr comb))))"), ....: "cmbn", ["zero morphism on ZCC"]) sage: A.target_complex() # optional - kenzo [K... Chain-Complex] sage: A.degree() # optional - kenzo -1 sage: type(A) # optional - kenzo <class 'sage.interfaces.kenzo.KenzoChainComplexMorphism'>
- sage.interfaces.kenzo.k2s_matrix(kmatrix)#
Convert an array of ECL to a matrix of Sage.
INPUT:
kmatrix
– An array in ECL
EXAMPLES:
sage: from sage.interfaces.kenzo import k2s_matrix # optional - kenzo sage: from sage.libs.ecl import EclObject sage: M = EclObject("#2A((1 2 3) (3 2 1) (1 1 1))") sage: k2s_matrix(M) # optional - kenzo [1 2 3] [3 2 1] [1 1 1]
- sage.interfaces.kenzo.morphism_dictmat(morphism)#
Computes a list of matrices in ECL associated to a morphism in Sage.
INPUT:
morphism
– A morphism of chain complexes
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import morphism_dictmat # optional - kenzo sage: X = simplicial_complexes.Simplex(1) sage: Y = simplicial_complexes.Simplex(0) sage: g = Hom(X,Y)({0:0, 1:0}) sage: f = g.associated_chain_complex_morphism() sage: morphism_dictmat(f) # optional - kenzo <ECL: ((2 . #2A()) (1 . #2A()) (0 . #2A((1 1))))>
- sage.interfaces.kenzo.pairing(slist)#
Convert a list of Sage (which has an even length) to an assoc list in ECL.
INPUT:
slist
– A list in Sage
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import pairing # optional - kenzo sage: l = [1,2,3] sage: pairing(l) # optional - kenzo <ECL: ((2 . 3))>
- sage.interfaces.kenzo.s2k_dictmat(sdictmat)#
Convert a dictionary in Sage, whose values are matrices, to an assoc list in ECL.
INPUT:
sdictmat
– A dictionary in Sage
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import s2k_dictmat # optional - kenzo sage: A = Matrix([[1,2,3],[3,2,1],[1,1,1]]) sage: B = Matrix([[1,2],[2,1],[1,1]]) sage: d = {1 : A, 2 : B} sage: s2k_dictmat(d) # optional - kenzo <ECL: ((2 . #2A((1 2) (2 1) (1 1))) (1 . #2A((1 2 3) (3 2 1) (1 1 1))))>
- sage.interfaces.kenzo.s2k_listofmorphisms(l)#
Computes a list of morphisms of chain complexes in Kenzo from a list of morphisms in Sage.
INPUT:
l
– A list of morphisms of chain complexes
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import s2k_listofmorphisms # optional - kenzo sage: C1 = ChainComplex({1: matrix(ZZ, 0, 2, [])}, degree_of_differential=-1) sage: C2 = ChainComplex({1: matrix(ZZ, 1, 2, [1, 0])},degree_of_differential=-1) sage: C3 = ChainComplex({0: matrix(ZZ, 0,2 , [])},degree_of_differential=-1) sage: M1 = Hom(C2,C1)({1: matrix(ZZ, 2, 2, [2, 0, 0, 2])}) sage: M2 = Hom(C3,C2)({0: matrix(ZZ, 1, 2, [2, 0])}) sage: l = [M1, M2] sage: s2k_listofmorphisms(l) # optional - kenzo <ECL: ([K... Morphism (degree 0): K... -> K...] [K... Morphism (degree 0): K... -> K...])>
- sage.interfaces.kenzo.s2k_matrix(smatrix)#
Convert a matrix of Sage to an array of ECL.
INPUT:
smatrix
– A matrix in Sage
OUTPUT:
EXAMPLES:
sage: from sage.interfaces.kenzo import s2k_matrix # optional - kenzo sage: A = Matrix([[1,2,3],[3,2,1],[1,1,1]]) sage: s2k_matrix(A) # optional - kenzo <ECL: #2A((1 2 3) (3 2 1) (1 1 1))>