Use flag to avoid false dependency on random if using recent QC