% huckel matrix for biphenylene

beta_mat=zeros(12,12);

% just determine beta_mat_{ij} with j>i, 
% then we'll use symmetry to get the res
beta_mat(1,2)=1;beta_mat(1,6)=1;beta_mat(1,12)=1;
beta_mat(2,3)=1;
beta_mat(3,4)=1;
beta_mat(4,5)=1;
beta_mat(5,6)=1;
beta_mat(6,7)=1;
beta_mat(7,8)=1;beta_mat(7,12)=1;
beta_mat(8,9)=1;beta_mat(9,10)=1;
beta_mat(10,11)=1;
beta_mat(11,12)=1;

beta_mat=beta_mat+triu(beta_mat,1)'

[evec eval]=eig(beta_mat);

eval=diag(eval) % eigenvalues

sum(2*eval(7:12)) % total pi electron energy (16.05 beta)  % note ordering we want lowest to have no nodes

% for reference:  benzene 
beta_mat=zeros(6,6);
for i=1:5;beta_mat(i,i+1)=1;end
beta_mat(1,6)=1;
beta_mat=beta_mat+triu(beta_mat,1)';

[evecb evalb]=eig(beta_mat);
evalb=diag(evalb)
sum(2*evalb(4:6))*2   % -16  very close

% bond orders

bo_12=2*sum(evec(1,7:12).*evec(2,7:12))
bo_23=2*sum(evec(2,7:12).*evec(3,7:12))
bo_34=2*sum(evec(4,7:12).*evec(3,7:12))  
bo_16=2*sum(evec(1,7:12).*evec(6,7:12))
bo_67=2*sum(evec(7,7:12).*evec(6,7:12))

% benzene
bo=2*sum(evecb(1,4:6).*evecb(2,4:6))