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.
api/function_BitUtil_8hpp_1a8047c80721fcfc5cdfb34f48f548000c
Download Python script
Download Notebook
View on GitHub