Skip to content

Commit

Permalink
fixing pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderivrii committed Dec 25, 2024
1 parent 1ffeba7 commit 39e552b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
21 changes: 4 additions & 17 deletions qiskit/transpiler/passes/synthesis/high_level_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,21 @@
from __future__ import annotations

import typing
from functools import partial
from collections.abc import Callable

import numpy as np

from qiskit.circuit.annotated_operation import Modifier
from qiskit.circuit.controlflow.control_flow import ControlFlowOp
from qiskit.circuit.operation import Operation
from qiskit.circuit.instruction import Instruction
from qiskit.converters import circuit_to_dag, dag_to_circuit
from qiskit.transpiler.basepasses import TransformationPass
from qiskit.circuit.quantumcircuit import QuantumCircuit
from qiskit.circuit import ControlledGate, EquivalenceLibrary, equivalence, Qubit
from qiskit.transpiler.passes.utils import control_flow
from qiskit.transpiler.target import Target
from qiskit.transpiler.coupling import CouplingMap
from qiskit.dagcircuit.dagcircuit import DAGCircuit
from qiskit.transpiler.exceptions import TranspilerError

from qiskit.circuit.annotated_operation import (
AnnotatedOperation,
InverseModifier,
ControlModifier,
PowerModifier,
)

from qiskit._accelerate.high_level_synthesis import QubitTracker
from .plugin import HighLevelSynthesisPluginManager

Expand Down Expand Up @@ -266,8 +255,6 @@ def __init__(

if target is not None:
coupling_map = target.build_coupling_map()
else:
coupling_map = coupling_map

top_level_only = basis_gates is None and target is None

Expand Down Expand Up @@ -396,7 +383,7 @@ def _run(
continue

# Check if synthesis for this operation can be skipped
if _definitely_skip_op(op, op_qubits, data, input_circuit):
if _definitely_skip_op(op, op_qubits, data):
output_circuit.append(op, inst.qubits, inst.clbits)
tracker.set_dirty(op_qubits)
continue
Expand Down Expand Up @@ -431,8 +418,8 @@ def _run(
op, op_qubits, data, tracker
)

# If the synthesis did not change anything, we add the operation to the output circuit and update the
# qubit tracker.
# If the synthesis did not change anything, we add the operation to the output circuit
# and update the qubit tracker.
if synthesized_circuit is None:
output_circuit.append(op, inst.qubits, inst.clbits)
tracker.set_dirty(op_qubits)
Expand Down Expand Up @@ -788,7 +775,7 @@ def _definitely_skip_node(
)


def _definitely_skip_op(op: Operation, qubits: tuple[int], data: HLSData, dag: DAGCircuit) -> bool:
def _definitely_skip_op(op: Operation, qubits: tuple[int], data: HLSData) -> bool:
"""Check if an operation does not need to be synthesized."""

# It would be nice to avoid code duplication with the previous function, the difference is
Expand Down
5 changes: 0 additions & 5 deletions qiskit/transpiler/passes/synthesis/hls_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,8 @@
import numpy as np
import rustworkx as rx

from qiskit.circuit.quantumregister import QuantumRegister
from qiskit.dagcircuit.dagcircuit import DAGCircuit
from qiskit.converters import circuit_to_dag, dag_to_circuit
from qiskit.circuit.quantumcircuit import QuantumCircuit
from qiskit.circuit.operation import Operation
from qiskit.circuit.instruction import Instruction
from qiskit.circuit.library import (
LinearFunction,
QFTGate,
Expand Down Expand Up @@ -1625,7 +1621,6 @@ def run(self, high_level_object, coupling_map=None, target=None, qubits=None, **
preserve_order = options.get("preserve_order", True)
upto_clifford = options.get("upto_clifford", False)
upto_phase = options.get("upto_phase", False)
input_qubits = options.get("input_qubits")
resynth_clifford_method = options.get("resynth_clifford_method", 1)

return synth_pauli_network_rustiq(
Expand Down
1 change: 0 additions & 1 deletion test/python/circuit/library/test_multipliers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"""Test multiplier circuits."""

import unittest
import re
import numpy as np
from ddt import ddt, data, unpack

Expand Down

0 comments on commit 39e552b

Please sign in to comment.