FeynKit · latest
On this page

ThreeMomentum

symbolica.community.hepkit Class

ThreeMomentum(px: float, py: float, pz: float)

A Cartesian spatial momentum (px, py, pz).

Three-momenta are used for boost velocities, spatial rotations, and the three-vector part of a relativistic four-momentum.

Examples

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

Parameters

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 Cartesian three-momentum.

Examples

Using the setup in the ThreeMomentum class example:

momentum = hep.ThreeMomentum(3.0, 4.0, 0.0)

Parameters

NameTypeDefaultDescription
pxfloat—

Momentum along the x axis.

pyfloat—

Momentum along the y axis.

pzfloat—

Momentum along the z axis.

Member details

px

Property · read-only#
px: float

Return the x component.

Examples

Using the setup in the ThreeMomentum class example:

assert momentum.px == 3.0

py

Property · read-only#
py: float

Return the y component.

Examples

Using the setup in the ThreeMomentum class example:

assert momentum.py == 4.0

pz

Property · read-only#
pz: float

Return the z component.

Examples

Using the setup in the ThreeMomentum class example:

assert momentum.pz == 0.0

norm_squared

Property · read-only#
norm_squared: float

Return the squared Euclidean norm.

Examples

Using the setup in the ThreeMomentum class example:

hep.ThreeMomentum(3.0, 4.0, 0.0).norm_squared

norm

Property · read-only#
norm: float

Return the Euclidean norm.

Examples

Using the setup in the ThreeMomentum class example:

hep.ThreeMomentum(3.0, 4.0, 0.0).norm

pt

Property · read-only#
pt: float

Return the transverse-momentum magnitude.

Examples

Using the setup in the ThreeMomentum class example:

hep.ThreeMomentum(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 ThreeMomentum class example:

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

pseudorapidity

Property · read-only#
pseudorapidity: float

Return the pseudorapidity derived from the momentum direction.

Examples

Using the setup in the ThreeMomentum class example:

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

dot

Method#
dot(other: ThreeMomentum) -> float

Return the Euclidean dot product with another three-momentum.

Examples

Using the setup in the ThreeMomentum class example:

hep.ThreeMomentum(1.0, 0.0, 0.0).dot(hep.ThreeMomentum(2.0, 0.0, 0.0))

Parameters

NameTypeDefaultDescription
otherThreeMomentum—

Momentum to contract with this one.

cross

Method#
cross(other: ThreeMomentum) -> ThreeMomentum

Return the vector cross product with another three-momentum.

Examples

Using the setup in the ThreeMomentum class example:

hep.ThreeMomentum(1.0, 0.0, 0.0).cross(hep.ThreeMomentum(0.0, 1.0, 0.0))

Parameters

NameTypeDefaultDescription
otherThreeMomentum—

Right-hand operand of the cross product.

delta_phi

Method#
delta_phi(other: ThreeMomentum) -> float

Return the wrapped azimuthal separation from another momentum.

Examples

Using the setup in the ThreeMomentum class example:

first.delta_phi(second)

Parameters

NameTypeDefaultDescription
otherThreeMomentum—

Momentum whose azimuth is compared.

delta_r

Method#
delta_r(other: ThreeMomentum) -> float

Return the angular distance in pseudorapidity-azimuth space.

Examples

Using the setup in the ThreeMomentum class example:

separation = first.delta_r(second)
passes_isolation = separation > 0.4

Parameters

NameTypeDefaultDescription
otherThreeMomentum—

Momentum to compare with this one.

__add__

Method#
__add__(other: ThreeMomentum) -> ThreeMomentum

Add two spatial momenta component by component.

Examples

Using the setup in the ThreeMomentum class example:

total = first + second

Parameters

NameTypeDefaultDescription
otherThreeMomentum—

Momentum to add.

__sub__

Method#
__sub__(other: ThreeMomentum) -> ThreeMomentum

Subtract another spatial momentum component by component.

Examples

Using the setup in the ThreeMomentum class example:

incoming = hep.ThreeMomentum(3.0, 4.0, 0.0)
outgoing = hep.ThreeMomentum(1.0, 0.0, 0.0)
transfer = incoming - outgoing
assert transfer.px == 2.0

Parameters

NameTypeDefaultDescription
otherThreeMomentum—

Momentum to subtract.

__neg__

Method#
__neg__() -> ThreeMomentum

Reverse every spatial momentum component.

Examples

Using the setup in the ThreeMomentum class example:

incoming_convention = hep.ThreeMomentum(3.0, 4.0, 0.0)
outgoing_convention = -incoming_convention
assert outgoing_convention.px == -3.0

__mul__

Method#
__mul__(scalar: float) -> ThreeMomentum

Scale every spatial momentum component.

Examples

Using the setup in the ThreeMomentum class example:

half_momentum = momentum * 0.5

Parameters

NameTypeDefaultDescription
scalarfloat—

Multiplicative scale factor.

__rmul__

Method#
__rmul__(scalar: float) -> ThreeMomentum

Scale every spatial momentum component from the left.

Examples

Using the setup in the ThreeMomentum class example:

half_momentum = 0.5 * momentum

Parameters

NameTypeDefaultDescription
scalarfloat—

Multiplicative scale factor.

on_shell

Method#
on_shell(mass: Optional[float] = None) -> FourMomentum

Lift this spatial momentum to an on-shell four-momentum.

Examples

Using the setup in the ThreeMomentum class example:

hep.ThreeMomentum(3.0, 4.0, 0.0).on_shell().energy

Parameters

NameTypeDefaultDescription
massOptional[float]None

On-shell mass; omitted values describe a massless momentum.

__repr__

Method#
__repr__() -> str

Return a constructor-style representation of the components.

Examples

Using the setup in the ThreeMomentum class example:

track_momentum = hep.ThreeMomentum(1.0, 2.0, 3.0)
print(f"track momentum: {track_momentum!r}")

_repr_latex_

Method#
_repr_latex_() -> str

Render the momentum as a mathematical three-vector.

Examples

Using the setup in the ThreeMomentum 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 ThreeMomentum 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.