From ccd85546f5e9f5dae78b702fb66c397fd73fa0cd Mon Sep 17 00:00:00 2001 From: Craig Roy Date: Fri, 8 May 2026 12:02:52 +0100 Subject: [PATCH] Fix bug in `append` --- sphinx/language_guide/static.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sphinx/language_guide/static.md b/sphinx/language_guide/static.md index e7c9e3a..46f0559 100644 --- a/sphinx/language_guide/static.md +++ b/sphinx/language_guide/static.md @@ -202,9 +202,9 @@ def append(q_arr: array[qubit, n] @owned, qb: qubit @owned) -> array[qubit, m]: for q in q_arr: q_arr_opt[idx].swap(some(q)).unwrap_nothing() idx += 1 - - q_arr_opt[m].swap(some(qb)).unwrap_nothing() - + + q_arr_opt[m-1].swap(some(qb)).unwrap_nothing() + qs = array(q.unwrap() for q in q_arr_opt) return qs