Skip to content

Generic constructor fails for Signature "-+" #2

@karlwessel

Description

@karlwessel

The geometric product works like expected for the commonly used algebra with signature "-+++":

julia> using Grassmann

julia> basis"-+++"
(⟨-+++⟩, v, v₁, v₂, v₃, v₄, v₁₂, v₁₃, v₁₄, v₂₃, v₂₄, v₃₄, v₁₂₃, v₁₂₄, v₁₃₄, v₂₃₄, v₁₂₃₄)

julia> v1*v1
-1v

However, it does not work for algebras with more uncommon signatures like "-+" or "-++":

julia> basis"-+"
(⟨-,+⟩, v, v₁, v₂, v₁₂)

julia> v1*v1
ERROR: MethodError: no method matching abs(::Symbol)
Closest candidates are:
  abs(::Bool) at bool.jl:91
  abs(::Float16) at float.jl:520
  abs(::Float32) at float.jl:521
  ...
Stacktrace:
 [1] parityinner(::UInt64, ::UInt64, ::DiagonalForm{2,0,1,0}) at .julia/packages/Grassmann/H9Zog/src/parity.jl:96
 [2] *(::Basis{⟨-,+⟩,1,0x0000000000000001}, ::Basis{⟨-,+⟩,1,0x0000000000000001}) at .julia/packages/Grassmann/H9Zog/src/algebra.jl:150
 [3] top-level scope at none:0

julia> basis"-++"
(⟨-,++⟩, v, v₁, v₂, v₁₂)

julia> v1*v1
ERROR: MethodError: no method matching abs(::Symbol)
Closest candidates are:
  abs(::Bool) at bool.jl:91
  abs(::Float16) at float.jl:520
  abs(::Float32) at float.jl:521
  ...
Stacktrace:
 [1] parityinner(::UInt64, ::UInt64, ::DiagonalForm{2,0,2,0}) at .julia/packages/Grassmann/H9Zog/src/parity.jl:96
 [2] *(::Basis{⟨-,++⟩,1,0x0000000000000001}, ::Basis{⟨-,++⟩,1,0x0000000000000001}) at .julia/packages/Grassmann/H9Zog/src/algebra.jl:150
 [3] top-level scope at none:0

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions