# Revision history [back]

### How to get coordinates of an element of a combinatorial free module?

This sounds ridiculously simple, but it seems that I don't know the right command. I have an element in a CombinatorialFreeModule, which has a finite basis. I want the coordinates of this vector as an array or a vector or in whatever way. Here is what I have tried:

MRH([1,3,2]) # this is our vector


B[[1, 3, 2]]

for i in MR.homogeneous_component(3).basis():
print(i) # this prints our basis


B[[1, 2, 3]]

B[[1, 3, 2]]

B[[2, 1, 3]]

B[[2, 3, 1]]

B[[3, 1, 2]]

B[[3, 2, 1]]

(MR.homogeneous_component(3)).coordinates(MRH([1,3,2])) # this should print [0,1,0,0,0,0] or sth. like this


Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_82.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -- coding: utf-8 --\n" + _support_.preparse_worksheet_cell(base64.b64decode("KE1SLmhvbW9nZW5lb3VzX2NvbXBvbmVudCgzKSkuY29vcmRpbmF0ZXMoTVJIKFsxLDMsMl0pKQ=="),globals())+"\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in <module>

File "/tmp/tmpa4FCTA/___code___.py", line 3, in <module> exec compile(u'(MR.homogeneous_component(_sage_const_3 )).coordinates(MRH([_sage_const_1 ,_sage_const_3 ,_sage_const_2 ])) File "", line 1, in <module>

File "parent.pyx", line 811, in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:6260) File "parent.pyx", line 323, in sage.structure.parent.getattr_from_other_class (sage/structure/parent.c:3110) AttributeError: 'CombinatorialFreeModule_with_category' object has no attribute 'coordinates'

### How to get coordinates of an element of a combinatorial free module?

This sounds ridiculously simple, but it seems that I don't know the right command. I have an element in a CombinatorialFreeModule, which has a finite basis. I want the coordinates of this vector as an array or a vector or in whatever way. Here is what I have tried:

MRH([1,3,2]) # this is our vector


B[[1, 3, 2]]

for i in MR.homogeneous_component(3).basis():
print(i) # this prints our basis


B[[1, 2, 3]]

B[[1, 3, 2]]

B[[2, 1, 3]]

B[[2, 3, 1]]

B[[3, 1, 2]]

B[[3, 2, 1]]

(MR.homogeneous_component(3)).coordinates(MRH([1,3,2])) # this should print [0,1,0,0,0,0] or sth. like this


Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_82.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -- coding: utf-8 --\n" + _support_.preparse_worksheet_cell(base64.b64decode("KE1SLmhvbW9nZW5lb3VzX2NvbXBvbmVudCgzKSkuY29vcmRpbmF0ZXMoTVJIKFsxLDMsMl0pKQ=="),globals())+"\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in <module>

File "/tmp/tmpa4FCTA/___code___.py", line 3, in <module> exec compile(u'(MR.homogeneous_component(_sage_const_3 )).coordinates(MRH([_sage_const_1 ,_sage_const_3 ,_sage_const_2 ])) File "", line 1, in <module>

File "parent.pyx", line 811, in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:6260) File "parent.pyx", line 323, in sage.structure.parent.getattr_from_other_class (sage/structure/parent.c:3110) AttributeError: 'CombinatorialFreeModule_with_category' object has no attribute 'coordinates'

I have no idea what the error is supposed to tell us, unless the CombinatorialFreeModule type really doesn't have a coordinates function...

### How to get coordinates of an element of a combinatorial free module?

This sounds ridiculously simple, but it seems that I don't know the right command. I have an element in a CombinatorialFreeModule, which has a finite basis. I want the coordinates of this vector as an array or a vector or in whatever way. Here is what I have tried:

MRH([1,3,2]) # this is our vector


B[[1, 3, 2]]

for i in MR.homogeneous_component(3).basis():
print(i) # this prints our basis


B[[1, 2, 3]]

B[[1, 3, 2]]

B[[2, 1, 3]]

B[[2, 3, 1]]

B[[3, 1, 2]]

B[[3, 2, 1]]

(MR.homogeneous_component(3)).coordinates(MRH([1,3,2])) (MR.homogeneous_component(3)).coordinates(MRH([1,3,2]))
# this should print [0,1,0,0,0,0] or sth. something like this


Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_82.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -- coding: utf-8 --\n" + _support_.preparse_worksheet_cell(base64.b64decode("KE1SLmhvbW9nZW5lb3VzX2NvbXBvbmVudCgzKSkuY29vcmRpbmF0ZXMoTVJIKFsxLDMsMl0pKQ=="),globals())+"\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in <module>

File "/tmp/tmpa4FCTA/___code___.py", line 3, in <module> exec compile(u'(MR.homogeneous_component(_sage_const_3 )).coordinates(MRH([_sage_const_1 ,_sage_const_3 ,_sage_const_2 ])) File "", line 1, in <module>

File "parent.pyx", line 811, in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:6260) File "parent.pyx", line 323, in sage.structure.parent.getattr_from_other_class (sage/structure/parent.c:3110) AttributeError: 'CombinatorialFreeModule_with_category' object has no attribute 'coordinates'

I have no idea what the error is supposed to tell us, unless the CombinatorialFreeModule type really doesn't have a coordinates function...