-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ideas * test zipper * test measure_memory * test zipper * test zipper * benchmarks * changed n, m, t so that they work for Z4 * bench pegasus * clean up * device * zipper cuda * fix kwargs * bench * cuda tensors * tests * add zipper contractor * adjust * tests pass * tests pass * add Zipper contractor * add Zipper Strategy in tests * crashing example * benchmark pegasus * Revert "benchmark pegasus" This reverts commit 8134dbe. * benchmark pegasus * benchmarks zephyr and pegasus * add squarestar2_zephyr * clean up tests * rewrite cluster assignment rule for zephyr * added minimal zephyr example * added readme for zephyr * added minimal pegasus * added AC3 instances for zephyr * added Z12 and Z16 * added Z8 * gauges on gpu * reordering * test * square * squarestar * test * test * clean up * tests * onGPU * precompute cond squarestar2 * add sampling and instances * overlap between states in sampling * clean up flags onGPU * add flag * correct instances of P4 AC3 * lp * sitetensor * SiteTensor Sparse * VirtualTensor * stash * new PoolOfProjectors * cplex bench (possible error) * CBFM-P instances * clean cplex bench * refactor cpxl bench * clean up * fix a bug * hunting for a bug * qubo works, but not vectorized * huntig bugs * fix a bug * moved CBFM-P to correct folders * benchamrking with cplex * floats bugfix * added time column for results * batched_mul square_star2 * added instances P8 CBFM-P * measure_Spectrum * bench pegasus CBFM-P * mps memory * reduced_env on cpu * matyas instances * results for pegasus * RAU for P8 * aggregated bench results for P4 * test memory allocation of basis operations * added tests for reshape * slicing bench * fixed typo * precompute * working * tests * testing zipper * new parameters (svd and var) in contractor * add Schmidt values in solution * change pegasus_bench2.jl * create output folder * clean up * jdl example * bugfix * zipper parameters * P12 and P16 for CBFM-P * Dtemp_multiplier in MpsParameters * zipper_var - SVDTruncate not working * zipper_var * ploting results * sb_plot changes * method in MpsParams * example for truncated_fg * truncate fg - small examples * truncate_factor_graph * pegasus bench with truncation * bench pegasus with truncated fg * agregated results from dwave for Z3 and Z4 * results PT P4 * created scripts multi_gpu pararel computing * add test for belief propagation * agregated data for Z3 i Z4 * change of names in truncate factor graph * example truncation * test truncate * separate truncation and BP * separate truncation and BP another bench * modify test on BP truncation * draft droplets * draft droplets * separate bp and truncation in bench * added EmptyDroplets and its usage * modified to comply with new Solution struct * added symbol for droplets in search * working tests * droplets * add xor-droplets * single layer drop * add Hamming distance * droplets * hamming * add decode_to_spin * add pathological test for droplets * spinglelayerdroplet * diversity metrics * mo * diversity * droplets add tests * add perm_droplet * add tests hamming * clean up diversity metric * Z2 symmetry in search * rename factor_graph to clustered_hamiltonian * spins in Solution * remove decode_to_spins * split bond_energy * PoolOfProjectors in clustered_hamiltonian * rename square2 and squarestar2 * Z2 symmetry * split long lines in src * move to attic * rename tests * move poster to attic * Z2 symmetry * add docs * docs * add docs for operations and contractor * add docs for search and PEPS * add another merge method * add condition on hamming dist on boundaries * merge_branches_blur * add square instances with diagonals and example * add graphs representing instances * clean up toml * clean up * moved parts of search.jl to droplets.jl * change hamming dist * add docs for droplets.jl * moved some functions from contractor.jl to util.jl * bugfix (commas in export statement) * add test for diagonal lattice * add the docs for PEPS.jl * added descriptions to some files * add docs for search, util and square_cross_double_node * Added simple example for running pegasus graph * add the docs * test for random markov field * add the docs * fix the bug in docs * add droplets for RMF * fix the bug in rmf * add flag for RMF in Contractor * add docs * benchmarking_script * add the docs * add depth in Contractor * add the docs * add the docs * add newest version * add png images * changed julia dependency to 1.8 and 1.9 only * changed versions * update versions * add RAU benchmark * clean bench script * benchamark for RAU P8 RAU 3-5 * fixed "droplets not defined" error * fixed droplets not defined * clean up stuff * bugfix * add instances on a square grid * add instances on a square grid * add benchmarks: square and zephyr instances * add 100 square instances * check ground state after BP * clean up * add P8 RCO bench * script to calculate and draw random markoc field * clean up * optimizing mrf * bugfix * docs add plots * link added * add P8 CBFM-P bench * bench without MPI * stability * LightGraphsfix versions, switch to Graphs * fix caches * mwe for CUDA problems * update mwe to more readable * Fix tests and make the pass (#23) * fix cuda import position * fix chimera pathological * fix chimera overlap python * fix search to clear proper cache * add Exhaustive * restore NNlib * comment out working tests (for now) * fixed hamming tests * fixed hamming_distance in search and tests * fix testów * uncoment all tests * search chimera full passes * fixed the chimera_pathological_Z2 test * bugfix * fix repeated function definitions * comment out long tests * moved gauges to experimental so that they dont stop release (feature is not ready) * uncomment tests * fix deps * remove prints * make tests pass again * update exhaustive versions * update CI workflow --------- Co-authored-by: tomsmierz <[email protected]> * uncomment all tests * remove benchmarks * remove test attic * remove mps stuff --------- Co-authored-by: marekrams <[email protected]> Co-authored-by: annamariadziubyna <[email protected]> Co-authored-by: bartekGardas <[email protected]> Co-authored-by: annamariadziubyna <[email protected]> Co-authored-by: Łukasz Pawela <[email protected]> Co-authored-by: Łukasz Pawela <[email protected]>
- Loading branch information
1 parent
b4b15ef
commit fcf0c16
Showing
96 changed files
with
56,696 additions
and
477 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,41 @@ | ||
name: CI | ||
on: | ||
- push | ||
- pull_request | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
jobs: | ||
test: | ||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} | ||
runs-on: ${{ matrix.os }} | ||
name: Julia ${{ matrix.version }} | ||
runs-on: [self-hosted,titan,gpu] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: | ||
- '1.7' | ||
- '1.8' | ||
os: | ||
- ubuntu-latest | ||
- macOS-latest | ||
arch: | ||
- x64 | ||
- '1.9' | ||
- '1.10' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@v1 | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v2 | ||
with: | ||
version: ${{ matrix.version }} | ||
arch: ${{ matrix.arch }} | ||
- uses: julia-actions/julia-buildpkg@latest | ||
- uses: julia-actions/julia-runtest@latest | ||
env: | ||
JULIA_NUM_THREADS: 4 | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
# - uses: codecov/codecov-action@v1 | ||
# with: | ||
# file: lcov.info | ||
- uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: lcov.info | ||
parallel: true | ||
flag-name: run-${{ matrix.version }} | ||
finish: | ||
needs: test | ||
runs-on: [self-hosted,titan] | ||
steps: | ||
- name: Close parallel build | ||
uses: coverallsapp/github-action@v1 | ||
with: | ||
parallel-finished: true | ||
carryforward: "run-1.9,run-1.10" |
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 |
---|---|---|
|
@@ -10,3 +10,5 @@ docs/build | |
**/.DS_Store | ||
Manifest.toml | ||
sysimage.so | ||
benchmarks/run_bench.sh | ||
*.pb.gz |
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,32 +1,41 @@ | ||
name = "SpinGlassEngine" | ||
uuid = "0563570f-ea1b-4080-8a64-041ac6565a4e" | ||
version = "0.4.0" | ||
authors = ["Anna Maria Dziubyna <[email protected]>", "Tomasz Śmierzchalski <[email protected]>", "Bartłomiej Gardas <[email protected]>", "Konrad Jałowiecki <[email protected]>", "Łukasz Pawela <[email protected]>", "Marek M. Rams <[email protected]>"] | ||
version = "1.0.0" | ||
|
||
[deps] | ||
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" | ||
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" | ||
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" | ||
LabelledGraphs = "605abd48-4d17-4660-b914-d4df33194460" | ||
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
Memoize = "c03570c3-d221-55d1-a50c-7939bbd78826" | ||
MKL = "33e6dc65-8f57-5167-99aa-e5a354878fb2" | ||
Memoization = "6fafb56a-5788-4b4e-91ca-c0cea6611c73" | ||
MetaGraphs = "626554b9-1ddb-594c-aa3c-2596fe9399a5" | ||
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd" | ||
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca" | ||
SpinGlassExhaustive = "a894d7c4-7f54-4100-9d77-d00d924adeb3" | ||
SpinGlassNetworks = "b7f6bd3e-55dc-4da6-96a9-ef9dbec6ac19" | ||
SpinGlassTensors = "7584fc6a-5a23-4eeb-8277-827aab0146ea" | ||
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" | ||
TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b" | ||
TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2" | ||
|
||
[compat] | ||
DocStringExtensions = "0.8" | ||
LabelledGraphs = "0.3" | ||
LightGraphs = "1.3" | ||
Memoize = "0.4" | ||
MetaGraphs = "0.6, 0.7" | ||
ProgressMeter = "1.7" | ||
SpinGlassNetworks = "0.3" | ||
SpinGlassTensors = "0.3" | ||
TensorCast = "0.3, 0.4" | ||
TensorOperations = "3.0.1" | ||
julia = "1.7, 1.8" | ||
CUDA = "5" | ||
DocStringExtensions = "0.9" | ||
Graphs = "1.9" | ||
LabelledGraphs = "0.4.4" | ||
Memoization = "0.2" | ||
MetaGraphs = "0.7" | ||
ProgressMeter = "1.10" | ||
SpinGlassExhaustive = "1.0.0" | ||
SpinGlassNetworks = "1.1.2" | ||
SpinGlassTensors = "1.1.1" | ||
Statistics = "1.7.0" | ||
TensorCast = "0.4" | ||
TensorOperations = "4" | ||
julia = "1.9, 1.10" | ||
|
||
[extras] | ||
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" | ||
|
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,43 +1,5 @@ | ||
# Introduction | ||
We consider a classical Ising Hamiltonian | ||
```math | ||
E = \sum_{<i,j> \in \mathcal{E}} J_{ij} s_i s_j + \sum_j h_i s_j. | ||
``` | ||
where ``s`` is a configuration of ``N`` classical spins taking values ``s_i = \pm 1`` | ||
and ``J_{ij}, h_i \in \mathbb{R}`` are input parameters of a given problem instance. | ||
Nonzero couplings ``J_{ij}`` form a graph ``\mathcal{E}``. Edges of ``\mathcal{E}`` form a quasi-two-dimensional structure. In this package we focus in particular on the [Chimera](https://docs.dwavesys.com/docs/latest/c_gs_4.html#chimera-graph) graph with up to 2048 spins. | ||
A [Julia](http://julialang.org) package for finding low energy spectrum of Ising spin systems. Part of [SpinGlassPEPS](https://github.com/euro-hpc-pl/SpinGlassPEPS.jl) package. | ||
|
||
This part of the documentation is dedicated to describing the `SpinGlassEngine.jl` package, which serves as the actual solver. First, we will demonstrate how to construct a tensor network using the clustered Hamiltonian obtained with the `SpinGlassNetworks.jl` package. Next, we discuss the parameters necessary for conducting calculations, which the user should provide. Finally, we present functions that enable the discovery of low-energy spectra. | ||
|
||
## Finding structure of low energy states | ||
Below we describe simple Ising chain spin system with open boundary condition. The system has three spins with couplings ``J_{12} = -1.0`` and``J_{23} = 1.0``. Additionaly there are local fields ``h_1 = 0.5``, ``h_2 = 0.75`` and ``h_3 = -0.25``. | ||
|
||
We can calculate spectrum using `SpinGlassPEPS`. First we create graph (called Ising graph) which corespond to given Ising system. Then from this graph we create PEPS tensor network. Lastly we define model's parameters and control parameters such as `num_states` - maximal number of low energy states to be found. Then we can use function `low_energy_spectrum` to find desired low energy spectrum. | ||
|
||
|
||
```@example | ||
using SpinGlassEngine, SpinGlassTensors, SpinGlassNetworks, SpinGlassPEPS, MetaGraphs | ||
# Create instance and coresponding factor graph. Details can be | ||
# found in SpinGlassNetworks documentation. | ||
instance = Dict((1, 1) => 0.5, (2, 2) => 0.75, (3, 3) => -0.25, (1, 2) => -1.0, (2, 3) => 1.0) | ||
ig = ising_graph(instance) | ||
fg = factor_graph( | ||
ig, | ||
cluster_assignment_rule = super_square_lattice((3, 1, 1)), | ||
) | ||
# Define inverse temperature for gibbs distribution used in tensor network | ||
# contraction. Details can be found in SpinGlassEngine documentation | ||
β = 1.0 | ||
# Create PEPS network | ||
peps = PEPSNetwork(3, 1, fg, rotation(0), β = β, bond_dim = 32) | ||
# Decide number of states we wane | ||
num_states = 3 | ||
# Solve model | ||
sol = low_energy_spectrum(peps, num_states) | ||
@show sol.states, sol.energies | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Contracting PEPS tensor network | ||
Once we construct the tensor network, we can proceed with its contraction. The first step involves preparing structures to store information about the approximate contraction using the MPS-MPO method and the exploration of states through the branch-and-bound algorithm. | ||
|
||
```@docs | ||
MpsContractor | ||
``` | ||
|
||
# Structures to store parameters used in branch and bound search | ||
```@docs | ||
MpsParameters | ||
SearchParameters | ||
``` | ||
|
||
# Strategy | ||
In the boundary MPS-MPO approach we apply Matrix Product Operator (MPO) to appropriate sites of Matrix Product State (MPS). In this context, the absorption of a MPO into a MPS leads to an exponential growth of the bond dimension. Hence, a truncation scheme is necessary to mitigate this issue and to keep the bond dimension in a reasonable size. | ||
Our package offers users the flexibility to choose between three distinct methods for optimizing the boundary MPS used in contracting the tensor network: | ||
* `Zipper` | ||
* `MPSAnnealing` | ||
* `SVDTruncate`. | ||
`Zipper` method combines randomized truncated Singular Value Decomposition (SVD) and a variational scheme. | ||
```@raw html | ||
<img src="../images/zipper_final.png" width="200%" class="center"/> | ||
``` | ||
With the `SVDTruncate` method, the Matrix Product State (MPS) is systematically constructed row by row, contracted with the Matrix Product Operator (MPO) from the preceding row. The resulting MPS undergoes a Singular Value Decomposition (SVD) to truncate its bond dimension, followed by variational compression. | ||
```@raw html | ||
<img src="../images/svd_truncate.png" width="50%" class="center"/> | ||
``` | ||
On the other hand, the `MPSAnnealing` method tailors the construction of MPS based on variational compression. | ||
```@raw html | ||
<img src="../images/annealing.png" width="50%" class="center"/> | ||
``` | ||
|
||
# Sparsity | ||
Our software package acknowledges the importance of two fundamental methodologies in tensor processing | ||
* `Dense` | ||
* `Sparse`. | ||
The latter, referred to as sparsity, plays a pivotal role in manipulation on large tensors. To accommodate this, our package offers the flexibility to choose the `Sparse` mode. In this mode, tensors are not explicitly constructed but are stored in structures and represented as blocks, in which not every dimension is contracted. This choice not only optimizes memory utilization but also significantly improves computational efficiency. In the `Dense` mode tensors are build explicitly. | ||
|
||
# Geometry | ||
|
||
* `SquareSingleNode` | ||
```@raw html | ||
<img src="../images/square_single.png" width="50%" class="center"/> | ||
``` | ||
```@docs | ||
SquareSingleNode | ||
``` | ||
|
||
* `SquareDoubleNode` | ||
```@raw html | ||
<img src="../images/square_double.png" width="50%" class="center"/> | ||
``` | ||
```@docs | ||
SquareDoubleNode | ||
``` | ||
|
||
* `SquareCrossSingleNode` | ||
```@raw html | ||
<img src="../images/square_cross_single.png" width="50%" class="center"/> | ||
``` | ||
```@docs | ||
SquareCrossSingleNode | ||
``` | ||
|
||
* `SquareCrossDoubleNode` | ||
```@raw html | ||
<img src="../images/square_cross_double.png" width="50%" class="center"/> | ||
``` | ||
```@docs | ||
SquareCrossDoubleNode | ||
``` | ||
|
||
# Layout | ||
`SpinGlassPEPS.jl` allows for different decompositions of the network into MPOs: | ||
* `GaugesEnergy` | ||
* `EnergyGauges` | ||
* `EngGaugesEng` | ||
For complex problems, the solution may depend on the choice of decomposition. | ||
|
||
```@raw html | ||
<img src="../images/layout.png" width="200%" class="center"/> | ||
``` | ||
|
||
# Lattice transformations | ||
Our package offers users the ability to undergo diverse transformations of PEPS network. Notably, users can apply `rotations`, occurring in multiples of $\frac{\pi}{2}$ radians, and `reflections` along various axes. These transformations include rotations and reflections around the horizontal (x), vertical (y), diagonal, and antidiagonal axes. Transformations are used to contract PEPS and perform search starting from different sites of the lattice. | ||
```@raw html | ||
<img src="../images/trans.png" width="200%" class="center"/> | ||
``` | ||
```@docs | ||
all_lattice_transformations | ||
rotation | ||
reflection | ||
``` | ||
|
||
# Gauge | ||
Currently only `NoUpdate` mode is supported. |
Oops, something went wrong.