From 1967528b03e521757bb3a81d91ea3a84aab77696 Mon Sep 17 00:00:00 2001 From: Matan Vax Date: Thu, 2 Jan 2025 07:22:38 +0200 Subject: [PATCH] Fix issues --- .../time_marching/time_marching.ipynb | 4 ++-- .../classiq_open_library/qpe/qpe.ipynb | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/algorithms/differential_equations/time_marching/time_marching.ipynb b/algorithms/differential_equations/time_marching/time_marching.ipynb index 4a96fccc2..eb408a674 100644 --- a/algorithms/differential_equations/time_marching/time_marching.ipynb +++ b/algorithms/differential_equations/time_marching/time_marching.ipynb @@ -815,7 +815,7 @@ "def long_time_integrator(\n", " T: CReal, num_slices: CInt, qbe_full: FullBE # start from time 0\n", "):\n", - " inplace_qbe_full.counter |= num_slices\n", + " qbe_full.counter ^= num_slices\n", " repeat(\n", " num_slices,\n", " lambda i: long_time_integrator_step(\n", @@ -887,7 +887,7 @@ "def long_time_integrator_naive(\n", " T: CReal, num_slices: CInt, qbe_full: FullBE # start from time 0\n", "):\n", - " inplace_qbe_full.counter |= num_slices\n", + " qbe_full.counter ^= num_slices\n", " repeat(\n", " num_slices,\n", " lambda i: long_time_integrator_step_naive(\n", diff --git a/functions/qmod_library_reference/classiq_open_library/qpe/qpe.ipynb b/functions/qmod_library_reference/classiq_open_library/qpe/qpe.ipynb index ba39cca9f..06a671271 100644 --- a/functions/qmod_library_reference/classiq_open_library/qpe/qpe.ipynb +++ b/functions/qmod_library_reference/classiq_open_library/qpe/qpe.ipynb @@ -85,11 +85,13 @@ "\n", "\n", "@qfunc\n", - "def main(state: Output[QArray[QBit]], phase: Output[QNum]):\n", + "def main(state: Output[QArray[QBit]], phase: Output[QNum[QPE_RESOLUTION, UNSIGNED, QPE_RESOLUTION]]):\n", + " allocate(phase.size, phase)\n", + " \n", " allocate(2, state)\n", - " allocate_num(QPE_RESOLUTION, False, QPE_RESOLUTION, phase)\n", - "\n", - " state ^= 3\n", + " X(state[0])\n", + " X(state[1])\n", + " \n", " qpe(unitary=lambda: CRZ(pi, state[0], state[1]), phase=phase)\n", "\n", "\n",