Function Pennylane::Util::log2PerfectPower

Function Documentation

inline constexpr auto Pennylane::Util::log2PerfectPower(uint64_t val) -> size_t

Faster log2 when the value is the perfect power of 2.

If the value is the perfect power of 2, using a system provided bit operation is much faster than std::log2