Function Pennylane::Util::generateBitsPatterns

Function Documentation

inline auto Pennylane::Util::generateBitsPatterns(const std::vector<std::size_t> &qubitIndices, std::size_t num_qubits) -> std::vector<std::size_t>

Generate indices for applying operations.

This method will return the statevector indices participating in the application of a gate to a given set of qubits.

Parameters
  • qubitIndices – Indices of the qubits to apply operations.

  • num_qubits – Number of qubits in register.

Returns

std::vector<std::size_t>