#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jun  6 10:30:02 2026

@author: leonhardtm
"""

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from pathlib import Path
import matplotlib.colors as colors

J_nn=pd.read_csv(Path(__file__).resolve().parent.parent/"DATA"/"FIG11"/'Jij_nearest_neighbours.csv',header=None)
J_nn=J_nn.to_numpy()

J_opt=pd.read_csv(Path(__file__).resolve().parent.parent/"DATA"/"FIG11"/'Jij_optimized_coupling.csv',header=None)
J_opt=J_opt.to_numpy()

norm=colors.Normalize(vmin=np.min(J_nn), vmax=np.max(J_nn))

fig, axs = plt.subplots(1,2,figsize=(6,2.5))
plt.subplots_adjust(hspace=0.1,wspace=0.1)
axs[0].imshow(J_nn,norm=norm)
im=axs[1].imshow(J_opt,norm=norm)
fig.colorbar(im,ax=axs,fraction=0.08,aspect=10)

for ax in axs:
    ax.xaxis.tick_top()
    ax.xaxis.set_label_position("top")
    ax.set_xticks(np.arange(4))
    ax.set_yticks(np.arange(4))
    ax.set_xticklabels(np.arange(1, 5))
    ax.set_yticklabels(np.arange(1, 5))