-
Notifications
You must be signed in to change notification settings - Fork 121
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
How to run a random circuite in a batched way? #485
Comments
Unfortunately, there is no easy way to do that. You need to copy julia> sum([expect(Z, copy(reg) |> dispatch!(Rx(0),rand()*2π)) for _ in 1:1000])/1000
0.027340815055604813 + 0.0im |
In fact, I hope to use the parallel computing of the GPU for batch processing. But this does not seem to be a good use of the parallel computing of the GPU. |
I see. In your case, I would suggest you writing a new kernel, since this features is not supported by Yao yet.
Hint of rewriting this instructinstruct!(::Val{2}, state::DenseCuVecOrMat, U0::AbstractMatrix, locs::NTuple{M, Int}, clocs::NTuple{C, Int}, cvals::NTuple{C, Int})
Please feel free to ask if you encounter any issue. |
Thanks for your patience and guidance! Actually, I need compute a chain block with such one qubit gates layer and two qubits gate layer in many qubits. You give me a good advice, I will try it. |
I wand to run a random unitary circuite in so many instance (like 1000 instance) and return the averge value like :
but I want run it in a batched way, I know 幺 has batchedarrayreg, but I don't know how to performance random circuit in each instance to a batchedreg in a batched way. I tried
but it seems not work, it just will pick one random instance 1000 times. What is the correct way?
The text was updated successfully, but these errors were encountered: