Function Pennylane::LightningGPU::Util::controlPermutationMatrixIndex

Function Documentation

inline std::size_t Pennylane::LightningGPU::Util::controlPermutationMatrixIndex(const std::size_t ctrl_size, const std::size_t tgt_size, const std::vector<bool> &ctrl_values)

Calculate the starting index for target in controlled-operations for permutation matrix.

Parameters
  • ctrl_size – Number of control wires

  • tgt_size – Number of target wires

  • ctrl_values – Control values

Returns

index starting index for target in combined control/target wires