diff --git a/test/aqua/test_shor.py b/test/aqua/test_shor.py index aae7911435..ae66fc217a 100644 --- a/test/aqua/test_shor.py +++ b/test/aqua/test_shor.py @@ -16,10 +16,9 @@ import unittest import math -import operator from test.aqua import QiskitAquaTestCase from ddt import ddt, data, idata, unpack -from qiskit import BasicAer, QuantumCircuit, QuantumRegister, ClassicalRegister +from qiskit import BasicAer from qiskit.aqua import QuantumInstance from qiskit.aqua.algorithms import Shor @@ -74,36 +73,6 @@ def test_shor_modinv(self, a_v, m_v, expected): modinv = Shor.modinv(a_v, m_v) self.assertTrue(modinv == expected) - @idata([[3, "0011"], - [5, "0101"]]) - @unpack - def test_phi_add_gate(self, addition_magnitude, expected_state): - """ shor phi add gate test """ - shor = Shor(3) - shor._n = 2 - shor._qft.num_qubits = 3 - shor._iqft.num_qubits = 3 - q = QuantumRegister(4) - c = ClassicalRegister(4, name='measurement') - circuit = QuantumCircuit(q, c) - - gate = shor._phi_add_gate(3, addition_magnitude) - qubits = [q[i] for i in reversed(range(len(q) - 1))] - - circuit.compose(shor._qft, qubits, inplace=True) - circuit.compose(gate, qubits, inplace=True) - circuit.compose(shor._iqft, qubits, inplace=True) - circuit.measure(q, c) - - backend = BasicAer.get_backend('qasm_simulator') - quantum_instance = QuantumInstance(backend, shots=1000) - - result = quantum_instance.execute(circuit) - - result_data = result.get_counts().items() - most_likely_state = max(result_data, key=operator.itemgetter(1))[0] - self.assertTrue(most_likely_state, expected_state) - if __name__ == '__main__': unittest.main()