% Tetrahedron graph
C = [0 1 1 1;
    1 0 1 1;
    1 1 0 1;
    1 1 1 0];

% x and y coordinates of vertices
xx = [0 2 1/sqrt(3) 1/sqrt(3) -1 3];
yy = [0 0 1        exp(1) -1 3];

% Define the graph
gr = QuantumGraph(C, xx, yy);

% Draw the graph
gr.draw();

%% Get spectrum

spec = gr.get_spec(0.001, 10000, 1e-7);

%% Plot the eigenvalue spacing distribution

histogram( diff(spec) * sum(gr.Ls) / (2*pi), 30, 'Normalization', 'pdf' );

ws = @(s) pi*s/2 .* exp(-pi/4*s.^2);
hold on;
plot(linspace(0,3), ws(linspace(0,3)), 'k-');
