Template Function Pennylane::Util::squaredNorm(const std::vector<T, Alloc>&)

Function Documentation

template<class T, class Alloc>
auto Pennylane::Util::squaredNorm(const std::vector<T, Alloc> &vec) -> remove_complex_t<T>

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

Parameters

vec – std::vector containing data