Operator

class feynman.Operator(vertices, **kwargs)

A N-point operator. Often represented as a polygon, or a circle.

Parameters:
  • vertices (a list of N vertices (feynman.Vertex)) – First and second vertex, counted clockwise defining an edge (or the starting and ending points) of a patch object.
  • rotate ((0.)) – Rotation angle to the operator, in units of tau.
  • c ((1.)) – If the shape is elliptic, c is the excentricity of the ellipse, that is, the ratio of the long axe over the short axe. When c = 1, the shape will be a circle.
  • shape – By default, the shape is ‘ellipse’ if N=2, and ‘polygon’ if N>2. When N=4 however, you can also specify ‘bubble’ as a shape to have lines connecting (v1, v2) together and (v3, v4) together, and a single elliptic patch on top of those two lines.
  • line_prop – Line properties if shape=’bubble’.
  • **kwargs – Any other style specification for a matplotlib.patches.Patch instance.
N

Number of vertices to the operator.

scale(x)

Apply a scaling factor.

scale_text(x)

Apply a scaling factor to the text size and relative position.

scale_width(x)

Apply a scaling factor to the line width.

style

A dictionary of style elements for a matplotlib.patches.Patch instance, such as linewidth, edgecolor, facecolor, etc.

text(s, x=0.0, y=0.0, **kwargs)

Add text in the operator.

Parameters:
  • s (Text string.) –
  • x ((0.)) – x position, relative to the center of the operator.
  • y ((0.)) – y position, relative to the center of the operator.
  • fontsize – The font size.
  • **kwargs – Any other style specification for a matplotlib.text.Text instance.
vertices

The list of N vertices forming the operator.

class feynman.RegularOperator(N, center, size=0.3, angle=None, **kwargs)

A N-point operator represented as a polygon.

Parameters:
  • N – Number of vertices.
  • center – Position of the center of the operator.
  • size – Distance from the center to a corner.
  • angle – vertices are counted clockwise. angle=0=1 means that there is a vertex in the [1,0] direction from the center.
  • **kwargs – Any other style specification for a matplotlib.patches.Patch instance.
class feynman.RegularBubbleOperator(N, center, size=0.3, angle=None, **kwargs)

This operator is represented by a circle with N vertices.

Parameters:
  • N – Number of vertices.
  • center – Position of the center of the operator.
  • size – Radius of the circle.
  • angle – vertices are counted clockwise. angle=0=1 means that there is a vertex in the [1,0] direction from the center.
  • **kwargs – Any other style specification for a matplotlib.patches.Patch instance.