VakintNumericalResult

VakintNumericalResult

VakintNumericalResult()

Container class storing the result of a numerical evaluation of a vakint expression as a Laurent series in the dimensional regularisation parameter epsilon.

Methods

Name Description
__new__ Create a new instance of VakintNumericalResult from a list of (espilon exponent, (real, imag)) tuples.
__str__ String representation of the numerical result.
compare_to Compare this numerical result to another, returning a tuple of (bool, str) where the bool indicates whether the results match within the specified thresholds, and the str provides details of the comparison.
to_list Convert the numerical result to a native Python list of (epsilon exponent, (real, imag)) tuples.

__new__

VakintNumericalResult.__new__(values: typing.Sequence[tuple[builtins.int, tuple[builtins.float, builtins.float]]]) -> VakintNumericalResult

Create a new instance of VakintNumericalResult from a list of (espilon exponent, (real, imag)) tuples.

Examples

VakintNumericalResult([
    (-3, (0.0, -11440.53140354612)),
    (-2, (0.0,  57169.95521898031)),
    (-1, (0.0, -178748.9838377694)),
    (-0, (0.0,  321554.1122184795)),
])

Parameters

  • values (List[Tuple[int, Tuple[float, float]]]) A list of tuples, each containing an integer exponent of epsilon and a tuple of two floats representing the real and imaginary parts of the coefficient.

__str__

VakintNumericalResult.__str__() -> builtins.str

String representation of the numerical result.

Examples

result = VakintNumericalResult([
  (-3, (0.0, -11440.53140354612)),
  (-2, (0.0,  57169.95521898031)),
  (-1, (0.0, -178748.9838377694)),
  (0, (0.0,  321554.1122184795)),
])

str(result)
ε^-3 : (0+-11440.5314035461i)
ε^-2 : (0+57169.9552189803i)
ε^-1 : (0+-178748.983837769i)
ε^ 0 : (0+321554.112218480i)

## `compare_to` { #symbolica.community.vakint.VakintNumericalResult.compare_to }

```python
VakintNumericalResult.compare_to(
    other: VakintNumericalResult,
    relative_threshold: builtins.float,
    error: typing.Optional[VakintNumericalResult] = None,
    max_pull: typing.Optional[builtins.float] = None,
) -> tuple[builtins.bool, builtins.str]

Compare this numerical result to another, returning a tuple of (bool, str) where the bool indicates whether the results match within the specified thresholds, and the str provides details of the comparison.

Examples

result1 = VakintNumericalResult([
 (-3, (0.0, -11440.53140354612)),
])
result2 = VakintNumericalResult([
 (-3, (0.0, -11440.53140354612)),
 (-2, (0.0,  2.0)),
])
result1.compare_to(result2, relative_threshold=1e-5)

# (False, 'imaginary part of ε^-2 coefficient does not match within rel. error required: 0 != 2.00000000000000 (rel. error = 2.00000000000000)')

Parameters

  • other (VakintNumericalResult) The other numerical result to compare to.
  • relative_threshold (float) The relative threshold for comparison.
  • error (Optional[VakintNumericalResult]) An optional numerical result representing the error in the evaluation.
  • max_pull (Optional[float]) The maximum pull for comparison. Default is 3.0.

to_list

VakintNumericalResult.to_list() -> builtins.list[tuple[builtins.int, tuple[builtins.float, builtins.float]]]

Convert the numerical result to a native Python list of (epsilon exponent, (real, imag)) tuples.

Examples

result = VakintNumericalResult([
  (-3, (0.0, -11440.53140354612)),
  (-2, (0.0,  57169.95521898031)),
  (-1, (0.0, -178748.9838377694)),
  (0, (0.0,  321554.1122184795)),
])

result.to_list()

# [(-3, (0.0, -11440.53140354612)), (-2, (0.0, 57169.95521898031)), (-1, (0.0, -178748.9838377694)), (0, (0.0, 321554.1122184795))]