Skip to content

Instantly share code, notes, and snippets.

@AidanRocke
Last active March 11, 2019 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AidanRocke/1c154b42a52902015a83603a5efb640e to your computer and use it in GitHub Desktop.
Save AidanRocke/1c154b42a52902015a83603a5efb640e to your computer and use it in GitHub Desktop.
using LinearAlgebra
using Random
function circuit_complexity(N)
radii = zeros(1,N);
for i=1:N
sum_of_radii = 0.0
## the input signal
X = rand(3,1)*2 .-1.0
W= rand(3,3)*sqrt(2/3)
## the main calculation
for j=1:100
sum_of_radii += norm(W^i*X-X)
end
radii[i] = sum_of_radii/100
end
return radii
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment