Template Function Pennylane::Util::squaredNorm(const T *, std::size_t)

Function Documentation

template<class T>
auto Pennylane::Util::squaredNorm(const T *data, std::size_t data_size) -> remove_complex_t<T>

Compute the squared norm of a real/complex vector \(\sum_k |v_k|^2\)

Parameters
  • data – Data pointer

  • data_size – Size of the data