classmethod graphicle.data.Graphicle.from_numpy(pdg: ndarray[Any, dtype[int32]] | None = None, pmu: ndarray[Any, dtype[void]] | None = None, color: ndarray[Any, dtype[void]] | None = None, helicity: ndarray[Any, dtype[int16]] | None = None, status: ndarray[Any, dtype[int16]] | None = None, final: ndarray[Any, dtype[bool_]] | None = None, edges: ndarray[Any, dtype[void]] | None = None, weights: ndarray[Any, dtype[float64]] | None = None) Graphicle[source]

Instantiates a Graphicle object from an optional collection of numpy arrays.

Parameters:
pdg : ndarray[int32], optional

PDG codes.

pmu : ndarray[float64] or ndarray[void], optional

Four momenta, \(p_\mu\), formatted as a structured array with fields ('x', 'y', 'z', 'e') or an unstructured array with columns in that order.

color : ndarray[int32] or ndarray[void], optional

Color / anti-color pairs, formatted in columns of ('color', 'anticolor'), or as a structured array with those fields.

helicity : ndarray[int16], optional

Helicity values.

status : ndarray[int16], optional

Status codes from Monte-Carlo event generator.

final: ndarray[Any, dtype[bool_]] | None = None

Boolean array indicating which particles are final state.

edges : ndarray[int32] or ndarray[void], optional

COO formatted pairs of vertex ids, of shape (N, 2), where N is the number of particles in the graph. Alternatively, supply a structured array with field names ('src', 'dst').

weights : ndarray[Number], optional

Weights to be associated with each edge in the COO edge list, provided in the same order.

Returns:

Event record instantiated from a collection of optionally provided numpy arrays.

Return type:

Graphicle


Last update: Jun 27, 2025