Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LGPU FPP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fernando Pérez Panadero
LGPU FPP
Commits
14c116f7
Commit
14c116f7
authored
Mar 27, 2023
by
Fernando Pérez Panadero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrected bugs in Spinors.jl & pmul and dmul defined for general ns and output fixed for dmul
parent
08745620
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
73 deletions
+98
-73
src/Spinors/Spinors.jl
src/Spinors/Spinors.jl
+98
-73
No files found.
src/Spinors/Spinors.jl
View file @
14c116f7
...
...
@@ -50,12 +50,37 @@ Returns the scalar product of two spinors.
sum
=
:
(
dot
(
a
.
s
[
1
],
b
.
s
[
1
]))
for
i
in
2
:
NS
sum
=
:
(
$
sum
+
norm2
(
a
.
s
[
$
i
]))
sum
=
:
(
$
sum
+
dot
(
a
.
s
[
$
i
],
b
.
s
[
$
i
]))
end
return
:
(
$
sum
)
end
#=
"""
Diracdot(a::Spinor,b::Spinor)
Returns the scalar product of the dirac adjoint of the first spinor times the second spinor.
"""
function Diracdot(a::Spinor{NS,G},b::Spinor{NS,G}) where {NS,G}
S = dot(dag(a).s[3], b[1]) + dot(dag(a).s[4], b[2])
+ dot(dag(a).s[1], b[3]) + dot(dag(a).s[2], b[4])
return -S
end
#"""
# dag(a::Spinor)
#Returns a^+
#"""
#function dag(a::Spinor{NS,G}) where {NS,G}
# return Spinor{NS,G}(ntuple(i -> dag(a.s[i]),Val(NS))) # Need dag function for G, export it from SU3fund.jl
#end
=#
"""
*(g::SU3{T},b::Spinor)
...
...
@@ -75,15 +100,15 @@ Base.:\(g::S,b::Spinor{NS,G}) where {S <: Group,NS,G} = Spinor{NS,G}(ntuple(i->g
Base
.:+
(
a
::
Spinor
{
NS
,
G
},
b
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->
a
.
s
[
i
]
+
b
.
s
[
i
],
NS
))
Base
.:-
(
a
::
Spinor
{
NS
,
G
},
b
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->
a
.
s
[
i
]
-
b
.
s
[
i
],
NS
))
Base
.:+
(
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
a
Base
.:-
(
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->-
b
.
s
[
i
],
NS
))
imm
(
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->
imm
(
b
.
s
[
i
]),
NS
))
mimm
(
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->
mimm
(
b
.
s
[
i
]),
NS
))
Base
.:-
(
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->-
a
.
s
[
i
],
NS
))
imm
(
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->
imm
(
a
.
s
[
i
]),
NS
))
mimm
(
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->
mimm
(
a
.
s
[
i
]),
NS
))
# Operations with numbers
Base
.:*
(
a
::
Spinor
{
NS
,
G
},
b
::
Number
)
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->
b
*
a
.
s
[
i
],
NS
))
Base
.:*
(
b
::
Number
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->
b
*
a
.
s
[
i
],
NS
))
Base
.:/
(
a
::
Spinor
{
NS
,
G
},
b
::
Number
)
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->
a
.
s
[
i
]
/
b
,
NS
))
Base
.:*
(
a
::
Spinor
{
NS
,
G
},
b
::
Number
)
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->
b
*
a
.
s
[
i
],
NS
))
# For some reason, these are type instable(?)
Base
.:*
(
b
::
Number
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->
b
*
a
.
s
[
i
],
NS
))
# when the number is a ComplexF64 and I try to
Base
.:/
(
a
::
Spinor
{
NS
,
G
},
b
::
Number
)
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}(
ntuple
(
i
->
a
.
s
[
i
]
/
b
,
NS
))
# run .* with CuArray. Cannot get the length of th tuple.
##
...
...
@@ -100,56 +125,56 @@ end
Returns ``(1+s
\\
gamma_N)a``.
"""
@inline
function
pmul
(
::
Type
{
Pgamma
{
4
,
1
}},
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
pmul
(
::
Type
{
Pgamma
{
4
,
1
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
a
.
s
[
1
]
+
a
.
s
[
3
]
r2
=
a
.
s
[
2
]
+
a
.
s
[
4
]
return
Spinor
{
4
,
G
}((
r1
,
r2
,
r1
,
r2
))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
r1
,
r2
))
end
@inline
function
pmul
(
::
Type
{
Pgamma
{
4
,
-
1
}},
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
pmul
(
::
Type
{
Pgamma
{
4
,
-
1
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
a
.
s
[
1
]
-
a
.
s
[
3
]
r2
=
a
.
s
[
2
]
-
a
.
s
[
4
]
return
Spinor
{
4
,
G
}((
r1
,
r2
,
-
r1
,
-
r2
))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
-
r1
,
-
r2
))
end
@inline
function
pmul
(
::
Type
{
Pgamma
{
1
,
1
}},
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
pmul
(
::
Type
{
Pgamma
{
1
,
1
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
a
.
s
[
1
]
+
imm
(
a
.
s
[
4
])
r2
=
a
.
s
[
2
]
+
imm
(
a
.
s
[
3
])
return
Spinor
{
4
,
G
}((
r1
,
r2
,
mimm
(
r2
),
mimm
(
r1
)))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
mimm
(
r2
),
mimm
(
r1
)))
end
@inline
function
pmul
(
::
Type
{
Pgamma
{
1
,
-
1
}},
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
pmul
(
::
Type
{
Pgamma
{
1
,
-
1
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
a
.
s
[
1
]
-
imm
(
a
.
s
[
4
])
r2
=
a
.
s
[
2
]
-
imm
(
a
.
s
[
3
])
return
Spinor
{
4
,
G
}((
r1
,
r2
,
imm
(
r2
),
imm
(
r1
)))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
imm
(
r2
),
imm
(
r1
)))
end
@inline
function
pmul
(
::
Type
{
Pgamma
{
2
,
1
}},
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
pmul
(
::
Type
{
Pgamma
{
2
,
1
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
a
.
s
[
1
]
+
a
.
s
[
4
]
r2
=
a
.
s
[
2
]
-
a
.
s
[
3
]
return
Spinor
{
4
,
G
}((
r1
,
r2
,
-
r2
,
r1
))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
-
r2
,
r1
))
end
@inline
function
pmul
(
::
Type
{
Pgamma
{
2
,
-
1
}},
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
pmul
(
::
Type
{
Pgamma
{
2
,
-
1
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
a
.
s
[
1
]
-
a
.
s
[
4
]
r2
=
a
.
s
[
2
]
+
a
.
s
[
3
]
return
Spinor
{
4
,
G
}((
r1
,
r2
,
r2
,
-
r1
))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
r2
,
-
r1
))
end
@inline
function
pmul
(
::
Type
{
Pgamma
{
3
,
1
}},
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
pmul
(
::
Type
{
Pgamma
{
3
,
1
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
a
.
s
[
1
]
+
imm
(
a
.
s
[
3
])
r2
=
a
.
s
[
2
]
-
imm
(
a
.
s
[
4
])
return
Spinor
{
4
,
G
}((
r1
,
r2
,
mimm
(
r1
),
imm
(
r2
)))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
mimm
(
r1
),
imm
(
r2
)))
end
@inline
function
pmul
(
::
Type
{
Pgamma
{
3
,
-
1
}},
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
pmul
(
::
Type
{
Pgamma
{
3
,
-
1
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
a
.
s
[
1
]
-
imm
(
a
.
s
[
3
])
r2
=
a
.
s
[
2
]
+
imm
(
a
.
s
[
4
])
return
Spinor
{
4
,
G
}((
r1
,
r2
,
imm
(
r1
),
mimm
(
r2
)))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
imm
(
r1
),
mimm
(
r2
)))
end
...
...
@@ -158,56 +183,56 @@ end
Returns ``g(1+s
\\
gamma_N)a``
"""
@inline
function
gpmul
(
::
Type
{
Pgamma
{
4
,
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gpmul
(
::
Type
{
Pgamma
{
4
,
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
*
(
a
.
s
[
1
]
+
a
.
s
[
3
])
r2
=
g
*
(
a
.
s
[
2
]
+
a
.
s
[
4
])
return
Spinor
{
4
,
G
}((
r1
,
r2
,
r1
,
r2
))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
r1
,
r2
))
end
@inline
function
gpmul
(
::
Type
{
Pgamma
{
4
,
-
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gpmul
(
::
Type
{
Pgamma
{
4
,
-
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
*
(
a
.
s
[
1
]
-
a
.
s
[
3
])
r2
=
g
*
(
a
.
s
[
2
]
-
a
.
s
[
4
])
return
Spinor
{
4
,
G
}((
r1
,
r2
,
-
r1
,
-
r2
))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
-
r1
,
-
r2
))
end
@inline
function
gpmul
(
::
Type
{
Pgamma
{
1
,
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gpmul
(
::
Type
{
Pgamma
{
1
,
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
*
(
a
.
s
[
1
]
+
imm
(
a
.
s
[
4
]))
r2
=
g
*
(
a
.
s
[
2
]
+
imm
(
a
.
s
[
3
]))
return
Spinor
{
4
,
G
}((
r1
,
r2
,
mimm
(
r2
),
mimm
(
r1
)))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
mimm
(
r2
),
mimm
(
r1
)))
end
@inline
function
gpmul
(
::
Type
{
Pgamma
{
1
,
-
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gpmul
(
::
Type
{
Pgamma
{
1
,
-
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
*
(
a
.
s
[
1
]
-
imm
(
a
.
s
[
4
]))
r2
=
g
*
(
a
.
s
[
2
]
-
imm
(
a
.
s
[
3
]))
return
Spinor
{
4
,
G
}((
r1
,
r2
,
imm
(
r2
),
imm
(
r1
)))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
imm
(
r2
),
imm
(
r1
)))
end
@inline
function
gpmul
(
::
Type
{
Pgamma
{
2
,
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gpmul
(
::
Type
{
Pgamma
{
2
,
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
*
(
a
.
s
[
1
]
+
a
.
s
[
4
])
r2
=
g
*
(
a
.
s
[
2
]
-
a
.
s
[
3
])
return
Spinor
{
4
,
G
}((
r1
,
r2
,
-
r2
,
r1
))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
-
r2
,
r1
))
end
@inline
function
gpmul
(
::
Type
{
Pgamma
{
2
,
-
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gpmul
(
::
Type
{
Pgamma
{
2
,
-
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
*
(
a
.
s
[
1
]
-
a
.
s
[
4
])
r2
=
g
*
(
a
.
s
[
2
]
+
a
.
s
[
3
])
return
Spinor
{
4
,
G
}((
r1
,
r2
,
r2
,
-
r1
))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
r2
,
-
r1
))
end
@inline
function
gpmul
(
::
Type
{
Pgamma
{
3
,
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gpmul
(
::
Type
{
Pgamma
{
3
,
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
*
(
a
.
s
[
1
]
+
imm
(
a
.
s
[
3
]))
r2
=
g
*
(
a
.
s
[
2
]
-
imm
(
a
.
s
[
4
]))
return
Spinor
{
4
,
G
}((
r1
,
r2
,
mimm
(
r1
),
imm
(
r2
)))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
mimm
(
r1
),
imm
(
r2
)))
end
@inline
function
gpmul
(
::
Type
{
Pgamma
{
3
,
-
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gpmul
(
::
Type
{
Pgamma
{
3
,
-
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
*
(
a
.
s
[
1
]
-
imm
(
a
.
s
[
3
]))
r2
=
g
*
(
a
.
s
[
2
]
+
imm
(
a
.
s
[
4
]))
return
Spinor
{
4
,
G
}((
r1
,
r2
,
imm
(
r1
),
mimm
(
r2
)))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
imm
(
r1
),
mimm
(
r2
)))
end
"""
...
...
@@ -215,56 +240,56 @@ end
Returns ``g^+ (1+s
\\
gamma_N)a``
"""
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
4
,
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
4
,
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
\
(
a
.
s
[
1
]
+
a
.
s
[
3
])
r2
=
g
\
(
a
.
s
[
2
]
+
a
.
s
[
4
])
return
Spinor
{
4
,
G
}((
r1
,
r2
,
r1
,
r2
))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
r1
,
r2
))
end
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
4
,
-
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
4
,
-
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
\
(
a
.
s
[
1
]
-
a
.
s
[
3
])
r2
=
g
\
(
a
.
s
[
2
]
-
a
.
s
[
4
])
return
Spinor
{
4
,
G
}((
r1
,
r2
,
-
r1
,
-
r2
))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
-
r1
,
-
r2
))
end
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
1
,
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
1
,
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
\
(
a
.
s
[
1
]
+
imm
(
a
.
s
[
4
]))
r2
=
g
\
(
a
.
s
[
2
]
+
imm
(
a
.
s
[
3
]))
return
Spinor
{
4
,
G
}((
r1
,
r2
,
mimm
(
r2
),
mimm
(
r1
)))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
mimm
(
r2
),
mimm
(
r1
)))
end
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
1
,
-
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
1
,
-
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
\
(
a
.
s
[
1
]
-
imm
(
a
.
s
[
4
]))
r2
=
g
\
(
a
.
s
[
2
]
-
imm
(
a
.
s
[
3
]))
return
Spinor
{
4
,
G
}((
r1
,
r2
,
imm
(
r2
),
imm
(
r1
)))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
imm
(
r2
),
imm
(
r1
)))
end
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
2
,
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
2
,
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
\
(
a
.
s
[
1
]
+
a
.
s
[
4
])
r2
=
g
\
(
a
.
s
[
2
]
-
a
.
s
[
3
])
return
Spinor
{
4
,
G
}((
r1
,
r2
,
-
r2
,
r1
))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
-
r2
,
r1
))
end
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
2
,
-
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
2
,
-
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
\
(
a
.
s
[
1
]
-
a
.
s
[
4
])
r2
=
g
\
(
a
.
s
[
2
]
+
a
.
s
[
3
])
return
Spinor
{
4
,
G
}((
r1
,
r2
,
r2
,
-
r1
))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
r2
,
-
r1
))
end
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
3
,
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
3
,
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
\
(
a
.
s
[
1
]
+
imm
(
a
.
s
[
3
]))
r2
=
g
\
(
a
.
s
[
2
]
-
imm
(
a
.
s
[
4
]))
return
Spinor
{
4
,
G
}((
r1
,
r2
,
mimm
(
r1
),
imm
(
r2
)))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
mimm
(
r1
),
imm
(
r2
)))
end
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
3
,
-
1
}},
g
,
a
::
Spinor
{
4
,
G
})
where
{
NS
,
G
}
@inline
function
gdagpmul
(
::
Type
{
Pgamma
{
3
,
-
1
}},
g
,
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
r1
=
g
\
(
a
.
s
[
1
]
-
imm
(
a
.
s
[
3
]))
r2
=
g
\
(
a
.
s
[
2
]
+
imm
(
a
.
s
[
4
]))
return
Spinor
{
4
,
G
}((
r1
,
r2
,
imm
(
r1
),
mimm
(
r2
)))
return
Spinor
{
NS
,
G
}((
r1
,
r2
,
imm
(
r1
),
mimm
(
r2
)))
end
...
...
@@ -298,24 +323,24 @@ indexing for Dirac basis ``\\Gamma_n``:
16 identity
"""
@inline
dmul
(
::
Type
{
Gamma
{
1
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
mimm
(
a
.
s
[
4
]),
mimm
(
a
.
s
[
3
]),
imm
(
a
.
s
[
2
]),
imm
(
a
.
s
[
1
]
))
@inline
dmul
(
::
Type
{
Gamma
{
2
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
-
a
.
s
[
4
],
a
.
s
[
3
],
a
.
s
[
2
],
-
a
.
s
[
1
]
)
@inline
dmul
(
::
Type
{
Gamma
{
3
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
mimm
(
a
.
s
[
3
]),
imm
(
a
.
s
[
4
]),
imm
(
a
.
s
[
1
]),
mimm
(
a
.
s
[
2
]
))
@inline
dmul
(
::
Type
{
Gamma
{
4
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
-
a
.
s
[
3
],
-
a
.
s
[
4
],
-
a
.
s
[
1
],
-
a
.
s
[
2
]
)
@inline
dmul
(
::
Type
{
Gamma
{
5
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
a
.
s
[
1
],
a
.
s
[
2
],
-
a
.
s
[
3
],
-
a
.
s
[
4
]
)
@inline
dmul
(
::
Type
{
Gamma
{
6
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
imm
(
a
.
s
[
4
]),
imm
(
a
.
s
[
3
]),
imm
(
a
.
s
[
2
]),
imm
(
a
.
s
[
1
]
))
@inline
dmul
(
::
Type
{
Gamma
{
7
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
a
.
s
[
4
],
-
a
.
s
[
3
],
a
.
s
[
2
],
-
a
.
s
[
1
]
)
@inline
dmul
(
::
Type
{
Gamma
{
8
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
imm
(
a
.
s
[
3
]),
mimm
(
a
.
s
[
4
]),
imm
(
a
.
s
[
1
]),
mimm
(
a
.
s
[
2
]
))
@inline
dmul
(
::
Type
{
Gamma
{
9
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
a
.
s
[
3
],
a
.
s
[
4
],
-
a
.
s
[
1
],
-
a
.
s
[
2
]
)
@inline
dmul
(
::
Type
{
Gamma
{
10
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
a
.
s
[
2
],
a
.
s
[
1
],
-
a
.
s
[
4
],
-
a
.
s
[
3
]
)
@inline
dmul
(
::
Type
{
Gamma
{
11
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
mimm
(
a
.
s
[
2
]),
imm
(
a
.
s
[
1
]),
imm
(
a
.
s
[
4
]),
mimm
(
a
.
s
[
3
]
))
@inline
dmul
(
::
Type
{
Gamma
{
12
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
a
.
s
[
1
],
-
a
.
s
[
2
],
-
a
.
s
[
3
],
a
.
s
[
4
]
)
@inline
dmul
(
::
Type
{
Gamma
{
13
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
-
a
.
s
[
1
],
a
.
s
[
2
],
-
a
.
s
[
3
],
a
.
s
[
4
]
)
@inline
dmul
(
::
Type
{
Gamma
{
14
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
-
a
.
s
[
2
],
-
a
.
s
[
1
],
-
a
.
s
[
4
],
-
a
.
s
[
3
]
)
@inline
dmul
(
::
Type
{
Gamma
{
15
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
Spinor
{
4
,
G
}(
imm
(
a
.
s
[
2
]),
mimm
(
a
.
s
[
1
]),
imm
(
a
.
s
[
4
]),
mimm
(
a
.
s
[
3
]
))
@inline
dmul
(
::
Type
{
Gamma
{
16
}},
a
::
Spinor
{
4
,
G
})
where
{
G
}
=
a
export
Spinor
,
Pgamma
@inline
dmul
(
::
Type
{
Gamma
{
1
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
mimm
(
a
.
s
[
4
]),
mimm
(
a
.
s
[
3
]),
imm
(
a
.
s
[
2
]),
imm
(
a
.
s
[
1
])
))
@inline
dmul
(
::
Type
{
Gamma
{
2
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
-
a
.
s
[
4
],
a
.
s
[
3
],
a
.
s
[
2
],
-
a
.
s
[
1
])
)
@inline
dmul
(
::
Type
{
Gamma
{
3
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
mimm
(
a
.
s
[
3
]),
imm
(
a
.
s
[
4
]),
imm
(
a
.
s
[
1
]),
mimm
(
a
.
s
[
2
])
))
@inline
dmul
(
::
Type
{
Gamma
{
4
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
-
a
.
s
[
3
],
-
a
.
s
[
4
],
-
a
.
s
[
1
],
-
a
.
s
[
2
])
)
@inline
dmul
(
::
Type
{
Gamma
{
5
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
a
.
s
[
1
],
a
.
s
[
2
],
-
a
.
s
[
3
],
-
a
.
s
[
4
])
)
@inline
dmul
(
::
Type
{
Gamma
{
6
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
imm
(
a
.
s
[
4
]),
imm
(
a
.
s
[
3
]),
imm
(
a
.
s
[
2
]),
imm
(
a
.
s
[
1
])
))
@inline
dmul
(
::
Type
{
Gamma
{
7
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
a
.
s
[
4
],
-
a
.
s
[
3
],
a
.
s
[
2
],
-
a
.
s
[
1
])
)
@inline
dmul
(
::
Type
{
Gamma
{
8
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
imm
(
a
.
s
[
3
]),
mimm
(
a
.
s
[
4
]),
imm
(
a
.
s
[
1
]),
mimm
(
a
.
s
[
2
])
))
@inline
dmul
(
::
Type
{
Gamma
{
9
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
a
.
s
[
3
],
a
.
s
[
4
],
-
a
.
s
[
1
],
-
a
.
s
[
2
])
)
@inline
dmul
(
::
Type
{
Gamma
{
10
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
a
.
s
[
2
],
a
.
s
[
1
],
-
a
.
s
[
4
],
-
a
.
s
[
3
])
)
@inline
dmul
(
::
Type
{
Gamma
{
11
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
mimm
(
a
.
s
[
2
]),
imm
(
a
.
s
[
1
]),
imm
(
a
.
s
[
4
]),
mimm
(
a
.
s
[
3
])
))
@inline
dmul
(
::
Type
{
Gamma
{
12
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
a
.
s
[
1
],
-
a
.
s
[
2
],
-
a
.
s
[
3
],
a
.
s
[
4
])
)
@inline
dmul
(
::
Type
{
Gamma
{
13
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
-
a
.
s
[
1
],
a
.
s
[
2
],
-
a
.
s
[
3
],
a
.
s
[
4
])
)
@inline
dmul
(
::
Type
{
Gamma
{
14
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
-
a
.
s
[
2
],
-
a
.
s
[
1
],
-
a
.
s
[
4
],
-
a
.
s
[
3
])
)
@inline
dmul
(
::
Type
{
Gamma
{
15
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
Spinor
{
NS
,
G
}((
imm
(
a
.
s
[
2
]),
mimm
(
a
.
s
[
1
]),
imm
(
a
.
s
[
4
]),
mimm
(
a
.
s
[
3
])
))
@inline
dmul
(
::
Type
{
Gamma
{
16
}},
a
::
Spinor
{
NS
,
G
})
where
{
NS
,
G
}
=
a
export
Spinor
,
Pgamma
,
Gamma
export
norm
,
norm2
,
dot
,
imm
,
mimm
export
pmul
,
gpmul
,
gdagpmul
,
dmul
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment