Closed GiggleLiu closed 4 years ago
Might be useful in the future.
function ztensor(nleg::Int, α::T) where T<:Number shape = (fill(2, nleg)...,) factor = exp(im*α) out = zeros(typeof(factor), shape...) out[1] = one(typeof(factor)) out[fill(2, nleg)...] = factor out end function xtensor(nleg::Int, α::T) where T<:Number shape = (fill(2, nleg)...,) reshape(reduce(kron, fill(pos, nleg)) + exp(im*α)*reduce(kron, fill(neg, nleg)), shape) end function htensor(nleg::Int, α::T) where T<:Number shape = (fill(2, nleg)...,) factor = exp(im*α) out = fill(one(typeof(factor)), shape) out[fill(2, nleg)...] = factor return out end
Might be useful in the future.