lincomb

adcc.lincomb(coefficients: Sequence[float] | ndarray[tuple[int], dtype[float64]], tensors: Sequence[Tensor], evaluate: bool = False) → Tensor
adcc.lincomb(coefficients: Sequence[float] | ndarray[tuple[int], dtype[float64]], tensors: Sequence[AmplitudeVector], evaluate: bool = False) → AmplitudeVector

Form a linear combination from a list of tensors.

Parameters:
  • coefficients (Sequence[float] | Array1D) – Coefficients for the linear combination

  • tensors (Sequence[AmplitudeVector] | Sequence[libadcc.Tensor]) – Tensors for the linear combination

  • evaluate (bool) – Should the linear combination be evaluated (True) or should just a lazy expression be formed (False). Notice that lincomb(…, evaluate=True) is identical to lincomb(…, evaluate=False).evaluate(), but the former is generally faster.