Template Function Pennylane::LightningQubit::Util::Transpose(std::span<const T>, std::size_t, std::size_t, Allocator)

Function Documentation

template<class T, class Allocator = std::allocator<T>>
inline auto Pennylane::LightningQubit::Util::Transpose(std::span<const T> mat, std::size_t m, std::size_t n, Allocator allocator = std::allocator<T>()) -> std::vector<T, Allocator>

Transpose a matrix of shape m * n to n * m using the best available method.

Template Parameters

T – Floating point precision type.

Parameters
  • mat – Row-wise flatten matrix of shape m * n.

  • m – Number of rows of mat.

  • n – Number of columns of mat.

Returns

mat transpose of shape n * m.