Esempio n. 1
0
def get_unscaled_proj_35_8888_sd_asd(dtype=numpy.int32):
  """Computes the [35, 8, 8, 8, 8]-projector to the (anti)self-dual 4-forms."""
  # In principle, we could use the so8.gamma_vvvvss and so8.gamma_vvvvcc here,
  # but we opt for instead constructing some explicit orthonormal bases for the
  # 35-dimensional irreps as this makes it easier to stay exact despite using
  # floating point numbers.
  #
  # We first need some basis for the 35 self-dual 4-forms.
  # Our convention is that we lexicographically list those 8-choose-4
  # combinations that contain the index 0.
  ret_sd = numpy.zeros([35, 8, 8, 8, 8], dtype=dtype)
  ret_asd = numpy.zeros([35, 8, 8, 8, 8], dtype=dtype)
  #
  def get_complementary(ijkl):
    mnpq = tuple(n for n in range(8) if n not in ijkl)
    return (algebra.permutation_sign(ijkl + mnpq), ijkl, mnpq)
  #
  complements = [get_complementary(ijkl)
                 for ijkl in itertools.combinations(range(8), 4)
                 if 0 in ijkl]
  for num_sd, (sign, ijkl, mnpq) in enumerate(complements):
    for abcd in itertools.permutations(range(4)):
      sign_abcd = algebra.permutation_sign(abcd)
      for r, part2_sign in ((ret_sd, 1), (ret_asd, -1)):
        r[num_sd,
          ijkl[abcd[0]], ijkl[abcd[1]],
          ijkl[abcd[2]], ijkl[abcd[3]]] = sign_abcd
        r[num_sd,
          mnpq[abcd[0]], mnpq[abcd[1]], mnpq[abcd[2]],
          mnpq[abcd[3]]] = sign_abcd * sign * part2_sign
  return ret_sd, ret_asd
Esempio n. 2
0
 def get_complementary(ijkl):
   mnpq = tuple(n for n in range(8) if n not in ijkl)
   return (algebra.permutation_sign(ijkl + mnpq), ijkl, mnpq)