Skip to content

Commit c26ed52

Browse files
authored
update (#52)
1 parent 63fe821 commit c26ed52

File tree

14 files changed

+665
-976
lines changed

14 files changed

+665
-976
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,23 @@ jobs:
4747
docs:
4848
name: Documentation
4949
runs-on: ubuntu-latest
50+
permissions:
51+
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
52+
contents: write
53+
statuses: write
5054
steps:
5155
- uses: actions/checkout@v4
5256
- uses: julia-actions/setup-julia@v2
5357
with:
5458
version: '1'
55-
56-
- name: Run Pluto notebooks
57-
run: julia -e 'using Pkg;
58-
Pkg.add("PlutoUI");
59-
Pkg.activate("notebooks");
60-
Pkg.develop(path=".");
61-
Pkg.instantiate();
62-
using PlutoSliderServer;
63-
for file in readdir("notebooks")
64-
endswith(file, ".jl") && PlutoSliderServer.export_notebook(joinpath("notebooks", file))
65-
end
66-
'
67-
- name: Deploy to gh-pages
68-
uses: JamesIves/github-pages-deploy-action@releases/v3
69-
with:
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71-
BRANCH: gh-pages
72-
FOLDER: .
59+
- uses: julia-actions/cache@v2
60+
- name: Configure doc environment
61+
shell: julia --project=docs --color=yes {0}
62+
run: |
63+
using Pkg
64+
Pkg.develop(PackageSpec(path=pwd()))
65+
Pkg.instantiate()
66+
- uses: julia-actions/julia-buildpkg@v1
67+
- uses: julia-actions/julia-docdeploy@v1
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ _local/
77
*.log
88
*.fdb_latexmk
99
.vscode
10+
/docs/build/
11+
/docs/src/generated/

Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
JL = julia --project
2+
3+
default: init test
4+
5+
init:
6+
$(JL) -e 'using Pkg; Pkg.precompile(); Pkg.activate("docs"); Pkg.develop(path="."), Pkg.precompile()'
7+
8+
update:
9+
$(JL) -e 'using Pkg; Pkg.update(); Pkg.precompile(); Pkg.activate("docs"); Pkg.update(); Pkg.precompile()'
10+
11+
test:
12+
$(JL) -e 'using Pkg; Pkg.test()'
13+
14+
coverage:
15+
$(JL) -e 'using Pkg; Pkg.test(; coverage=true)'
16+
17+
serve:
18+
$(JL) -e 'using Pkg; Pkg.activate("docs"); using LiveServer; servedocs(;skip_dirs=["docs/src/assets", "docs/src/generated"], literate_dir="examples")'
19+
20+
fig:
21+
for entry in "docs/src/assets/"*.typ; do \
22+
echo compiling $$entry to $${entry%.typ}.pdf; \
23+
typst compile $$entry $${entry%.typ}.pdf; \
24+
pdf2svg $${entry%.typ}.pdf $${entry%.typ}.svg; \
25+
done
26+
27+
clean:
28+
rm -rf docs/build
29+
find . -name "*.cov" -type f -print0 | xargs -0 /bin/rm -f
30+
31+
.PHONY: init test coverage serve clean update

README.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,5 @@
1919
pkg> add UnitDiskMapping
2020
```
2121

22-
## Examples
23-
24-
Please check the following notebooks:
25-
1. [Unit Disk Mapping](https://queracomputing.github.io/UnitDiskMapping.jl/notebooks/tutorial.html), which contains the examples in ["Quantum Optimization with Arbitrary Connectivity Using Rydberg Atom Arrays"](https://journals.aps.org/prxquantum/abstract/10.1103/PRXQuantum.4.010316):
26-
* Reduction from a generic weighted or unweighted maximum independent set (MIS) problem to that on a King's subgraph (KSG).
27-
* Reduction from a generic or square-lattice QUBO problem to an MIS problem on a unit-disk grid graph.
28-
* Reduction from an integer factorization problem to an MIS problem on a unit-disk grid graph.
29-
30-
2. [Unweighted KSG reduction of the independent set problem](https://queracomputing.github.io/UnitDiskMapping.jl/notebooks/unweighted.html), which contains the unweighted reduction from a general graph to a King's subgraph. It covers all example graphs in paper: "Computer-Assisted Gadget Design and Problem Reduction of Unweighted Maximum Independent Set" (To be published).
31-
32-
![](https://user-images.githubusercontent.com/6257240/198861111-4499c17d-9938-406b-8253-943b01f4633c.png)
33-
34-
To run the notebook locally, you will need to activate and instantiate the local environment that specified in the [`notebooks`](notebooks) directory:
35-
```bash
36-
$ cd notebooks
37-
$ julia --project -e 'using Pkg; Pkg.instantiate()'
38-
```
39-
40-
To run the notebook, just type in the same terminal:
41-
```bash
42-
julia --project -e "import Pluto; Pluto.run()"
43-
```
44-
At this point, your browser should automatically launch and display a list of available notebooks you can run. You should just see the notebooks listed.
45-
46-
4722
## Supporting and Citing
4823
Much of the software in this ecosystem was developed as a part of an academic research project. If you would like to help support it, please star the repository. If you use our software as part of your research, teaching, or other activities, we would like to request you to cite our [work](https://arxiv.org/abs/2209.03965). The [CITATION.bib](CITATION.bib) file in the root of this repository lists the relevant papers.

docs/Project.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[deps]
2+
DocThemeIndigo = "8bac0ac5-51bf-41f9-885e-2bf1ac2bec5f"
3+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
4+
GenericTensorNetworks = "3521c873-ad32-4bb4-b63d-f4f178f42b49"
5+
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
6+
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
7+
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
8+
LuxorGraphPlot = "1f49bdf2-22a7-4bc4-978b-948dc219fbbc"
9+
UnitDiskMapping = "1b61a8d9-79ed-4491-8266-ef37f39e1727"

docs/make.jl

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
using UnitDiskMapping
2+
using Documenter
3+
using Literate
4+
using DocThemeIndigo
5+
6+
# Literate
7+
for each in readdir(pkgdir(UnitDiskMapping, "examples"))
8+
input_file = pkgdir(UnitDiskMapping, "examples", each)
9+
endswith(input_file, ".jl") || continue
10+
@info "building" input_file
11+
output_dir = pkgdir(UnitDiskMapping, "docs", "src", "generated")
12+
Literate.markdown(input_file, output_dir; name=each[1:end-3], execute=false)
13+
end
14+
15+
DocMeta.setdocmeta!(UnitDiskMapping, :DocTestSetup, :(using UnitDiskMapping); recursive=true)
16+
indigo = DocThemeIndigo.install(UnitDiskMapping)
17+
18+
makedocs(;
19+
modules=[UnitDiskMapping],
20+
authors="GiggleLiu and contributors",
21+
sitename="UnitDiskMapping.jl",
22+
format=Documenter.HTML(;
23+
canonical="https://QuEraComputing.github.io/UnitDiskMapping.jl",
24+
edit_link="main",
25+
assets=String[indigo],
26+
),
27+
doctest = ("doctest=true" in ARGS),
28+
pages=[
29+
"Home" => "index.md",
30+
"Examples" => [
31+
"generated/tutorial.md",
32+
"generated/unweighted.md"
33+
],
34+
"Reference" => "ref.md",
35+
],
36+
warnonly=[:missing_docs]
37+
)
38+
39+
deploydocs(;
40+
repo="github.com/QuEraComputing/UnitDiskMapping.jl",
41+
devbranch="main",
42+
)

docs/src/assets/indigo.css

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
@font-face {
2+
font-family: JuliaMono;
3+
src: local("JuliaMono"), url("https://cdn.jsdelivr.net/gh/cormullion/juliamono/webfonts/JuliaMono-Regular.woff2"); }
4+
5+
html.theme--documenter-dark pre,
6+
html.theme--documenter-dark code {
7+
font-family: "JuliaMono"; }
8+
9+
html:not(.theme--documenter-dark) body #documenter a {
10+
color: #4595D1; }
11+
12+
html:not(.theme--documenter-dark) body #documenter a:hover, html:not(.theme--documenter-dark) body #documenter a:focus {
13+
color: #194E82; }
14+
15+
html:not(.theme--documenter-dark) body #documenter .docs-sidebar {
16+
box-shadow: none;
17+
color: #FFFFFF;
18+
background-color: #194E82; }
19+
html:not(.theme--documenter-dark) body #documenter .docs-sidebar .docs-package-name a, html:not(.theme--documenter-dark) body #documenter .docs-sidebar .docs-package-name a:hover {
20+
color: #FFFFFF; }
21+
html:not(.theme--documenter-dark) body #documenter .docs-sidebar ul.docs-menu {
22+
border-top: none; }
23+
html:not(.theme--documenter-dark) body #documenter .docs-sidebar ul.docs-menu li.is-active ul.internal .tocitem:hover, html:not(.theme--documenter-dark) body #documenter .docs-sidebar ul.docs-menu li.is-active .tocitem:hover, html:not(.theme--documenter-dark) body #documenter .docs-sidebar ul.docs-menu li.is-active .tocitem, html:not(.theme--documenter-dark) body #documenter .docs-sidebar ul.docs-menu .tocitem:hover {
24+
color: #FFFFFF;
25+
background-color: #4595D1; }
26+
html:not(.theme--documenter-dark) body #documenter .docs-sidebar ul.docs-menu .tocitem {
27+
color: #FFFFFF;
28+
background: none; }
29+
html:not(.theme--documenter-dark) body #documenter .docs-sidebar ul.docs-menu li.is-active {
30+
border-top: none;
31+
border-bottom: none; }
32+
html:not(.theme--documenter-dark) body #documenter .docs-sidebar ul.docs-menu li.is-active ul.internal {
33+
margin: 0;
34+
border-top: none; }
35+
html:not(.theme--documenter-dark) body #documenter .docs-sidebar ul.docs-menu li.is-active ul.internal li {
36+
margin-top: 0; }
37+
html:not(.theme--documenter-dark) body #documenter .docs-sidebar ul.docs-menu li.is-active ul.internal .tocitem {
38+
color: #194E82;
39+
background-color: #FFFFFF;
40+
padding: 0.5em;
41+
padding-left: 1em; }
42+
43+
html:not(.theme--documenter-dark) body #documenter article#documenter-page a.docs-heading-anchor {
44+
color: #194E82; }
45+
46+
html:not(.theme--documenter-dark) body #documenter pre, html:not(.theme--documenter-dark) body #documenter code {
47+
color: inherit;
48+
font-family: "JuliaMono"; }
49+
html:not(.theme--documenter-dark) body #documenter pre .hljs-meta, html:not(.theme--documenter-dark) body #documenter code .hljs-meta {
50+
color: #4595D1; }
51+
html:not(.theme--documenter-dark) body #documenter pre .hljs-keyword, html:not(.theme--documenter-dark) body #documenter code .hljs-keyword {
52+
color: #194E82; }
53+
54+
.admonition.is-category-terminology {
55+
background-color: #FFFEDD;
56+
border-color: #FFEC8B; }
57+
.admonition.is-category-terminology > .admonition-header {
58+
background-color: #FFEC8B;
59+
color: black; }
60+
.admonition.is-category-terminology > .admonition-header:before {
61+
content: "Terminology: ";
62+
font-family: inherit;
63+
font-weight: bold; }
64+
65+
html.theme--documenter-dark .admonition.is-category-terminology {
66+
border-color: #FFEC8B; }
67+
68+
details {
69+
padding-left: 1rem;
70+
padding-right: 1rem;
71+
padding-bottom: 1rem;
72+
background: aliceblue; }
73+
74+
html.theme--documenter-dark details {
75+
background: #282f2f; }
76+
77+
.video-container {
78+
position: relative;
79+
width: 100%;
80+
padding-bottom: 56.25%; }
81+
82+
.video-container > iframe {
83+
position: absolute;
84+
top: 0;
85+
left: 0;
86+
width: 100%;
87+
height: 100%;
88+
border: 0; }

docs/src/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
```@meta
2+
CurrentModule = UnitDiskMapping
3+
```
4+
5+
# UnitDiskMapping
6+
7+
Please check the following examples:
8+
1. [Unit Disk Mapping](@ref), which contains the examples in ["Quantum Optimization with Arbitrary Connectivity Using Rydberg Atom Arrays"](https://journals.aps.org/prxquantum/abstract/10.1103/PRXQuantum.4.010316):
9+
* Reduction from a generic weighted or unweighted maximum independent set (MIS) problem to that on a King's subgraph (KSG).
10+
* Reduction from a generic or square-lattice QUBO problem to an MIS problem on a unit-disk grid graph.
11+
* Reduction from an integer factorization problem to an MIS problem on a unit-disk grid graph.
12+
13+
2. [Unweighted KSG reduction of the independent set problem](@ref), which contains the unweighted reduction from a general graph to a King's subgraph. It covers all example graphs in paper: "Computer-Assisted Gadget Design and Problem Reduction of Unweighted Maximum Independent Set" (To be published).
14+
15+
![](https://user-images.githubusercontent.com/6257240/198861111-4499c17d-9938-406b-8253-943b01f4633c.png)

docs/src/ref.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Reference
2+
3+
```@autodocs
4+
Modules = [UnitDiskMapping]
5+
```

0 commit comments

Comments
 (0)