diff --git a/crates/accelerate/src/sparse_pauli_op.rs b/crates/accelerate/src/sparse_pauli_op.rs index abfe8536f893..aa97dd64b180 100644 --- a/crates/accelerate/src/sparse_pauli_op.rs +++ b/crates/accelerate/src/sparse_pauli_op.rs @@ -97,9 +97,7 @@ pub fn decompose_dense( operator: PyReadonlyArray2, tolerance: f64, ) -> PyResult { - // Can't use `{integer}::ilog2` until Rust 1.67+. - let ilog2 = |val: usize| std::mem::size_of::() * 8 - val.leading_zeros() as usize - 1; - let num_qubits = ilog2(operator.shape()[0]); + let num_qubits = operator.shape()[0].ilog2() as usize; let size = 1 << num_qubits; if operator.shape() != [size, size] { return Err(PyValueError::new_err(format!(