Template Function Pennylane::LightningQubit::Util::Transpose(const std::vector<T, Allocator>&, std::size_t, std::size_t)¶
Defined in File LinearAlgebra.hpp
Function Documentation¶
-
template<class T, class Allocator>
inline auto Pennylane::LightningQubit::Util::Transpose(const std::vector<T, Allocator> &mat, std::size_t m, std::size_t n) -> std::vector<T, Allocator>¶ Transpose a matrix of shape m * n to n * m using the best available method.
This version may be merged with the above one when std::ranges is well supported.
- 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.
api/function_LinearAlgebra_8hpp_1a16e80c43941081e074f434dca1db9dd2
Download Python script
Download Notebook
View on GitHub