Ask Your Question

parsons.kyle.89's profile - activity

2023-12-09 19:57:56 +0200 received badge  Notable Question (source)
2021-07-05 00:03:39 +0200 received badge  Popular Question (source)
2018-10-26 21:37:46 +0200 received badge  Popular Question (source)
2018-06-20 16:27:05 +0200 received badge  Notable Question (source)
2015-09-26 23:49:30 +0200 received badge  Popular Question (source)
2013-08-13 15:54:04 +0200 received badge  Supporter (source)
2013-08-13 14:00:14 +0200 commented answer sparse differential of a chain complex

I've actually found the answer to my own question. Asking for X._numeric_representation gives the desired list.

2013-08-12 23:38:49 +0200 commented answer sparse differential of a chain complex

Thank you for your help. I am having success with this, but the problem now is that _chomp_repr_ renames all my vertices to integers. However, the names of the vertices are important. Is there a way to also output a table that matches up the new and old names?

2013-08-06 18:21:20 +0200 commented answer sparse differential of a chain complex

Restricting the dimension still fails. It also fails if dimensions = [1,2]. I'm running sage as a virtual machine image on Windows. The virtual machine has 512 MB of RAM (is that a lot or a little?). In actuality my computer has 4 GB.

2013-08-06 12:14:25 +0200 commented answer sparse differential of a chain complex

The f-vector is [1, 4096, 18945, 14850]. I would ideally like to work with complexes much larger than this if possible. The reason I thought that sage would return a dense matrix is the error I got. > File "matrix_integer_dense.pyx", line 226, in sage.matrix.matrix_integer_dense.Matrix_integer_dense.__cinit__ (sage/matrix/matrix_integer_dense.c:6865) MemoryError: out of memory allocating a matrix

2013-08-06 11:56:45 +0200 commented question sparse differential of a chain complex

Yes sorry I've corrected that.

2013-08-06 11:56:22 +0200 received badge  Editor (source)
2013-08-05 18:16:29 +0200 asked a question sparse differential of a chain complex

I'm trying to convert a simplicial complex into a chain complex and then extract the differential map. However the simplicial complex is rather large and sage runs out of memory when it tries to make the conversion. However, the differential should be a very sparse matrix and there should be plenty of memory to store a sparse representation of the differential. Is it possible to have sage compute the differential as a sparse matrix? Specifically the method which gives the out of memory error is chain_complex().

2013-06-05 13:33:34 +0200 commented question problem extracting the differentials of a chain complex

Those both give errors nearly identical to the original error. However changing it to comp = SimplicialComplex(grid1d(1)) computes correctly. So maybe it is just something about large matricies. Also matrix.identity(19) computes correctly, but matrix.identity(20) fails with a similar error. I've reported this as a bug.

2013-06-05 11:41:06 +0200 commented answer problem extracting the differentials of a chain complex

I also didn't get the error in the command line. Is there a reason It would work in the command line but not in the notebook?

2013-06-04 18:25:08 +0200 asked a question problem extracting the differentials of a chain complex

I'm getting an error when trying to convert a simplicial complex into a chain complex and then extract the differential maps using the .differential operator.

def grid1d(n1, n2=None, n3=None):
    if n2 == None:
        n2 = n1
    if n3 == None:
        n3 = n1
    edges = []
    for i in range(n1+1):
        for j in range(n2+1):
            for k in range(n3+1):
                if i < n1:
                    edges.append(((i,j,k),(i+1,j,k)))
                if j < n2:
                    edges.append(((i,j,k),(i,j+1,k)))
                if k < n3:
                    edges.append(((i,j,k),(i,j,k+1)))
    return edges

comp = SimplicialComplex(grid1d(3))
chain = comp.chain_complex()
chain.differential()

Everything runs but the last line which gives me the error:

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

File "/tmp/tmpZ7wtbe/___code___.py", line 5, in module exec compile(u'chain.differential() File "", line 1, in module

File "matrix0.pyx", line 1729, in sage.matrix.matrix0.Matrix.__repr__ (sage/matrix/matrix0.c:9374) File "/home/sage/sage-5.9/local/lib/python2.7/site-packages/sage/misc/sageinspect.py", line 1915, in sage_getvariablename for frame in inspect.stack(): File "/home/sage/sage-5.9/local/lib/python/inspect.py", line 1054, in stack return getouterframes(sys._getframe(1), context) File "/home/sage/sage-5.9/local/lib/python/inspect.py", line 1032, in getouterframes framelist.append((frame,) + getframeinfo(frame, context)) File "/home/sage/sage-5.9/local/lib/python/inspect.py", line 1007, in getframeinfo lines, lnum = findsource(frame) File "/home/sage/sage-5.9/local/lib/python/inspect.py", line 528, in findsource if not sourcefile and file[0] + file[-1] != '<>': IndexError: string index out of range

Any help resolving this problem would be greatly appreciated.

2013-05-17 11:13:16 +0200 received badge  Nice Question (source)
2013-05-14 09:51:03 +0200 received badge  Student (source)
2013-05-13 22:48:01 +0200 asked a question error computing homology of a simplicial complex

I'm running code to first generate a simplicial complex that is just a 3 dimensional lattice. I'm then adding square plaquettes. However, I get an error sometimes when I try to calculate homology. Specifically, when I run the code below I get the error:

ValueError: The differentials d_{2} and d_{1} are not compatible: their composition is not zero.

This seems strange since a simplicial complex should always have homology. The error persists even when I specify the homology function to use different algorithms.

def grid(n1, n2=None, n3=None):
    if n2 == None:
        n2 = n1
    if n3 == None:
        n3 = n1
    edges = []
    for i in range(n1+1):
        for j in range(n2+1):
            for k in range(n3+1):
                if i < n:
                    edges.append(((i,j,k),(i+1,j,k)))
                if j < n:
                    edges.append(((i,j,k),(i,j+1,k)))
                if k < n:
                    edges.append(((i,j,k),(i,j,k+1)))
    return edges

def add_plaquette(complex, address):
    b = address[1]
    a1 = address[2]
    a2 = address[3]
    if address[0] == 2:
        complex.add_face(((a1,a2,b),(a1+1,a2,b),(a1,a2+1,b)))
        complex.add_face(((a1+1,a2+1,b),(a1+1,a2,b),(a1,a2+1,b)))
    if address[0] == 1:
        complex.add_face(((a1,b,a2),(a1+1,b,a2),(a1,b,a2+1)))
        complex.add_face(((a1+1,b,a2+1),(a1+1,b,a2),(a1,b,a2+1)))
    if address[0] == 0:
        complex.add_face(((b,a1,a2),(b,a1+1,a2),(b,a1,a2+1)))
        complex.add_face(((b,a1+1,a2+1),(b,a1+1,a2),(b,a1,a2+1)))

t0 = SimplicialComplex(grid(2))
add_plaquette(t0, (0,0,1,0))
add_plaquette(t0, (0,0,1,1))
add_plaquette(t0, (2,2,0,1))
t0.homology()

The full text of the error is:

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

File "/tmp/tmpBNPSQ1/___code___.py", line 7, in <module> exec compile(u't0.homology() File "", line 1, in <module>

File "/home/sage/sage-5.9/local/lib/python2.7/site-packages/sage/homology/cell_complex.py", line 549, in homology return self._homology_(dim, *kwds) File "/home/sage/sage-5.9/local/lib/python2.7/site-packages/sage/homology/simplicial_complex.py", line 1925, in _homology_ cochain=cohomology, *kwds) File "/home/sage/sage-5.9/local/lib/python2.7/site-packages/sage/homology/simplicial_complex.py", line 1788, in chain_complex return ChainComplex(data=differentials, degree=-1, **kwds) File "/home/sage/sage-5.9/local/lib/python2.7/site-packages/sage/homology/chain_complex.py", line 462, in __init__ raise ValueError, "The differentials d_{%s} and d_{%s} are not compatible: their composition is not zero." % (n, n+degree) ValueError: The differentials d_{2} and d_{1} are not compatible: their composition is not zero.