verry.autodiff.Jet#
- class verry.autodiff.Jet(coeffs)#
Bases:
Scalar,ABC,GenericAbstract base class for jets.
- Parameters:
coeffs (Iterable[T]) – Coefficients of the jet.
- Variables:
coeffs (list[T]) – Coefficients of the jet.
Warning
Users cannot define classes derived from this.
See also
Notes
In principle, instances of this class behave like elements of the ring \(T[x]/(x^n)\), where \(n\) is the length of coeffs. However, this does not apply to \(n=1\). If \(n=1\), the instance is treated as an element of the coefficient ring T.
Examples
>>> x = DynJet([1.0, 6.0, 7.0, 2.0]) >>> y = DynJet([3.0, -1.0, 5.0]) >>> z = x + y >>> z DynJet([4.0, 5.0, 12.0])
>>> x = DynJet([1.0, 2.0, 3.0]) >>> y = DynJet([2.0]) # treated as 2.0 since its order is 0 >>> z = x * y >>> z DynJet([2.0, 4.0, 6.0])
- __call__(arg)#
Call self as a function.
- reciprocal()#
Return the reciprocal of the jet.
- Raises:
ZeroDivisionError – If the constant term is not invertible.
- property order#
Order of the jet.
This is a shorthand for
len(self.coeffs) - 1.