Function Pennylane::Util::log2PerfectPower¶
Defined in File BitUtil.hpp
Function Documentation¶
-
inline auto constexpr Pennylane::Util::log2PerfectPower(std::size_t val) -> std::size_t¶
Faster log2 when the value is a power of 2.
- Parameters:
val – Size of the state vector. Expected to be a power of 2.
- Returns:
std::size_t Log2(val), or the state vector’s number of qubits.