@@ -4,35 +4,19 @@ using Test
44using LinearAlgebra
55
66# TODO move to MP
7- @testset " Noncommutative quadratic" begin
8- @ncpolyvar x[1 : 2 ]
9- Q = Hermitian ([1 2 + 3im ; 2 - 3im 4 ])
10- p = 1 x[1 ]^ 2 + (2 + 3im ) * x[1 ] * x[2 ] + (2 - 3im ) * x[2 ] * x[1 ] + 4 x[2 ]^ 2
11- @test polynomial (Q, x) == p
12- @test polynomial (Q, monovec (x)) == p
13- end
14-
15- @testset " Issue #71" begin
16- @ncpolyvar x y
17- @test x^ 0 * y == y * x^ 0
7+ @testset " Issue #70" begin
8+ @ncpolyvar y0 y1 x0 x1
9+ p = x1 * x0 * x1
10+ @test subs (p, x0 => y0, x1 => y1) == y1 * y0 * y1
11+ @test subs (p, x0 => 1 ) == x1^ 2
12+ @test p (x0 => y0, x1 => y1) == y1 * y0 * y1
1813end
1914
2015include (" mono.jl" )
2116include (" poly.jl" )
2217include (" comp.jl" )
2318include (" mutable_arithmetics.jl" )
2419
25- # TODO move to MultivariatePolynomials.jl
26- @testset " Subs with no variables" begin
27- @polyvar x
28- t = convert (termtype (x, Int), 3 )
29- @test t == @inferred subs (t, x => x + 1 )
30- @test t == @inferred subs (t, x => x + 1.0 )
31- @test t == @inferred subs (t, x => 1 x)
32- @test t == @inferred subs (t, x => 1.0 x)
33- @test t == @inferred subs (t, x => 1.0 )
34- end
35-
3620module newmodule
3721 using Test
3822 import DynamicPolynomials
0 commit comments