Function Pennylane::Util::transposed_state_index

Function Documentation

inline auto Pennylane::Util::transposed_state_index(std::size_t ind, const std::vector<std::size_t> &new_axes) -> std::size_t

Determines the transposed index of a tensor stored linearly. This function assumes each axis will have a length of 2 (|0>, |1>).

Parameters
  • ind – index after transposition.

  • new_axes – new axes distribution.

Returns

unsigned int with the new transposed index.