Skip to content

Commit

Permalink
Add optimization_level=0 to transpiler for compiling dynamic circuits (
Browse files Browse the repository at this point in the history
…Qiskit#2000)

``id`` gate was removed by transpiler called from aer_compiler without optimization_level for dynamic circuits.
This commits adds ``optimization_level=0`` to avoid removing id gates
  • Loading branch information
doichanj committed Nov 21, 2023
1 parent a07f76f commit 1c7d241
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion qiskit_aer/backends/aer_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def compile(self, circuits, basis_gates=None, optypes=None):
circuit = self._inline_initialize(circuit, compiled_optypes[idx])
if self._is_dynamic(circuit, compiled_optypes[idx]):
compiled_circ = transpile(
self._inline_circuit(circuit, None, None), basis_gates=basis_gates
self._inline_circuit(circuit, None, None),
basis_gates=basis_gates,
optimization_level=0,
)
compiled_circuits.append(compiled_circ)
# Recompute optype for compiled circuit
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
fixes:
- |
For dynamic circuits, aer_compiler calls transpiler without optimizaiton
level. Because id gates are removed by transpiler, noise applied id gates
did not work correctly. This fix adds optimization_level=0 not to remove
id gates of dynamic circuits

0 comments on commit 1c7d241

Please sign in to comment.