48b4ee957ec7ceff46a103e1fa68e5cb66dbc5a6,qiskit/aqua/components/oracles/logical_expression_oracle.py,LogicalExpressionOracle,evaluate_classically,#LogicalExpressionOracle#Any#,277

Before Change


    def evaluate_classically(self, measurement):
        assignment = [(var + 1) * (int(tf) * 2 - 1) for tf, var in zip(measurement[::-1], range(len(measurement)))]
        if self._pyeda:
            return self._evaluate_classically_with_pyeda(assignment)
        else:
            return self._evaluate_classically_with_sympy(assignment)

After Change


        assignment_dict = dict()
        for v in assignment:
            assignment_dict[self._lit_to_var[abs(v)]] = True if v > 0 else False
        return self._expr.subs(assignment_dict), assignment
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: Qiskit/qiskit-aqua
Commit Name: 48b4ee957ec7ceff46a103e1fa68e5cb66dbc5a6
Time: 2019-06-27
Author: shaohan.hu@ibm.com
File Name: qiskit/aqua/components/oracles/logical_expression_oracle.py
Class Name: LogicalExpressionOracle
Method Name: evaluate_classically


Project Name: sympy/sympy
Commit Name: f0556f7b6806d21083c55752046cd7ecfcf1723d
Time: 2021-02-10
Author: harshityadav2k@gmail.com
File Name: sympy/concrete/products.py
Class Name: Product
Method Name: _eval_derivative


Project Name: sympy/sympy
Commit Name: a732984b582e2869665c6448d35cad2c4178ad94
Time: 2021-02-09
Author: harshityadav2k@gmail.com
File Name: sympy/concrete/products.py
Class Name: Product
Method Name: _eval_derivative