QuantumBFS / Yao.jl

Extensible, Efficient Quantum Algorithm Design for Humans.
https://yaoquantum.org
Other
924 stars 122 forks source link

reorder! does not seem to work properly #370

Closed GiggleLiu closed 2 years ago

GiggleLiu commented 2 years ago
julia> reg = product_state(bit"010101")
ArrayReg{2, ComplexF64, Array...}
    active qubits: 6/6
    nlevel: 2

julia> reorder!(reg, (1,3,5,2,4,6))
ArrayReg{2, ComplexF64, Array...}
    active qubits: 6/6
    nlevel: 2

julia> measure(reg; nshots=3)
3-element Vector{BitBasis.BitStr64{6}}:
 011001 ₍₂₎
 011001 ₍₂₎
 011001 ₍₂₎
GiggleLiu commented 2 years ago

Ah, this is actually correct, our convension is different from the permutedims.