diff --git a/tests/test_QAOAmaxClique.py b/tests/test_QAOAmaxClique.py index 39688b10..fa05bdbe 100644 --- a/tests/test_QAOAmaxClique.py +++ b/tests/test_QAOAmaxClique.py @@ -89,31 +89,3 @@ def aClcostFct(state, G): #assert set(intlist) in the_itt #assert aClcostFct(name, giraf) <= -1 - # test for full solution... - truth_list = [] - for index in range(10): - - integ = np.random.randint(1,7) - #create random graph with either all nodes connected, or no nodes connected - integ2 = np.random.randint(0,1) - - secondGraph = nx.erdos_renyi_graph(integ,integ2) - secondQarg = QuantumVariable(secondGraph.number_of_nodes()) - secondInstance = QAOAProblem(cost_operator= maxCliqueCostOp(secondGraph), mixer= RX_mixer, cl_cost_function=maxCliqueCostfct(secondGraph)) - secondInstance.set_init_function(init_function=init_state) - theNiceQAOA2 = secondInstance.run(qarg=secondQarg, depth= 3, max_iter = 50, mes_kwargs = {"shots" : 100000}) - maxOne = sorted(theNiceQAOA2, key=theNiceQAOA2.get, reverse=True)[:1] - #if no nodes connected, maxClique sol should just be the first node, i.e. "1000" (more or less zeros) - if integ2 == 0: - string = "1" - string += str(integ2) * (secondGraph.number_of_nodes()-1) - testStr = [string] - #if all nodes connected, maxClique sol should be all nodes, i.e. "1111" (more or less ones) - if integ2 == 1: - testStr = [str(integ2) * secondGraph.number_of_nodes()] - - - if testStr == maxOne: - truth_list.append(1) - - assert sum(truth_list)/10 > 0.5