-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix skip_transpiler: do not remove gates #562
fix skip_transpiler: do not remove gates #562
Conversation
@@ -126,9 +126,11 @@ def compile(circuits, backend, | |||
if skip_transpiler: # Just return the qobj, without any transformation or analysis | |||
job["config"]["layout"] = None | |||
job["compiled_circuit_qasm"] = circuit.qasm() | |||
basis_all = "id,u0,u1,u2,u3,x,y,z,h,s,sdg,t,tdg,rx,ry,rz," \ | |||
"cx,cy,cz,ch,crz,cu1,cu3,swap,ccx,cswap" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember seeing many other places where we have similar basis gates definition hardcoded as well, I guess we could review this in the near future and find out a way to have a unique source for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@atilag yes, this definitely has to change. It's ugly and bugs like this pop up. It's on my list to go through all the code and change this. But that's for a future PR.
@@ -126,9 +126,11 @@ def compile(circuits, backend, | |||
if skip_transpiler: # Just return the qobj, without any transformation or analysis | |||
job["config"]["layout"] = None | |||
job["compiled_circuit_qasm"] = circuit.qasm() | |||
basis_all = "id,u0,u1,u2,u3,x,y,z,h,s,sdg,t,tdg,rx,ry,rz," \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can avoid defining basis_all
by doing,
if skip_transpiler: # Just return the qobj, without any transformation or analysis
job["config"]["layout"] = None
dag_circuit = DAGCircuit.fromQuantumCircuit(circuit)
job["compiled_circuit_qasm"] = dag_circuit.qasm(qeflag=True,
eval_symbols=True)
job["compiled_circuit"] = DagUnroller(dag_circuit,
JsonBackend(dag_circuit.basis)).execute()
in pr Qiskit#562 a basis string constant was defined which seems like could be avoided.
in pr #562 a basis string constant was defined which seems like could be avoided.
…-unroll fix skip_transpiler: do not remove gates
in pr Qiskit#562 a basis string constant was defined which seems like could be avoided.
Summary
The
skip_transpiler
flag was silently removing gates that did not match a backend's basis set. This PR fixes that.Details and comments