Skip to content

Commit

Permalink
Merge pull request #64 from psrenergy/px/docs
Browse files Browse the repository at this point in the history
Write Docs for `v0.1.5`
  • Loading branch information
pedromxavier authored Apr 20, 2023
2 parents 3e37e5c + 65b0441 commit ac8be79
Show file tree
Hide file tree
Showing 32 changed files with 868 additions and 276 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ jobs:
- uses: julia-actions/setup-julia@latest
with:
version: '1.6'
- name: Develop ToQUBO.jl
run: julia --project=docs -e 'using Pkg; Pkg.develop(path=pwd())'
- uses: julia-actions/julia-buildpkg@latest
with:
project: "docs/"
project: "docs"
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
run: julia --project=docs/ docs/make.jl
run: julia --project=docs docs/make.jl
2 changes: 1 addition & 1 deletion CITATION.bib
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% If you use this software, please cite it as below.
@software{toqubo:2023,
author = {Pedro Maciel Xavier and Pedro Ripper and Tiago Andrade and Joaquim Dias Garcia and David E. Bernal Neira},
title = {ToQUBO.jl},
title = {{ToQUBO.jl}},
month = {feb},
year = {2023},
publisher = {Zenodo},
Expand Down
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ ToQUBO.jl was written as a [MathOptInterface](https://github.com/jump-dev/MathOp

### Installation
ToQUBO is available via Julia's Pkg:
```julia
julia> ]add ToQUBO
```
or

```julia
julia> using Pkg

Expand All @@ -53,9 +50,10 @@ model = Model(() -> ToQUBO.Optimizer(ExactSampler.Optimizer))
optimize!(model)

for i = 1:result_count(model)
xᵢ = value.(x, result = i)
yᵢ = objective_value(model, result = i)
println("f($xᵢ) = $yᵢ")
xi = value.(x, result = i)
yi = objective_value(model, result = i)

println("f($xi) = $yi")
end
```

Expand Down Expand Up @@ -135,15 +133,15 @@ If you think this list is incomplete, consider creating an [Issue](https://githu
## Citing ToQUBO.jl
If you use `ToQUBO.jl` in your work, we kindly ask you to include the following citation:
```tex
@software{toqubo:2022,
author = {Pedro Xavier and Tiago Andrade and Joaquim Garcia and David Bernal},
@software{toqubo:2023,
author = {Pedro Maciel Xavier and Pedro Ripper and Tiago Andrade and Joaquim Dias Garcia and David E. Bernal Neira},
title = {{ToQUBO.jl}},
month = {mar},
year = {2022},
month = {feb},
year = {2023},
publisher = {Zenodo},
version = {v0.1.0},
doi = {10.5281/zenodo.6387592},
url = {https://doi.org/10.5281/zenodo.6387592}
version = {v0.1.5},
doi = {10.5281/zenodo.7644291},
url = {https://doi.org/10.5281/zenodo.7644291}
}
```

Expand Down
6 changes: 4 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ DWaveNeal = "870cdf72-5502-4b10-839c-127ceab78f22"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
MQLib = "16f11440-1623-44c9-850c-358a6c72f3c9"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
QUBODrivers = "a3f166f7-2cd3-47b6-9e1e-6fbfe0449eb0"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PythonPlot = "274fc56d-3b97-40fa-a1cd-1b4a50311bf9"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
ToQUBO = "9a412ddf-83fa-43b6-9748-7843c851aa65"

[compat]
CSV = "0.10"
DWaveNeal = "0.4"
DataFrames = "1.3"
Documenter = "0.27"
JuMP = "1"
Expand Down
54 changes: 40 additions & 14 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,50 @@ DocMeta.setdocmeta!(
)

makedocs(;
modules=[ToQUBO],
doctest=true,
clean=true,
format=Documenter.HTML(
assets = ["assets/extra_styles.css", "assets/favicon.ico"],
mathengine=Documenter.MathJax2(),
sidebar_sitename=false,
modules = [ToQUBO],
doctest = true,
clean = true,
format = Documenter.HTML(
sidebar_sitename = false,
mathengine = Documenter.KaTeX(
Dict(
:macros => Dict(
raw"\set" => raw"\left\lbrace{#1}\right\rbrace"
)
)
),
assets = [
"assets/extra_styles.css",
"assets/favicon.ico",
asset("https://tikzjax.com/v1/fonts.css"; class = :css),
asset("https://tikzjax.com/v1/tikzjax.js"; class = :js),
],
),
sitename="ToQUBO.jl",
authors="Pedro Xavier and Tiago Andrade and Joaquim Garcia and David Bernal",
pages=[
sitename = "ToQUBO.jl",
authors = "Pedro Maciel Xavier and Pedro Ripper and Tiago Andrade and Joaquim Dias Garcia and David E. Bernal Neira",
pages = [
"Home" => "index.md",
"Manual" => "manual.md",
"Manual" => [
"Getting Started" => "manual/1-start.md",
"Running a Model" => "manual/2-model.md",
"Gathering Results" => "manual/3-results.md",
"Compiler Settings" => "manual/4-settings.md",
],
"Examples" => [
"Knapsack" =>"examples/knapsack.md",
"Prime Factorization" => "examples/prime_factorization.md",
"Knapsack" => "examples/knapsack.md",
"Prime Factorization" => "examples/prime_factorization.md",
"Portfolio Optimization" => "examples/portfolio_optimization.md",
],
"Booklet" => [
"Introduction" => "booklet/1-intro.md",
"QUBO" => "booklet/2-qubo.md",
"PBO" => "booklet/3-pbo.md",
"Encoding" => "booklet/4-encoding.md",
"Virtual Mapping" => "booklet/5-virtual.md",
"The Compiler" => "booklet/6-compiler.md",
"Solvers" => "booklet/7-solvers.md",
"Appendix" => "booklet/8-appendix.md",
],
"Booklet" => "booklet.md"
],
workdir="."
)
Expand Down
23 changes: 0 additions & 23 deletions docs/src/assets/README.md

This file was deleted.

13 changes: 12 additions & 1 deletion docs/src/assets/extra_styles.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
.docs-sidebar .docs-logo > img {
max-height: 16rem !important;
margin: auto;
}
}

/* Center images & diagrams */
p:has(img) {
text-align: center;
margin: 0 auto;
}

div.mermaid {
text-align: center;
margin: 0 auto;
}
Binary file added docs/src/assets/figures/quantum-chip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
24 changes: 24 additions & 0 deletions docs/src/assets/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Ref:
** https://discourse.julialang.org/t/use-javascript-library-with-documenter-jl/34984/8
*/
require.config({
paths: {
mermaid: "https://cdnjs.cloudflare.com/ajax/libs/mermaid/9.4.0/mermaid.min"
}
});

require(['mermaid'], function (mermaid) {
mermaid.initialize({
startOnLoad : true,
theme : 'neutral',
// themeVariables: {
// primaryColor: '#BB2528',
// primaryTextColor: '#fff',
// primaryBorderColor: '#7C0000',
// lineColor: '#F8B229',
// secondaryColor: '#006100',
// tertiaryColor: '#aaa',
// noteBorderColor: '#ff0',
// }
})
});
121 changes: 0 additions & 121 deletions docs/src/booklet.md

This file was deleted.

11 changes: 11 additions & 0 deletions docs/src/booklet/1-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ToQUBO.jl Booklet

This booklet aims to gather the theoretical and practical details behind `ToQUBO` and provide documentation for project internals.
The target audience includes, among others, advanced users and those willing to contribute to the project.
The latter are advised to read the following sections, as they give a glimpse of the ideas employed up to now.

## Table of Contents
```@contents
Pages = ["2-qubo.md", "3-pbo.md", "4-encoding.md", "5-virtual.md", "6-compiler.md", "7-solvers.md", "8-appendix.md"]
Depth = 2
```
Loading

2 comments on commit ac8be79

@pedromxavier
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/82005

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.6 -m "<description of version>" ac8be795fb607c8a6c2d3984d89cdce9054dc95f
git push origin v0.1.6

Please sign in to comment.