diff --git a/main.cpp b/main.cpp index 3c17464..e464dbb 100644 --- a/main.cpp +++ b/main.cpp @@ -913,6 +913,181 @@ compute_st (mod_map sq1, return st; } +void +display_st (map > st) +{ + bool first = 1; + for (map_const_iter > i = st; i; i ++) + { + grading hq = i.key (); + int s1 = i.val ()[1], + s2 = i.val ()[2], + s3 = i.val ()[3], + s4 = i.val ()[4]; + if (s1 == 0 && s2 == 0 && s3 == 0 && s4 == 0) + continue; + if (first) + first = 0; + else + printf (","); + printf ("$(%d, %d) \\mapsto (%d, %d, %d, %d)$", hq.h, hq.q, s1, s2, s3, s4); + } + newline (); +} + +void +test_kh_htt_stronger () +{ + map, + multivariate_laurentpoly >, + pair > > > P_sq1_knot_st; + + const char *knot_sq_files[] = { + "knot_sq/rolfsen_sq.dat.gz", + "knot_sq/Ksmall_sq.dat.gz", + "knot_sq/K11_sq.dat.gz", + "knot_sq/K12_sq.dat.gz", + "knot_sq/K13_sq.dat.gz", + "knot_sq/K14_sq.dat.gz", + "knot_sq/Lsmall_sq.dat.gz", + "knot_sq/L11_sq.dat.gz", + "knot_sq/L12_sq.dat.gz", + "knot_sq/L13_sq.dat.gz", + "knot_sq/L14_sq.dat.gz", + 0, + }; + + for (unsigned i = 0; knot_sq_files[i]; i ++) + { + gzfile_reader r (knot_sq_files[i]); + + printf ("loading %s...\n", knot_sq_files[i]); + + unsigned n = r.read_unsigned (); + for (unsigned i = 1; i <= n; i ++) + { + knot_desc desc (r); + pair, mod_map > p1 (r); + + if (desc.t == knot_desc::MT + || desc.t == knot_desc::MT_ALT + || desc.t == knot_desc::MT_NONALT) + { + knot_diagram kd = desc.diagram (); + if (kd.num_components () == 1) + continue; + } + + mod_map sq1 = p1.first, + sq2 = p1.second; + ptr > H = sq1.domain (); + multivariate_laurentpoly P = H->free_poincare_polynomial (); + + unsigned hwidth = homological_width (H); + + map > st + = compute_st (sq1, sq2); + + ptr > sq1_im = sq1.image (); + multivariate_laurentpoly sq1_im_P = sq1_im->free_poincare_polynomial (); + + pair > > &, + bool> p2 = P_sq1_knot_st.find (pair, + multivariate_laurentpoly > (P, sq1_im_P)); + if (p2.second) + { + if (p2.first.second != st) + { + printf ("DIFFER:\n"); + printf ("hwidth = %d\n", hwidth); + + show (p2.first.first); + display_st (p2.first.second); + + show (desc); + display_st (st); + + printf ("Kh["); + planar_diagram (p2.first.first.diagram ()).show_knottheory (); + printf (", Modulus -> Null][q,t] === Kh["); + planar_diagram (desc.diagram ()).show_knottheory (); + printf (", Modulus -> Null][q,t]\n"); + } + } + else + { + p2.first.first = desc; + p2.first.second = st; + } + } + } +} + +void +find_width4_in_h0 () +{ + const char *knot_sq_files[] = { + "knot_sq/rolfsen_sq.dat.gz", + "knot_sq/Ksmall_sq.dat.gz", + "knot_sq/K11_sq.dat.gz", + "knot_sq/K12_sq.dat.gz", + "knot_sq/K13_sq.dat.gz", + "knot_sq/K14_sq.dat.gz", + "knot_sq/K15_sq_part.dat.gz", + 0, + }; + + for (unsigned i = 0; knot_sq_files[i]; i ++) + { + gzfile_reader r (knot_sq_files[i]); + + printf ("loading %s...\n", knot_sq_files[i]); + fflush (stdout); + + unsigned n = r.read_unsigned (); + for (unsigned i = 1; i <= n; i ++) + { + knot_desc desc (r); + // show (desc); newline (); + + pair, mod_map > p (r); + + mod_map sq1 = p.first, + sq2 = p.second; + ptr > H = sq1.domain (); + + int minq = 1000, + maxq = -1000; + + for (unsigned j = 1; j <= H->dim (); j ++) + { + grading hq = H->generator_grading (j); + if (hq.h == 0) + { + if (hq.q < minq) + minq = hq.q; + if (hq.q > maxq) + maxq = hq.q; + } + } + + unsigned h0_width = 0; + if (minq <= maxq) + h0_width = (maxq - minq) / 2 + 1; + + // printf ("h0_width = %d\n", h0_width); + + if (h0_width >= 4) + { + show (desc); newline (); + // printf (" > WIDTH 4!!\n"); + } + } + } +} + void test_knot_sq () { @@ -1144,6 +1319,58 @@ file_exists (const char *file) return 1; } +#if 0 +bool +file_exists (const char *buf) +{ + struct stat stat_buf; + if (stat (buf, &stat_buf) != 0) + { + if (errno == ENOENT) + return 0; + + stderror ("stat: %s", buf); + exit (EXIT_FAILURE); + } + + return 1; +} + +void +convert_mut15 () +{ + hashmap, mod_map > > knot15_sq_part; + + basedvector, 1> groups = mutant_knot_groups (15); + for (unsigned i = 1; i <= groups.size (); i ++) + { + for (unsigned j = 1; j <= groups[i].size (); j ++) + { + knot_desc desc (knot_desc::HTW, i, groups[i][j]); + + char buf[1000]; + sprintf (buf, "/u/cseed/mut15.bak/K15_%d.dat.gz", groups[i][j]); + + if (file_exists (buf)) + { + gzfile_reader r (buf); + + mod_map sq1 (r); + mod_map sq2 (r); + knot15_sq_part.push (desc, + pair, mod_map > (sq1, sq2)); + } + } + } + + printf ("|knot15_sq_part| = %d\n", knot15_sq_part.card ()); + + gzfile_writer w ("/u/cseed/src/knotkit/knot_sq/K15_sq_part.dat.gz"); + write (w, knot15_sq_part); +} +#endif + void compute_mutant_mirrors () { @@ -1351,12 +1578,22 @@ convert_15 () int main () { - test_knot_sq (); + find_width4_in_h0 (); + // convert_15 (); + // test_knot_sq (); return 0; + // convert_mut15 (); + compute_mutant_mirrors (); + + test_kh_htt_stronger (); + + compute_mutant_mirrors (); + + test_knot_sq (); + convert_mknots (); - convert_15 (); test_forgetful_ss (); compute_twistedU (); diff --git a/serial.cmd b/serial.cmd index ec0c136..22b916b 100644 --- a/serial.cmd +++ b/serial.cmd @@ -1,5 +1,5 @@ # serial job -#PBS -l nodes=1:ppn=1,walltime=96:00:00 +#PBS -l nodes=1:ppn=1,walltime=4:00:00 # xxx PBS -l mem=80gb # # sends mail if the process aborts, when it begins, and