Open ajahraus opened 2 years ago
No, you are mistaken. That is not a grade
selection syntax. The grade
selection syntax is handled with the grade
function:
julia> grade(v1+v2,0)
𝟎
julia> grade(v1+v2,Val(0))
𝟎
The scalar
part of an element is obtained with the scalar
function:
julia> scalar(v1+v2)
𝟎
Note that you may have to use Grassmann v0.8 or later to reproduce these exact results.
That still doesn't work for me, I get a method error
MethodError: no method matching grade(::Grassmann.MultiVector{⟨1,1,1⟩, Int64, 8})
I'm importing using Grassmann, LinearAlgebra, AbstractTensors, Leibniz
Also, your documentation reads:
Taking a projection into a specific grade of a MultiVector is usually written $\langle A\rangle_n$ and can be done using the soft brackets, like so
julia> A(0) 1v
julia> A(1) 2v₁ + 0v₂ + 0v₃
julia> A(2) 3v₁₂ + 0v₁₃ + 0v₂₃
Which is the only example of selecting elements of a grade I can find, and it fails if the type happens to be a Chain
rather than a MultiVector
That still doesn't work for me, I get a method error MethodError: no method matching grade(::Grassmann.MultiVector{⟨1,1,1⟩, Int64, 8})
Are you using Grassmann
v0.8? That's the only currently supported version of Grassmann
older versions are not supported.
Also, your documentation reads: ... and can be done using the soft brackets, like so
No, converting \langle
and \rangle
sandwhich into a parenthesis prefix argument form is grammatically not implied anywhere.
I see, this is why I don't want to document any features that are works in progress. This package is not v1.0 yet, and is basically my scratch pad which is ever evolving. The syntax for grade selection is not yet firmly settled on a standard and is in flux.
When getting the elements of a
MultiVector
, you can use parentheses to select the grade, i.e.However, if the type if a
Chain
, then the parentheses act as an indexing operation, and only into the elements that are non-zero in theChain
. Attempting to access the scalar part of aChain
via `(0) returns an index error.There is a work-around for this, it is to wrap the
Chain
in aMultiVector
, but aMultiVector
is (depending on the basis) many times the size of aChain
. It seems to me that this behaviour ofChain
is useful for the internal implementation, but at the user level, the difference between aChain
and aMultiVector
should be abstracted away.