Skip to content

Commit

Permalink
Added CliffordScalar, CliffordVector, and CliffordBivector aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
brainandforce committed Jun 11, 2024
1 parent 1002d9d commit eef936a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Added
- Definition of `signature(::BitIndex{Q})`.
- Unexported aliases `CliffordNumbers.CliffordScalar{Q,T} === KVector{0,Q,T,1}`,
`CliffordNumbers.CliffordVector{Q,T,L} === KVector{1,Q,T,L}`, and
`CliffordNumbers.CliffordBivector{Q,T,L} === KVector{2,Q,T,L}`.

### Changed
- Split up `src/math.jl` to separate files in `src/math/`.
Expand Down
28 changes: 28 additions & 0 deletions src/kvector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,34 @@ complement_type(::Type{KVector{K,Q}}) where {K,Q} = KVector{dimension(Q)-K,Q}

short_typename(::Type{<:KVector{K,Q,T}}) where {K,Q,T} = KVector{K,Q,T}

#---Aliases for special KVector types--------------------------------------------------------------#
"""
CliffordScalar{Q,T} (alias for KVector{0,Q,T,1})
Represents a scalar of the Clifford algebra described by `Q`.
"""
const CliffordScalar{Q,T} = KVector{0,Q,T,1}

"""
CliffordVector{Q,T,L} (alias for KVector{1,Q,T,L})
Represents a 1-vector (or equivalently, a 1-blade) of the Clifford algebra described by `Q`. `L` is
constrained to be equal to `dimension(Q)`.
"""
const CliffordVector{Q,T,L} = KVector{1,Q,T,L}

"""
CliffordBivector{Q,T,L} (alias for KVector{2,Q,T,L})
Represents a bivector of the Clifford algebra described by `Q`. `L` is constrained to be equal to
`binomial(dimension(Q), 2)`.
Note that when `dimension(Q) > 3`, bivectors are *not* always 2-blades, meaning that they cannot
always be described as the wedge product of two 1-blades. An example is
`CliffordBivector{VGA(4)}(1, 0, 0, 0, 0, 1)`.
"""
const CliffordBivector{Q,T,L} = KVector{2,Q,T,L}

#---Special Z2CliffordNumber constructor-----------------------------------------------------------#

# Automatically infer if we want an even or odd Clifford number
Expand Down

0 comments on commit eef936a

Please sign in to comment.