Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Fix leftsite and rightsite for adjoint Chains #50

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

jofrevalles
Copy link
Member

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.

Example (fixed code):

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))
Symbol("Z'")

@jofrevalles jofrevalles merged commit b86c970 into master Jun 20, 2024
5 checks passed
@jofrevalles jofrevalles deleted the fix/site-adjoint-functions branch June 20, 2024 11:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant