Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jlbosse/Yao.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
jlbosse committed May 30, 2024
2 parents 728aac7 + b3a7b22 commit 972bcf5
Show file tree
Hide file tree
Showing 113 changed files with 4,531 additions and 1,258 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
- YaoArrayRegister
- YaoBlocks
- YaoSym
- YaoPlots
- YaoToEinsum
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ docs/src/assets/*.pdf
*.synctex.gz
*.fls
*.log
lib/YaoPlots/examples/*.png
lib/YaoPlots/examples/*.svg
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
JL = julia --project

default: init test

init:
$(JL) -e 'using Pkg; Pkg.develop([Pkg.PackageSpec(path = joinpath("lib", pkg)) for pkg in ["YaoArrayRegister", "YaoBlocks", "YaoSym", "YaoPlots", "YaoAPI", "YaoToEinsum"]]); Pkg.precompile()'
init-docs:
$(JL) -e 'using Pkg; Pkg.activate("docs"); Pkg.develop([Pkg.PackageSpec(path = joinpath("lib", pkg)) for pkg in ["YaoArrayRegister", "YaoBlocks", "YaoSym", "YaoPlots", "YaoAPI", "YaoToEinsum"]]); Pkg.precompile()'

update:
$(JL) -e 'using Pkg; Pkg.update(); Pkg.precompile()'
update-docs:
$(JL) -e 'using Pkg; Pkg.activate("docs"); Pkg.update(); Pkg.precompile()'

test-Yao:
$(JL) -e 'using Pkg; Pkg.test("Yao")'
test-CuYao:
$(JL) -e 'using Pkg; Pkg.activate("ext/CuYao/test"); Pkg.develop(path="."); Pkg.update()'
$(JL) -e 'using Pkg; Pkg.activate("ext/CuYao/test"); include("ext/CuYao/test/runtests.jl")'

test-%:
$(JL) -e 'using Pkg; Pkg.test("$*")'

test:
$(JL) -e 'using Pkg; Pkg.test(["YaoAPI", "YaoArrayRegister", "YaoBlocks", "YaoSym", "YaoPlots", "Yao", "YaoToEinsum"])'

coverage:
$(JL) -e 'using Pkg; Pkg.test(["YaoAPI", "YaoArrayRegister", "YaoBlocks", "YaoSym", "YaoPlots", "Yao", "YaoToEinsum"]; coverage=true)'

servedocs:
$(JL) -e 'using Pkg; Pkg.activate("docs"); using LiveServer; servedocs(;skip_dirs=["docs/src/assets", "docs/src/generated"])'

clean:
rm -rf docs/build
find . -name "*.cov" -type f -print0 | xargs -0 /bin/rm -f

.PHONY: init test
16 changes: 14 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Yao"
uuid = "5872b779-8223-5990-8dd0-5abbb0748c8c"
version = "0.8.8"
version = "0.9.0"

[deps]
BitBasis = "50ba71b6-fa0f-514d-ae9a-0916efc90dcf"
Expand All @@ -10,16 +10,28 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
YaoAPI = "0843a435-28de-4971-9e8b-a9641b2983a8"
YaoArrayRegister = "e600142f-9330-5003-8abb-0ebd767abc51"
YaoBlocks = "418bc28f-b43b-5e0b-a6e7-61bbc1a2c1df"
YaoPlots = "32cfe2d9-419e-45f2-8191-2267705d8dbc"
YaoSym = "3b27209a-d3d6-11e9-3c0f-41eb92b2cb9d"
YaoToEinsum = "9b173c7b-dc24-4dc5-a0e1-adab2f7b6ba9"

[weakdeps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"

[extensions]
CuYao = "CUDA"

[compat]
BitBasis = "0.8"
BitBasis = "0.8, 0.9"
CUDA = "4, 5"
LinearAlgebra = "1"
LuxurySparse = "0.7"
Reexport = "1"
YaoAPI = "0.4"
YaoArrayRegister = "0.9"
YaoBlocks = "0.13"
YaoPlots = "0.9"
YaoSym = "0.6"
YaoToEinsum = "0.2"
julia = "1"

[extras]
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
Expand Down
23 changes: 11 additions & 12 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ using Documenter
using DocThemeIndigo
using Literate
using Yao
using Yao: YaoBlocks, YaoArrayRegister, YaoSym, BitBasis, YaoAPI
using Yao: YaoBlocks, YaoArrayRegister, YaoSym, BitBasis, YaoAPI, YaoPlots
using YaoBlocks: AD
using YaoBlocks: Optimise

Expand All @@ -15,24 +15,17 @@ attach_notebook_badge(root, name) = str->attach_notebook_badge(root, name, str)

function attach_notebook_badge(root, name, str)
mybinder_badge_url = "https://mybinder.org/badge_logo.svg"
nbviewer_badge_url = "https://img.shields.io/badge/show-nbviewer-579ACA.svg"
download_badge_url = "https://img.shields.io/badge/download-project-orange"
mybinder = "[![]($mybinder_badge_url)](@__BINDER_ROOT_URL__/generated/$root/$name/main.ipynb)"
nbviewer = "[![]($nbviewer_badge_url)](@__NBVIEWER_ROOT_URL__/generated/$root/$name/main.ipynb)"
download = "[![]($download_badge_url)](https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/QuantumBFS/tutorials/tree/gh-pages/dev/generated/$root/$name)"

markdown_only(x) = "#md # " * x
return join(map(markdown_only, (mybinder, nbviewer, download)), "\n") * "\n\n" * str
return join(map(markdown_only, (mybinder, )), "\n") * "\n\n" * str
end

function build_tutorial(root, name)
generated_path = joinpath("generated", root, name)
generated_abspath = joinpath(@__DIR__, "src", generated_path)
source_dir = joinpath(@__DIR__, "src", root, name)
source_path = joinpath(source_dir, "main.jl")
Literate.markdown(source_path, generated_abspath; execute=true, name="index", preprocess = attach_notebook_badge(root, name))
Literate.notebook(source_path, generated_abspath; execute=false, name="main", preprocess = notebook_filter)
Literate.script(source_path, generated_abspath; execute=false, name="main")
Literate.markdown(source_path, generated_abspath; execute=true, name="index", preprocess = attach_notebook_badge(root, name), binder_root_url="")
# copy other things
for each in readdir(source_dir)
if each != "main.jl"
Expand All @@ -53,6 +46,8 @@ end

# download("yaoquantum.org/assets/logo-light.png", "docs/src/assets/logo.png")

example_pages = build("examples")

const PAGES = [
"Home" => "index.md",
"Quick Start" => "quick-start.md",
Expand All @@ -63,18 +58,21 @@ const PAGES = [
"man/registers.md",
"man/blocks.md",
"man/symbolic.md",
"man/cuda.md",
"man/plot.md",
"man/automatic_differentiation.md",
"man/yao2einsum.md",
"man/simplification.md",
"man/bitbasis.md",
],
"Examples" => build("examples"),
"Examples" => example_pages,
"Performance Tips" => "performancetips.md",
]

indigo = DocThemeIndigo.install(Yao)

makedocs(
modules = [Yao, YaoAPI, YaoArrayRegister, YaoBlocks, BitBasis, YaoSym, AD, Optimise],
modules = [Yao, YaoAPI, YaoArrayRegister, YaoBlocks, BitBasis, YaoSym, YaoPlots, YaoToEinsum, AD, Optimise],
format = Documenter.HTML(
prettyurls = ("deploy" in ARGS),
canonical = ("deploy" in ARGS) ? "https://docs.yaoquantum.org/" : nothing,
Expand All @@ -88,6 +86,7 @@ makedocs(
sitename = "Documentation | Yao",
linkcheck = !("skiplinks" in ARGS),
pages = PAGES,
warnonly = [:missing_docs, :linkcheck, :cross_references],
)


Expand Down
Binary file added docs/src/assets/images/Riemannian.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 972bcf5

Please sign in to comment.