import math

# Returns (Weyl group size, number of positive roots)
def data_sizes(sys_type, n):
  if sys_type == "A":
    if n >= 1:
      return (math.factorial(n+1), n*(n+1) // 2)
    
  elif sys_type == "B":
    if n >= 2:
      return (2**n * math.factorial(n), n*n)
    
  elif sys_type == "C":
    if n >= 3:
      return (2**n * math.factorial(n), n*n)
    
  elif sys_type == "D":
    if n >= 4:
      return (2**(n-1) * math.factorial(n), n*(n-1))
    
  elif sys_type == "E":
    if n == 6:
      return (51840, 72 // 2)
    elif n == 7:
      return (2903040, 126 // 2)
    elif n == 8:
      return (696729600, 240 // 2)
    
  elif sys_type == "F":
    if n == 4:
      return (1152, 48 // 2)
    
  elif sys_type == "G":
    if n == 2:
      return (12, 12 // 2)

  raise Exception("Invalid root system")

# Returns distinguished rho tuples
def distinguished_rho_list(sys_type, n):
  if sys_type in ["A","B","C","D"]:
    raise NotImplementedError()

  distinguished = dict()

  # Distinguished rho for G2
  distinguished["G2"] = [
    (0,2),
    (2,2)
  ]

  # Distinguished rho for F4
  distinguished["F4"] = [
    (0,2,0,0),
    (0,2,0,2),
    (2,2,0,2),
    (2,2,2,2)
  ]

  # Distinguished rho for E6
  distinguished["E6"] = [
    (2,0,0,2,0,2),
    (2,2,2,0,2,2),
    (2,2,2,2,2,2)
  ]

  # Distinguished rho for E7
  distinguished["E7"] = [
    (0,0,0,2,0,0,2),
    (2,0,0,2,0,0,2),
    (2,0,0,2,0,2,2),
    (2,2,2,0,2,0,2),
    (2,2,2,0,2,2,2),
    (2,2,2,2,2,2,2)
  ]

  # Distinguished rho for E8
  distinguished["E8"] = [
    (0,0,0,0,2,0,0,0),
    (0,0,0,2,0,0,0,2),
    (0,0,0,2,0,0,2,0),
    (0,0,0,2,0,0,2,2),
    (2,0,0,2,0,0,2,0),
    (2,0,0,2,0,0,2,2),
    (2,0,0,2,0,2,0,2),
    (2,0,0,2,0,2,2,2),
    (2,2,2,0,2,0,2,2),
    (2,2,2,0,2,2,2,2),
    (2,2,2,2,2,2,2,2)
  ]

  return distinguished[sys_type + str(n)]