mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-12-25 02:05:30 +01:00
fix and test issymplectic
This commit is contained in:
parent
6774d40d11
commit
53773efac7
@ -58,14 +58,13 @@ function _std_symplectic_form(m::AbstractMatrix)
|
|||||||
iseven(r) || return false
|
iseven(r) || return false
|
||||||
|
|
||||||
n = r÷2
|
n = r÷2
|
||||||
Ω = zero(m)
|
𝕆 = zeros(eltype(m), n, n)
|
||||||
for i in 1:n
|
𝕀 = one(eltype(m))*LinearAlgebra.I
|
||||||
Ω[2i-1:2i, 2i-1:2i] .= [0 -1; 1 0]
|
Ω = [𝕆 -𝕀
|
||||||
end
|
𝕀 𝕆]
|
||||||
return Ω
|
return Ω
|
||||||
end
|
end
|
||||||
|
|
||||||
function issymplectic(mat::M, Ω = _std_symplectic_form(mat)) where M <: AbstractMatrix
|
function issymplectic(mat::M, Ω = _std_symplectic_form(mat)) where M <: AbstractMatrix
|
||||||
r, c = size(mat)
|
|
||||||
return Ω == transpose(mat) * Ω * mat
|
return Ω == transpose(mat) * Ω * mat
|
||||||
end
|
end
|
||||||
|
@ -71,5 +71,9 @@ using Groups.MatrixGroups
|
|||||||
@test sprint(print, x) isa String
|
@test sprint(print, x) isa String
|
||||||
|
|
||||||
@test length(word(x)) == 1
|
@test length(word(x)) == 1
|
||||||
|
|
||||||
|
for g in gens(Sp6)
|
||||||
|
@test MatrixGroups.issymplectic(MatrixGroups.matrix_repr(g))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user