Skip to content

Commit

Permalink
fix several APIchanges
Browse files Browse the repository at this point in the history
  • Loading branch information
GiggleLiu committed Apr 4, 2020
1 parent 2f484f5 commit d7fa48f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion developer-guide/1.extending-register/main.jl
Expand Up @@ -37,7 +37,7 @@ function Yao.relax!(reg::EchoReg{B}, locs; to_nactive=nqubits(reg)) where {B}
return true
end

function Yao.measure!(rng, ::ComputationalBasis, reg::EchoReg{B}, locs) where {B}
function Yao.measure!(::NoPostProcess, ::ComputationalBasis, reg::EchoReg{B}, locs) where {B}
println("measure -> $locs")
return true
end
Expand Down
4 changes: 2 additions & 2 deletions quick-start/3.grover-search/main.jl
Expand Up @@ -63,7 +63,7 @@ function single_try(oracle, gen::AbstractBlock{N}, nstep::Int; nbatch::Int) wher
return r
end
reg |> checker
res = measure_remove!(reg, (N+1))
res = measure!(RemoveMeasured(), reg, (N+1))
return res, reg
end

Expand All @@ -76,7 +76,7 @@ checker = control(num_bit+1,ctrl, num_bit+1=>X)

# The register is batched, with batch dimension `nshot`.
# [`focus!`](@ref Yao.focus!) views the first 1-N qubts as system.
# For a batched register, [`measure_remove!`](@ref Yao.measure_remove!)
# For a batched register, [`measure!`](@ref Yao.measure!)
# returns a vector of bitstring as output.

# #### Run
Expand Down
1 change: 1 addition & 0 deletions quick-start/5.shor-9-code/main.jl
Expand Up @@ -6,6 +6,7 @@
# which can be constructed by the following code

using Yao
using SymEngine

shor(E) = chain(9,
## encode circuit
Expand Down
4 changes: 2 additions & 2 deletions quick-start/6.quantum-circuit-born-machine/main.jl
Expand Up @@ -199,13 +199,13 @@ end

# Now let's setup the training

using Flux.Optimise
using Flux: Optimise
qcbm = build_circuit(6, 10, [1=>2, 3=>4, 5=>6, 2=>3, 4=>5, 6=>1])
dispatch!(qcbm, :random) # initialize the parameters

κ = RBFKernel(0.25, 0:2^6-1)
pg = gaussian_pdf(1:1<<6, 1<<5-0.5, 1<<4);
opt = ADAM()
opt = Optimise.ADAM()

function train(qcbm, κ, opt, target)
history = Float64[]
Expand Down

0 comments on commit d7fa48f

Please sign in to comment.