You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.
We have already got batched register for solving the sampling problem.
Also, I find pretty useful to have batched blocks, especially in simulating kernel quantum algorithms in
Schuld, Maria, and Nathan Killoran. "Quantum machine learning in feature Hilbert spaces." Physical review letters 122.4 (2019): 040504.
A possible prototype
using Yao
struct Batched{N, T, BT<:AbstractBlock{N, T}} <:CompositeBlock{N, T}
blocks::Vector{<:BT}end
Base.broadcastable(bb::Batched) = bb.blocks
function Yao.apply!(reg::AbstractRegister{B}, bb::Batched) where B
B ==length(bb.blocks) ||error()
Yao.apply!.(reg, bb)
reg
endzero_state(4, nbatch=10) |> bb |> state
The problem is how do we dispatch a Batched block? Or just disallow dispatch! a scalar for such a block?
The text was updated successfully, but these errors were encountered:
I don't think we should let it be broadcastable, having two similar things apply! and apply!. is dangerous, especially when a simple for loop will do the job.
I was think about share type annotation, so the a batch of same block with parameters are contiguous on memory which improves cache efficiency and simplifies the update process of variational circuits, and it will fallback to the only static type Any which will not hoist the type annotation.
We have already got batched register for solving the sampling problem.
Also, I find pretty useful to have batched blocks, especially in simulating
kernel
quantum algorithms inA possible prototype
The problem is how do we dispatch a
Batched
block? Or just disallowdispatch!
a scalar for such a block?The text was updated successfully, but these errors were encountered: