qspec logo qspec logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qspec. transform  (  t ,  vec ,  axis=-1  )[source]

Transform vectors with a matrix, $\vec{v}^\prime = T\vec{v}$.

Parameters:
tarray_like

The transformation matrix $T$. It must hold t.shape[axis + 1] == vec.shape[axis].

vecarray_like

The vector $\vec{v}$ to be transformed.

axisint

The axis along which the vector components of vec are aligned and that is summed over.

Returns:
vec_newndarray

The transformed vector $\vec{v}^\prime$.

Raises:
ValueError

If the shapes of t and vec are not compatible.