appliedtopology / javaplex

Persistent Homology and Topological Data Analysis Library
BSD 3-Clause "New" or "Revised" License
190 stars 57 forks source link

Zig Zag Persistence Examples/Documentation #15

Open alexjwilliams opened 7 years ago

alexjwilliams commented 7 years ago

I am interested in using JavaPlex to compute zig zag persistent homology. An example or two would really help a lot. I didn't find any in the documentation. Could someone add one?

henryadams commented 7 years ago

Hi Alex (and others!), I've essentially never computed any zigzag persistent homology examples in JavaPlex. But if anybody has, please let me know, as I'd consider adding nice Matlab examples to the tutorial! Unfortunately I don't have the time right now to try to figure out the code myself. Alex, you may be interested in the following files, which rely on zigzag persistent homology: https://github.com/appliedtopology/javaplex/blob/master/src/matlab/experimental/witness_bootstrap/circle_pairwise.m https://github.com/appliedtopology/javaplex/blob/master/src/matlab/experimental/witness_bootstrap/figure8_example.m https://github.com/appliedtopology/javaplex/blob/master/src/matlab/experimental/witness_bootstrap/torus_example.m I think some users in the past had trouble running those files, so I'm not sure what the current state of affairs is. Best, Henry

alexjwilliams commented 7 years ago

Hello again. I was able to successfully run one of the zigzag examples that used the vietoris rips complex: https://github.com/appliedtopology/javaplex/blob/master/src/matlab/experimental/vietoris_rips_bootstrap/basic_sphere_example.m.

I ran into trouble with the witness complex examples, however. For example, when I ran https://github.com/appliedtopology/javaplex/blob/master/src/matlab/experimental/witness_bootstrap/figure8_example.m, I got the following error:

Error using zigzagex (line 19) Java exception occurred: java.lang.UnsupportedOperationException at edu.stanford.math.plex4.streams.impl.WitnessStream.setPlex3Compatbility(Unknown Source) at edu.stanford.math.plex4.homology.zigzag.bootstrap.WitnessBootstrapper.performProjectionBootstrap(Unknown Source)

Just to try it out, I commented out all of the Y_stream.setPlex3Compatbility(false); lines in WitnessBootstrapper.java, but that resulted in:

Error using zigzagex (line 19) Java exception occurred: java.lang.UnsupportedOperationException at edu.stanford.math.plex4.streams.impl.WitnessStream.getAssociatedSimplices(WitnessStream.java:157) at edu.stanford.math.plex4.streams.impl.WitnessBicomplex.constructComplex(WitnessBicomplex.java:32) at edu.stanford.math.plex4.streams.interfaces.PrimitiveStream.finalizeStream(PrimitiveStream.java:95) at edu.stanford.math.plex4.homology.zigzag.bootstrap.WitnessBootstrapper.performProjectionBootstrap(WitnessBootstrapper.java:142)

Would this be relatively easy to fix? Henry, given your last answer it doesn't sound like you have the time to get to the bottom of this (Although I'd be very grateful if you could help me). I'll tag Andrew Tausz, who wrote the code in question. @ogdet, do you know what is going on here?

Thanks, Alex

Edit: zigzagex.m is a file in which I pasted load_javaplex.m above the code in https://github.com/appliedtopology/javaplex/blob/master/src/matlab/experimental/witness_bootstrap/figure8_example.m. Originally the line numbers of the errors above ("Error using zigzagex") pointed to the lines of the modified file (zigzagex.m). I have changed the above line numbers to point to the line number where the error occurred in the unmodified version of the script. The errors occur at line 19 of https://github.com/appliedtopology/javaplex/blob/master/src/matlab/experimental/witness_bootstrap/figure8_example.m. My apologies.

henryadams commented 7 years ago

Hi Alex, I don't know this part of the code well enough to have much to say. @ogdet or @michiexile may be able to give you some ideas, but @ogdet has largely moved on to other responsibilities. Best, Henry