import warnings

warnings.filterwarnings('ignore')

import os

path = os.getcwd()
os.chdir(os.path.dirname(path))

from classes import Problems

instance = Problems.Problems(verbose=True)

instance.get_draw() 

print(instance.G == instance.get_graph())
print(instance.get_graph())

print(instance.G.nodes == instance.get_nodes())
print(instance.get_nodes())

print(instance.G.edges == instance.get_edges())
print(instance.get_edges())

print(instance.G.number_of_nodes() == instance.get_number_of_nodes())
print(instance.get_number_of_nodes())

print(instance.G.number_of_edges() == instance.get_number_of_edges())
print(instance.get_number_of_edges())

import networkx 

print((networkx.to_numpy_array(instance.G) == instance.get_adjacency_matrix()).all())
print(instance.get_adjacency_matrix())

print(instance.get_adjacency_spectrum())

print(instance.get_laplacian())

print(instance.get_laplacian_spectrum())

print(instance.get_adjacency_dict())

from classes import Qaoa

p = 1
G = instance
qaoa = Qaoa.Qaoa(p, G)

gamma = 0
cost = qaoa.cost_operator(gamma)
print(cost)

beta = 0
mixer = qaoa.x_mixer_operator(beta)
print(mixer)

beta = 0
mixer = qaoa.xx_mixer_operator(beta)
print(mixer)

beta = 0
mixer = qaoa.y_mixer_operator(beta)
print(mixer)

beta = 0
mixer = qaoa.yy_mixer_operator(beta)
print(mixer)

phi = 0
psi = 2
mixer = qaoa.xy_mixer_operator(phi, psi)
print(mixer)

circuit = qaoa.get_circuit()
print(circuit)