Skip to content

Commit

Permalink
Fix removal of barriers and delays from quantum circuit
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoneGasperini authored Jan 29, 2024
1 parent faf4edb commit ad023d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/qiskit_symb/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
import random
from sympy import Symbol, sympify
from qiskit import QuantumCircuit, transpile
from qiskit.transpiler.passes import RemoveBarriers
from .circuit.library import NAME_TO_INIT # pylint: disable=cyclic-import


def get_init(name):
"""todo"""
if name not in NAME_TO_INIT:
raise NotImplementedError(
f'Gate "{name}" is not implemented in qiskit-symb, use Qiskit transpiler!')
f'Instruction "{name}" is not implemented in qiskit-symb')
return NAME_TO_INIT[name]


Expand All @@ -28,7 +27,8 @@ def flatten_circuit(circuit):

def transpile_circuit(circuit):
"""todo"""
circuit = RemoveBarriers()(circuit)
circuit.data = [
instr for instr in circuit if instr.operation.name not in ['barrier', 'delay']]
return transpile(circuit, optimization_level=2)


Expand Down

0 comments on commit ad023d4

Please sign in to comment.