Wavefunction

Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.

Wavefunction

class Wavefunction

A fixed numerical external state in GammaLoop’s MadGraph phase convention.

Obtain states from FourMomentum.wavefunction(kind, helicity). Vector components use (E,x,y,z) and signature +---; spinors use the chiral gamma-matrix basis. These external states have four components independently of the dimension used for internal symbolic Lorentz/Dirac algebra. A scalar has one component. No helicity sum, spin average or coupling is included.

Examples

from symbolica.community import hepkit as hep
momentum = hep.FourMomentum(150.0, 0.0, 0.0, 150.0)
state = momentum.wavefunction("epsilon", hep.Helicity.PLUS)
assert state.kind == "epsilon" and len(state) == 4

Attributes

Name Description
components Return a copy of the numerical components as native Python complex values.
kind One of scalar, epsilon, epsilon_bar, u, u_bar, v, v_bar.

components

Wavefunction.components: builtins.list[complex]

Return a copy of the numerical components as native Python complex values.

Examples

Using the setup in the Wavefunction class example:

values = state.components
assert len(values) == 4 and values[0] == 0j
assert abs(values[1] + 2**-0.5) < 1e-14

kind

Wavefunction.kind: builtins.str

One of scalar, epsilon, epsilon_bar, u, u_bar, v, v_bar.

Examples

Using the setup in the Wavefunction class example:

assert state.kind == "epsilon"

Methods

Name Description
__eq__ Compare both the external-state kind and its numerical components.
__len__ Return one for scalar states and four for vector or spinor states.
__repr__ Describe the numerical state kind and its components.
bar Conjugate a scalar/vector or take the chiral Dirac adjoint of a spinor

__eq__

Wavefunction.__eq__(other: Wavefunction) -> builtins.bool

Compare both the external-state kind and its numerical components.

Examples

Using the setup in the Wavefunction class example:

assert state == state.bar().bar()

Parameters

  • other (Wavefunction) State to compare with this one.

__len__

Wavefunction.__len__() -> builtins.int

Return one for scalar states and four for vector or spinor states.

Examples

Using the setup in the Wavefunction class example:

assert len(state) == 4

__repr__

Wavefunction.__repr__() -> builtins.str

Describe the numerical state kind and its components.

Examples

Using the setup in the Wavefunction class example:

assert "Wavefunction" in repr(state)

bar

Wavefunction.bar() -> Wavefunction

Conjugate a scalar/vector or take the chiral Dirac adjoint of a spinor.

Calling this twice restores both the original components and state kind.

Examples

Using the setup in the Wavefunction class example:

assert state.bar().kind == "epsilon_bar"
assert state.bar().bar() == state