Replies: 1 comment 2 replies
-
no, none of the
I'm not sure what you meant here, what do you expect to get from it instead?
active/inactive qubits is just give you a way to apply a (smaller) circuit only partially on the current active qubits, e.g you can
yes, you can verify this yourself. julia> mat(A)
2×2 Matrix{Float64}:
0.255424 0.356126
0.702261 0.082124
julia> mat(A')
┌ Warning: converting Float64 to eltype ComplexF64, consider create another matblock with eltype ComplexF64
└ @ YaoBlocks ~/.julia/packages/YaoBlocks/wUHRm/src/primitive/general_matrix_gate.jl:75
2×2 adjoint(::Matrix{ComplexF64}) with eltype ComplexF64:
0.255424-0.0im 0.702261-0.0im
0.356126-0.0im 0.082124-0.0im
It's not actively maintained, but try this package https://github.com/QuantumBFS/YaoBlocksQASM.jl, there are some examples in the tests |
Beta Was this translation helpful? Give feedback.
-
Hi,
I want to implement the algorithm from "An Efficient Algorithm for Sparse Quantum State Preparation" in Yao.
I have (quite) a few questions:
I could do
r = 0.6 product_state(bit"111111110001100") + 0.8 product_state(bit"111111110001010")
a) Is it stored efficiently?
b) can I easily retrieve the states? if I use
statevec
, I get a vector whose size is 2^num_qubits rather than the number of statesThis is especially important to this specific algorithm, as it accepts a very large, yet sparse, superposition and iteratively reduces the number of states by applying circuits. Thus, I need to read the individual states to build the circuit and then read the states of the resulting operation until reaching the final state (not a superposition).
active
andinactive
qubits in Yao, but I did not find an explanation for what that meansmatblock
to create a new unitary. is it automatically "reversed" with the adjoint'
operatorThanks
Beta Was this translation helpful? Give feedback.
All reactions