function S = createsite (maxA,maxB,j)

%
% Creates one site
%

global UA UB UAB POTA POTB;

XA = 1:maxA;
XB = 1:maxB;
IA = speye(maxA+1);
IB = speye(maxB+1);
I = speye((maxA+1)*(maxB+1));

CA = sparse (kron (diag(sqrt(XA),-1),IB));
CB = sparse (kron (IA,diag(sqrt(XB),-1)));
NA = CA*CA';
NB = CB*CB';
H = 1/2*UA*NA*(NA-I) + 1/2*UB*NB*(NB-I) + UAB*NA*NB + POTA(j)*NA + POTB(j)*NB;

S.m = (maxA+1)*(maxB+1);
S.NTOTA = uint16(full(diag(NA,0)));
S.NTOTB = uint16(full(diag(NB,0)));
S.CA = CA;
S.CB = CB;
S.NA = NA;
S.NB = NB;
S.H = H;
