Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose cycle equivalence code to python #32

Closed
nhchristianson opened this issue Jul 26, 2018 · 6 comments
Closed

Expose cycle equivalence code to python #32

nhchristianson opened this issue Jul 26, 2018 · 6 comments

Comments

@nhchristianson
Copy link

As mentioned on the mailing list: would it be possible to add the functionality of judging equivalence of two cycles (i.e., whether they are in the same homology class) to the python bindings?

@mrzv
Copy link
Owner

mrzv commented Aug 22, 2018

@nhchristianson I've pushed a new branch, homologous-cycles. It's added a function homologous to ReducedMatrix, plus a constructor for Chain. A sample usage is:

>>> import dionysus as d
>>> simplices = [[0], [1], [0,1], [2]]
>>> f = d.Filtration()
>>> for s in simplices: f.append(d.Simplex(s))
>>> f.sort()
>>> for s in f:
...     print(s)
<0> 0
<1> 0
<2> 0
<0,1> 0

>>> m = d.homology_persistence(f)
>>> for i,c in enumerate(m):
...     print(i,c)
0 
1 
2 
3 1*0 + 1*1

>>> m.homologous(d.Chain([(1,0)]), d.Chain([(1,1)]))
True

>>> m.homologous(d.Chain([(1,0)]), d.Chain([(1,2)]))
False

Give it a shot. If it works for you, I'll merge it into master.

@nhchristianson
Copy link
Author

Seems to work well, thanks!

@mrzv
Copy link
Owner

mrzv commented Aug 25, 2018

Perfect. I'll add some docs and merge into master.

@mrzv mrzv closed this as completed in bdfdba8 May 14, 2019
@anvarava
Copy link

anvarava commented Jun 24, 2020

Hi! seems like it is still not available (I am using 2.0.6 installed through pip) -- could you please add it? Thanks!

@mrzv
Copy link
Owner

mrzv commented Jun 24, 2020

Is your question specifically about the PyPI release? I need to dig up the instruction on how to post a new update there, but I'll try to do so soon. Meanwhile, you could install through pip directly from GitHub.

@mrzv
Copy link
Owner

mrzv commented Jun 24, 2020

@anvarava I think I managed to make a 2.0.7 release on PyPI. Try and see if it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants