Template Function Pennylane::LightningQubit::Util::count_unique

Function Documentation

template<typename T, std::size_t size>
constexpr std::size_t Pennylane::LightningQubit::Util::count_unique(const std::array<T, size> &arr)

Count the number of unique elements in the array.

This is O(n^2) version for all T

Template Parameters
  • T – Type of array elements

  • size – Size of the array

Returns

std::size_t