From b2abbaa6b021ffa5c9619dcf0530c1284b9c2208 Mon Sep 17 00:00:00 2001 From: Bettina Heim Date: Sun, 23 Jul 2023 12:42:03 +0200 Subject: [PATCH] Updating the IonQ examples (#465) (#466) --- docs/sphinx/examples/cpp/providers/ionq.cpp | 4 +++- docs/sphinx/examples/python/providers/ionq.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/sphinx/examples/cpp/providers/ionq.cpp b/docs/sphinx/examples/cpp/providers/ionq.cpp index 5eca932421..6b66ad9abd 100644 --- a/docs/sphinx/examples/cpp/providers/ionq.cpp +++ b/docs/sphinx/examples/cpp/providers/ionq.cpp @@ -16,7 +16,9 @@ struct ghz { for (int i = 0; i < 4; i++) { x(q[i], q[i + 1]); } - mz(q); + // Note: All qubits will be measured at the end upon performing + // the sampling. You may encounter a pre-flight error on IonQ + // backends if you include explicit measurements. } }; diff --git a/docs/sphinx/examples/python/providers/ionq.py b/docs/sphinx/examples/python/providers/ionq.py index dfb0d6b122..10e5881d32 100644 --- a/docs/sphinx/examples/python/providers/ionq.py +++ b/docs/sphinx/examples/python/providers/ionq.py @@ -11,8 +11,10 @@ qubits = kernel.qalloc(2) kernel.h(qubits[0]) kernel.cx(qubits[0], qubits[1]) -kernel.mz(qubits[0]) -kernel.mz(qubits[1]) + +# Note: All qubits will be measured at the end upon performing +# the sampling. You may encounter a pre-flight error on IonQ +# backends if you include explicit measurements. # Execute on IonQ and print out the results.