mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-12-24 18:05:27 +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
|
||||
|
||||
n = r÷2
|
||||
Ω = zero(m)
|
||||
for i in 1:n
|
||||
Ω[2i-1:2i, 2i-1:2i] .= [0 -1; 1 0]
|
||||
end
|
||||
𝕆 = zeros(eltype(m), n, n)
|
||||
𝕀 = one(eltype(m))*LinearAlgebra.I
|
||||
Ω = [𝕆 -𝕀
|
||||
𝕀 𝕆]
|
||||
return Ω
|
||||
end
|
||||
|
||||
function issymplectic(mat::M, Ω = _std_symplectic_form(mat)) where M <: AbstractMatrix
|
||||
r, c = size(mat)
|
||||
return Ω == transpose(mat) * Ω * mat
|
||||
end
|
||||
|
@ -71,5 +71,9 @@ using Groups.MatrixGroups
|
||||
@test sprint(print, x) isa String
|
||||
|
||||
@test length(word(x)) == 1
|
||||
|
||||
for g in gens(Sp6)
|
||||
@test MatrixGroups.issymplectic(MatrixGroups.matrix_repr(g))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user