Previously, doing leftsite or rightsite for a Chain that is adjoint, returned a Site that does not have dual=true. This caused the functions leftindex and rightindex to not work for adjointed Chains.
Example (code before the PR):
julia> using Qrochet
julia> mps = rand(Chain, Open, State; n=8, χ=10)
MPS (inputs=0, outputs=8)
julia> Qrochet.rightsite(mps', Site(2; dual=true))
3
julia> rightindex(mps', Site(2; dual=true))
ERROR: AssertionError: Site 3 not found
Stacktrace: ...
julia> rightindex(mps', Site(2))
ERROR: AssertionError: Site 2 not found
Stacktrace: ...
This PR addresses this issue by fixing the leftsite or rightsite functions. Additionally, we added the testset for the adjoint for Chains.
Previously, doing
leftsite
orrightsite
for aChain
that is adjoint, returned aSite
that does not havedual=true
. This caused the functionsleftindex
andrightindex
to not work for adjointedChain
s.Example (code before the PR):
This PR addresses this issue by fixing the
leftsite
orrightsite
functions. Additionally, we added thetestset
for theadjoint
forChain
s.Example (fixed code):