Computation of the Jones polynomial

This commit is contained in:
Wojciech Politarczyk 2016-11-19 20:46:39 +01:00
parent 4fdd08f1d1
commit df8f02f3ca
5 changed files with 56 additions and 11 deletions

4
.gitignore vendored
View File

@ -1,5 +1,9 @@
#*
*~ *~
*.o *.o
GPATH
GRTAGS
GTAGS
/kk /kk
/main /main
/testsurfaces /testsurfaces

View File

@ -4,9 +4,9 @@ devel = 1
BISON = bison BISON = bison
FLEX = flex FLEX = flex
# CXX = g++ CXX = g++ -std=c++11
# CXX = OMPI_CXX=clang++ mpic++ -fno-color-diagnostics --stdlib=libc++ --std=c++11 -I/u/cseed/llvm-3.1/lib/c++/v1 # CXX = OMPI_CXX=clang++ mpic++ -fno-color-diagnostics --stdlib=libc++ --std=c++11 -I/u/cseed/llvm-3.1/lib/c++/v1
CXX = clang++ -fno-color-diagnostics --stdlib=libc++ --std=c++11 #CXX = clang++ -fno-color-diagnostics --stdlib=libc++ --std=c++11
INCLUDES = -I. -I/opt/local/include INCLUDES = -I. -I/opt/local/include

43
kk.cpp
View File

@ -251,6 +251,37 @@ compute_gss ()
tex_footer (); tex_footer ();
} }
multivariate_laurentpoly<Q> compute_jones(const knot_diagram& k, bool reduced) {
cube<Z2> c(kd, reduced);
multivariate_laurentpoly<Q> jones;
for(uint i = 1; i <= c.n_generators; ++i) {
grading gr = c.compute_generator_grading(i);
if(gr.h % 2 == 0) {
jones += multivariate_laurentpoly<Q>(1, VARIABLE, 1, gr.q);
}
else {
jones += multivariate_laurentpoly<Q>(-1, VARIABLE, 1, gr.q);
}
}
return jones;
}
void compute_khp(const knot_diagram& k, bool reduced) {
cube<Z2> c(kd,reduced);
ptr<const module<Z2> > C = c.khC;
mod_map<Z2> d = c.compute_d(1, 0, 0, 0, 0);
chain_complex_simplifier<Z2> s(C, d, maybe<int>(1), maybe<int>(0));
C = s.new_C;
d = s.new_d;
C->show_self();
//multivariate_laurentpoly<Q> khp;
//for(uint i = 1; i <= c.n_generators; ++i) {
// grading gr = c.compute_generator_grading(i);
// khp += multivariate_laurentpoly<Q>(1, VARIABLE, gr.h, gr.q);
//}
printf("The Poincare polynomial \n");
}
template<class R> void template<class R> void
compute_invariant () compute_invariant ()
{ {
@ -701,6 +732,18 @@ main (int argc, char **argv)
compute_gss (); compute_gss ();
} }
else if(!strcmp(invariant, "jones")) {
multivariate_laurentpoly<Q> jones_pol = compute_jones(kd, reduced);
printf("Jones polynomial of %s is equal to:\n", knot);
jones_pol.show_self();
printf("\n");
}
else if(!strcmp(invariant, "przytycki_cong")) {
multivariate_laurentpoly<Q> jones_pol = compute_jones(kd, reduced);
}
else if(!strcmp(invariant, "khp")) {
compute_khp(kd, reduced);
}
else else
{ {
if (!strcmp (field, "Z2")) if (!strcmp (field, "Z2"))

View File

@ -1,8 +1,6 @@
#include <knotkit.h> #include <knotkit.h>
#define HOME "/Users/josh/Documents/code/knotkit/"
bool verbose = 0; bool verbose = 0;
static const struct { static const struct {