Giter Club home page Giter Club logo

Comments (4)

chakravala avatar chakravala commented on May 18, 2024

Currently, the implementation of inv is only for single Basis and SValue elements. It can be extended to MBlade elements but not for mixed-grade MultiVector elements, I believe.

from grassmann.jl.

chakravala avatar chakravala commented on May 18, 2024

A naive implementation would be the following formula

julia> using Grassmann; basis"3"
(⟨+++⟩, v, v₁, v₂, v₃, v₁₂, v₁₃, v₂₃, v₁₂₃)

julia> Base.inv(a::TensorAlgebra) = (A=~a; A/(Aa))

julia> inv(v1+v2)
0.0 + 0.5v₁ + 0.5v₂

However, a more optimized method could also be defined, similar to the other operations.

from grassmann.jl.

chakravala avatar chakravala commented on May 18, 2024

The MBlade should now be invertible with the inv method on master branch, which will be on v0.1.4

from grassmann.jl.

chakravala avatar chakravala commented on May 18, 2024

The inv method has now been fully generalized to arbitrary MultiVector elements, provided that the it is defined for the given input value.

julia> 1/(0v+2v1)
0.0 + 0.5v₁

julia> @btime inv(0v+2v1)
  5.677 μs (80 allocations: 4.81 KiB)
0.0 + 0.5v₁

julia> @btime inv(2v1)
  62.522 ns (4 allocations: 64 bytes)
0.5v₁

julia> @btime inv(0v2+2v1)
  136.415 ns (6 allocations: 128 bytes)
0.5v₁ + 0.0v₂ + 0.0v₃

However, it is much slower for an arbitrary MultiVector input at the moment, due to type instability.

This may be improved in the future with the MultiGrade type, when it is further implemented.

from grassmann.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.