@@ -582,13 +582,21 @@ end
582582
583583# bug identified in PR #52318: dot products of quaternionic Hermitian matrices,
584584# or any number type where conj(a)*conj(b) ≠ conj(a*b):
585- @testset " dot Hermitian quaternion #52318 " begin
586- A, B = [Quaternion . (randn (3 , 3 ), randn ( 3 , 3 ), randn ( 3 , 3 ), randn ( 3 , 3 )) |> t -> t + t' for i in 1 : 2 ]
585+ @testset " dot Hermitian quaternion" begin
586+ A, B = [(randn (Quaternion{Float64}, 4 , 4 )) |> t -> t + t' for i in 1 : 2 ]
587587 @test A == Hermitian (A) && B == Hermitian (B)
588588 @test dot (A, B) ≈ dot (Hermitian (A), Hermitian (B))
589- A, B = [Quaternion . (randn (3 , 3 ), randn ( 3 , 3 ), randn ( 3 , 3 ), randn ( 3 , 3 )) |> t -> t + transpose (t) for i in 1 : 2 ]
589+ A, B = [(randn (Quaternion{Float64}, 4 , 4 )) |> t -> t + transpose (t) for i in 1 : 2 ]
590590 @test A == Symmetric (A) && B == Symmetric (B)
591591 @test dot (A, B) ≈ dot (Symmetric (A), Symmetric (B))
592+ A = randn (Quaternion{Float64}, 4 , 4 )
593+ x = randn (Quaternion{Float64}, 4 )
594+ y = randn (Quaternion{Float64}, 4 )
595+ for t in (Symmetric, Hermitian), uplo in (:U , :L )
596+ M = t (A, uplo)
597+ N = Matrix (M)
598+ @test dot (x, M, y) ≈ dot (x, M* y) ≈ dot (x, N, y)
599+ end
592600end
593601
594602# let's make sure the analogous bug will not show up with kronecker products
610618 end
611619end
612620
621+ @testset " 3-arg dot with Symmetric/Hermitian matrix of matrices" begin
622+ for m in (Symmetric ([randn (ComplexF64, 2 , 2 ) for i in 1 : 2 , j in 1 : 2 ]),
623+ Symmetric ([randn (ComplexF64, 2 , 2 ) for i in 1 : 2 , j in 1 : 2 ], :L ),
624+ Hermitian ([randn (ComplexF64, 2 , 2 ) for i in 1 : 2 , j in 1 : 2 ]),
625+ Hermitian ([randn (ComplexF64, 2 , 2 ) for i in 1 : 2 , j in 1 : 2 ], :L )
626+ )
627+ x = [randn (ComplexF64, 2 ) for i in 1 : 2 ]
628+ y = [randn (ComplexF64, 2 ) for i in 1 : 2 ]
629+ @test dot (x, m, y) ≈ dot (x, m* y) ≈ dot (x, Matrix (m), y)
630+ end
631+ end
632+
613633# Issue #7647: test xsyevr, xheevr, xstevr drivers.
614634@testset " Eigenvalues in interval for $(typeof (Mi7647)) " for Mi7647 in
615635 (Symmetric (diagm (0 => 1.0 : 3.0 )),
0 commit comments