dc045bebd58dbf547728ff2f34e1d9a0fcb916f9,test/aqua/test_graph_partition.py,TestGraphPartition,test_graph_partition_vqe,#TestGraphPartition#,84
Before Change
def test_graph_partition_vqe(self):
Graph Partition VQE test
algorithm_cfg = {
"name": "VQE",
"max_evals_grouped": 2
}
optimizer_cfg = {
"name": "SPSA",
"max_trials": 300
}
var_form_cfg = {
"name": "RY",
"depth": 5,
"entanglement": "linear"
}
params = {
"problem": {"name": "ising", "random_seed": 10598},
"algorithm": algorithm_cfg,
"optimizer": optimizer_cfg,
"variational_form": var_form_cfg
}
backend = BasicAer.get_backend("statevector_simulator")
result = run_algorithm(params, self.algo_input, backend=backend)
x = sample_most_likely(result["eigvecs"][0])
// check against the oracle
ising_sol = graph_partition.get_graph_solution(x)
np.testing.assert_array_equal(ising_sol, [0, 1, 0, 1])
After Change
def test_graph_partition_vqe(self):
Graph Partition VQE test
aqua_globals.random_seed = 10598
result = VQE(self.qubit_op,
RY(self.qubit_op.num_qubits, depth=5, entanglement="linear"),
SPSA(max_trials=300),
max_evals_grouped=2).run(
QuantumInstance(BasicAer.get_backend("statevector_simulator")))
x = sample_most_likely(result["eigvecs"][0])
// check against the oracle
ising_sol = graph_partition.get_graph_solution(x)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 22
Instances
Project Name: Qiskit/qiskit-aqua
Commit Name: dc045bebd58dbf547728ff2f34e1d9a0fcb916f9
Time: 2019-11-08
Author: manoel@us.ibm.com
File Name: test/aqua/test_graph_partition.py
Class Name: TestGraphPartition
Method Name: test_graph_partition_vqe
Project Name: Qiskit/qiskit-aqua
Commit Name: dc045bebd58dbf547728ff2f34e1d9a0fcb916f9
Time: 2019-11-08
Author: manoel@us.ibm.com
File Name: test/aqua/test_partition.py
Class Name: TestSetPacking
Method Name: test_partition_vqe
Project Name: Qiskit/qiskit-aqua
Commit Name: dc045bebd58dbf547728ff2f34e1d9a0fcb916f9
Time: 2019-11-08
Author: manoel@us.ibm.com
File Name: test/aqua/test_graph_partition.py
Class Name: TestGraphPartition
Method Name: test_graph_partition_vqe
Project Name: Qiskit/qiskit-aqua
Commit Name: dc045bebd58dbf547728ff2f34e1d9a0fcb916f9
Time: 2019-11-08
Author: manoel@us.ibm.com
File Name: test/aqua/test_vertex_cover.py
Class Name: TestVertexCover
Method Name: test_vertex_cover_vqe