Repository: Qiskit/qiskit-ibm-transpiler (language: python)

Issue:
Service creates ECR instructions that are incompatible with IBM Strasbourg
## Description

While testing IBM Circuit Function, we noticed a few jobs would fail. Upon further investigation, this was isolated to the Transpiler Service adding instructions labelled `ecr_[int]`. 

## Expected behaviour

The circuit should transpile with native basis gates applicable to IBM Strasbourg. While this system does have `ecr` gates, it should not have the `_[int]` suffix

## Reproducible code example

Thanks to @mberna for creating this example

```python
from qiskit.circuit import QuantumCircuit
from qiskit import transpile
from qiskit_ibm_transpiler.transpiler_service import TranspilerService
from qiskit_ibm_runtime import QiskitRuntimeService
 
num_qubits = 16
circuit = QuantumCircuit(num_qubits)
for i in range(num_qubits-1):
    circuit.ecr(i,i+1)

runtime_service = QiskitRuntimeService(channel="ibm_quantum")
backend = runtime_service.backend("ibm_strasbourg")

isa_circuit = transpile(circuit, backend)
cloud_transpiler_service = TranspilerService(
    backend_name="ibm_strasbourg",
    ai="false",
    optimization_level=3,
)
transpiled_circuit = cloud_transpiler_service.run(circuit)
print([data.name for data in transpiled_circuit.data])
```
Fixing the type of ECR gates when loading circuits from the qiskit transpiler service
<!--
⚠️ If you do not respect this template, your pull request will be closed.
⚠️ Your pull request title should be short detailed and understandable for all.
⚠️ Also, please add a release note file using reno if the change needs to be
  documented in the release notes.
⚠️ If your pull request fixes an open issue, please link to the issue.

- [ ] I have added the tests to cover my changes.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the CONTRIBUTING document.
-->

### Summary

Fixes #62 

### Details and comments

co-authored-by: @d-kremer



Discussion / hints:

Fix patch:
diff --git a/qiskit_ibm_transpiler/wrappers/transpile.py b/qiskit_ibm_transpiler/wrappers/transpile.py
index 4fc7e5d..a12d68d 100644
--- a/qiskit_ibm_transpiler/wrappers/transpile.py
+++ b/qiskit_ibm_transpiler/wrappers/transpile.py
@@ -203,16 +203,19 @@ def _create_transpile_layout(initial, final, circuit, orig_circuit):
 
 class FixECR(TransformationPass):
     def run(self, dag):
-        for node in dag.named_nodes("ecr"):
-            dag.substitute_node(node, library.ECRGate())
+        for node in dag.op_nodes():
+            if node.name.startswith("ecr"):
+                dag.substitute_node(node, library.ECRGate())
         return dag
 
 
 def _get_circuit_from_qasm(qasm_string: str):
     try:
-        return qasm2.loads(
-            qasm_string,
-            custom_instructions=_get_circuit_from_qasm.QISKIT_INSTRUCTIONS,
+        return _get_circuit_from_qasm.fix_ecr(
+            qasm2.loads(
+                qasm_string,
+                custom_instructions=_get_circuit_from_qasm.QISKIT_INSTRUCTIONS,
+            )
         )
     except QASM2ParseError:
         return _get_circuit_from_qasm.fix_ecr(qasm3.loads(qasm_string))
diff --git a/release-notes/unreleased/74.bug.rst b/release-notes/unreleased/74.bug.rst
new file mode 100644
index 0000000..4fbdc7f
--- /dev/null
+++ b/release-notes/unreleased/74.bug.rst
@@ -0,0 +1,1 @@
+Fixes a bug with ECR gates coming from Qiskit when parsing using OpenQASM2


Test patch:
diff --git a/tests/test_transpiler_service.py b/tests/test_transpiler_service.py
index 65f2756..dc35d3d 100644
--- a/tests/test_transpiler_service.py
+++ b/tests/test_transpiler_service.py
@@ -400,3 +400,18 @@ def test_fix_ecr_qasm3():
 
     circuit_from_qasm = _get_circuit_from_qasm(qasm3.dumps(qc))
     assert isinstance(list(circuit_from_qasm)[0].operation, ECRGate)
+
+
+def test_fix_ecr_ibm_strasbourg():
+    num_qubits = 16
+    circuit = QuantumCircuit(num_qubits)
+    for i in range(num_qubits - 1):
+        circuit.ecr(i, i + 1)
+
+    cloud_transpiler_service = TranspilerService(
+        backend_name="ibm_strasbourg",
+        ai="false",
+        optimization_level=3,
+    )
+    transpiled_circuit = cloud_transpiler_service.run(circuit)
+    assert any(isinstance(gate.operation, ECRGate) for gate in list(transpiled_circuit))