qutip/qutip-qip

View on GitHub

Showing 27 of 175 total issues

Avoid deeply nested control flow statements.
Open

if (self.reverse_states and n == self.N - 1) or (
not self.reverse_states and n == 0
):
col.append(
r" \multigate{%d}{%s} "
Severity: Major
Found in src/qutip_qip/circuit/texrenderer.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

    if start + end - i - i == 1 and (end - start + 1) % 2 == 0:
    qc_t.add_gate(gate.name, [i, i + 1])
    elif (start + end - i - i) == 2 and (
    end - start + 1
    ) % 2 == 1:
    Severity: Major
    Found in src/qutip_qip/transpiler/chain.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

      if j < N - end - 2:
      qc_t.add_gate(
      gate.name,
      [end + gate.targets[0], end + gate.targets[1]],
      )
      Severity: Major
      Found in src/qutip_qip/transpiler/chain.py - About 45 mins to fix

        Function _get_qobjevo_helper has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
        Open

        def _get_qobjevo_helper(self, spline_kind, dims):
        """
        Please refer to `_Evoelement.get_qobjevo` for documentation.
        """
        mat = self.get_qobj(dims)
        Severity: Minor
        Found in src/qutip_qip/pulse.py - About 35 mins to fix

        Function _concatenate_pulses has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
        Open

        def _concatenate_pulses(
        self, pulse_instructions, scheduled_start_time, num_controls
        ):
        """
        Concatenate compiled pulses coefficients and tlist for each pulse.
        Severity: Minor
        Found in src/qutip_qip/compiler/gatecompiler.py - About 35 mins to fix

        Function _is_pulses_valid has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
        Open

        def _is_pulses_valid(self):
        """
        Check if the pulses are in the correct shape.
         
        Returns: bool
        Severity: Minor
        Found in src/qutip_qip/device/processor.py - About 25 mins to fix

        Function generate_dependency_graph has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
        Open

        def generate_dependency_graph(self, commuting):
        """
        Generate the instruction dependency graph.
        It modifies the class attribute `nodes`, where each element (node)
        is an `Instruction`.
        Severity: Minor
        Found in src/qutip_qip/compiler/scheduler.py - About 25 mins to fix
        Severity
        Category
        Status
        Source
        Language