-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix sites in Yao to Tenet conversion #298
Conversation
test/integration/YaoBlocks_test.jl
Outdated
|
||
@test only(ampl11) ≈ yaoampl11 | ||
yaosv = apply!(zero_state(n_qubits), yaocirc) # circuit|00> | ||
@test only(expected_value) ≈ only(statevec(ArrayReg(bit"11"))' * statevec(yaosv)) # Yao <11|circuit|00> | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mind leaving the tests how they were before? it does the exact same thing but it's cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@@ -22,7 +22,7 @@ function Base.convert(::Type{Circuit}, yaocirc::AbstractBlock) | |||
# end | |||
|
|||
gatelanes = Lane.(occupied_locs(gate)) | |||
gatesites = [Site.(gatelanes; dual=true)..., Site.(gatelanes)...] | |||
gatesites = [Site.(gatelanes)..., Site.(gatelanes; dual=true)...] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah dammit, yeah. my fault.
When converting a
Yao
circuit to aTenet
tensor network, the gates' sites and its duals had an incorrect order causing a bad interconnection inside the tensor network. This is, the outputs were taken as inputs and viceversa giving the following inconsistent results: