def __init__(self,i,n): # our inde scheme starts at 0, so subtract 1 from n # when naming the momenta k = n-1 il = lorentz_key(i) if (i<0) else i p_str = "p{0}[{1}]" array = [tensor([c_variable(p_str.format(k,vect_gauge_dict[0]))], None), tensor([c_variable(p_str.format(k,vect_gauge_dict[1]))], None), tensor([c_variable(p_str.format(k,vect_gauge_dict[2]))], None), tensor([c_variable(p_str.format(k,vect_gauge_dict[3]))], None)] super(P,self).__init__(array,il)
def __init__(self, i, n): # our inde scheme starts at 0, so subtract 1 from n # when naming the momenta k = n - 1 il = lorentz_key(i) if (i < 0) else i p_str = "p{0}[{1}]" array = [ tensor([c_variable(p_str.format(k, vect_gauge_dict[0]))], None), tensor([c_variable(p_str.format(k, vect_gauge_dict[1]))], None), tensor([c_variable(p_str.format(k, vect_gauge_dict[2]))], None), tensor([c_variable(p_str.format(k, vect_gauge_dict[3]))], None) ] super(P, self).__init__(array, il)
def get_in_current_tens(self, key, spin): # scalar if spin == 1: return tensor([c_variable("j{0}[0]".format(key))], None) # fermion if (spin == 2): return tensor([tensor([c_variable("j{0}[{1}]".format(key,0))] , None), tensor([c_variable("j{0}[{1}]".format(key,1))] , None), tensor([c_variable("j{0}[{1}]".format(key,2))] , None), tensor([c_variable("j{0}[{1}]".format(key,3))] , None)], key+1) if (spin == 3): needs_gauge = self.needs_vector_gauge() dummy = tensor([tensor([c_variable("j{0}[{1}]".format(key,vect_gauge_dict[0] if needs_gauge else 0))] , None), tensor([c_variable("j{0}[{1}]".format(key,vect_gauge_dict[1] if needs_gauge else 1))] , None), tensor([c_variable("j{0}[{1}]".format(key,vect_gauge_dict[2] if needs_gauge else 2))] , None), tensor([c_variable("j{0}[{1}]".format(key,vect_gauge_dict[3] if needs_gauge else 3))] , None)], 'dummy_key') # incoming currents are alway contravariant in sherpa, # so we need to multiply by metric return dummy * mink_metric(key+1, 'dummy_key') raise ufo_exception("External wavefunction for spin {0} not implemented".format(spin))
def get_in_current_tens(self, key, spin): # scalar if spin == 1: return tensor([c_variable("j{0}[0]".format(key))], None) # fermion if (spin == 2): return tensor([ tensor([c_variable("j{0}[{1}]".format(key, 0))], None), tensor([c_variable("j{0}[{1}]".format(key, 1))], None), tensor([c_variable("j{0}[{1}]".format(key, 2))], None), tensor([c_variable("j{0}[{1}]".format(key, 3))], None) ], key + 1) if (spin == 3): needs_gauge = self.needs_vector_gauge() dummy = tensor([ tensor([ c_variable("j{0}[{1}]".format( key, vect_gauge_dict[0] if needs_gauge else 0)) ], None), tensor([ c_variable("j{0}[{1}]".format( key, vect_gauge_dict[1] if needs_gauge else 1)) ], None), tensor([ c_variable("j{0}[{1}]".format( key, vect_gauge_dict[2] if needs_gauge else 2)) ], None), tensor([ c_variable("j{0}[{1}]".format( key, vect_gauge_dict[3] if needs_gauge else 3)) ], None) ], 'dummy_key') # incoming currents are alway contravariant in sherpa, # so we need to multiply by metric return dummy * mink_metric(key + 1, 'dummy_key') raise ufo_exception( "External wavefunction for spin {0} not implemented".format(spin))
def get_in_current_tens(self, key, spin): # scalar if spin == 1: return tensor([c_variable("j{0}[0]".format(key))], None) # fermion if (spin == 2): # put key+1 as key to account for UFO key conv. return tensor([tensor([c_variable("j{0}[{1}]".format(key,0))] , None), tensor([c_variable("j{0}[{1}]".format(key,1))] , None), tensor([c_variable("j{0}[{1}]".format(key,2))] , None), tensor([c_variable("j{0}[{1}]".format(key,3))] , None)], key+1) if (spin == 3): dummy = tensor([tensor([c_variable("j{0}[{1}]".format(key,vect_gauge_dict[0]))] , None), tensor([c_variable("j{0}[{1}]".format(key,vect_gauge_dict[1]))] , None), tensor([c_variable("j{0}[{1}]".format(key,vect_gauge_dict[2]))] , None), tensor([c_variable("j{0}[{1}]".format(key,vect_gauge_dict[3]))] , None)], 'dummy_key') # Incoming currents are alway contravariant in sherpa, # so we need to multiply by metric. # Put key+1 as key to account for UFO key conv. return dummy * mink_metric(key+1, 'dummy_key') raise ufo_exception("External wavefunction for spin {0} not implemented".format(spin))
def get_in_current_tens(self, key, spin): # scalar if spin == 1: return tensor([c_variable("j{0}[0]".format(key))], None) # fermion if (spin == 2): # put key+1 as key to account for UFO key conv. return tensor([ tensor([c_variable("j{0}[{1}]".format(key, 0))], None), tensor([c_variable("j{0}[{1}]".format(key, 1))], None), tensor([c_variable("j{0}[{1}]".format(key, 2))], None), tensor([c_variable("j{0}[{1}]".format(key, 3))], None) ], key + 1) if (spin == 3): dummy = tensor([ tensor( [c_variable("j{0}[{1}]".format(key, vect_gauge_dict[0]))], None), tensor( [c_variable("j{0}[{1}]".format(key, vect_gauge_dict[1]))], None), tensor( [c_variable("j{0}[{1}]".format(key, vect_gauge_dict[2]))], None), tensor( [c_variable("j{0}[{1}]".format(key, vect_gauge_dict[3]))], None) ], 'dummy_key') # Incoming currents are alway contravariant in sherpa, # so we need to multiply by metric. # Put key+1 as key to account for UFO key conv. return dummy * mink_metric(key + 1, 'dummy_key') raise ufo_exception( "External wavefunction for spin {0} not implemented".format(spin))