Skip to content

Commit

Permalink
Fix: Adapt to Qiskit#12730
Browse files Browse the repository at this point in the history
  • Loading branch information
raynelfss committed Aug 30, 2024
1 parent 1c6eb40 commit c743cc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/accelerate/src/basis/basis_translator/basis_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ pub(crate) fn basis_search(
let mut cost_tot = 0;
let borrowed_cost = opt_cost_map.borrow();
for instruction in edge_data.rule.circuit.data.iter() {
cost_tot += borrowed_cost[&(instruction.op.name(), instruction.op.num_qubits())];
let instruction_op = instruction.op.view();
cost_tot += borrowed_cost[&(instruction_op.name(), instruction_op.num_qubits())];
}
Ok(cost_tot
- borrowed_cost[&(edge_data.source.name.as_str(), edge_data.source.num_qubits)])
Expand Down
2 changes: 2 additions & 0 deletions qiskit/transpiler/passes/basis/basis_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
from qiskit.transpiler.basepasses import TransformationPass
from qiskit.transpiler.exceptions import TranspilerError
from qiskit.circuit.controlflow import CONTROL_FLOW_OP_NAMES
from qiskit._accelerate.circuit import StandardGate
from qiskit._accelerate.basis.basis_translator import basis_search

logger = logging.getLogger(__name__)

Expand Down

0 comments on commit c743cc7

Please sign in to comment.