600633ca50dbae038f494162a67e3cab2a84b4b6,test/test_qsvm_kernel.py,TestQSVMKernel,test_qsvm_kernel_binary_directly,#TestQSVMKernel#,93

Before Change



    def test_qsvm_kernel_binary_directly(self):
        svm = get_pluggable_class(PluggableType.ALGORITHM,"QSVM.Kernel")
        svm = svm()
        svm.random_seed = self.random_seed
        svm.setup_quantum_backend(backend="qasm_simulator_py", shots=self.shots)

        num_qubits = 2
        feature_map = get_pluggable_class(PluggableType.FEATURE_MAP,"SecondOrderExpansion")
        feature_map = feature_map()

After Change



    def test_qsvm_kernel_binary_directly(self):

        backend = Aer.get_backend("qasm_simulator_py")
        num_qubits = 2
        feature_map = SecondOrderExpansion(num_qubits=num_qubits, depth=2, entangler_map={0: [1]})
        svm = QSVM_Kernel(feature_map, self.training_data, self.testing_data, None)
        svm.setup_quantum_backend(backend=backend, shots=self.shots)

        result = svm.run()
        np.testing.assert_array_almost_equal(
            result["kernel_matrix_training"], self.ref_kernel_matrix_training, decimal=4)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: Qiskit/qiskit-aqua
Commit Name: 600633ca50dbae038f494162a67e3cab2a84b4b6
Time: 2018-11-20
Author: chenrich@us.ibm.com
File Name: test/test_qsvm_kernel.py
Class Name: TestQSVMKernel
Method Name: test_qsvm_kernel_binary_directly


Project Name: Qiskit/qiskit-aqua
Commit Name: bd12ec54e6b360019c83311c8cc685c252e306d8
Time: 2018-11-19
Author: chenrich@us.ibm.com
File Name: test/test_qsvm_variational.py
Class Name: TestQSVMVariational
Method Name: test_qsvm_variational_directly


Project Name: Qiskit/qiskit-aqua
Commit Name: 600633ca50dbae038f494162a67e3cab2a84b4b6
Time: 2018-11-20
Author: chenrich@us.ibm.com
File Name: test/test_qsvm_kernel.py
Class Name: TestQSVMKernel
Method Name: test_qsvm_kernel_binary_directly_statevector