def omega(n,w):
  """
  Calculates Omega(n,w)

  Args: 
    n is the symplectic multiplicity (class U3State)
    w is the symplectic weight (class U3State) 
  
  Returns:
    Omega (float). For example: 
      om=U3State([4.5,.5,.5])
      n=U3State([4,0,0])
      omega(n,om)
     returns
      4.375.
  """
  Omga=0
  nn=n.cartesian()
  ww=w.cartesian()
  #suming over cartesian componenets of nn and ww
  for i in range(3):    
    Omga=Omga+(2*(ww[i]**2)-(nn[i]**2)+8*(ww[i]-nn[i])-2*(i+1)*(2*ww[i]-nn[i]))
    i=i+1
  Omga=Omga/4.0
  return Omga