Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docstrings in 1.11 #27

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/api/math.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```@docs; canonical=false
Base.reverse(::BitIndex)
Base.adjoint(::BitIndex)
CliffordNumbers.grade_involution(::BitIndex)
Base.conj(::BitIndex)
CliffordNumbers.left_complement(::BitIndex)
Expand Down
16 changes: 11 additions & 5 deletions src/bitindex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,22 @@ pseudoscalar_index(x::AbstractCliffordNumber) = pseudoscalar_index(typeof(x))

#---Grade dependent sign inversion-----------------------------------------------------------------#
"""
adjoint(i::BitIndex) = reverse(i::BitIndex) = i' -> BitIndex
adjoint(x::AbstractCliffordNumber) = reverse(x::AbstractCliffordNumber) = x' -> typeof(x)
reverse(i::BitIndex) = i' -> BitIndex
reverse(x::AbstractCliffordNumber) = x' -> typeof(x)

Performs the reverse operation on the basis blade indexed by `b` or the Clifford number `x`. The
sign of the reverse depends on the grade of the basis blade `g`, and is positive for `g % 4 in 0:1`
and negative for `g % 4 in 2:3`.
"""
adjoint(i::BitIndex) = typeof(i)(xor(signbit(i), !iszero(grade(i) & 2)), UInt(i))
reverse(i::BitIndex) = adjoint(i)
@doc (@doc adjoint(::BitIndex)) reverse(::BitIndex)
reverse(i::BitIndex) = typeof(i)(xor(signbit(i), !iszero(grade(i) & 2)), UInt(i))

"""
adjoint(i::BitIndex) = i' -> BitIndex
adjoint(x::AbstractCliffordNumber) = x' -> typeof(x)

An alias for [`reverse(i::BitIndex)`](@ref) used to implement operator notation.
"""
adjoint(i::BitIndex) = reverse(i)

"""
grade_involution(i::BitIndex) -> BitIndex
Expand Down
26 changes: 22 additions & 4 deletions src/metrics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ const VGA2D = VGA(2)

"""
VGA3D (alias for VGA(3))
const APS = VGA3D

The algebra of physical space, a 3D VGA which is commonly used (explicitly and implicitly) to model
non-relativistic physics. It also serves as the subalgebra of both signature conventions of the
Expand All @@ -194,8 +193,15 @@ spacetime algebra (available as [`STAEast`](@ref) and [`STAWest`](@ref)).
The even subalgebra of this algebra is isomorphic to ℍ, the quaternions.
"""
const VGA3D = VGA(3)

"""
CliffordNumbers.Metrics.APS

An alias for `VGA(3)` or [`VGA3D`](@ref), referring to the algebra of physical space.

In the future, this may refer to a different object from the values it currently aliases.
"""
const APS = VGA3D
@doc (@doc VGA3D) APS

"""
PGA <: Metrics.AbstractSignature
Expand Down Expand Up @@ -328,7 +334,6 @@ const STAEast = LGAEast(3)

"""
STAWest (alias for LGAWest(3))
const STA = STAWest

The spacetime algebra using the West Coast sign convention (spatial dimensions square negative,
temporal dimensions square positive), with the temporal dimension at index 0.
Expand All @@ -338,6 +343,13 @@ This convention is the default STA convention in this package, since the signatu
[the 2D conformal geometric algebra](@ref CGA2D).
"""
const STAWest = LGAWest(3)

"""
STA

An alias for [`STAWest`](@ref), referring to the spacetime algebra with the West Coast (mostly
negative) signature convention.
"""
const STA = STAWest
@doc (@doc STAWest) STA

Expand Down Expand Up @@ -389,8 +401,14 @@ As with `STA`, the default convention for `STAP` is the West Coast metric. For a
see [`STA`](@ref).
"""
const STAPWest = Signature(5, 0b11100, 0b00001, -1)

"""
STAP

An alias for [`STAPWest`](@ref), referring to the projective spacetime algebra with the West Coast
(mostly negative) signature convention.
"""
const STAP = STAPWest
@doc (@doc STAPWest) STAP

export dimension, blade_count, grades, is_degenerate, is_positive_definite
export Signature, VGA, PGA, CGA, LGA, LGAEast, LGAWest, Exterior
Expand Down
Loading