Open cqc-melf opened 4 months ago
Transferring this to Qiskit/qiskit-ibm-runtime
This seems to be a problem in the coupling map returned for simulator_stabilizer
:
response = requests.request(
"GET",
"https://api.quantum-computing.ibm.com/runtime/backends/simulator_stabilizer/configuration",
headers={
"Accept": "application/json",
"Authorization": "Bearer <token>"
},
)
response.json()["gates"][0]
{'coupling_map': [[0], [1], [2], [3], [4]],
'name': 'cx',
'parameters': [],
'qasm_def': 'gate cx c,t { CX c,t; }',
'conditional': True,
'description': 'Two-qubit Controlled-NOT gate'}
The following code passes this map to the transpiler which then raises the error.
It seems each element in the coupling map should have two elements (e.g. [[0, 1], [1, 2] ... ]
) or the gate shouldn't have a coupling map attribute. Since the stabilizer can go up to 5000 qubits and has (I believe) all-to-all connectivity, the latter is probably best.
Environment
What is happening?
This error shows up when updating
qiskit-ibm-runtime
from 0.19 to 0.20 or 0.21 (So the error is only showing up withqiskit-ibm-runtime==0.20
andqiskit-ibm-runtime==0.21
simulator_stabilizer is rejecting circuits containing cx gates, the error messages shown is: qiskit.transpiler.exceptions.TranspilerError: "The number of qubits for Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]) does not match the number of qubits in the properties dictionary: (0,)"
How can we reproduce the issue?
What should happen?
The circuit should run and no error should be shown
Any suggestions?
No response