Skip to content

Commit 982e1d5

Browse files
authored
tests for 3-operator products involving conversion (#263)
1 parent 811d5df commit 982e1d5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/UltrasphericalTest.jl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,35 @@ include("testutils.jl")
118118
@test CC isa Operator{ComplexF64}
119119
@test CC[1:4, 1:4] C[1:4, 1:4]
120120
end
121+
122+
@testset "three-term product" begin
123+
C1 = Conversion(Chebyshev(), Ultraspherical(1))
124+
C2 = Conversion(Ultraspherical(1), Ultraspherical(2))
125+
C = C2 * 2 * C1
126+
f = Fun(x->3x^4, Chebyshev())
127+
@test space(C * f) == Ultraspherical(2)
128+
@test C * f 2f
129+
130+
C1 = Conversion(Chebyshev(), Ultraspherical(1))
131+
C2 = Conversion(Ultraspherical(1), Ultraspherical(2))
132+
C = C2 * Operator(2I, Ultraspherical(1)) * C1
133+
f = Fun(x->3x^4, Chebyshev())
134+
@test space(C * f) == Ultraspherical(2)
135+
@test C * f 2f
136+
137+
M = Multiplication(Fun(), Ultraspherical(1))
138+
C = C2 * M * C1
139+
@test space(C * f) == Ultraspherical(2)
140+
@test C * f Fun() * f
141+
142+
C = C2 * (M * C1)
143+
@test space(C * f) == Ultraspherical(2)
144+
@test C * f Fun() * f
145+
146+
C = (C2 * M) * C1
147+
@test space(C * f) == Ultraspherical(2)
148+
@test C * f Fun() * f
149+
end
121150
end
122151

123152
@testset "Normalized space" begin

0 commit comments

Comments
 (0)