I am trying to run my circuit which is the following on a simulator. However, when I want to execute this on almost all the simulators the following error pops up:
"The control-flow construct 'switch_case' is not supported by the backend.". I will let you informed as soon as possible"
My code is:
from qiskit import QuantumCircuit, transpile from qiskit.tools.jupyter import * from qiskit.visualization import * from ibm_quantum_widgets import * from qiskit import * from qiskit_ibm_provider import IBMProvider from qiskit import QuantumCircuit, execute, Aer from qiskit.result import marginal_counts from qiskit.providers.ibmq.job import job_monitor from qiskit.tools.visualization import plot_histogram from qiskit_ibm_runtime import QiskitRuntimeService, Sampler, Estimator, Session, Options from math import pi service = QiskitRuntimeService(channel="ibm_quantum") provider = IBMProvider() backend = provider.get_backend('ibmq_qasm_simulator') from qiskit.circuit import QuantumCircuit, ClassicalRegister, QuantumRegister qreg = QuantumRegister(4) creg = ClassicalRegister(6) qc = QuantumCircuit(qreg, creg) qc.x(qreg) qc.x(qreg) qc.x(qreg) qc.measure([0, 1, 2], [0, 1, 2]) with qc.switch(creg) as case: with case(7): qc.x(qreg) qc.measure(qreg, creg) job = execute(qc, backend = backend, shots = 1000) results = job.result() ```