Skip to content

Commit

Permalink
improved some algebra dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed May 2, 2021
1 parent 6fbe29b commit bdbc054
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/composite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export exph, log_fast, logh_fast
@inline Base.expm1(t::SubManifold{V,0}) where V = Simplex{V}(ℯ-1)
@inline Base.expm1(t::T) where T<:TensorGraded{V,0} where V = Simplex{Manifold(t)}(AbstractTensors.expm1(value(T<:TensorTerm ? t : scalar(t))))

Base.expm1(t::Chain) = expm1(MultiVector(t))
function Base.expm1(t::T) where T<:TensorAlgebra
V = Manifold(t)
S,term,f = t,(t^2)/2,norm(t)
Expand Down
6 changes: 3 additions & 3 deletions src/products.jl
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ for side ∈ (:left,:right)
out = zeros(svec(N,G,Any))
D = diffvars(V)
for k 1:binomial(N,G)
val = :(b.v[$k])
val = :(conj(b.v[$k]))
@inbounds p = $p(V,ib[k])
v = $(ch ? :($pnp(V,ib[k],val)) : :val)
v = typeof(V)<:Signature ? (p ? :($SUB($v)) : v) : Expr(:call,MUL,p,v)
Expand All @@ -559,7 +559,7 @@ for side ∈ (:left,:right)
if val0
@inbounds p = $$p(V,ib[k])
v = $(ch ? :($$pn(V,ib[k],val)) : :val)
v = typeof(V)<:Signature ? (p ? $SUB(v) : v) : $MUL(p,v)
v = conj(typeof(V)<:Signature ? (p ? $SUB(v) : v) : $MUL(p,v))
@inbounds setblade!(out,v,complement(N,ib[k],D,P),Val{N}())
end
end
Expand Down Expand Up @@ -595,7 +595,7 @@ for side ∈ (:left,:right)
@inbounds val = m.v[bs[g]+i]
if val0
v = $(ch ? :($$pn(V,ib[i],val)) : :val)
v = typeof(V)<:Signature ? ($$p(V,ib[i]) ? $SUB(v) : v) : $$p(V,ib[i])*v
v = conj(typeof(V)<:Signature ? ($$p(V,ib[i]) ? $SUB(v) : v) : $$p(V,ib[i])*v)
@inbounds setmulti!(out,v,complement(N,ib[i],D,P),Val{N}())
end
end
Expand Down

2 comments on commit bdbc054

@chakravala
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/35844

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.4 -m "<description of version>" bdbc054e783bd0dfec9beb055d9135e254f784ca
git push origin v0.7.4

Please sign in to comment.