0
$\begingroup$

I just tried coding my first quantum circuit using the code snippets examples provided via IBM QLab. I ran the code as instructed and it doesn't work as shown. Does anyone know why the code doesnt work? Any thoughts, suggestions, appreciated! Thank-you! Jeffrey

New contributor
Design Research is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
4
  • 1
    $\begingroup$ Hello Jeffrey, welcome to quantum computing! Please consider adding relevant details to your question. What is the specific problem, what have you tried, where are you stuck at? These details would help the community members to better answer your question. $\endgroup$ – QuestionEverything Jul 18 at 16:04
  • $\begingroup$ the code IBM provides doesnt work......Is there something wrong with the code? $\endgroup$ – Design Research Jul 18 at 16:22
  • $\begingroup$ please try this link: drive.google.com/file/d/1SJD-Vrj0Dt-NbwXwmUsrI9Q0LlV9Y2qb/… $\endgroup$ – Design Research Jul 18 at 22:17
  • $\begingroup$ note that you can edit the post with the "Edit" button. Please add all relevant details needed to understand the question in the post itself, not in the comments $\endgroup$ – glS Jul 18 at 23:09
0
$\begingroup$

Try to use this code, I saw at the very last line have "," instead of an "arrow" "->":

OPENQASM 2.0;
include "qelib1.inc";

qreg q[2];
creg c[2];

h q[0];
cx q[0],q[1];
measure q[0] -> c[0];

If you get an execution error like this:

Traceback (most recent call last): File "", line 8, in job = execute(circuit, simulator, shots=1000) NameError: name 'execute' is not defined Use %tb to get the full traceback

follow along this solution.

New contributor
DEX7RA is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
$\endgroup$
9

Not the answer you're looking for? Browse other questions tagged or ask your own question.