Example #1
0
def get_diagram_one(ax, fermion_style, boson_style, vertex_style):

    D = Diagram(ax)

    w = 0.75
    xy0 = [0.5 - w / 2, 0.25]
    v1 = D.vertex(xy0, **vertex_style)
    v2 = D.vertex(v1.xy, dx=w, **vertex_style)
    G = D.line(v1, v2, **fermion_style)
    B = D.line(v1, v2, **boson_style)

    # In case the axes get smaller (you have more diagrams), you might want to change the scale
    D.scale(1.0)

    D.plot()
    return D
Example #2
0
def get_diagram_two(ax, fermion_style, boson_style, vertex_style):

    D = Diagram(ax)

    w = 0.75
    xy0 = [0.5 - w/2, 0.25]

    v1 = D.vertex(xy0, **vertex_style)
    v2 = D.vertex(v1.xy, dx=w/2, **vertex_style)
    v3 = D.vertex(v1.xy, dx=w, **vertex_style)
    G1 = D.line(v1, v2, **fermion_style)
    G2 = D.line(v2, v3, **fermion_style)
    B = D.line(v2, v2, **boson_style)

    # In case the axes get smaller (you have more diagrams), you might want to change the scale
    D.scale(1.0)

    D.plot()
    return D
Example #3
0
import matplotlib.pyplot as plt
from feynman import Diagram

fig = plt.figure(figsize=(8,2))
ax = fig.add_subplot(111, frameon=False)

ax.set_xlim(0, 2)
ax.set_ylim(0, .5)

W_style = dict(style='double wiggly elliptic', nwiggles=5)
G_style = dict(style='double', arrow=True, arrow_param={'width':0.05})

# Sigma operator
D = Diagram(ax)

v01 = D.verticle([.2, .175])
v02 = D.verticle(v01.xy, dx=.3)

Sigma = D.operator([v01, v02])
Sigma.text("$\Sigma$")

# Equal sign
D.text(v02.x+.2, v02.y, "=", fontsize=30)

# GW convolution
v21 = D.verticle(v02.xy, dxy=[0.4, -0.07])
v22 = D.verticle(v21.xy, dx=0.8)

l21 = D.line(v21, v22, **G_style)
l22 = D.line(v21, v22, **W_style)
Example #4
0
"""
import matplotlib.pyplot as plt
from feynman import Diagram

# Set up the figure and ax
fig = plt.figure(figsize=(8,2))
ax = fig.add_axes([0,0,1,1], frameon=False)

# It is best to keep the xlim/ylim ratio the same as the figure aspect ratio.
ax.set_xlim(0, 1)
ax.set_ylim(0, 0.25)

y0 = sum(ax.get_ylim()) / 2

# Initialize diagram with the ax
D = Diagram(ax)

# Polarizability operator
v11 = D.vertex([0.1, y0])
v12 = D.vertex(v11.xy, dx=0.15)
P = D.operator([v11, v12], c=1.3)  # c is the excentricity of the patch
P.text("$P$")

# Symbols
D.text(.35, y0, "=", fontsize=30)

# Propagator lines
G_style = dict(style='double elliptic',
               ellipse_excentricity=-1.2, ellipse_spread=.3,
               arrow=True, arrow_param={'width':0.03})
Example #5
0
import matplotlib

from feynman import Diagram

fig = matplotlib.pyplot.figure(figsize=(1., 1.))
ax = fig.add_axes([0, 0, 10, 10], frameon=False)
diagram = Diagram(ax)
#diagram.text(.5,0.9,"Vector Boson Fusion (VBF)",fontsize=40)
in1 = diagram.verticle(xy=(.1, .8), marker='')
in2 = diagram.verticle(xy=(.1, .2), marker='')
v1 = diagram.verticle(xy=(.4, .7))
v2 = diagram.verticle(xy=(.4, .3))
v3 = diagram.verticle(xy=(.4, .5))
out1 = diagram.verticle(xy=(.9, .8), marker='')
out2 = diagram.verticle(xy=(.9, .2), marker='')
higgsout = diagram.verticle(xy=(.65, .5))
wout1 = diagram.verticle(xy=(.9, .7), marker='')
wout2 = diagram.verticle(xy=(.9, .3), marker='')

q1 = diagram.line(in1, v1, arrow=False)
q2 = diagram.line(in2, v2, arrow=False)
wz1 = diagram.line(v1, v3, style='wiggly')
wz2 = diagram.line(v2, v3, style='wiggly')
w1 = diagram.line(higgsout, wout1, style='wiggly', arrow=False)
w2 = diagram.line(wout2, higgsout, style='wiggly', arrow=False)
higgs = diagram.line(v3, higgsout, style='dashed', arrow=False)
q3 = diagram.line(v1, out1, arrow=False)
q4 = diagram.line(v2, out2, arrow=False)

q1.text("$q_1$", fontsize=30)
q2.text("$q_2$", fontsize=30)
Example #6
0
"""
Polarization
============

A diagram containing different operators.
"""
from __future__ import print_function, division
import numpy as np
import matplotlib.pyplot as plt
from feynman import Diagram

# Set up the dimensions of the figure and the objects
d = Diagram(figsize=(8, 3))
d.ax.set_xlim(0, 8 / 3)
d.ax.set_ylim(0, 1)

textpad = 0.25
opwidth = 0.4
linlen = 1.1
Gamma_side = .4
Gamma_height = Gamma_side * np.sqrt(3) / 2

# Positon of the first vertex
x0 = 0.2
y0 = sum(d.ax.get_ylim()) / 2

# Define line styles
G_style = dict(
    style='double elliptic',
    ellipse_excentricity=-1.2,
    ellipse_spread=.3,
Example #7
0
ax.set_xlim(0, 3)
ax.set_ylim(0, .75)

y0 = .75 / 2

side = 0.3
gammalen = side * np.sqrt(3) / 2
linlen = 0.4
tail_marker = 'o'

W_style = dict(style = 'double wiggly', nwiggles=2)
v_style = dict(style = 'simple wiggly', nwiggles=2)
G_style = dict(style = 'double',  arrow=True, arrow_param={'width':0.05})

D = Diagram(ax)

xy = [0.2, y0]

v01 = D.verticle(xy, dy= side/2)
v02 = D.verticle(xy, dy=-side/2)
v03 = D.verticle(xy, dx=gammalen)
gamma0 = D.operator([v01,v02,v03])
gamma0.text("$\Gamma$")

D.text(.75, y0, "=", fontsize=30)

v30 = D.verticle([1.05, y0])

# Create a three-verticle dot.
n1 = np.array([-np.sqrt(3)/6, .5])
Example #8
0
import matplotlib

from feynman import Diagram

fig = matplotlib.pyplot.figure(figsize=(1., 1.))
ax = fig.add_axes([0, 0, 10, 10], frameon=False)
diagram = Diagram(ax)
#diagram.text(.5,0.9,"Gluon-Gluon Fusion (ggF)",fontsize=40)
in1 = diagram.verticle(xy=(.1, .7), marker='')
in2 = diagram.verticle(xy=(.1, .3), marker='')
v1 = diagram.verticle(xy=(.4, .7))
v2 = diagram.verticle(xy=(.4, .3))
v3 = diagram.verticle(xy=(.6, .5))
higgsout = diagram.verticle(xy=(.9, .5))

gluon_style = dict(style='linear loopy', xamp=.025, yamp=.035, nloops=7)

g1 = diagram.line(in1, v1, **gluon_style)
g2 = diagram.line(in2, v2, **gluon_style)
t1 = diagram.line(v1, v2)
t2 = diagram.line(v2, v3)
t3 = diagram.line(v3, v1)
higgs = diagram.line(v3, higgsout, arrow=False, style='dashed')

g1.text("g", fontsize=30)
g2.text("g", fontsize=30)
t1.text("t", fontsize=30)
t2.text("t", fontsize=30)
t3.text(r"$\bar{\mathrm{t}}$", fontsize=35)
higgs.text("H", fontsize=30)
Example #9
0
Electron-phonon coupling self-energy
====================================

A diagram containing loopy lines.
"""
from feynman import Diagram
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(8,2))
ax = fig.add_axes([0,0,1,1], frameon=False)

ax.set_xlim(0, fig.get_size_inches()[0])
ax.set_ylim(0, fig.get_size_inches()[1])

# Init D and ax
D = Diagram(ax)

D.x0 = 0.2
D.y0 = sum(D.ax.get_ylim()) * .35

# Various size
opwidth = 1.
linlen = 2.
txtpad = .8
wiggle_amplitude=.1

# Line styles
Ph_style = dict(style='elliptic loopy', ellipse_spread=.6, xamp=.10, yamp=-.15, nloops=15)
DW_style = dict(style='circular loopy', circle_radius=.7, xamp=.10, yamp=.15, nloops=18)
G_style = dict(style='simple', arrow=True, arrow_param={'width':0.15, 'length': .3})
Example #10
0
fig = plt.figure(figsize=(8,2))
ax = fig.add_subplot(111, frameon=False)

ax.set_xlim(0, 2)
ax.set_ylim(0, .5)

y0 = 0.175

opwidth = 0.3
linlen = 0.8

W_style = dict(style='double wiggly elliptic', nwiggles=5)
G_style = dict(style='double', arrow=True, arrow_param={'width':0.05})

D = Diagram(ax)

xy = [0.2, y0]
v01 = D.verticle(xy)

xy[0] += opwidth
v02 = D.verticle(xy)

Sigma = D.operator([v01,v02])
Sigma.text("$\Sigma$")

D.text(.70, y0, "=", fontsize=30)

xy[1] = y0 - 0.07

xy[0] = 0.9
Example #11
0
# Set the ax
fig = plt.figure(figsize=(10, 1.2))
ax = fig.add_subplot(111, frameon=False)

ax.set_xlim(0, 2.5)
ax.set_ylim(0, .3)

y0 = sum(ax.get_ylim()) / 2
l = 0.4

x0 = .05

G_style = dict(arrow=True, arrow_param={'width': 0.05}, style='double')
G0_style = dict(arrow=True, arrow_param={'width': 0.05}, style='simple')

D = Diagram(ax)

x = x0
v01 = D.verticle(xy=(x, y0))
v02 = D.verticle(v01.xy, dx=l)
G = D.line(v01, v02, **G_style)

text_prop = dict(y=0.05, fontsize=20)
G.text("$G$", **text_prop)

x = x0 + .55
D.text(x, y0, "=", fontsize=30)

x = x0 + .7
v21 = D.verticle(xy=(x, y0))
v22 = D.verticle(v21.xy, dx=l)
Example #12
0
import matplotlib

from feynman import Diagram

fig = matplotlib.pyplot.figure(figsize=(1., 1.))
ax = fig.add_axes([0, 0, 10, 10], frameon=False)
diagram = Diagram(ax)
#diagram.text(.5,0.9,"Gluon-Gluon Fusion (ggF)",fontsize=40)
in1 = diagram.verticle(xy=(.1, .7), marker='')
in2 = diagram.verticle(xy=(.1, .3), marker='')
v1 = diagram.verticle(xy=(.3, .7))
v2 = diagram.verticle(xy=(.3, .3))
v3 = diagram.verticle(xy=(.5, .5))
higgsout = diagram.verticle(xy=(.65, .5))
zout1 = diagram.verticle(xy=(.9, .7), marker='')
zout2 = diagram.verticle(xy=(.9, .3), marker='')

gluon_style = dict(style='linear loopy', xamp=.025, yamp=.035, nloops=4)

g1 = diagram.line(in1, v1, **gluon_style)
g2 = diagram.line(in2, v2, **gluon_style)
t1 = diagram.line(v1, v2)
t2 = diagram.line(v2, v3)
t3 = diagram.line(v3, v1)
higgs = diagram.line(v3, higgsout, arrow=False, style='dashed')
z1 = diagram.line(higgsout, zout1, arrow=False, style='wiggly')
z2 = diagram.line(zout2, higgsout, arrow=False, style='wiggly')

g1.text("$g$", fontsize=30)
g2.text("$g$", fontsize=30)
diagram.text(zout1.xy[0] + .025, zout1.xy[1], "$Z$", fontsize=30)
Example #13
0
"""
VBH
===

Vector Boson Fusion.
"""
import matplotlib.pyplot as plt
from feynman import Diagram

fig = plt.figure(figsize=(10.,10.))
ax = fig.add_axes([0,0,1,1], frameon=False)

diagram = Diagram(ax)
diagram.text(.5,0.9,"Vector Boson Fusion (VBF)",fontsize=40)
in1 = diagram.vertex(xy=(.1,.8), marker='')
in2= diagram.vertex(xy=(.1,.2), marker='')
v1 = diagram.vertex(xy=(.4,.7))
v2 = diagram.vertex(xy=(.4,.3))
v3 = diagram.vertex(xy=(.6,.5))
out1 = diagram.vertex(xy=(.9,.8), marker='')
out2 = diagram.vertex(xy=(.9,.2), marker='')
higgsout = diagram.vertex(xy=(.9,.5))

q1 = diagram.line(in1, v1, arrow=False)
q2 = diagram.line(in2, v2, arrow=False)
wz1 = diagram.line(v1, v3, style='wiggly')
wz2 = diagram.line(v2, v3, style='wiggly')
higgs = diagram.line(v3, higgsout, style='dashed', arrow=False)
q3 = diagram.line(v1, out1, arrow=False)
q4 = diagram.line(v2, out2, arrow=False)
Example #14
0
fig = plt.figure(figsize=(12,3))
ax = fig.add_subplot(111, frameon=False)

ax.set_xlim(0, 3)
ax.set_ylim(0, .75)

y0 = .75 / 2

opwidth = 0.3
linlen = 0.4

W_style = dict(style='double wiggly', nwiggles=2)
v_style = dict(style='simple wiggly', nwiggles=2)

# First diagram
D1 = Diagram(ax)

xy = [0.2, y0]
v01 = D1.verticle(xy)

xy[0] += linlen
v02 = D1.verticle(v01.xy, dx=linlen)

W = D1.line(v01, v02, **W_style)

text_prop = dict(y=0.06, fontsize=22)

W.text("$W$", **text_prop)

D1.text(.75, y0, "=", fontsize=30)
Example #15
0
"""
LFV
===

The LFV diagram.
"""
import matplotlib.pyplot as plt
from feynman import Diagram

fig = plt.figure(figsize=(10.,10.))
ax = fig.add_axes([0,0,1,1], frameon=False)

diagram = Diagram(ax)
in1 = diagram.vertex(xy=(.1,.5))
in2= diagram.vertex(xy=(.4,.5))
v1 = diagram.vertex(xy=(.65,.65))
v2 = diagram.vertex(xy=(.65,.35))
out1 = diagram.vertex(xy=(.9,.65),marker='')
out2 = diagram.vertex(xy=(.9,.35),marker='')

higgs = diagram.line(in1, in2, arrow=False, style='dashed')
nu1 = diagram.line(v1, in2)
nu2 = diagram.line(in2, v2)
w = diagram.line(v1, v2, style='wiggly')
lep = diagram.line(out1, v1)
tau = diagram.line(v2, out2)

nu1.text(r"$\nu_\ell$",fontsize=40)
nu2.text(r"$\nu_\tau$",fontsize=40)
lep.text(r"$\ell^+$",fontsize=40)
tau.text(r"$\tau^-$",fontsize=40)
Example #16
0
ax.set_xlim(0, 3)
ax.set_ylim(0, .75)

y0 = .75 / 2

side = 0.3
gammalen = side * np.sqrt(3) / 2
linlen = 0.4
tail_marker = 'o'

W_style = dict(style='double wiggly', nwiggles=2)
v_style = dict(style='simple wiggly', nwiggles=2)
G_style = dict(style='double', arrow=True, arrow_param={'width': 0.05})

D = Diagram(ax)

arrow_param = dict(width=0.05)

xy = [0.2, y0]

v01 = D.verticle(xy, dy=side / 2)
v02 = D.verticle(xy, dy=-side / 2)
v03 = D.verticle(xy, dx=gammalen)
gamma0 = D.operator([v01, v02, v03])
gamma0.text("$\Gamma$")

D.text(.75, y0, "=", fontsize=30)

v30 = D.verticle([1.05, y0])
Example #17
0
import matplotlib

from feynman import Diagram

fig = matplotlib.pyplot.figure(figsize=(1., 1.))
ax = fig.add_axes([0, 0, 10, 10], frameon=False)

diagram = Diagram(ax)
diagram.text(.5, 0.9, "Associated Top Pair (ttH)", fontsize=40)
in1 = diagram.verticle(xy=(.1, .8), marker='')
in2 = diagram.verticle(xy=(.1, .2), marker='')
v1 = diagram.verticle(xy=(.4, .7))
v2 = diagram.verticle(xy=(.4, .3))
v3 = diagram.verticle(xy=(.6, .5))
out1 = diagram.verticle(xy=(.9, .8), marker='')
out2 = diagram.verticle(xy=(.9, .2), marker='')
higgsout = diagram.verticle(xy=(.9, .5))

g1 = diagram.line(in1, v1, style='loopy', nloops=7, yamp=0.04)
g2 = diagram.line(in2, v2, style='loopy', nloops=7, yamp=0.04)
t1 = diagram.line(v3, v1, arrow=True)
t2 = diagram.line(v2, v3, arrow=True)
higgs = diagram.line(v3, higgsout, arrow=False, style='dashed')
t3 = diagram.line(v1, out1, arrow=True)
t4 = diagram.line(out2, v2, arrow=True)

g1.text("g", fontsize=30)
g2.text("g", fontsize=30)
diagram.text(v3.xy[0], v3.xy[1] + 0.1, r"$\bar{\mathrm{t}}$", fontsize=35)
t2.text("t", fontsize=30)
t3.text("t", fontsize=30)
Example #18
0
Electron-phonon coupling self-energy
====================================

A diagram containing loopy lines.
"""
from feynman import Diagram
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(8, 2))
ax = fig.add_axes([0, 0, 1, 1], frameon=False)

ax.set_xlim(0, fig.get_size_inches()[0])
ax.set_ylim(0, fig.get_size_inches()[1])

# Init D and ax
D = Diagram(ax)

D.x0 = 0.2
D.y0 = sum(D.ax.get_ylim()) * .35

# Various size
opwidth = 1.
linlen = 2.
txtpad = .8
wiggle_amplitude = .1

# Line styles
Ph_style = dict(style='elliptic loopy',
                ellipse_spread=.6,
                xamp=.10,
                yamp=-.15,
Example #19
0
# Set the ax
fig = plt.figure(figsize=(10,1.2))
ax = fig.add_subplot(111, frameon=False)

ax.set_xlim(0, 2.5)
ax.set_ylim(0, .3)

y0 = sum(ax.get_ylim()) / 2
l = 0.4

x0 = .05

G_style = dict(arrow=True, arrow_param={'width':0.05}, style = 'double')
G0_style = dict(arrow=True, arrow_param={'width':0.05}, style = 'simple')

D = Diagram(ax)

x = x0
v01 = D.verticle(xy=(x,y0))
v02 = D.verticle(v01.xy, dx=l)
G = D.line(v01, v02, **G_style)

text_prop = dict(y=0.05, fontsize=20)
G.text("$G$", **text_prop)

x = x0 + .55
D.text(x, y0, "=", fontsize=30)

x = x0 + .7
v21 = D.verticle(xy=(x,y0))
v22 = D.verticle(v21.xy, dx=l)
Example #20
0
"""Create the Fock interaction diagram."""

import matplotlib.pyplot as plt
from feynman import Diagram

diagram = Diagram()

v1 = diagram.verticle(xy=(.1, .5), marker='')
v2 = diagram.verticle(xy=(.3, .5))
v3 = diagram.verticle(xy=(.7, .5))
v4 = diagram.verticle(xy=(.9, .5), marker='')

l12 = diagram.line(v1, v2, arrow=True)
w23 = diagram.line(v2, v3, style='elliptic wiggly')
l23 = diagram.line(v2, v3, arrow=True)
l34 = diagram.line(v3, v4, arrow=True)

l12.text("p")
w23.text("q")
l23.text("p-q")
l34.text("p")

diagram.plot()
plt.savefig('pdf/fock.pdf')
diagram.show()
Example #21
0
ax.set_xlim(0, 3)
ax.set_ylim(0, .75)

y0 = .75 / 2

side = 0.3
gammalen = side * np.sqrt(3) / 2
linlen = 0.4
tail_marker = 'o'

W_style = dict(style = 'double wiggly', nwiggles=2)
v_style = dict(style = 'simple wiggly', nwiggles=2)
G_style = dict(style = 'double',  arrow=True, arrow_param={'width':0.05})

D = Diagram(ax)

arrow_param = dict(width=0.05)

xy = [0.2, y0]

v01 = D.verticle(xy, dy= side/2)
v02 = D.verticle(xy, dy=-side/2)
v03 = D.verticle(xy, dx=gammalen)
gamma0 = D.operator([v01,v02,v03])
gamma0.text("$\Gamma$")

D.text(.75, y0, "=", fontsize=30)

v30 = D.verticle([1.05, y0])
Example #22
0
"""
ggF EFT
=========

The gluon-gluon fusion.
"""
import matplotlib.pyplot as plt
from feynman import Diagram

fig = plt.figure(figsize=(10.,10.))
ax = fig.add_axes([0,0,1,1], frameon=False)

diagram = Diagram(ax)
in1 = diagram.vertex(xy=(.1,.6), marker='')
in2= diagram.vertex(xy=(.1,.4), marker='')
v1 = diagram.vertex(xy=(.4,.6))
v2 = diagram.vertex(xy=(.4,.4))
v3 = diagram.vertex(xy=(.6,.5))
v4 = diagram.vertex(xy=(.34,.5), marker='')
higgsout = diagram.vertex(xy=(.9,.5))
epsilon = diagram.operator([v4,v3], c=1.1)
epsilon.text("Effective \n coupling", fontsize=30)

gluon_up_style = dict(style='linear loopy', xamp=.025, yamp=.035, nloops=7)
gluon_down_style = dict(style='linear loopy', xamp=.025, yamp=-.035, nloops=7)

g1 = diagram.line(in1, v1, **gluon_up_style)
g2 = diagram.line(in2, v2, **gluon_down_style)

higgs = diagram.line(v3, higgsout, arrow=False, style='dashed')
Example #23
0
ax.set_ylim(0, .75)

y0 = .75 / 2

side = 0.3
gammalen = side * np.sqrt(3) / 2
linlen = 0.4
opwidth = 0.3
obj_spacing = .23
tail_marker = 'o'

W_style = dict(style='double wiggly', nwiggles=2)
v_style = dict(style='simple wiggly', nwiggles=2)
G_style = dict(style='double', arrow=True, arrow_param={'width': 0.05})

D = Diagram(ax)

xy = [0.2, y0]

v01 = D.verticle(xy)
v02 = D.verticle(v01.xy, dx=opwidth)
epsilon = D.operator([v01, v02], c=1.1)
epsilon.text("$\\varepsilon$", fontsize=50)

D.text(v02.xy[0] + obj_spacing, y0, "=", fontsize=30)

v30 = D.verticle(v02.xy, dx=2 * obj_spacing)

n1 = np.array([-1., 0.])
n2 = np.array([1., 0.])
Example #24
0
fig = plt.figure(figsize=(8, 2))
ax = fig.add_subplot(111, frameon=False)

ax.set_xlim(0, 2)
ax.set_ylim(0, .5)

y0 = 0.175

opwidth = 0.3
linlen = 0.8

W_style = dict(style='double wiggly elliptic', nwiggles=5)
G_style = dict(style='double', arrow=True, arrow_param={'width': 0.05})

D = Diagram(ax)

xy = [0.2, y0]
v01 = D.verticle(xy)

xy[0] += opwidth
v02 = D.verticle(xy)

Sigma = D.operator([v01, v02])
Sigma.text("$\Sigma$")

D.text(.70, y0, "=", fontsize=30)

xy[1] = y0 - 0.07

xy[0] = 0.9
Example #25
0
"""
Fock exchange
=============

A simple diagram composed of vertices and lines.
"""

import matplotlib.pyplot as plt
from feynman import Diagram

# If no Axes is given, a new one is initialized.
diagram = Diagram()

# Create four vertices.
v1 = diagram.vertex(xy=(.1, .5), marker='')
v2 = diagram.vertex(v1.xy, dx=.2)
v3 = diagram.vertex(v2.xy, dx=.4)
v4 = diagram.vertex(v3.xy, dx=.2, marker='')

# Create four lines.
# By default, 'simple' lines have arrows
# and others flavours such as 'wiggly' or 'loopy' don't.
l12 = diagram.line(v1, v2)
l23 = diagram.line(v2, v3)
l34 = diagram.line(v3, v4, arrow=True)
w23 = diagram.line(v2, v3, style='wiggly elliptic')

# Add labels.
l12.text("p")
w23.text("q")
l23.text("p - q")
Example #26
0
import matplotlib

from feynman import Diagram

fig = matplotlib.pyplot.figure(figsize=(1., 1.))
ax = fig.add_axes([0, 0, 10, 10], frameon=False)
diagram = Diagram(ax)
#diagram.text(.5,0.9,r"Vector Boson Fusion (VBF) Higgs $\rightarrow\tau\tau$",fontsize=40)
in1 = diagram.verticle(xy=(.1, .8), marker='')
in2 = diagram.verticle(xy=(.1, .2), marker='')
v1 = diagram.verticle(xy=(.3, .7))
v2 = diagram.verticle(xy=(.3, .3))
v3 = diagram.verticle(xy=(.5, .5))
out1 = diagram.verticle(xy=(.9, .8), marker='')
out2 = diagram.verticle(xy=(.9, .2), marker='')
higgsf = diagram.verticle(xy=(.7, .5))
tau1 = diagram.verticle(xy=(.9, .7), marker='')
tau2 = diagram.verticle(xy=(.9, .3), marker='')

q1 = diagram.line(in1, v1, arrow=False)
q2 = diagram.line(in2, v2, arrow=False)
wz1 = diagram.line(v1, v3, style='wiggly')
wz2 = diagram.line(v2, v3, style='wiggly')
higgs = diagram.line(v3, higgsf, style='dashed', arrow=False)
q3 = diagram.line(v1, out1, arrow=False)
q4 = diagram.line(v2, out2, arrow=False)
t1 = diagram.line(higgsf, tau1)
t2 = diagram.line(tau2, higgsf)

q1.text("$q_1$", fontsize=30)
q2.text("$q_2$", fontsize=30)
Example #27
0
# ================================================================
#
# Author:  Richard L. Trotta III <*****@*****.**>
#
# Copyright (c) trottar
#

import matplotlib
matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.family'] = 'STIXGeneral'

from feynman import Diagram

fig = matplotlib.pyplot.figure(figsize=(1., 1.))
ax = fig.add_axes([0, 0, 10, 10], frameon=False)
diagram = Diagram(ax)
diagram.text(.5, 0.9, "Vector Boson Fusion (VBF)", fontsize=40)
in1 = diagram.verticle(xy=(.1, .8), marker='')
in2 = diagram.verticle(xy=(.1, .2), marker='')
v1 = diagram.verticle(xy=(.4, .7))
v2 = diagram.verticle(xy=(.4, .3))
v3 = diagram.verticle(xy=(.6, .5))
out1 = diagram.verticle(xy=(.9, .8), marker='')
out2 = diagram.verticle(xy=(.9, .2), marker='')
higgsout = diagram.verticle(xy=(.9, .5))

q1 = diagram.line(in1, v1, arrow=False)
q2 = diagram.line(in2, v2, arrow=False)
wz1 = diagram.line(v1, v3, style='wiggly')
wz2 = diagram.line(v2, v3, style='wiggly')
higgs = diagram.line(v3, higgsout, style='double', arrow=False)
Example #28
0
ax.set_xlim(0, 3)
ax.set_ylim(0, 1)

y0 = sum(ax.get_ylim()) / 2.

side = 0.3
gammalen = side * np.sqrt(3) / 2
linlen = 0.3
txtpad = 0.2
tail_marker = 'o'

W_style = dict(style='double wiggly', nwiggles=2)
v_style = dict(style='simple wiggly', nwiggles=2)
G_style = dict(style='double', arrow=True, arrow_param={'width': 0.05})

D = Diagram(ax)

# Left hand size
xy = [0.4, y0]
v11 = D.vertex(xy, dy=side / 2)
v12 = D.vertex(xy, dy=-side / 2)
v13 = D.vertex(xy, dx=gammalen)
gamma0 = D.operator([v11, v12, v13])
gamma0.text("$\Gamma$")

# Symbol
D.text(v13.x + txtpad, y0, "=")

# Create a three-vertex dot.
chunkdist = .03
chunklen = .03
Example #29
0
"""Create the Fock interaction diagram."""

from feynman import Diagram

diagram = Diagram()

v1 = diagram.verticle(xy=(.1,.5), marker='')
v2 = diagram.verticle(xy=(.3,.5))
v3 = diagram.verticle(xy=(.7,.5))
v4 = diagram.verticle(xy=(.9,.5), marker='')

l12 = diagram.line(v1, v2, arrow=True)
w23 = diagram.line(v2, v3, pathtype='elliptic', linestyle='wiggly')
l23 = diagram.line(v2, v3, arrow=True)
l34 = diagram.line(v3, v4, arrow=True)

l12.text("p")
w23.text("q")
l23.text("p-q")
l34.text("p")

diagram.plot()
diagram.show()
GW self-energy
==============

A diagram containing double lines.
"""
import matplotlib.pyplot as plt
from feynman import Diagram

fig = plt.figure(figsize=(8, 2))
ax = fig.add_axes([0, 0, 1, 1], frameon=False)

ax.set_xlim(0, 1)
ax.set_ylim(0, .25)

# Sigma operator
D = Diagram(ax)

v11 = D.vertex([.1, .08])
v12 = D.vertex(v11.xy, dx=.15)

Sigma = D.operator([v11, v12])
Sigma.text("$\Sigma$")

# Symbols
D.text(v12.x + .1, v12.y, "=")

# GW convolution
v21 = D.vertex(v12.xy, dxy=[0.2, -0.04])
v22 = D.vertex(v21.xy, dx=0.4)

l21 = D.line(v21, v22, style='double', arrow=True)
Example #31
0
# Set up the figure and ax
fig = plt.figure(figsize=(10,1.5))
ax = fig.add_axes([.0,.0,1.,1.], frameon=False)

ax.set_xlim(0, 1.0)
ax.set_ylim(0, .15)

l = 0.15  # Length of the propagator
txt_l = 0.05  # Padding around the symbol
op_l = 0.08  # Size of the operator

G_style = dict(arrow=True, arrow_param={'width':0.02, 'length': 0.05}, style = 'double')
G0_style = dict(arrow=True, arrow_param={'width':0.02, 'length': 0.05}, style = 'simple')
text_prop = dict(y=0.02, fontsize=20)

D = Diagram(ax)

# Left hand side
v11 = D.vertex(xy=[0.05, 0.06])
v12 = D.vertex(v11.xy, dx=l)
G = D.line(v11, v12, **G_style)
G.text("$G$", **text_prop)

# Symbol
D.text(v12.x + txt_l, v12.y, "=")

# First term
v21 = D.vertex(v12.xy, dx=2*txt_l)
v22 = D.vertex(v21.xy, dx=l)
G0 = D.line(v21, v22, **G0_style)
G0.text("$G_0$", **text_prop)
Example #32
0
GW self-energy
==============

A diagram containing double lines.
"""
import matplotlib.pyplot as plt
from feynman import Diagram

fig = plt.figure(figsize=(8,2))
ax = fig.add_axes([0,0,1,1], frameon=False)

ax.set_xlim(0, 1)
ax.set_ylim(0,.25)

# Sigma operator
D = Diagram(ax)

v11 = D.vertex([.1, .08])
v12 = D.vertex(v11.xy, dx=.15)

Sigma = D.operator([v11, v12])
Sigma.text("$\Sigma$")

# Symbols
D.text(v12.x+.1, v12.y, "=")

# GW convolution
v21 = D.vertex(v12.xy, dxy=[0.2, -0.04])
v22 = D.vertex(v21.xy, dx=0.4)

l21 = D.line(v21, v22, style='double', arrow=True)
Example #33
0
"""
ggFZZ EFT
=========

The gluon-gluon fusion.
"""
import matplotlib.pyplot as plt
from feynman import Diagram

fig = plt.figure(figsize=(10.,10.))
ax = fig.add_axes([0,0,1,1], frameon=False)

diagram = Diagram(ax)
#diagram.text(.5,0.9,"Gluon-Gluon Fusion (ggF)",fontsize=40)
in1 = diagram.vertex(xy=(.05,.7), marker='')
in2= diagram.vertex(xy=(.05,.3), marker='')
v1 = diagram.vertex(xy=(.25,.7))
v2 = diagram.vertex(xy=(.25,.3))
v3 = diagram.vertex(xy=(.45,.5))
higgsout = diagram.vertex(xy=(.60,.5))
zout1 = diagram.vertex(xy=(.85,.7), marker='')
zout2 = diagram.vertex(xy=(.85,.3), marker='')

gluon_style = dict(style='linear loopy', xamp=.025, yamp=.035, nloops=4)

g1 = diagram.line(in1, v1, **gluon_style)
g2 = diagram.line(in2, v2, **gluon_style)
t1 = diagram.line(v1, v2)
t2 = diagram.line(v2, v3)
t3 = diagram.line(v3, v1)
higgs = diagram.line(v3, higgsout, arrow=False, style='dashed')
Example #34
0
ax.set_xlim(0, 3)
ax.set_ylim(0, 1)

y0 = sum(ax.get_ylim())/2.

side = 0.3
gammalen = side * np.sqrt(3) / 2
linlen = 0.3
txtpad = 0.2
tail_marker = 'o'

W_style = dict(style = 'double wiggly', nwiggles=2)
v_style = dict(style = 'simple wiggly', nwiggles=2)
G_style = dict(style = 'double',  arrow=True, arrow_param={'width':0.05})

D = Diagram(ax)

# Left hand size
xy = [0.4, y0]
v11 = D.vertex(xy, dy= side/2)
v12 = D.vertex(xy, dy=-side/2)
v13 = D.vertex(xy, dx=gammalen)
gamma0 = D.operator([v11,v12,v13])
gamma0.text("$\Gamma$")

# Symbol
D.text(v13.x + txtpad, y0, "=")

# Create a three-vertex dot.
chunkdist = .03
chunklen = .03
Example #35
0
"""
ttH
===

The ttH diagram.
"""
import matplotlib.pyplot as plt
from feynman import Diagram

fig = plt.figure(figsize=(10.,10.))
ax = fig.add_axes([0,0,1,1], frameon=False)

diagram = Diagram(ax)
diagram.text(.5,0.9,"Associated Top Pair (ttH)", fontsize=40)
in1 = diagram.vertex(xy=(.1,.8), marker='')
in2= diagram.vertex(xy=(.1,.2), marker='')
v1 = diagram.vertex(xy=(.4,.7))
v2 = diagram.vertex(xy=(.4,.3))
v3 = diagram.vertex(xy=(.6,.5))
out1 = diagram.vertex(xy=(.9,.8), marker='')
out2 = diagram.vertex(xy=(.9,.2), marker='')
higgsout = diagram.vertex(xy=(.9,.5))

g1 = diagram.line(in1, v1, style='loopy',nloops=7,yamp=0.04)
g2 = diagram.line(in2, v2, style='loopy',nloops=7,yamp=0.04)
t1 = diagram.line(v3, v1, arrow = True)
t2 = diagram.line(v2, v3, arrow = True)
higgs = diagram.line(v3, higgsout, arrow=False, style='dashed')
t3 = diagram.line(v1, out1, arrow=True)
t4 = diagram.line(out2, v2, arrow=True)
Example #36
0
fig = plt.figure(figsize=(12, 3))
ax = fig.add_subplot(111, frameon=False)

ax.set_xlim(0, 3)
ax.set_ylim(0, 0.75)

y0 = 0.75 / 2

opwidth = 0.3
linlen = 0.4
tail_marker = "o"

W_style = dict(style="double wiggly", nwiggles=2)
v_style = dict(style="simple wiggly", nwiggles=2)

D = Diagram(ax)

arrowparam = dict(width=0.05)

xy = [0.2, y0]
v01 = D.verticle(xy, marker=tail_marker)
xy[0] += linlen
v02 = D.verticle(v01.xy, dx=linlen, marker=tail_marker)
W = D.line(v01, v02, **W_style)

text_prop = dict(y=0.06, fontsize=22)

W.text("$W$", **text_prop)

D.text(0.75, y0, "=", fontsize=30)
Example #37
0
ax.set_ylim(0, .75)

y0 = .75 / 2

side = 0.3
gammalen = side * np.sqrt(3) / 2
linlen = 0.4
opwidth = 0.3
obj_spacing = .23
tail_marker = 'o'

W_style = dict(style='double wiggly', nwiggles=2)
v_style = dict(style='simple wiggly', nwiggles=2)
G_style = dict(style='double',  arrow=True, arrow_param={'width':0.05})

D = Diagram(ax)

xy = [0.2, y0]

v01 = D.verticle(xy)
v02 = D.verticle(v01.xy, dx=opwidth)
epsilon = D.operator([v01,v02], c=1.1)
epsilon.text("$\\varepsilon$", fontsize=50)

D.text(v02.xy[0]+obj_spacing, y0, "=", fontsize=30)

v30 = D.verticle(v02.xy, dx=2*obj_spacing)

n1 = np.array([-1.,0.])
n2 = np.array([ 1.,0.])
Example #38
0
"""
Polarization
============

A diagram containing different operators.
"""
from __future__ import print_function, division
import numpy as np
import matplotlib.pyplot as plt
from feynman import Diagram

# Set up the dimensions of the figure and the objects
d = Diagram(figsize=(8,3))
d.ax.set_xlim(0, 8/3)
d.ax.set_ylim(0, 1)

textpad = 0.25
opwidth = 0.4
linlen = 1.1
Gamma_side = .4
Gamma_height = Gamma_side * np.sqrt(3) / 2

# Positon of the first vertex
x0 = 0.2
y0 = sum(d.ax.get_ylim()) / 2

# Define line styles
G_style = dict(
    style='double elliptic',
    ellipse_excentricity=-1.2, ellipse_spread=.3,
    arrow=True, arrow_param={'width':0.05},
"""
Common neutrino nucleon interactions
"""
import matplotlib.pyplot as plt
from feynman import Diagram

fig = plt.figure(figsize=(10, 5))

ax1 = fig.add_subplot(121, frameon=False)
diagram = Diagram(ax1)
diagram.text(.5, 0.9, "Charged-Current", fontsize=25)
in1 = diagram.vertex(xy=(0.05, 0.75), marker='')
in2 = diagram.vertex(xy=(0.05, 0.25), marker='')
v1 = diagram.vertex(xy=(.45, .6))
v2 = diagram.vertex(xy=(.45, .4))
out1 = diagram.vertex(xy=(0.85, 0.75), marker='')
out2 = diagram.vertex(xy=(0.85, 0.25), marker='')
nu1 = diagram.line(in1, v1)  #incoming neutrino
N = diagram.line(in2, v2)  #incoming neucleon
W = diagram.line(v1, v2, style='wiggly')  #W mediator
nu2 = diagram.line(v1, out1)  #outgoing neutrino
X = diagram.line(v2, out2)  #outgoing shower
diagram.text(0.10, 0.68, "$\\nu_{\ell}$", fontsize=30)
diagram.text(0.10, 0.32, "$N$", fontsize=30)
diagram.text(0.57, 0.5, "$W^{\pm}$", fontsize=30)
diagram.text(0.81, 0.68, "$\ell$", fontsize=30)
diagram.text(0.81, 0.32, "$X$", fontsize=30)

ax2 = fig.add_subplot(122, frameon=False)
diagram2 = Diagram(ax2)
diagram2.text(.5, 0.9, "Neutral-Current", fontsize=25)
Example #40
0
import matplotlib

from feynman import Diagram

fig = matplotlib.pyplot.figure(figsize=(1., 1.))
ax = fig.add_axes([0, 0, 10, 10], frameon=False)
diagram = Diagram(ax)
in1 = diagram.verticle(xy=(.1, .8), marker='')
in2 = diagram.verticle(xy=(.1, .2), marker='')
v1 = diagram.verticle(xy=(.5, .7))
v2 = diagram.verticle(xy=(.5, .3))
v3 = diagram.verticle(xy=(.5, .5))
out1 = diagram.verticle(xy=(.9, .8), marker='')
out2 = diagram.verticle(xy=(.9, .2), marker='')
higgsout = diagram.verticle(xy=(.9, .5))

q1 = diagram.line(in1, v1, arrow=False)
q2 = diagram.line(in2, v2, arrow=False)
wz1 = diagram.line(v1, v3, style='wiggly')
wz2 = diagram.line(v2, v3, style='wiggly')
higgs = diagram.line(v3, higgsout, style='dashed', arrow=False)
q3 = diagram.line(v1, out1, arrow=False)
q4 = diagram.line(v2, out2, arrow=False)

q1.text(r"$\bar{q}$", fontsize=30)
q2.text("$Q$", fontsize=30)
diagram.text(v3.xy[0] + 0.12, v3.xy[1] + 0.11, "$Z/W^\pm$", fontsize=30)
wz2.text("$Z/W^\pm$", fontsize=30)
q3.text(r"$\bar{q}$", fontsize=30)
q4.text("$Q$", fontsize=30)
higgsout.text("$H$", fontsize=30)
Example #41
0
"""
VH
==

Higgs Strahlung.
"""
import matplotlib.pyplot as plt
from feynman import Diagram

fig = plt.figure(figsize=(10.,10.))
ax = fig.add_axes([0,0,1,1], frameon=False)

diagram = Diagram(ax)
diagram.text(.4,0.9,"Associated Vector Boson", fontsize=40)
diagram.text(.6,0.83,"(VH or 'Higgs Strahlung')", fontsize=40)
in1 = diagram.vertex(xy=(.1,.75), marker='')
in2= diagram.vertex(xy=(.1,.25), marker='')
v1 = diagram.vertex(xy=(.35,.5))
v2 = diagram.vertex(xy=(.65,.5))
higgsout = diagram.vertex(xy=(.9,.75))
out1 = diagram.vertex(xy=(.9,.25),marker='')

q1 = diagram.line(in1, v1)
q2 = diagram.line(v1, in2)
wz1 = diagram.line(v1, v2, style='wiggly')
wz2 = diagram.line(v2, out1, style='wiggly')
higgs = diagram.line(v2, higgsout, arrow=False, style='dashed')

q1.text("q",fontsize=30)
q2.text(r"$\bar{\mathrm{q}}$",fontsize=30)
diagram.text(0.5,0.55,"$Z/W^\pm$",fontsize=30)
Example #42
0
DCHP1
=====

Doubly Charged Higgs Production
"""
import matplotlib

matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.family'] = 'STIXGeneral'

from feynman import Diagram

fig = matplotlib.pyplot.figure(figsize=(10., 10.))
ax = fig.add_axes([0, 0, 1, 1], frameon=False)

diagram = Diagram(ax)
diagram.text(.4, 0.9, "Doubly Charged Higgs Production", fontsize=40)
in1 = diagram.vertex(xy=(.1, .75), marker='')
in2 = diagram.vertex(xy=(.1, .25), marker='')
v1 = diagram.vertex(xy=(.35, .5))
v2 = diagram.vertex(xy=(.65, .5))
higgsplusout = diagram.vertex(xy=(.8, .7))
higgsminusout = diagram.vertex(xy=(.8, .3))
l1plus = diagram.vertex(xy=(.95, .8), marker='')
l2plus = diagram.vertex(xy=(.95, .6), marker='')
l1minus = diagram.vertex(xy=(.95, .4), marker='')
l2minus = diagram.vertex(xy=(.95, .2), marker='')

lw = 5
q1 = diagram.line(v1,
                  in1,
Example #43
0
fig = plt.figure(figsize=(12, 3))
ax = fig.add_subplot(111, frameon=False)

ax.set_xlim(0, 3)
ax.set_ylim(0, .75)

y0 = .75 / 2

opwidth = 0.3
linlen = 0.4

W_style = dict(style='double wiggly', nwiggles=2)
v_style = dict(style='simple wiggly', nwiggles=2)

# First diagram
D1 = Diagram(ax)

xy = [0.2, y0]
v01 = D1.verticle(xy)

xy[0] += linlen
v02 = D1.verticle(v01.xy, dx=linlen)

W = D1.line(v01, v02, **W_style)

text_prop = dict(y=0.06, fontsize=22)

W.text("$W$", **text_prop)

D1.text(.75, y0, "=", fontsize=30)
Example #44
0
y0 = sum(ax.get_ylim()) / 2

opwidth = 0.3
linlen = 0.8
tail_marker = 'o'
Gamma_width = .3

W_style = dict(style='double wiggly', nwiggles=4)
G_style = dict(style='double elliptic',
               ellipse_excentricity=-1.2,
               ellipse_spread=.3,
               arrow=True,
               arrow_param={'width': 0.05})

D = Diagram(ax)

xy = [0.2, y0]
v01 = D.verticle(xy)
v02 = D.verticle(v01.xy, dx=opwidth)
P = D.operator([v01, v02], c=1.3)
P.text("$P$")

D.text(.70, y0, "=", fontsize=30)

xy[0] = 0.9
v21 = D.verticle(xy)
v22 = D.verticle(xy, dx=linlen)

l21 = D.line(v22, v21, **G_style)
l21 = D.line(v21, v22, **G_style)
Example #45
0
"""
VBH tau-tau
===========

Vector Boson Fusion.
"""
import matplotlib.pyplot as plt
from feynman import Diagram

fig = plt.figure(figsize=(10.,10.))
ax = fig.add_axes([0,0,1,1], frameon=False)

diagram = Diagram(ax)
#diagram.text(.5,0.9,r"Vector Boson Fusion (VBF) Higgs $\rightarrow\tau\tau$",fontsize=40)
in1 = diagram.vertex(xy=(.1,.8), marker='')
in2= diagram.vertex(xy=(.1,.2), marker='')
v1 = diagram.vertex(xy=(.3,.7))
v2 = diagram.vertex(xy=(.3,.3))
v3 = diagram.vertex(xy=(.5,.5))
out1 = diagram.vertex(xy=(.9,.8), marker='')
out2 = diagram.vertex(xy=(.9,.2), marker='')
higgsf = diagram.vertex(xy=(.7,.5))
tau1 = diagram.vertex(xy=(.9,.7), marker='')
tau2 = diagram.vertex(xy=(.9,.3), marker='')

q1 = diagram.line(in1, v1, arrow=False)
q2 = diagram.line(in2, v2, arrow=False)
wz1 = diagram.line(v1, v3, style='wiggly')
wz2 = diagram.line(v2, v3, style='wiggly')
higgs = diagram.line(v3, higgsf, style='dashed', arrow=False)
q3 = diagram.line(v1, out1, arrow=False)
Example #46
0
"""
import matplotlib.pyplot as plt
from feynman import Diagram

# Set up the figure and ax
fig = plt.figure(figsize=(8, 2))
ax = fig.add_axes([0, 0, 1, 1], frameon=False)

# It is best to keep the xlim/ylim ratio the same as the figure aspect ratio.
ax.set_xlim(0, 1)
ax.set_ylim(0, 0.25)

y0 = sum(ax.get_ylim()) / 2

# Initialize diagram with the ax
D = Diagram(ax)

# Polarizability operator
v11 = D.vertex([0.1, y0])
v12 = D.vertex(v11.xy, dx=0.15)
P = D.operator([v11, v12], c=1.3)  # c is the excentricity of the patch
P.text("$P$")

# Symbols
D.text(.35, y0, "=", fontsize=30)

# Propagator lines
G_style = dict(style='double elliptic',
               ellipse_excentricity=-1.2,
               ellipse_spread=.3,
               arrow=True,
Example #47
0
"""
VH
==

Higgs Strahlung.
"""
import matplotlib.pyplot as plt
from feynman import Diagram

fig = plt.figure(figsize=(10., 10.))
ax = fig.add_axes([0, 0, 1, 1], frameon=False)

diagram = Diagram(ax)
diagram.text(.4, 0.9, "Associated Vector Boson", fontsize=40)
diagram.text(.6, 0.83, "(VH or 'Higgs Strahlung')", fontsize=40)
in1 = diagram.vertex(xy=(.1, .75), marker='')
in2 = diagram.vertex(xy=(.1, .25), marker='')
v1 = diagram.vertex(xy=(.35, .5))
v2 = diagram.vertex(xy=(.65, .5))
higgsout = diagram.vertex(xy=(.9, .75))
out1 = diagram.vertex(xy=(.9, .25), marker='')

q1 = diagram.line(in1, v1)
q2 = diagram.line(v1, in2)
wz1 = diagram.line(v1, v2, style='wiggly')
wz2 = diagram.line(v2, out1, style='wiggly')
higgs = diagram.line(v2, higgsout, arrow=False, style='dashed')

q1.text("q", fontsize=30)
q2.text(r"$\bar{\mathrm{q}}$", fontsize=30)
diagram.text(0.5, 0.55, "$Z/W^\pm$", fontsize=30)
Example #48
0
ax.set_xlim(0, 2)
ax.set_ylim(0, 1.5)

y0 = sum(ax.get_ylim()) / 2

opwidth = 0.3
linlen = 0.8
tail_marker = 'o'
Gamma_width = .3

W_style = dict(style='double wiggly', nwiggles=4)
G_style = dict(style='double elliptic',
                ellipse_excentricity=-1.2, ellipse_spread=.3,
                arrow=True, arrow_param={'width':0.05})

D = Diagram(ax)

xy = [0.2, y0]
v01 = D.verticle(xy)
v02 = D.verticle(v01.xy, dx=opwidth)
P = D.operator([v01,v02], c=1.3)
P.text("$P$")

D.text(.70, y0, "=", fontsize=30)

xy[0] = 0.9
v21 = D.verticle(xy)
v22 = D.verticle(xy, dx=linlen)

l21 = D.line(v22, v21, **G_style)
l21 = D.line(v21, v22, **G_style)
Example #49
0
from feynman import Diagram
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(8.0,2.0))
ax = fig.add_axes([0,0,1,1], frameon=False)

fig.patch.set_alpha(0.)
ax.patch.set_alpha(0.)

ax.set_xlim(0, fig.get_size_inches()[0])
ax.set_ylim(0, fig.get_size_inches()[1])

# Init D and ax
D = Diagram(ax)

D.x0 = 0.2
D.y0 = sum(D.ax.get_ylim()) * .35

# Various size
opwidth = 1.
linlen = 2.
objspace = .8
wiggle_amplitude=.1

# Line styles
Ph_style = dict(style='elliptic loopy', ellipse_spread=.6, xamp=.10, yamp=-.15, nloops=15)
DW_style = dict(style='circular loopy', circle_radius=.7, xamp=.10, yamp=.15, nloops=18)
G_style = dict(style='simple', arrow=True, arrow_param={'width':0.15, 'length': .3})

# Item 1
v1 = D.verticle([D.x0, D.y0])
Example #50
0
import matplotlib

from feynman import Diagram

fig = matplotlib.pyplot.figure(figsize=(1., 1.))
ax = fig.add_axes([0, 0, 10, 10], frameon=False)

diagram = Diagram(ax)
in1 = diagram.verticle(xy=(.1, .5))
in2 = diagram.verticle(xy=(.4, .5))
v1 = diagram.verticle(xy=(.65, .65))
v2 = diagram.verticle(xy=(.65, .35))
out1 = diagram.verticle(xy=(.9, .65), marker='')
out2 = diagram.verticle(xy=(.9, .35), marker='')

higgs = diagram.line(in1, in2, arrow=False, style='dashed')
nu1 = diagram.line(v1, in2)
nu2 = diagram.line(in2, v2)
w = diagram.line(v1, v2, style='wiggly')
lep = diagram.line(out1, v1)
tau = diagram.line(v2, out2)

nu1.text(r"$\nu_\ell$", fontsize=40)
nu2.text(r"$\nu_\tau$", fontsize=40)
lep.text(r"$\ell^+$", fontsize=40)
tau.text(r"$\tau^-$", fontsize=40)
#w.text(r"W$^\pm$",fontsize=40)
diagram.text(0.72, 0.5, "$W^\pm$", fontsize=40)
#diagram.text(0.69,0.35,"$Z/W^\pm$",fontsize=30)
higgs.text("H", fontsize=40)
Example #51
0
"""
Fock exchange
=============

A simple diagram composed of vertices and lines.
"""

import matplotlib.pyplot as plt
from feynman import Diagram

# If no Axes is given, a new one is initialized.
diagram = Diagram()

# Create four vertices.
v1 = diagram.vertex(xy=(.1,.5), marker='')
v2 = diagram.vertex(v1.xy, dx=.2)
v3 = diagram.vertex(v2.xy, dx=.4)
v4 = diagram.vertex(v3.xy, dx=.2, marker='')

# Create four lines.
# By default, 'simple' lines have arrows
# and others flavours such as 'wiggly' or 'loopy' don't.
l12 = diagram.line(v1, v2)
l23 = diagram.line(v2, v3)
l34 = diagram.line(v3, v4, arrow=True)
w23 = diagram.line(v2, v3, style='wiggly elliptic')

# Add labels.
l12.text("p")
w23.text("q")
l23.text("p - q")