This is a response to https://discourse.julialang.org/t/higher-dimensional-cross-product-in-linearalgebra/47919
akshu3398:
and some of the major packages still uses the same definition in LinearAlgebra library for their own cross products(may be they were thinking that someone might someday extend that definition).
There’s no problem with extending the LinearAlgebra.cross method in Grassmann because the cross product defined in Grassmann.jl only operators on AbstractTensors.TensorAlgebra types, so that it doesn’t interfere with LinearAlgebra or cause type piracy. It would in fact be type piracy to redefine the LinearAlgebra.cross for Vector types.
akshu3398:
cross([1,1,1,1], [2,2,2,2], [3,3,3,3]) .|> iszero |> all
You don’t need a cross product for this operation at all. The cross product is the complement of the exterior product, and all you need there is to take the exterior product to see if it is zero. The cross product would be unnecessary for your operation, since taking the complement is not needed.
Additionally, the cross product is defined as the complement of the exterior product of 2 vectors, which makes the cross product a pseudo-bivector! What you’re describing is a pseudo-trivector, which is no longer a generalized cross product at all, so the LinearAlgebra.cross name is incorrect.
akshu3398:
cross([1,1,0,2,4], [3,0,1,-5,3], [3,3,3,1,2], [-4,2,0,7,1]) == [-13.0, -221.0, 195.0, 51.0, 33.0] # true
Again, this is not a cross product at all, a cross product would be a pseudo-bivector, while you are calculating a pseudo-vector here.
Therefore, you seem to be misunderstanding some fundamentals here, LinearAlgebra.cross should produce a pseudo-bivector.
In 3dimensional space, there is a special case for the cross product that results in a vector, because the pseudo-bivector of 3dimensions is a vector. However, in higher dimensions, the pseudo-bivector is not a regular vector at all.
What you seem to be looking for is just a regular exterior product to check for linear independence.
Olof_Salberger:
attempt to avoid a situation where people have to worry about whether they are importing PackageA.(∧) or PackageB.(∧)
This issue has already been resolved by AbstractLattices.jl, which provides an undefined `∧` symbol for common use among packages.
Orbots:
what “those other operators” could be would require someone with knowledge of how tensors and geometric/clifford products are related.
Unfortunately, chakravala has been banned from discussing on discourse, he has a lot of ideas about how to integrate Grassmann exterior products into the Julia language for linear algebra purposes.
Indeed the exterior product is metric independent, so it would be easier to implement it in the base language than other geometric algebra operations. Nevertheless, to have any sort of performance efficiency you need something statically allocated, and just like StaticArrays is outside of the base language it naturally makes sense to have static allocated exterior products in external packages.
The main reason for not including things like this in the base language is because these type of packages are still changing at a much faster pace than the base language, so it wouldn’t make sense to only update it once every 6 months on the base language release cycle.
The fact that Julia Stewards censors open source collaboration is problematic, this is why somebody else will have to link my response to the discussion.
Please post a link to my response on the original discourse thread, to help akshu3398