Skip to content

Commit

Permalink
fixed bug in expm1 evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed Apr 13, 2024
1 parent d1d7d72 commit 0d4f3c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Project.toml
@@ -1,7 +1,7 @@
name = "Grassmann"
uuid = "4df31cd9-4c27-5bea-88d0-e6a7146666d8"
authors = ["Michael Reed"]
version = "0.8.9"
version = "0.8.10"

[deps]
AbstractTensors = "a8e43f4a-99b7-5565-8bf1-0165161caaea"
Expand Down
14 changes: 3 additions & 11 deletions src/composite.jl
Expand Up @@ -62,7 +62,6 @@ end
ns = norm(S)
@inbounds ns norms[3] && break
term .= out
out .= 0
# term *= b/k
$(loop[2])
@inbounds norms .= (norms[2],norm(out),ns)
Expand Down Expand Up @@ -90,7 +89,6 @@ end
ns = norm(S)
@inbounds ns norms[3] && break
term .= out
out .= 0
# term *= b/k
$(loop[2])
@inbounds norms .= (norms[2],norm(out),ns)
Expand Down Expand Up @@ -159,7 +157,7 @@ function Base.exp(t::Couple{V,B}) where {V,B}
end
end

function Base.expm1(t::PseudoCouple{V}) where V
function Base.expm1(t::PseudoCouple{V,B}) where {V,B}
if isscalar(B)
exp(t)-One(V)
else
Expand Down Expand Up @@ -261,7 +259,6 @@ qlog_fast(b::AntiSpinor,x::Int=10000) = qlog_fast(Multivector(b),x)
ns = norm(S)
@inbounds ns norms[3] && break
prod .= out
out .= 0
# prod *= w2
$(loop[2])
term .= out/k
Expand Down Expand Up @@ -293,7 +290,6 @@ end
ns = norm(S)
@inbounds ns norms[3] && break
prod .= out
out .= 0
# prod *= w2
$(loop[2])
term .= out/k
Expand Down Expand Up @@ -437,7 +433,6 @@ end
ns = norm(S)
@inbounds ns norms[3] && break
term .= out
out .= 0
# term *= τ/(k*(k-1))
$(loop[2])
@inbounds norms .= (norms[2],norm(out),ns)
Expand Down Expand Up @@ -467,7 +462,6 @@ end
ns = norm(S)
@inbounds ns norms[3] && break
term .= out
out .= 0
# term *= τ/(k*(k-1))
$(loop[2])
@inbounds norms .= (norms[2],norm(out),ns)
Expand Down Expand Up @@ -523,7 +517,6 @@ end
ns = norm(S)
@inbounds ns norms[3] && break
term .= out
out .= 0
# term *= τ/(k*(k-1))
$(loop[2])
@inbounds norms .= (norms[2],norm(out),ns)
Expand Down Expand Up @@ -552,7 +545,6 @@ end
ns = norm(S)
@inbounds ns norms[3] && break
term .= out
out .= 0
# term *= τ/(k*(k-1))
$(loop[2])
@inbounds norms .= (norms[2],norm(out),ns)
Expand Down Expand Up @@ -1084,9 +1076,9 @@ Base.rand(::AbstractRNG,::SamplerType{Couple}) = rand(Couple{rand(Manifold)})
Base.rand(::AbstractRNG,::SamplerType{Couple{V}}) where V = rand(Couple{V,Submanifold{V}(UInt(rand(1:1<<mdims(V)-1)))})
Base.rand(::AbstractRNG,::SamplerType{Couple{V,B}}) where {V,B} = Couple{V,B}(rand(Complex{Float64}))
Base.rand(::AbstractRNG,::SamplerType{Couple{V,B,T}}) where {V,B,T} = Couple{V,B}(rand(Complex{T}))
Base.rand(::AbstractRNG,::SamplerType{Couple{V,B,T} where B}) where {V,T} = rand(Couple{V,rand(Single{V}),T})
Base.rand(::AbstractRNG,::SamplerType{Couple{V,B,T} where B}) where {V,T} = rand(Couple{V,Submanifold{V}(UInt(rand(1:1<<mdims(V)-1))),T})
Base.rand(::AbstractRNG,::SamplerType{PseudoCouple}) = rand(PseudoCouple{rand(Manifold)})
Base.rand(::AbstractRNG,::SamplerType{PseudoCouple{V}}) where V = rand(PseudoCouple{V,Submanifold{V}(UInt(rand(0:(1<<mdims(V)-1)-1)))})
Base.rand(::AbstractRNG,::SamplerType{PseudoCouple{V,B}}) where {V,B} = PseudoCouple{V,B}(rand(Complex{Float64}))
Base.rand(::AbstractRNG,::SamplerType{PseudoCouple{V,B,T}}) where {V,B,T} = PseudoCouple{V,B}(rand(Complex{T}))
Base.rand(::AbstractRNG,::SamplerType{PseudoCouple{V,B,T} where B}) where {V,T} = rand(PseudoCouple{V,rand(Single{V}),T})
Base.rand(::AbstractRNG,::SamplerType{PseudoCouple{V,B,T} where B}) where {V,T} = rand(PseudoCouple{V,Submanifold{V}(UInt(rand(0:(1<<mdims(V)-1)-1))),T})

2 comments on commit 0d4f3c3

@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/104863

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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.8.10 -m "<description of version>" 0d4f3c3e2f016ff3f8c0055873fe2daa76210f69
git push origin v0.8.10

Please sign in to comment.