Sov-trotter / IBMQJulia.jl

IBMQ backend for Yao
MIT License
4 stars 0 forks source link

Better recursive parse #18

Closed GiggleLiu closed 4 years ago

GiggleLiu commented 4 years ago
julia> using IBMQJulia, Yao

julia> IBMQJulia.generate_experiment(chain([control(4, 1, 2=>shift(3))]))
Dict{String,Any} with 3 entries:
  "instructions" => Any[Dict{String,Any}("name"=>"cu1","params"=>[3.0],"qubits"=>[0, 1])]
  "header"       => Dict{String,Any}("clbit_labels"=>Array{Any,1}[["c", 0], ["c", 1]],"qubit_labels"=>Array{Any,1}[["q", 0], ["q", 1], …
  "config"       => Dict{Any,Any}()

julia> IBMQJulia.generate_inst(put(10, (2,1)=>put(2, 2=>chain(X, Y, Z, Measure()))))
4-element Array{Any,1}:
 Dict{String,Any}("name" => "x","qubits" => [0])
 Dict{String,Any}("name" => "y","qubits" => [0])
 Dict{String,Any}("name" => "z","qubits" => [0])
 Dict{String,Any}("name" => "measure","memory" => [0.0],"qubits" => [0])

Notice

Sov-trotter commented 4 years ago

This is really cool.

the indices now starts from 0, please check this is correct.

So I tried to run the circuit and it works. So I think there isn't any issue here.

GiggleLiu commented 4 years ago

I just removed the API test first. Feel free to add it back after the mock interface is ready.

Sov-trotter commented 4 years ago

Feel free to add it back after the mock interface is ready.

Can you elaborate on this?

GiggleLiu commented 4 years ago

Feel free to add it back after the mock interface is ready.

Can you elaborate on this?

Current api tests fails, so I commented it out. I think it is not likely a bug.

Sov-trotter commented 4 years ago

Looks good to go? Should we register it and tag a release first?

GiggleLiu commented 4 years ago

Sounds Good!