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

Function Documentation

template<typename T, size_t size>
constexpr 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

size_t