# need to make figure which shows curved path to build CX and SWAP
# ideally on the same weyl chamber plot

from slam.utils.pd_playground import ParallelDrivenGateWidget, ImprovedCX, ImprovedSWAP
import numpy as np
from slam.utils.visualize import coordinate_2dlist_weyl
from weylchamber import c1c2c3

cx = ImprovedCX()
fig = coordinate_2dlist_weyl(*cx.coordinate_list, c="cyan", no_bar=1);

%matplotlib widget

cx = ImprovedCX()
swap = ImprovedSWAP()

# unoptimized together
fig = coordinate_2dlist_weyl(*cx.baseline_coords, c="cyan", no_bar=1);
# fig = coordinate_2dlist_weyl(*swap.baseline_coords, c='magenta', no_bar=1, fig=fig);

from slam.utils.visualize import fpath_images

# save fig as pdf
cx.fig.savefig(f"{fpath_images}/optimimzed_cx.pdf")