Hi Andrey,
yes, that's certainly possible.
Since Algopy only computes in univariate Taylor arithmetic, one has to convert several univariate Taylor polynomials to one multivariate Taylor polynomial.
Basically, the idea is
1) INPUT: multivariate polynomial A(r1,..,rn)
2) CONVERT: to set of univariate polynomials A1(r), A2(r), ...
3) COMPUTE: in univariate Taylor arithmetic
4) CONVERT: set of univariate polynomials f(A1(r)), f(A2(r)), ... back to multivariate polynomial
The functionality is implemented in the submodule `algopy.exact_interpolation`.
The mathematical details are described on page 315 of the book "Evaluating Derivatives" by Andreas Griewank,
Chapter 13, Subsection: Multivariate Tensors via Univariate Tensors.
A more detailed and easier to understand description can be found in the original paper "Evaluating higher derivative tensors by forward propagation of univariate Taylor series"
by Andreas Griewank, Jean Utke, Andrea Walther.
Example (taken from `test_exact_interpolation.py`):
It assumes the special case when the input polynomial is
A(r1,...,rn) = A_{0} + A_{1,0,..} r1 + A_{0,1,0...} r2 + ... + A_{0,...0,1} rn .
def test_interpolation(self):
def f(x):
return x[0] + x[1] + 3.*x[0]*x[1] + 7.*x[1]*x[1] + 17.*x[0]*x[0]*x[0]
N = 2
D = 5
deg_list = [0,1,2,3,4]
coeff_list = []
for n,deg in enumerate(deg_list):
Gamma, rays = generate_Gamma_and_rays(N,deg) # 1) INPUT
x = UTPM(numpy.zeros((D,) + rays.shape)) # 2) CONVERT
x.data[1,:,:] = rays
y = f(x) # 3) COMPUTE
coeff_list.append(numpy.dot(Gamma, y.data[deg])) # 4) CONVERT
assert_array_almost_equal([0], coeff_list[0])
assert_array_almost_equal([1,1], coeff_list[1])
assert_array_almost_equal([0,3,7], coeff_list[2])
assert_array_almost_equal([17,0,0,0], coeff_list[3])
If your input polynomial is not of the special form as above you'll have to adapt the conversion step.
regards,
Sebastian