Skip to content

Commit

Permalink
Prefer is_hermitian, is_symmetric (#1207)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Sep 13, 2023
1 parent 727918f commit 6eea5a1
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/src/quad_forms/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ In all the other cases, we say that $V$ is *indefinite*.
```@docs
is_regular(::AbstractSpace)
is_quadratic(::AbstractSpace)
ishermitian(::AbstractSpace)
is_hermitian(::AbstractSpace)
is_positive_definite(::AbstractSpace)
is_negative_definite(::AbstractSpace)
is_definite(::AbstractSpace)
Expand All @@ -102,7 +102,7 @@ E, b = number_field(t^2-a*t+1, "b");
Q = quadratic_space(K, K[0 1; 1 0]);
H = hermitian_space(E, 3);
is_regular(Q), is_regular(H)
is_quadratic(Q), ishermitian(H)
is_quadratic(Q), is_hermitian(H)
is_definite(Q), is_positive_definite(H)
```
---
Expand Down
2 changes: 1 addition & 1 deletion src/QuadForm/Herm/Spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ end

is_quadratic(V::HermSpace) = false

ishermitian(V::HermSpace) = true
is_hermitian(V::HermSpace) = true

_base_algebra(V::HermSpace) = V.E

Expand Down
2 changes: 1 addition & 1 deletion src/QuadForm/Quad/Spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ end

is_quadratic(V::QuadSpace) = true

ishermitian(V::QuadSpace) = false
is_hermitian(V::QuadSpace) = false

_base_algebra(V::QuadSpace) = V.K

Expand Down
12 changes: 6 additions & 6 deletions src/QuadForm/Spaces.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export ambient_space, rank, gram_matrix, inner_product, involution, ishermitian, is_quadratic, is_regular,
export ambient_space, rank, gram_matrix, inner_product, involution, is_hermitian, is_quadratic, is_regular,
is_local_square, is_isometric, is_rationally_isometric, is_isotropic, is_isotropic_with_vector, quadratic_space,
hermitian_space, diagonal, invariants, hasse_invariant, witt_invariant, orthogonal_basis, fixed_field,
restrict_scalars, orthogonal_complement, orthogonal_projection
Expand Down Expand Up @@ -173,7 +173,7 @@ is_quadratic(::AbstractSpace)
Return whether the space `V` is hermitian.
"""
ishermitian(::AbstractSpace)
is_hermitian(::AbstractSpace)

################################################################################
#
Expand Down Expand Up @@ -439,7 +439,7 @@ is_isometric(L::AbstractSpace, M::AbstractSpace)
function _isdefinite(V::AbstractSpace)
E = base_ring(V)
K = fixed_field(V)
if (!is_totally_real(K)) || (ishermitian(V) && !is_totally_complex(E))
if (!is_totally_real(K)) || (is_hermitian(V) && !is_totally_complex(E))
return zero(K)
end
D = diagonal(V)
Expand Down Expand Up @@ -467,7 +467,7 @@ Return whether the space `V` is positive definite.
function is_positive_definite(V::AbstractSpace)
E = base_ring(V)
K = fixed_field(V)
if (!is_totally_real(K)) || (ishermitian(V) && !is_totally_complex(E))
if (!is_totally_real(K)) || (is_hermitian(V) && !is_totally_complex(E))
return false
end
D = diagonal(V)
Expand All @@ -487,7 +487,7 @@ Return whether the space `V` is negative definite.
function is_negative_definite(V::AbstractSpace)
E = base_ring(V)
K = fixed_field(V)
if (!is_totally_real(K)) || (ishermitian(V) && !is_totally_complex(E))
if (!is_totally_real(K)) || (is_hermitian(V) && !is_totally_complex(E))
return false
end
D = diagonal(V)
Expand Down Expand Up @@ -679,7 +679,7 @@ end
function _biproduct(x::Vector{T}) where T <: AbstractSpace
K = base_ring(x[1])
@req all(i -> base_ring(x[i]) === K, 2:length(x)) "All spaces must be defined over the same field"
@req is_quadratic(x[1]) ? all(i -> is_quadratic(x[i]), 2:length(x)) : all(i -> ishermitian(x[i]), 1:length(x)) "Spaces must be all hermitian or all quadratic"
@req is_quadratic(x[1]) ? all(i -> is_quadratic(x[i]), 2:length(x)) : all(i -> is_hermitian(x[i]), 1:length(x)) "Spaces must be all hermitian or all quadratic"
G = diagonal_matrix(gram_matrix.(x))
V = is_quadratic(x[1]) ? quadratic_space(K, G) : hermitian_space(K, G)
n = sum(dim.(x))
Expand Down
2 changes: 1 addition & 1 deletion src/QuadForm/indefiniteLLL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ julia> lll_gram_indef_with_transform(G)
"""
function lll_gram_indef_with_transform(G::MatElem{ZZRingElem}; check::Bool = false)

@req !check || (issymmetric(G) && det(G) != 0 && _is_indefinite(change_base_ring(QQ,G))) "Input should be a non-degenerate indefinite Gram matrix."
@req !check || (is_symmetric(G) && det(G) != 0 && _is_indefinite(change_base_ring(QQ,G))) "Input should be a non-degenerate indefinite Gram matrix."

red = lll_gram_indef_isotropic(G; base = true)

Expand Down
2 changes: 1 addition & 1 deletion test/QuadForm/Herm/Spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
V = @inferred hermitian_space(E, FlintQQ[1 2; 2 1])
@test V === hermitian_space(E, FlintQQ[1 2; 2 1])
@test V !== hermitian_space(E, FlintQQ[1 2; 2 1], cached = false)
@test ishermitian(V)
@test is_hermitian(V)
@test !is_definite(V)
@test involution(V) == s
@test det(V) == -discriminant(V)
Expand Down
2 changes: 1 addition & 1 deletion test/QuadForm/Quad/Spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
@test (@inferred dim(V)) == 2
@test (@inferred rank(V)) == 0
@test @inferred is_quadratic(V)
@test @inferred !ishermitian(V)
@test @inferred !is_hermitian(V)
@test (@inferred fixed_field(V)) === K

@test_throws ArgumentError quadratic_space(K, zero_matrix(K, 1, 2))
Expand Down

0 comments on commit 6eea5a1

Please sign in to comment.