ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 09 Jul 2016 16:18:07 -0500Unable to coerce dictionary to morphism between finite posetshttps://ask.sagemath.org/question/34059/unable-to-coerce-dictionary-to-morphism-between-finite-posets/Using the code below, I am unsure why I cannot form the identity map (or others such as constant maps) via dictionary. I have done the same process for finite simplicial complexes, so maybe this isn't implemented for finite posets? Thanks for any help!
The input:
X=Poset({1:[],2:[1]}) <br>
Hom(X,X)({1:1,2:2})
The output error message:
TypeError: Unable to coerce x (={1: 1, 2: 2}) to a morphism in Set of Morphisms from Finite poset containing 2 elements to Finite poset containing 2 elements in Join of Category of finite posets and Category of finite enumerated sets and Category of facade sets Sat, 09 Jul 2016 03:53:21 -0500https://ask.sagemath.org/question/34059/unable-to-coerce-dictionary-to-morphism-between-finite-posets/Comment by John Palmieri for <p>Using the code below, I am unsure why I cannot form the identity map (or others such as constant maps) via dictionary. I have done the same process for finite simplicial complexes, so maybe this isn't implemented for finite posets? Thanks for any help!</p>
<p>The input:</p>
<p>X=Poset({1:[],2:[1]}) <br/>
Hom(X,X)({1:1,2:2})</p>
<p>The output error message:</p>
<p>TypeError: Unable to coerce x (={1: 1, 2: 2}) to a morphism in Set of Morphisms from Finite poset containing 2 elements to Finite poset containing 2 elements in Join of Category of finite posets and Category of finite enumerated sets and Category of facade sets </p>
https://ask.sagemath.org/question/34059/unable-to-coerce-dictionary-to-morphism-between-finite-posets/?comment=34061#post-id-34061I'm not positive, but it looks like morphisms of posets are not implemented.Sat, 09 Jul 2016 10:17:44 -0500https://ask.sagemath.org/question/34059/unable-to-coerce-dictionary-to-morphism-between-finite-posets/?comment=34061#post-id-34061Answer by jobrien715 for <p>Using the code below, I am unsure why I cannot form the identity map (or others such as constant maps) via dictionary. I have done the same process for finite simplicial complexes, so maybe this isn't implemented for finite posets? Thanks for any help!</p>
<p>The input:</p>
<p>X=Poset({1:[],2:[1]}) <br/>
Hom(X,X)({1:1,2:2})</p>
<p>The output error message:</p>
<p>TypeError: Unable to coerce x (={1: 1, 2: 2}) to a morphism in Set of Morphisms from Finite poset containing 2 elements to Finite poset containing 2 elements in Join of Category of finite posets and Category of finite enumerated sets and Category of facade sets </p>
https://ask.sagemath.org/question/34059/unable-to-coerce-dictionary-to-morphism-between-finite-posets/?answer=34062#post-id-34062 Was given the following (tweaked) solution using lambda functions on sage-support:
X=Poset({1:[],2:[1]}) <br>
Hom(X,X)(lambda x:{1:1,2:2}[x])Sat, 09 Jul 2016 16:18:07 -0500https://ask.sagemath.org/question/34059/unable-to-coerce-dictionary-to-morphism-between-finite-posets/?answer=34062#post-id-34062