From b17178b89ae8451ad5674181a81976fd294dc946 Mon Sep 17 00:00:00 2001 From: Chihiro Watanabe Date: Sun, 3 May 2026 20:37:02 +0900 Subject: [PATCH] Update need_for_speed to new API --- lectures/need_for_speed.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lectures/need_for_speed.md b/lectures/need_for_speed.md index 2e2f88ba..37bf97e3 100644 --- a/lectures/need_for_speed.md +++ b/lectures/need_for_speed.md @@ -340,8 +340,9 @@ The following vectorized code uses NumPy, which we'll soon investigate in depth, to achieve the same thing. ```{code-cell} ipython +rng = np.random.default_rng() with qe.Timer(): - x = np.random.uniform(0, 1, n) + x = rng.uniform(0, 1, n) y = np.sum(x**2) ```