Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/QuantumBFS/tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
Roger-luo committed Jul 7, 2020
2 parents 5f03189 + d7fa48f commit 8391adf
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 6 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/TagBot.yml
@@ -0,0 +1,11 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
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
2 changes: 1 addition & 1 deletion src/assets/main.css
Expand Up @@ -36,5 +36,5 @@ html.theme--documenter-dark body {
}

#documenter .docs-sidebar ul.docs-menu {
flex-grow: 0;
flex-grow: 0 !important;
}
2 changes: 2 additions & 0 deletions src/index.md
Expand Up @@ -5,6 +5,8 @@ three badges on the top of each tutorial that allows you to open it in [mybinder
it in [nbviewer](https://nbviewer.jupyter.org/) or download the tutorial as `.zip` file, which includes the notebook
and the scripts and other related materials.

[![asciicast](https://asciinema.org/a/HaDO421J58cmKhIBbVPhJHIr7.svg)](https://asciinema.org/a/HaDO421J58cmKhIBbVPhJHIr7?speed=2)

## Contribution

If you are interesting in polishing or contributing our tutorial, you can just open a [PR in our tutorial repo](https://github.com/QuantumBFS/tutorials/compare).
Expand Down

0 comments on commit 8391adf

Please sign in to comment.