Skip to content

Commit 8b2b26e

Browse files
committed
Update circular.jl
1 parent af954d3 commit 8b2b26e

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

notebooks/circular.jl

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ function circular2(n)
6767
U = qr(A).Q .* cis.(2π*rand(n))
6868
end
6969

70+
# ╔═╡ 148317c1-e48f-4d39-833c-b51d2c43e5fd
71+
function circular1(n)
72+
A = randn(n,n) .+ im * randn(n,n)
73+
U = qr(A).Q * transpose( Matrix(qr(A).Q ))
74+
end
75+
7076
# ╔═╡ e14122da-9861-401c-bb56-3693b25e6e15
7177
circular2(5)
7278

@@ -83,8 +89,20 @@ let
8389

8490
end
8591

86-
# ╔═╡ 77bd8022-bb83-4e7d-adb6-f49c6bb74134
87-
sqrt(.36)
92+
# ╔═╡ 63bf73bf-b312-49cc-a909-c043bfc80fd1
93+
circular1(5)
94+
95+
# ╔═╡ 82ce98e9-37a9-4023-ac62-5c092a8fa932
96+
let
97+
n = 5
98+
t = 50_000
99+
m = [ smallabs(circular1(n)) for i=1:t]
100+
display((mean(m),var(m)))
101+
stephist(m,normalize=true,label="dense")
102+
mh = [ smallabs(circular(n,1)) for i=1:t]
103+
display((mean(mh),var(mh)))
104+
stephist!(mh,normalize=true,label="Hessenberg")
105+
end
88106

89107
# ╔═╡ 00000000-0000-0000-0000-000000000001
90108
PLUTO_PROJECT_TOML_CONTENTS = """
@@ -1236,8 +1254,10 @@ version = "1.4.1+1"
12361254
# ╠═63cd9672-d3d2-4b2a-8076-f98b60dc11e6
12371255
# ╠═02db4122-8e3c-477c-b1ef-d9c236787910
12381256
# ╠═14b4a088-ff74-43f3-b301-4057593c0447
1257+
# ╠═148317c1-e48f-4d39-833c-b51d2c43e5fd
12391258
# ╠═e14122da-9861-401c-bb56-3693b25e6e15
12401259
# ╠═5cd13d1b-9bb4-4a19-9e6a-07e214572639
1241-
# ╠═77bd8022-bb83-4e7d-adb6-f49c6bb74134
1260+
# ╠═63bf73bf-b312-49cc-a909-c043bfc80fd1
1261+
# ╠═82ce98e9-37a9-4023-ac62-5c092a8fa932
12421262
# ╟─00000000-0000-0000-0000-000000000001
12431263
# ╟─00000000-0000-0000-0000-000000000002

0 commit comments

Comments
 (0)