Closed nzy1997 closed 1 month ago
Here is an MWE.
using Test using CUDA using Yao @testset "fidelity" begin reg = rand_state(2;nbatch =1) cureg = cu(reg) @test reg.state ≈ cureg.state |> Array qc = chain(2,put(2,(1,2)=> matblock(rand_unitary(4)))) push!(qc, Measure(2; locs = [2], resetto = bit"0")) apply!(reg,qc) apply!(cureg,qc) @test reg.state ≈ cureg.state |> Array end
Here is an MWE.