Johan Mabille
- Scientific software developer @QuantStack
- Adjunct Faculty @Dauphine
- Formerly quant developer at HSBC
- Co-author of xtensor, xsimd, xeus
@JohanMabille @QuantStack
Johan Mabille
- Fernando Perez
Objectives of the tools @QuantStack
Simplify workflows of scientific software users
We are
A C++ template library for multi-dimensional array manipulation
Followings the idioms of the C++ STL
(iterator pairs, clear value semantics)
Python bindings to enable xtensor APIs on numpy arrays.
Julia bindings to enable xtensor APIs on Julia arrays.
R bindings to enable xtensor APIs on R arrays.
Cookiecutter projects for authoring of Python, Julia, and R extensions.
BLAS bindings to enable BLAS operations on xtensor expressions.
SIMD acceleration kernels.
Ever heard of numpy ?
Python 3 - numpy
C++ 14 - xtensor
np.array([[3, 4], [5, 6]])
arr.reshape([3, 4])
xt::xarray<double>({{3, 4}, {5, 6}})
xt::xtensor<double, 2>({{3, 4}, {5, 6}})
arr.reshape({3, 4});
np.linspace(1.0, 10.0, 100)
np.logspace(1.0, 10.0, 100)
np.arange(3, 7)
np.eye(4)
np.zeros([3, 4])
np.ones([3, 4])
xt::linspace<double>(1.0, 10.0, 100)
xt::logspace<double>(1.0, 10.0, 100)
xt::arange(3, 7)
xt::eye(4)
xt::zeros<double>({3, 4})
xt::ones<double>({3, 4})
Python 3 - numpy
C++ 14 - xtensor
a[:, np.newaxis]
a[:5, 1:]
a[5:1:-1, :]
np.broadcast(a, [4, 5, 7])
np.vectorize(f)
a[a > 5]
a[[0, 1], [0, 0]]
xt::view(a, xt::all(), xt::newaxis())
xt::view(a, xt::range(_, 5), xt::range(1, _))
xt::view(a, xt::range(5, 1, -1), xt::all())
xt::broadcast(a, {4, 5, 7})
xt::vectorize(f)
xt::filter(a, a > 5)
xt::index_view(a, {{0, 0}, {1, 0}})
np.sum(a, axis=[0, 1])
np.sum(a)
np.prod(a, axis=1)
np.prod(a)
np.mean(a, axis=1)
np.mean(a)
xt::sum(a, {0, 1})
xt::sum(a)
xt::prod(a, {1})
xt::prod(a)
xt::mean(a, {1})
xt::mean(a)
Python 3 - numpy
C++ 14 - xtensor
np.where(a > 5, a, b)
np.where(a > 5)
np.any(a)
np.all(a)
np.logical_and(a, b)
np.logical_or(a, b)
xt::where(a > 5, a, b)
xt::where(a > 5)
xt::any(a)
xt::all(a)
a && b
a || b
np.absolute(a)
np.exp(a)
np.sqrt(a)
np.cos(a)
np.cosh(a)
scipy.special.erf(a)
np.isnan(a)
xt::abs(a)
xt::exp(a)
xt::sqrt(a)
xt::cos(a)
xt::cosh(a)
xt::erf(a)
xt::isnan(a)
In fact, a kernel is merely an executable implementing an inter-process communication protocol. It should not need a Python runtime.
A kernel for the C++ programming language based on cling
Axel Naumann
Vassil Vassilev