Comments (4)
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.
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/(A⋅a))
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.
The MBlade
should now be invertible with the inv
method on master
branch, which will be on v0.1.4
from grassmann.jl.
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)
- Question: Extracting floating point values from coefficients HOT 2
- grade selection syntax HOT 6
- Renaming functions / API redesign for v1.0 HOT 2
- (log ∘ exp) gives strange output HOT 8
- Weird output for G3 HOT 2
- 3D vector fields don't plot correctly HOT 3
- Errors with symbolic coefficients, mixed-grades multivectors / operators related ? (both Reduce and SymEngine) HOT 4
- streamplot example in README got inv(...) is undefined HOT 4
- Confusion about mixed grade contraction HOT 4
- Incorrect geometric square `(v12 + v34)^2`. HOT 1
- Error processing example in README (Makie upgrade) HOT 5
- Calculating a Perpendicular Vector in Basis 2 HOT 2
- gradient throws error HOT 7
- Grassmann.jl software design discussion now private
- Reversion operator (~) is not defined for Symbolic Coefficients when using Grassmann and Reduce HOT 1
- stackoverflow on broadcast HOT 3
- ERROR: LoadError: MethodError: no method matching parityrighthodge(::Int64, ::UInt64)
- Unknown symbol in 5D CGA Basis HOT 1
- Inner Product between vector and bivector HOT 4
- Geometric Product between Bivectors of 5D CGA HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grassmann.jl.