Skip to content

Commit

Permalink
Add Pol vectors!
Browse files Browse the repository at this point in the history
  • Loading branch information
APN-Pucky committed May 28, 2024
1 parent f53a1ee commit ccfd848
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion feynamp/form/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Tensors colorcorrelation;
Tensors Metric(symmetric),df(symmetric),da(symmetric),Identity(symmetric);
Function ProjM,ProjP,VF,xg,xgi,P,dg,dgi,xeg,xegi;
CFunctions Den,Denom,P,Gamma,u,v,ubar,vbar,eps,epsstar,VC,VA,GammaId, GammaCollect, GammaIdCollect;
CFunctions Den,Denom,P,Gamma,u,v,ubar,vbar,eps,epsstar,VC,VA,VPol,GammaId, GammaCollect, GammaIdCollect;
Indices a,o,n,m,tm,tn,beta,b,m,betap,alphap,a,alpha,ind,delta,k,j,l,c,d,e;
"""

Expand Down
12 changes: 8 additions & 4 deletions feynamp/form/lorentz.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ def get_orthogonal_polarisation_momentum(


def get_polarisation_sums(fds: List[FeynmanDiagram], model: FeynModel):
pol_sums = ""
pol_sums = """
repeat;
id VPol(Polb?,Moma?) * VPol(Pold?,Moma?) = d_(Polb,Pold);
endrepeat;
"""
# TODO might want to loop over all fds?
for fd in [fds[0]]:
for l in fd.legs:
Expand All @@ -162,21 +166,21 @@ def get_polarisation_sums(fds: List[FeynmanDiagram], model: FeynModel):

def get_polarisation_sum_massive(mom_a):
pol_sum = f"""
id epsstar(Muc?,Polb?,{mom_a}) * eps(Mul?,Pold?,{mom_a}) = -Metric(Mul,Muc) + (P(Mul,{mom_a})*P(Muc,{mom_a}))*Den({mom_a}.{mom_a});
id epsstar(Muc?,Polb?,{mom_a}) * eps(Mul?,Polb?,{mom_a}) = -Metric(Mul,Muc) + (P(Mul,{mom_a})*P(Muc,{mom_a}))*Den({mom_a}.{mom_a});
"""
return pol_sum


def get_polarisation_sum_feynman(mom_a):
pol_sum = f"""
id epsstar(Muc?,Polb?,{mom_a}) * eps(Mul?,Pold?,{mom_a}) = -Metric(Mul,Muc);
id epsstar(Muc?,Polb?,{mom_a}) * eps(Mul?,Polb?,{mom_a}) = -Metric(Mul,Muc);
"""
return pol_sum


def get_polarisation_sum_physical(mom_a, mom_b):
pol_sum = f"""
id epsstar(Muc?,Polb?,{mom_a}) * eps(Mul?,Pold?,{mom_a}) = -Metric(Muc,Mul)
id epsstar(Muc?,Polb?,{mom_a}) * eps(Mul?,Polb?,{mom_a}) = -Metric(Muc,Mul)
+ (P(Muc,{mom_a})*P(Mul,{mom_b}) + P(Mul,{mom_a})*P(Muc,{mom_b}))*Den({mom_b}.{mom_a})
- P(Muc,{mom_a})*P(Mul,{mom_a})*({mom_b}.{mom_b})*Den({mom_b}.{mom_a})*Den({mom_b}.{mom_a});
"""
Expand Down
4 changes: 2 additions & 2 deletions feynamp/leg.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ def get_leg_math(fd, leg, model): # epsilons or u/v optionally also barred

if p.spin == 3:
if leg.is_incoming():
ret += f"eps(Mu{p.particle.id},Pol{p.particle.id},{mom})"
ret += f"eps(Mu{p.particle.id},Pol{p.particle.id},{mom})*VPol(Pol{p.particle.id},{mom})"
else:
ret += f"eps_star(Mu{p.particle.id},Pol{p.particle.id},{mom})"
ret += f"eps_star(Mu{p.particle.id},Pol{p.particle.id},{mom})*VPol(Pol{p.particle.id},{mom})"
if p.spin == 2:
if not p.particle.is_anti():
if leg.is_incoming():
Expand Down

0 comments on commit ccfd848

Please sign in to comment.