jwoehr / qisjob

Qiskit Job Control
Other
32 stars 4 forks source link

cannot read qasm from qasm_src #14

Closed omarcostahamido closed 3 years ago

omarcostahamido commented 3 years ago

I was having trouble learning how to use qasm_src kwarg.

Jack wrote some important instructions on slack:

qasm_src is only a kwarg to the QisJob ctor. If you want to pass source via stdin to the qisjob command, just give no file arg and pipe stdin to the instance

as an example: echo 'OPENQASM 2.0; include qelib1.inc; qreg q[1]; creg c[1]; h q[0]; measure q[0] -> c[0];' | qisjob -b ibmqx2

Note: qelib1.inc needs to be inside quotes.

Though, this example itself was not enough to make it work since it was throwing the error: UnboundLocalError: local variable 'the_source' referenced before assignment

Jack found that to be solvable with un-indenting a line. This fix can now be seen here.