Function Pennylane::Util::exp2

Function Documentation

inline auto Pennylane::Util::exp2(const std::size_t &n) -> std::size_t

Calculates 2^n for some integer n > 0 using bitshifts.

Parameters

n – the exponent

Returns

value of 2^n