qiskit/transpiler/passes/mapping/lookahead_swap.py
def _score_step(step):

    """Count the mapped two-qubit gates, less the number of added SWAPs."""
    # Each added swap will add 3 ops to gates_mapped, so subtract 3.
    return len([g for g in step['gates_mapped']
                if len(g.qargs) == 2]) - 3 * step['swaps_added']
def _score_step(step):

    # Each added swap will add 3 ops to gates_mapped, so subtract 3.
    return len([g for g in step['gates_mapped']
                if len(g.qargs) == 2]) - 3 * step['swaps_added']
def _score_step ( step ) : # Each added swap will add 3 ops to gates_mapped, so subtract 3. return len ( [ g for g in step [ 'gates_mapped' ] if len ( g . qargs ) == 2 ] ) - 3 * step [ 'swaps_added' ]
Count the mapped two-qubit gates, less the number of added SWAPs.
Count the mapped two - qubit gates less the number of added SWAPs .