Skip to content

Commit

Permalink
Merge 4041fbe into 5190225
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromxavier authored Sep 23, 2023
2 parents 5190225 + 4041fbe commit eac42f1
Show file tree
Hide file tree
Showing 177 changed files with 7,178 additions and 5,181 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
fail-fast: false
matrix:
include:
- version: '1'
- version: '1.9'
os: ubuntu-latest
arch: x64
- version: '1'
- version: '1.9'
os: windows-latest
arch: x64
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup Julia
uses: julia-actions/setup-julia@latest
with:
version: '1.6'
version: '1.9'
- name: Develop QUBOTools.jl
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(path=pwd())'
- name: Build Package
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Manifest.toml
# VSCode
.vscode

# PythonPlots
# PythonPlot
.CondaPkg
29 changes: 24 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
name = "QUBOTools"
uuid = "60eb5b62-0a39-4ddc-84c5-97d2adff9319"
authors = ["pedromxavier <[email protected]>", "pedroripper <[email protected]>", "AndradeTiago <[email protected]>", "joaquimg <[email protected]>", "bernalde <dbernalneira@usra.edu>"]
version = "0.8.2"
authors = ["pedromxavier <[email protected]>", "pedroripper <[email protected]>", "AndradeTiago <[email protected]>", "joaquimg <[email protected]>", "bernalde <dbernaln@purdue.edu>"]
version = "0.10.0"

[deps]
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NetworkLayout = "46757867-2c16-5918-afeb-47bfcb05e46a"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
PseudoBooleanOptimization = "c8fa9a04-bc42-452d-8558-dc51757be744"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[weakdeps]
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"

[extensions]
QUBOTools_MOI = ["MathOptInterface"]

[compat]
GeometryBasics = "0.4"
Graphs = "1"
HDF5 = "0.16.15"
JSON = "0.21.3"
JSONSchema = "1"
RecipesBase = "1.3"
julia = "1.6"
MathOptInterface = "1"
NetworkLayout = "0.4.5"
PseudoBooleanOptimization = "0.1"
RecipesBase = "1"
Statistics = "1"
julia = "1.9"
50 changes: 13 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,72 +51,48 @@ where $J \in \mathbb{R}^{n \times n}$ is triangular and $\mathbf{h} \in \mathbb{
## Getting Started

### Installation

```julia
julia> import Pkg
import Pkg

julia> Pkg.add("QUBOTools")
Pkg.add("QUBOTools")
```

### Basic Usage

```julia
julia> using QUBOTools
using QUBOTools

julia> model = QUBOTools.read_model("problem.json")
model = QUBOTools.read_model("problem.json")

julia> QUBOTools.write_model("problem.qubo", model)
QUBOTools.write_model("problem.qubo", model)
```

## Supported Formats

The `r` and `w` marks indicate that reading and writing modes are available for the corresponding file format, respectively.

### [BQPJSON](/docs/models/BQPJSON.md) `rw`

The [BQPJSON](https://bqpjson.readthedocs.io) format was designed at [LANL-ANSI](https://github.com/lanl-ansi) to represent Binary Quadratic Programs in a platform-independet fashion.
This is accomplished by using `.json` files validated using a well-defined [JSON Schema](/src/models/bqpjson.schema.json).

### [QUBO](/docs/models/QUBOTools.md) `rw`

The QUBO specification appears as the input format in many of D-Wave's applications.
A brief explanation about it can be found in [qbsolv](https://github.com/arcondello/qbsolv#qbsolv-qubo-input-file-format)'s repository README.

### [Qubist](/docs/models/Qubist.md) `rw`

This is the simplest of all current supported formats.

### [MiniZinc](/docs/models/MiniZinc.md) `rw`

[MiniZinc](https://www.minizinc.org) is a constraint modelling language that can be used as input for many solvers.

### [HFS](/docs/models/HFS.md) `w`
HFS is a very low-level mapping of weights to D-Wave's chimera graph.

### Conversion Flowchart
**Bold arrows** indicate that a bijective (modulo rounding erros) conversion is available.
**Regular arrows** indicate that some non-critical information might get lost in the process, such as problem metadata.
**Dashed arrows** tell that even though a format conversion exists, important information such as scale and offset factors will be neglected.

```mermaid
flowchart TD;
MODEL["QUBOTools Model"];
BQPJSON["BQPJSON<br><code>Bool</code><br><code>Spin</code>"];

HFS(["HFS<br><code>Bool</code>"]);
MINIZINC(["MiniZinc<br><code>Bool</code><br><code>Spin</code>"]);
QUBO["QUBO<br><code>Bool</code>"];
QUBIST["Qubist<br><code>Spin</code>"];
QUBIST -.-> MODEL;
MODEL --> HFS;
MODEL --> QUBIST;
MODEL <==> MINIZINC;
MODEL <==> BQPJSON;
QUBO <==> MODEL;
```
HFS is a very low-level mapping of weights to D-Wave's chimera graph.

<div align="center">
<h2>PSR Quantum Optimization Toolchain</h2>
Expand Down
3 changes: 3 additions & 0 deletions benchmark/benchmark.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using BenchmarkTools
using QUBOTools

4 changes: 3 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterDiagrams = "a106ebf2-4182-4cba-90d4-44cd3cc36e85"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
QUBOTools = "60eb5b62-0a39-4ddc-84c5-97d2adff9319"

[compat]
Documenter = "~0.27"
Documenter = "1"
DocumenterDiagrams = "1"
Plots = "~1.38"
32 changes: 17 additions & 15 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
using Documenter
using DocumenterDiagrams
using QUBOTools

# Set up to run docstrings with jldoctest
DocMeta.setdocmeta!(QUBOTools, :DocTestSetup, :(using QUBOTools); recursive = true)

makedocs(;
modules = [QUBOTools],
doctest = true,
clean = true,
format = Documenter.HTML(
assets = ["assets/extra_styles.css", "assets/favicon.ico"],
mathengine = Documenter.KaTeX(),
sidebar_sitename = false,
),
modules = [QUBOTools, QUBOTools.PBO],
doctest = true,
clean = true,
sitename = "QUBOTools.jl",
authors = "Pedro Xavier and and Pedro Ripper and Tiago Andrade and Joaquim Garcia and David Bernal",
pages = [
"Home" => "index.md",
"Manual" => [
authors = "Pedro Maciel Xavier and Pedro Ripper and Tiago Andrade and Joaquim Garcia and David E. Bernal Neira",
workdir = @__DIR__,
warnonly = [:missing_docs],
pages = [
"Home" => "index.md",
"Manual" => [
"Introduction" => "manual/1-start.md",
"Mathematical Formulation" => "manual/2-math.md",
"Basic Usage" => "manual/3-usage.md",
"Models" => "manual/4-models.md",
"File Formats" => "manual/5-formats.md",
"Solutions" => "manual/6-solutions.md",
"Analysis" => "manual/7-analysis.md"
"Analysis" => "manual/7-analysis.md",
],
"Formats" => [
"BQPJSON" => "formats/BQPJSON.md",
"HFS" => "formats/HFS.md",
"MiniZinc" => "formats/MiniZinc.md",
"QUBin" => "formats/QUBin.md",
"Qubist" => "formats/Qubist.md",
"QUBO" => "formats/QUBO.md",
],
"API Reference" => "api.md",
],
workdir = @__DIR__,
format = Documenter.HTML(
assets = ["assets/extra_styles.css", "assets/favicon.ico"],
mathengine = Documenter.KaTeX(),
sidebar_sitename = false,
),
)

if "--skip-deploy" ARGS
Expand Down
Loading

0 comments on commit eac42f1

Please sign in to comment.