-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from psrenergy/px/compiler
ToQUBO Compiler Upgrade
- Loading branch information
Showing
106 changed files
with
4,228 additions
and
3,964 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
name = "ToQUBO" | ||
uuid = "9a412ddf-83fa-43b6-9748-7843c851aa65" | ||
authors = ["pedromxavier <[email protected]>", "pedroripper <[email protected]>", "joaquimg <[email protected]>", "AndradeTiago <[email protected]>", "bernalde <[email protected]>"] | ||
version = "0.1.6" | ||
version = "0.1.7" | ||
|
||
[deps] | ||
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" | ||
PseudoBooleanOptimization = "c8fa9a04-bc42-452d-8558-dc51757be744" | ||
QUBOTools = "60eb5b62-0a39-4ddc-84c5-97d2adff9319" | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" | ||
|
||
[compat] | ||
MathOptInterface = "1" | ||
QUBOTools = "0.8.0" | ||
julia = "1.6" | ||
QUBOTools = "0.9" | ||
julia = "1.9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
[deps] | ||
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" | ||
DWaveNeal = "870cdf72-5502-4b10-839c-127ceab78f22" | ||
DWave = "4d534982-bf11-4157-9e48-fe3a62208a50" | ||
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
JuMP = "4076af6c-e467-56ae-b986-b466b2749572" | ||
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" | ||
Measures = "442fdcdd-2543-5da2-b0f3-8c86c306513e" | ||
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" | ||
Documenter = "1" | ||
JuMP = "1" | ||
MathOptInterface = "1" | ||
ToQUBO = "0.1" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Sunflower Font License | ||
|
||
```@raw txt | ||
MadeType | ||
behance.com/madetype | ||
https://www.fontspring.com/fonts/madetype | ||
https://creativemarket.com/MadeType | ||
https://www.youworkforthem.com/designer/1002/madetype/ | ||
https://crella.net/store/madetype/ | ||
https://thehungryjpeg.com/madetype | ||
END USER LICENSE AGREEMENT | ||
- FOR PERSONAL USE. | ||
- Contact me at [email protected] before commercial using it. | ||
- MadeType is not liable for any damage resulting from the use ot this typeface. | ||
- All rights are retained by MadeType. | ||
THANK YOU! | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,29 @@ | ||
# Pseudo-Boolean Optimization | ||
|
||
Internally, problems are represented through a Pseudo-Boolean Optimization (PBO) framework. | ||
The main goal is to represent a given problem using a Pseudo-Boolean Function (PBF) since there is an immediate correspondence between optimization over quadratic PBFs and the QUBO formalism. | ||
|
||
```@docs | ||
ToQUBO.PBO.PseudoBooleanFunction | ||
``` | ||
|
||
## Quadratization | ||
|
||
In order to successfully achieve a QUBO formulation, sometimes it is needed to quadratize the resulting PBF, i.e., reduce its degree until reaching the quadratic case. | ||
|
||
A quadratization is a mapping ``\mathcal{Q}: \mathscr{F} \to \mathscr{F}^{2}`` such that | ||
|
||
```math | ||
```math | ||
\forall f \in \mathscr{F}, \forall x \in \{0, 1\}^{n}, \min_{y} \mathcal{Q}\left\lbrace{}f\right\rbrace{}(x; y) = f(x) | ||
``` | ||
|
||
There are many quadratization methods available[^Dattani2019], and `ToQUBO` implements two of them for now. | ||
However, using Julia's multiple dispatch paradigm, it's possible to extend the quadratization method coverage with your own algorithms. | ||
|
||
```@docs | ||
ToQUBO.PBO.quadratize! | ||
``` | ||
|
||
[^Dattani2019]: | ||
Nikesh S. Dattani, **Quadratization in discrete optimization and quantum mechanics**, *ArXiv*, 2019 [{doi}](https://doi.org/10.48550/arXiv.1901.04405) | ||
|
||
### Implemented Quadratization Techniques | ||
|
||
Currently, `ToQUBO` has two reduction algorithms, one for negative and another for positive terms. | ||
|
||
```@docs | ||
ToQUBO.PBO.NTR_KZFD | ||
ToQUBO.PBO.PTR_BG | ||
``` | ||
### Quadratization Methods | ||
|
||
### Stable Quadratization | ||
|
||
The quadratization of a PBF does not guarantee that the resulting function will always be the same, as the order of terms can be different each time. This can be an issue in some situations where a deterministic output is required. | ||
|
||
With said that, we have introduced the concept of Stable Quadratization, where the terms of the PBF are sorted, guaranteeing that the resulting PBF will be the same every time. | ||
We have defined it as an attribute of the compiler, with the [`ToQUBO.Attributes.StableQuadratization`](@ref) flag. | ||
|
||
|
||
|
||
### A Primer on Submodularity | ||
A set function ``f : 2^{S} \to \mathbb{R}`` is said to be submodular if | ||
|
||
```math | ||
f(X \cup Y) + f(X \cap Y) \le f(X) + f(Y) \forall X, Y \subset S | ||
``` | ||
|
||
holds. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
072730a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
072730a
There was a problem hiding this comment.
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/95281
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
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: