Function Pennylane::Util::log2PerfectPower

Function Documentation

inline constexpr auto Pennylane::Util::log2PerfectPower(size_t val) -> 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

size_t Log2(val), or the state vector’s number of qubits.