Skip to content

Commit 1246594

Browse files
committed
Update toeplitz.jl
1 parent 328dd9d commit 1246594

File tree

1 file changed

+52
-8
lines changed

1 file changed

+52
-8
lines changed

examples/toeplitz.jl

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
####
2+
# This file shows how the ∞-dimensional QL decomposition can be used
3+
# for spectral theory of Toeplitz operators. We investigate the
4+
# QL decomposition on each of the examples in Trefethen & Embree.
5+
#
6+
7+
18
using InfiniteLinearAlgebra, BandedMatrices, PyPlot
29

10+
###
11+
# Basic routines for plotting
12+
###
313

414
function ℓ11(A,λ; kwds...)
515
try
@@ -9,9 +19,11 @@ function ℓ11(A,λ; kwds...)
919
end
1020
end
1121

12-
function findsecond(λ)
13-
j = sortperm(λ)[end-1]
14-
λ[j], j
22+
function branch(k)
23+
function(λ)
24+
j = sortperm(λ)[end-k+1]
25+
λ[j], j
26+
end
1527
end
1628

1729
qlplot(A::AbstractMatrix; kwds...) = qlplot(BandedMatrix(A); kwds...)
@@ -39,7 +51,7 @@ end
3951
###
4052

4153
A = BandedMatrix(1 => Fill(2im,∞), 2 => Fill(-1,∞), 3 => Fill(2,∞), -2 => Fill(-4,∞), -3 => Fill(-2im,∞))
42-
clf();qlplot(A; x=range(-10,7; length=100), y=range(-7,8;length=100)); symbolplot(A; color=:black); title("Trefethen & Embree")
54+
clf(); qlplot(A; x=range(-10,7; length=100), y=range(-7,8;length=100)); symbolplot(A; color=:black); title("Trefethen & Embree")
4355
clf(); qlplot(transpose(A); x=range(-10,7; length=200), y=range(-7,8;length=200)); symbolplot(A; color=:black); title("Trefethen & Embree, transpose")
4456

4557
###
@@ -52,17 +64,49 @@ clf(); qlplot(A; branch=findsecond, x=range(-2,3; length=100), y=range(-2.5,2.5;
5264
clf(); qlplot(transpose(A); x=range(-2,3; length=100), y=range(-2.5,2.5;length=100)); symbolplot(A; color=:black); title("Limacon, transpose")
5365

5466

55-
ql(A-(0.5+0.000001im)*I; branch=findsecond)
56-
5767
###
5868
# bull-head
5969
###
6070

6171
A = BandedMatrix(-3 => Fill(7/10,∞), -2 => Fill(1,∞), 1 => Fill(2im,∞))
62-
clf();qlplot(A; x=range(-10,7; length=100), y=range(-7,8;length=100)); symbolplot(A; color=:black); title("Bull-head")
72+
clf(); qlplot(A; x=range(-10,7; length=100), y=range(-7,8;length=100)); symbolplot(A; color=:black); title("Bull-head")
6373
clf(); qlplot(transpose(A); x=range(-10,7; length=100), y=range(-7,8;length=100)); symbolplot(A; color=:black); title("Bull-head, transpose")
6474

65-
6675
###
6776
# Grcar
6877
###
78+
79+
A = BandedMatrix(-3 => Fill(1,∞), -2 => Fill(1,∞), -1 => Fill(1,∞), 0 => Fill(1,∞), 1 => Fill(-1,∞))
80+
clf(); qlplot(A; x=range(-4,5; length=100), y=range(-6,5;length=100)); symbolplot(A; color=:black); title("Grcar")
81+
clf(); qlplot(A; branch=branch(2), x=range(-4,5; length=100), y=range(-6,5;length=100)); symbolplot(A; color=:black); title("Grcar, branch 2")
82+
clf(); qlplot(A; branch=branch(3), x=range(-4,5; length=100), y=range(-6,5;length=100)); symbolplot(A; color=:black); title("Grcar, branch 3")
83+
clf(); qlplot(transpose(A); x=range(-4,5; length=100), y=range(-6,5;length=100)); symbolplot(A; color=:black); title("Grcar, transpose")
84+
85+
###
86+
# Triangle
87+
###
88+
89+
A = BandedMatrix(-2 => Fill(1/4,∞), 1 => Fill(1,∞))
90+
clf(); qlplot(A; x=range(-2,2; length=100), y=range(-2,2;length=100)); symbolplot(A; color=:black); title("Triangle")
91+
clf(); qlplot(transpose(A); x=range(-2,2; length=100), y=range(-2,2;length=100)); symbolplot(A; color=:black); title("Triangle, transpose")
92+
clf(); qlplot(transpose(A); branch=branch(2), x=range(-2,2; length=100), y=range(-2,2;length=100)); symbolplot(A; color=:black); title("Triangle, transpose, branch 2")
93+
94+
###
95+
# Whale
96+
###
97+
98+
A = BandedMatrix(-4 => Fill(im,∞), -3 => Fill(4,∞), -2 => Fill(3+im,∞), -1 => Fill(10,∞),
99+
1 => Fill(1,∞), 2 => Fill(im,∞), 3 => Fill(-(3+2im),∞), 4=>Fill(-1,∞))
100+
101+
clf(); qlplot(A; x=range(-15,20; length=100), y=range(-20,20;length=100)); symbolplot(A; color=:black); title("Whale")
102+
clf(); qlplot(transpose(A); x=range(-15,20; length=100), y=range(-20,20;length=100)); symbolplot(A; color=:black); title("Whale, transpose")
103+
104+
###
105+
# Butterfly
106+
###
107+
108+
A = BandedMatrix(-2 => Fill(1,∞), -1 => Fill(-im,∞), 1 => Fill(im,∞), 2 => Fill(-1,∞))
109+
clf(); qlplot(A; x=range(-3,3; length=100), y=range(-3,3;length=100)); symbolplot(A; color=:black); title("Butterfly")
110+
clf(); qlplot(A; branch=branch(2), x=range(-3,3; length=100), y=range(-3,3;length=100)); symbolplot(A; color=:black); title("Butterfly, branch 2")
111+
clf(); qlplot(transpose(A); x=range(-3,3; length=100), y=range(-3,3;length=100)); symbolplot(A; color=:black); title("Butterfly")
112+
clf(); qlplot(transpose(A); branch=branch(2), x=range(-3,3; length=100), y=range(-3,3;length=100)); symbolplot(A; color=:black); title("Butterfly")

0 commit comments

Comments
 (0)