Esempio n. 1
0
def check_cores_are_cubelike(n):
  smaller_cores_canon = set()
  for i in range(1,n):
    for gen, G in hom.nonisomorphic_cubes_Z2(i):
      Gcanon = tuple(G.canonical_label().edges())
      smaller_cores_canon.add(Gcanon)

  for gen, G in hom.nonisomorphic_cubes_Z2(n):
    H = hom.find_core(G)
    if H.order() == G.order():
      print "G itself core, gen by", gen
      continue
    Hcanon = tuple(hom.Graph(H).canonical_label().edges())
    if Hcanon in smaller_cores_canon:
      continue
    print "Not a cube-like core", H, "of", G, "gen by", gen
    return False
  return True
Esempio n. 2
0
def check_prop_for_all(prop, n):
  """
  Check prop(G)->True/False for all n-dim cube-like graphs.
  For example: check_prop_for_all(check_some_squash_or_core, 4)
  Returns list of failed graphs as pairs (gens, G).
  """
  fails = []
  for gen, G in hom.nonisomorphic_cubes_Z2(n):
    if not prop(G):
      log.debug("Prop failed: G with gen %s", gen)
      fails.append((gen, G))
  return fails