pyfeyn2.render.pyx.lines

Various particle line types.

Module Contents

Classes

Line

Base class for all objects which connect points in Feynman diagrams

MultiLine

A class for drawing multiple parallel straight lines.

Scalar

A scalar particle line, like a Higgs boson.

Ghost

A dotted scalar particle line, like a Yang-Mills ghost particle.

DecoratedLine

Base class for spring and sine-like lines

Gluon

A line with a cycloid deformation

Vector

A line with a sinoid deformation

Graviton

A line with a double sinoid deformation

Gaugino

A line with a sinoid deformation and a normal line

Gluino

A line with a cycloid deformation and a normal line

Gravitino

A line with a double sinoid deformation and a simple line

Phantom

An invisible line.

Attributes

Fermion

Higgs

Sfermion

Photon

NamedLine

class pyfeyn2.render.pyx.lines.Line(point1, point2)[source]

Bases: pyfeyn2.render.pyx.utils.Visible

Base class for all objects which connect points in Feynman diagrams

Constructor.

addLabel(text, pos=0.5, displace=-0.25, angle=0, size=pyx.text.size.normalsize)[source]

Add a LaTeX label to this line, either via parameters or actually as a TeXLabel object.

addParallelArrow(pos=0.5, displace=0.3, length=0.5 * pyx.unit.v_cm, size=6 * pyx.unit.v_pt, angle=45, constriction=0.8, sense=+1, curved=False, stems=1, stemsep=0.03)[source]

Add an arrow pointing along the line.

removeLabels()[source]

Remove the labels from this line.

fracpoint(frac)[source]

Get a new Point representing the point at the given fraction along the fundamental line (i.e. no truncation or deformation). TODO: Handle units properly.

setArrows(arrows)[source]

Define the arrows on this line.

addArrow(position=0.53, arrow=None)[source]

Add an arrow to the line at the specified position, which is a number between 0 and 1, representing the fraction along the line at which the arrow should be placed. The default arrow style can be overridden by explicitly supplying an arrow object as the ‘arrow’ argument, in which case the position argument will be ignored.

removeArrows()[source]

Remove all arrows from this line.

arcThru(arcpoint=None, x=None, y=None)[source]

Set the point through which this line will arc. Either pass a Point or set x, y as floats.

straighten()[source]

Make this line a straight line between start and end.

bend(amount)[source]

Bend the line to the right by a given distance.

set3D(choice)[source]

Make this line display in ‘3D’.

getStyles(stylelist)[source]

Get the styles associated with this line.

setStyles(stylelist)[source]

Set the styles associated with this line.

addStyle(style)[source]

Add a style to this line.

addStyles(stylelist)[source]

Add some styles to this line.

getPath()[source]

Get the path taken by this line.

getVisiblePath()[source]

Find the subpath between the endpoints which isn’t overshadowed by a blob of some kind

draw(canvas)[source]

Drwa this line on the given canvas.

pyfeyn2.render.pyx.lines.Fermion[source]
class pyfeyn2.render.pyx.lines.MultiLine(point1, point2, n=5, dist=0.2)[source]

Bases: Line

A class for drawing multiple parallel straight lines.

Constructor.

draw(canvas)[source]

Draw this multiline on the supplied canvas.

class pyfeyn2.render.pyx.lines.Scalar(point1, point2)[source]

Bases: Line

A scalar particle line, like a Higgs boson.

Constructor.

draw(canvas)[source]

Draw this scalar line on the given canvas.

pyfeyn2.render.pyx.lines.Higgs[source]
pyfeyn2.render.pyx.lines.Sfermion[source]
class pyfeyn2.render.pyx.lines.Ghost(point1, point2)[source]

Bases: Line

A dotted scalar particle line, like a Yang-Mills ghost particle.

Constructor.

draw(canvas)[source]

Draw this scalar line on the given canvas.

class pyfeyn2.render.pyx.lines.DecoratedLine(point1, point2)[source]

Bases: Line

Base class for spring and sine-like lines

Constructor.

invert()[source]

Reflect the line decoration about the line.

getNumHalfCycles()[source]

Get the number of half cycles in this line.

getDeformedPath()[source]

Get the deformed path.

class pyfeyn2.render.pyx.lines.Gluon(point1, point2)[source]

Bases: DecoratedLine

A line with a cycloid deformation

Constructor.

set3D(is3D=True, skipsize=pyx.unit.length(0.04), parity=0)[source]

Make this line display in ‘3D’.

invert()[source]

Flip the line decoration around the line.

getFrequency()[source]

Get the rate of occurence of the coil decoration.

setFrequency(freq)[source]

Set the rate of occurence of the coil decoration.

getAmplitude()[source]

Get the radius of the coil decoration.

setAmplitude(amplitude)[source]

Set the radius of the coil decoration.

setExtraCycles(extras)[source]

Add some extra (possibly negative) oscillations to the coil decoration.

getDeformedPath()[source]

Get the path modified by the coil warping.

draw(canvas)[source]

Draw the line on the supplied canvas.

class pyfeyn2.render.pyx.lines.Vector(point1, point2, amplitude=0.25, frequency=1.0)[source]

Bases: DecoratedLine

A line with a sinoid deformation

Constructor.

invert()[source]

Reflect the decoration in the line itself.

getFrequency()[source]

Get the rate of occurance of the oscillation.

setFrequency(freq)[source]

Set the rate of occurance of the oscillation.

getAmplitude()[source]

Get the size of the oscillation.

setAmplitude(amplitude)[source]

Set the size of the oscillation.

setExtraHalfCycles(extras)[source]

Add some extra half cycles to the oscillation on top of those determined from the frequency.

getDeformedPath()[source]

Get the path with the decorative deformation.

draw(canvas)[source]

Draw the line on the supplied canvas.

pyfeyn2.render.pyx.lines.Photon[source]
class pyfeyn2.render.pyx.lines.Graviton(point1, point2)[source]

Bases: DecoratedLine

A line with a double sinoid deformation

Constructor.

set3D(is3D=True, skipsize=pyx.unit.length(0.04), parity=0)[source]

Make this line display in ‘3D’.

invert()[source]

Reflect the decoration in the line itself.

getDeformedPath(sign=1)[source]

Get the path with the decorative deformation.

draw(canvas)[source]

Draw the line on the supplied canvas.

class pyfeyn2.render.pyx.lines.Gaugino(point1, point2)[source]

Bases: DecoratedLine

A line with a sinoid deformation and a normal line

Constructor.

set3D(is3D=True, skipsize=pyx.unit.length(0.04), parity=0)[source]

Make the line look 3-dimensional by ‘cutting’ one line where self-intersections occur.

invert()[source]

Reflect the decoration in the line itself.

getDeformedPath()[source]

Get the path with the decorative deformation.

draw(canvas)[source]

Draw the line on the supplied canvas.

class pyfeyn2.render.pyx.lines.Gluino(point1, point2)[source]

Bases: DecoratedLine

A line with a cycloid deformation and a normal line

Constructor.

set3D(is3D=True, skipsize=pyx.unit.length(0.04), parity=0)[source]

Make this line display in ‘3D’.

invert()[source]

Reflect the decoration in the line itself.

getDeformedPath()[source]

Get the path with the decorative deformation.

draw(canvas)[source]

Draw the line on the supplied canvas.

class pyfeyn2.render.pyx.lines.Gravitino(point1, point2)[source]

Bases: DecoratedLine

A line with a double sinoid deformation and a simple line

Constructor.

set3D(is3D=True, skipsize=pyx.unit.length(0.04), parity=0)[source]

Make this line display in ‘3D’.

invert()[source]

Reflect the decoration in the line itself.

getDeformedPath(sign=1)[source]

Get the path with the decorative deformation.

draw(canvas)[source]

Draw the line on the supplied canvas.

class pyfeyn2.render.pyx.lines.Phantom(point1, point2)[source]

Bases: DecoratedLine

An invisible line.

Constructor.

draw(canvas)[source]

Draw the line on the supplied canvas (does nothing for a phantom).

pyfeyn2.render.pyx.lines.NamedLine[source]