179b564a13bf1d864e9b86af84e8973b25eba745,qiskit/aqua/algorithms/single_sample/grover/grover.py,Grover,_run_with_existing_iterations,#Grover#,210

Before Change


            max_amplitude_idx = np.where(variable_register_density_matrix_diag == max_amplitude)[0][0]
            top_measurement = np.binary_repr(max_amplitude_idx, len(self._oracle.variable_register))
        else:
            measurement_cr = ClassicalRegister(len(self._oracle.variable_register), name="m")
            qc.add_register(measurement_cr)
            qc.measure(self._oracle.variable_register, measurement_cr)
            measurement = self._quantum_instance.execute(qc).get_counts(qc)
            self._ret["measurement"] = measurement
            top_measurement = max(measurement.items(), key=operator.itemgetter(1))[0]

After Change



    def _run_with_existing_iterations(self):
        if self._quantum_instance.is_statevector:
            qc = self.construct_circuit(measurement=False)
            result = self._quantum_instance.execute(qc)
            complete_state_vec = result.get_statevector(qc)
            variable_register_density_matrix = get_subsystem_density_matrix(
                complete_state_vec,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: Qiskit/qiskit-aqua
Commit Name: 179b564a13bf1d864e9b86af84e8973b25eba745
Time: 2019-04-30
Author: shaohan.hu@ibm.com
File Name: qiskit/aqua/algorithms/single_sample/grover/grover.py
Class Name: Grover
Method Name: _run_with_existing_iterations


Project Name: Qiskit/qiskit-aqua
Commit Name: 80a45db18cab4f449d6f4e027f6fce6ca7133544
Time: 2019-04-30
Author: shaohan.hu@ibm.com
File Name: qiskit/aqua/algorithms/single_sample/shor/shor.py
Class Name: Shor
Method Name: _run


Project Name: Qiskit/qiskit-aqua
Commit Name: 419c5228433c57eda6b324780369c03039781e95
Time: 2019-04-30
Author: shaohan.hu@ibm.com
File Name: qiskit/aqua/algorithms/single_sample/qpe/qpe.py
Class Name: QPE
Method Name: _compute_energy


Project Name: Qiskit/qiskit-aqua
Commit Name: f0cf18a70d896f74f70f24a9a53fa7db7201951a
Time: 2019-04-30
Author: shaohan.hu@ibm.com
File Name: qiskit/aqua/algorithms/single_sample/iterative_qpe/iqpe.py
Class Name: IQPE
Method Name: _estimate_phase_iteratively