c7042ae38552e58476c048237cd80d3fe087cdd7,qiskit/aqua/utils/entangler_map.py,,validate_entangler_map,#Any#Any#Any#,41

Before Change


            raise TypeError("Entangle index list expected but got {}".format(type(v)))

    ret_map = {}
    for k, v in entangler_map.items():
        ret_map[int(k)] = [int(x) for x in v]

    for k, v in ret_map.items():
        if k < 0 or k >= num_qubits:
            raise ValueError("Qubit value {} invalid for {} qubits".format(k, num_qubits))
        for i in v:

After Change


            raise TypeError("Entangle index list expected but got {}".format(type(src_to_targ)))

    ret_map = []
    ret_map = [[int(src), int(targ)] for src, targ in entangler_map]

    for src, targ in ret_map:
        if src < 0 or src >= num_qubits:
            raise ValueError("Qubit entangle source value {} invalid for {} qubits".format(src, num_qubits))
        if targ < 0 or targ >= num_qubits:
            raise ValueError("Qubit entangle target value {} invalid for {} qubits".format(targ, num_qubits))
        if not allow_double_entanglement and [targ, src] in ret_map:
            raise ValueError("Qubit {} and {} cross-entangled.".format(src, targ))

    return ret_map
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: Qiskit/qiskit-aqua
Commit Name: c7042ae38552e58476c048237cd80d3fe087cdd7
Time: 2019-02-13
Author: chenrich@us.ibm.com
File Name: qiskit/aqua/utils/entangler_map.py
Class Name:
Method Name: validate_entangler_map


Project Name: dpressel/mead-baseline
Commit Name: 57591a23e73d3b2ca8132589e68c8a480f1686f5
Time: 2020-04-28
Author: dpressel@gmail.com
File Name: baseline/tf/lm/model.py
Class Name: LanguageModelBase
Method Name: load


Project Name: keras-team/keras
Commit Name: c9642571c23004a10e8bca1a5b1446af399f80db
Time: 2016-02-16
Author: francois.chollet@gmail.com
File Name: keras/callbacks.py
Class Name: History
Method Name: on_batch_end