Template Function Pennylane::Util::transpose_state_tensor

Function Documentation

template<typename T>
auto Pennylane::Util::transpose_state_tensor(const std::vector<T> &tensor, const std::vector<std::size_t> &new_axes) -> std::vector<T>

Template for the transposition of state tensors, axes are assumed to have a length of 2 (|0>, |1>).

Template Parameters

T – Tensor data type.

Parameters
  • tensor – Tensor to be transposed.

  • new_axes – new axes distribution.

Returns

Transposed Tensor.