FeynKit · latest
On this page

FourMomentum

symbolica.community.hepkit Class

FourMomentum(energy: float, px: float, py: float, pz: float)

A relativistic four-momentum in (energy, px, py, pz) order.

The class provides collider observables, invariant products, rotations, and boosts while keeping the component convention explicit.

Examples

from symbolica import S, E
from symbolica.community import hepkit as hep
momentum = hep.FourMomentum(5.0, 3.0, 4.0, 0.0)
p = momentum
first = hep.FourMomentum(5.0, 0.0, 5.0, 0.0)
second = hep.FourMomentum(5.0, 5.0, 0.0, 0.0)
assert momentum.mass_squared == 0.0

Parameters

energy float

Energy component.

px float

Momentum component along the x axis.

py float

Momentum component along the y axis.

pz float

Momentum component along the z axis.

Constructor

#

Construct a four-momentum from energy and Cartesian spatial components.

Examples

Using the setup in the FourMomentum class example:

momentum = hep.FourMomentum(5.0, 3.0, 4.0, 0.0)

Parameters

NameTypeDefaultDescription
energyfloat—

Temporal component.

pxfloat—

Momentum along the x axis.

pyfloat—

Momentum along the y axis.

pzfloat—

Momentum along the z axis.

Member details

energy

Property · read-only#
energy: float

Return the energy component.

Examples

Using the setup in the FourMomentum class example:

assert momentum.energy == 5.0

px

Property · read-only#
px: float

Return the x component of spatial momentum.

Examples

Using the setup in the FourMomentum class example:

assert momentum.px == 3.0

py

Property · read-only#
py: float

Return the y component of spatial momentum.

Examples

Using the setup in the FourMomentum class example:

assert momentum.py == 4.0

pz

Property · read-only#
pz: float

Return the z component of spatial momentum.

Examples

Using the setup in the FourMomentum class example:

assert momentum.pz == 0.0

spatial

Property · read-only#
spatial: ThreeMomentum

Return the spatial three-momentum.

Examples

Using the setup in the FourMomentum class example:

hep.FourMomentum(5.0, 3.0, 4.0, 0.0).spatial.pt

mass_squared

Property · read-only#
mass_squared: float

Return the invariant mass squared.

Examples

Using the setup in the FourMomentum class example:

hep.FourMomentum(5.0, 3.0, 4.0, 0.0).mass_squared

mass

Property · read-only#
mass: float

Return the invariant mass.

Examples

Using the setup in the FourMomentum class example:

hep.FourMomentum(5.0, 0.0, 0.0, 0.0).mass

pt

Property · read-only#
pt: float

Return the transverse-momentum magnitude.

Examples

Using the setup in the FourMomentum class example:

hep.FourMomentum(13.0, 3.0, 4.0, 12.0).pt

phi

Property · read-only#
phi: float

Return the azimuthal angle in radians.

Examples

Using the setup in the FourMomentum class example:

hep.FourMomentum(1.0, 1.0, 0.0, 0.0).phi

pseudorapidity

Property · read-only#
pseudorapidity: float

Return the pseudorapidity of the spatial momentum.

Examples

Using the setup in the FourMomentum class example:

abs(hep.FourMomentum(1.0, 1.0, 0.0, 0.0).pseudorapidity) < 1e-12

rapidity

Property · read-only#
rapidity: float

Return the longitudinal rapidity.

Examples

Using the setup in the FourMomentum class example:

hep.FourMomentum(1.0, 1.0, 0.0, 0.0).rapidity

wavefunction

Method#
wavefunction(kind: str, helicity: Helicity) -> Wavefunction

Construct a fixed scalar, vector or spinor external state.

kind is scalar, epsilon, epsilon_bar, u, u_bar, v or v_bar. Scalar helicity is zero; spinors use plus or minus. A massive vector also admits zero helicity for a longitudinal state. The inherited longitudinal convention is undefined at rest or zero mass and raises KinematicsError. All states use four-dimensional external components and GammaLoop's MadGraph phases; no averaging is included.

Examples

from symbolica.community import hepkit as hep
p = hep.FourMomentum(150.0, 0.0, 0.0, 150.0)
eps = p.wavefunction("epsilon", hep.Helicity.PLUS)
assert len(eps.components) == 4 and eps.bar().bar() == eps

Parameters

NameTypeDefaultDescription
kindstr—

Scalar, vector or spinor state kind, including the barred variants above.

helicityHelicity—

Fixed helicity; zero for scalars, plus/minus for spinors, and also zero for a massive longitudinal vector with nonzero spatial momentum.

components

Method#
components() -> tuple[float, float, float, float]

Return (energy, px, py, pz).

Examples

Using the setup in the FourMomentum class example:

hep.FourMomentum(5.0, 3.0, 4.0, 0.0).components()

dot

Method#
dot(other: FourMomentum) -> float

Return the Minkowski dot product with another four-momentum.

Examples

Using the setup in the FourMomentum class example:

momentum.dot(momentum)

Parameters

NameTypeDefaultDescription
otherFourMomentum—

Momentum to contract with this one.

flux

Method#
flux(other: Optional[FourMomentum] = None) -> float

Return the decay denominator 2E or the invariant two-particle flux.

Inputs must be physical, future-directed on-shell momenta. Decay rates refer to this momentum's frame; the rest-frame result is 2M. No unit conversion, spin/color average or symmetry factor is included.

Examples

Using the setup in the FourMomentum class example:

p = hep.FourMomentum(5.0, 0.0, 0.0, 5.0)
q = hep.FourMomentum(5.0, 0.0, 0.0, -5.0)
p.flux(q)

Parameters

NameTypeDefaultDescription
otherOptional[FourMomentum]None

Other incoming momentum; None selects a decay in this frame.

delta_phi

Method#
delta_phi(other: FourMomentum) -> float

Return the wrapped azimuthal separation from another momentum.

Examples

Using the setup in the FourMomentum class example:

first.delta_phi(second)

Parameters

NameTypeDefaultDescription
otherFourMomentum—

Momentum whose azimuth is compared.

delta_r

Method#
delta_r(other: FourMomentum) -> float

Return the distance in rapidity-azimuth space.

Examples

Using the setup in the FourMomentum class example:

separation = first.delta_r(second)
same_jet = separation < 0.4

Parameters

NameTypeDefaultDescription
otherFourMomentum—

Momentum to compare with this one.

__add__

Method#
__add__(other: FourMomentum) -> FourMomentum

Add two four-momenta component by component.

Examples

Using the setup in the FourMomentum class example:

(first + second).energy == first.energy + second.energy

Parameters

NameTypeDefaultDescription
otherFourMomentum—

Momentum to add.

__sub__

Method#
__sub__(other: FourMomentum) -> FourMomentum

Subtract another four-momentum component by component.

Examples

Using the setup in the FourMomentum class example:

(first - second).energy == first.energy - second.energy

Parameters

NameTypeDefaultDescription
otherFourMomentum—

Momentum to subtract.

__neg__

Method#
__neg__() -> FourMomentum

Reverse the four-momentum flow convention.

Examples

Using the setup in the FourMomentum class example:

incoming_convention = hep.FourMomentum(5.0, 3.0, 4.0, 0.0)
outgoing_convention = -incoming_convention
assert outgoing_convention.energy == -5.0

__mul__

Method#
__mul__(scalar: float) -> FourMomentum

Scale every four-momentum component.

Examples

Using the setup in the FourMomentum class example:

half_momentum = momentum * 0.5

Parameters

NameTypeDefaultDescription
scalarfloat—

Multiplicative scale factor.

__rmul__

Method#
__rmul__(scalar: float) -> FourMomentum

Scale every four-momentum component from the left.

Examples

Using the setup in the FourMomentum class example:

half_momentum = 0.5 * momentum

Parameters

NameTypeDefaultDescription
scalarfloat—

Multiplicative scale factor.

__repr__

Method#
__repr__() -> str

Return a constructor-style representation of the components.

Examples

Using the setup in the FourMomentum class example:

muon_momentum = hep.FourMomentum(5.0, 3.0, 4.0, 0.0)
print(f"muon four-momentum: {muon_momentum!r}")

_repr_latex_

Method#
_repr_latex_() -> str

Render the momentum as a contravariant four-vector.

Examples

Using the setup in the FourMomentum class example:

latex = momentum._repr_latex_()

_repr_pretty_

Method#
_repr_pretty_(pretty: Any, cycle: bool) -> None

Write the constructor-style form to an IPython pretty printer.

Examples

Using the setup in the FourMomentum class example:

from IPython.lib.pretty import pretty
text = pretty(momentum)

Parameters

NameTypeDefaultDescription
prettyAny—

The IPython pretty-printer object.

cyclebool—

Whether this object is part of a recursive formatting cycle.