Skip to content

Commit

Permalink
created Project.toml and fixed degenerate products #4
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed Apr 18, 2019
1 parent 13f84cb commit 3c3a926
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 22 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ os:
- linux
- osx
julia:
- 0.7
- 1.0
- 1.1
- nightly
Expand Down
24 changes: 24 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name = "Grassmann"
uuid = "4df31cd9-4c27-5bea-88d0-e6a7146666d8"
authors = ["Michael Reed"]
version = "0.1.1"

[deps]
AbstractLattices = "398f06c4-4d28-53ec-89ca-5b2656b7603d"
AbstractTensors = "a8e43f4a-99b7-5565-8bf1-0165161caaea"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
ComputedFieldTypes = "459fdd68-db75-56b8-8c15-d717a790f88e"
DirectSum = "22fd7b30-a8c0-5bf2-aabe-97783860d07c"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Reduce = "93e0c654-6965-5f22-aba9-9c1ae6b3c259"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
DirectSum = "0.2"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
9 changes: 0 additions & 9 deletions REQUIRE

This file was deleted.

1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
environment:
matrix:
- julia_version: 0.7
- julia_version: 1
- julia_version: 1.1
- julia_version: nightly
Expand Down
20 changes: 11 additions & 9 deletions src/algebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,15 @@ function dot(a::X,b::Y) where {X<:TensorTerm{V},Y<:TensorTerm{V}} where V
end

@pure function interior_calc(V::Signature{N,M,S},A,B) where {N,M,S}
hasinf(M) && isodd(A) && isodd(B) && (return false,zero(Bits),false)
γ = complement(N,B)
p,C,t = regressive(A,γ,V)
p,C,t = regressive_calc(V,A,γ,true)
return t ? pparityright(S,B) : p, C, t
end

@pure function interior_calc(V::DiagonalForm{N,M,S},A,B) where {N,M,S}
γ = complement(N,B)
p,C,t = regressive(A,γ,Signature(V))
p,C,t = regressive_calc(Signature(V),A,γ,true)
ind = indices(B)
g = prod(V[ind])
return t ? (pparityright(0,sum(ind),count_ones(B)) ? -(g) : g) : g, C, t
Expand All @@ -268,13 +269,14 @@ end
@inline (a::TensorAlgebra{V},b::UniformScaling{T}) where {V,T<:Field} = aV(b)
@inline (a::UniformScaling{T},b::TensorAlgebra{V}) where {V,T<:Field} = V(a)b

@pure function regressive_calc(::Signature{N,M,S},A,B) where {N,M,S}
@pure function regressive_calc(::Signature{N,M,S},A,B,opt=false) where {N,M,S}
α,β = complement(N,A),complement(N,B)
if (count_ones&β)==0) && !(hasinf(M) && isodd(α) && isodd(β))
if (count_ones&β)==0 ? true : A+B==0) && !(hasinf(M) && isodd(α) && isodd) && (A+B0))
C = α β
L = count_ones(A)+count_ones(B)
pa,pb,pc = parityright(S,A),parityright(S,B),parityright(S,C)
return isodd(L*(L-N))papbparity(N,S,α,β)pc, complement(N,C), true
bas = opt ? complement(N,C) : A+B0 ? complement(N,C) : zero(Bits)
return isodd(L*(L-N))papbparity(N,S,α,β)pc, bas, true
else
return false, zero(Bits), false
end
Expand Down Expand Up @@ -315,7 +317,7 @@ end
end
end

@pure function crodprod_calc(V::DiagonalForm{N,M,S}) where {N,M,S}
@pure function crossprod_calc(V::DiagonalForm{N,M,S}) where {N,M,S}
if (count_ones(A&B)==0) && !(hasinf(M) && isodd(A) && isodd(B))
C = A B
g = parityright(V,C)
Expand Down Expand Up @@ -632,7 +634,7 @@ function generate_product_algebra(Field=Field,MUL=:*,ADD=:+,SUB=:-,VEC=:mvec,CON
for k 1:binomial(N,G)
@inbounds val = b.v[k]
if val0
v = typeof(V)<:Signature ? ($p(V,ib[k]) ? $SUB(val) : val) : $p(V,ib[k])
v = typeof(V)<:Signature ? ($p(V,ib[k]) ? $SUB(val) : val) : $p(V,ib[k])*val
@inbounds setblade!(out,v,complement(N,ib[k]),Dimension{N}())
end
end
Expand All @@ -649,7 +651,7 @@ function generate_product_algebra(Field=Field,MUL=:*,ADD=:+,SUB=:-,VEC=:mvec,CON
@inbounds for i 1:bn[g]
@inbounds val = m.v[bs[g]+i]
if val0
v = typeof(V)<:Signature ? ($p(V,ib[i]) ? $SUB(val) : val) : $p(V,ib[i])
v = typeof(V)<:Signature ? ($p(V,ib[i]) ? $SUB(val) : val) : $p(V,ib[i])*val
@inbounds setmulti!(out,v,complement(N,ib[i]),Dimension{N}())
end
end
Expand Down Expand Up @@ -733,7 +735,7 @@ function generate_product_algebra(Field=Field,MUL=:*,ADD=:+,SUB=:-,VEC=:mvec,CON
for g 1:N+1
ib = indexbasis(N,g-1)
@inbounds for i 1:bn[g]
@inbounds $product!(V,out,bits(basis(s)),ib[i],$MUL(a.v,b.v[bs[g]+i]))
@inbounds $product!(V,out,bits(basis(a)),ib[i],$MUL(a.v,b.v[bs[g]+i]))
end
end
return MultiVector{t,V,2^N}(out)
Expand Down
2 changes: 1 addition & 1 deletion src/generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
else
print(io,C>0 ? string(dual) : lab)
for j shift_indices(V,sk)
print(io,j0 ? (j>0 ? (j>9 ? (C>0 ? sups[j] : subs[j]) : j) : 'ϵ') : 'o')
print(io,j0 ? (j>0 ? (j>9 ? (C>0 ? sups[j] : subs[j]) : j) : vio[1]) : vio[2])
end
end
icr += 1
Expand Down
2 changes: 1 addition & 1 deletion src/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import Base: @pure, print, show, getindex, setindex!, promote_rule, ==, convert, ndims
import DirectSum: Bits, bit2int, doc2m, indexbits, indices
import DirectSum: pre, alphanumv, alphanumw, vsn, subs, sups
import DirectSum: pre, alphanumv, alphanumw, vsn, vio, subs, sups

@pure binomial_set(N) = SVector(Int[binomial(N,g) for g 0:N]...)
@pure binomial(N,G) = Base.binomial(N,G)
Expand Down

5 comments on commit 3c3a926

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

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

git tag -a v0.1.1 -m "<description of version>" 3c3a92610ebc8885619f561fe988b0d985852fce
git push origin v0.1.1

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Error while trying to register: Register Failed
@lawless-m, it looks like you don't have collaborator status on this repository.

@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.

@lawless-m what are you trying to do?

@lawless-m
Copy link

Choose a reason for hiding this comment

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

I commented on the wrong page, sorry

Please sign in to comment.