Qiskit/qiskit-ibm-provider

Transpiler error when executing Clifford circuit in stabilizer simulator

Closed this issue · 4 comments

Environment

  • Qiskit Terra version: 0.24.1
  • Python version: 3.10.8
  • Operating system: IBM Quantum Experience jupyter notebook

What is happening?

When I run the following circuit:

from qiskit import QuantumCircuit, execute
from qiskit_ibm_provider import IBMProvider

qc = QuantumCircuit(1)
qc.x(0)

provider = IBMProvider()
sim = provider.get_backend("simulator_stabilizer")
execute(qc, backend=sim, optimization_level=3)

I get the following error:

TranspilerError: "The number of qubits for Instruction(name='cy', 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?

Run the code given above.

What should happen?

The circuit should run fine as it is only applying an X gate and therefore is apt for the stabilizer simulator.

Any suggestions?

No response

This looks to me like a miscalibration on the server-side backend. If so, it's not related to Terra, but we can ask some people who might know who to pass this on to (@jyu00, @wshanks?).

For ease, a reproducer without attempting to run the circuit is:

from qiskit import QuantumCircuit
from qiskit_ibm_provider import IBMProvider

qc = QuantumCircuit(1)
qc.x(0)

provider = IBMProvider()
sim = provider.get_backend("simulator_stabilizer")
sim.target

I see

>>> sim.configuration().gates
[GateConfig(cx, [], gate cx c,t { CX c,t; }, [[0], [1], [2], [3], [4]], True, 'Two-qubit Controlled-NOT gate'),
 GateConfig(cy, ['lambda'], gate cy a,b { U(0,0,-pi/2) b; CX a,b; U(0,0,pi/2) b; }, [[0], [1], [2], [3], [4]], True, 'Two-qubit Controlled-Y gate'),
 GateConfig(cz, ['phi', 'lambda'], gate cz a,b { U(pi/2,0,pi) b; CX a,b; U(pi/2,0,pi) b; }, [[0], [1], [2], [3], [4]], True, 'Two-qubit Controlled-Z gate'),
 GateConfig(id, ['theta', 'phi', 'lambda'], gate id a { U(0,0,0) a; }, [[0], [1], [2], [3], [4]], True, 'Single-qubit identity gate'),
 GateConfig(x, [], gate x a { U(pi,0,pi) a; }, [[0, 1], [1, 0], [1, 2], [1, 3], [2, 1], [3, 1], [3, 4], [4, 3]], True, 'Single-qubit Pauli-X gate'),
 GateConfig(y, [], gate y a { U(pi,pi/2,pi/2) a; }, True, 'Single-qubit Pauli-Y gate'),
 GateConfig(z, [], gate z a { U(0,0,pi) a; }, True, 'Single-qubit Pauli-Z gate'),
 GateConfig(h, [], gate h q { U(pi/2,0,pi) q; }, True, 'Single-qubit Hadamard gate'),
 GateConfig(s, [], gate s q { U(0,0,pi/2) q; }, True, 'Single-qubit phase gate'),
 GateConfig(sdg, [], gate sdg q { U(0,0,-pi/2) q; }, True, 'Single-qubit adjoint phase gate'),
 GateConfig(sx, [], gate sx q { U(pi/2,-pi/2,pi/2) q; }, True, 'Single-qubit Sqrt(X) gate'),
 GateConfig(swap, [], TODO, True, 'Two-qubit SWAP gate'),
 GateConfig(delay, [], TODO, True, 'Delay instruction')]

which looks like things are quite out of sync - the parameters and qubit numbers don't match the gate names.

I'm moving this to the provider.

This looks more like a configuration issue than a code issue even in the provider. I am not familiar with how the configuration for the hosted simulators is managed, but @jyu00 can probably notify the appropriate team.

jyu00 commented

Yeah there's an issue open for the internal team.