ccvm-simulators

Solve continuous non-convex optimization problems with Coherent Continous-Variable Machine (CCVM) architectures and solvers

https://github.com/1qb-information-technologies/ccvm

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.2%) to scientific vocabulary

Keywords

boxqp ccvm
Last synced: 10 months ago · JSON representation ·

Repository

Solve continuous non-convex optimization problems with Coherent Continous-Variable Machine (CCVM) architectures and solvers

Basic Info
  • Host: GitHub
  • Owner: 1QB-Information-Technologies
  • License: agpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 104 MB
Statistics
  • Stars: 9
  • Watchers: 2
  • Forks: 0
  • Open Issues: 41
  • Releases: 0
Topics
boxqp ccvm
Created over 3 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Changelog Contributing License Citation Codeowners Security

README.md

Coherent Continous-Variable Machine Simulators

License: AGPL v3 Maintainer Paper Docs

This software package includes solvers for continuous optimization problems. The solvers are simulators of coherent continuous-variable machines (CCVM), which are novel coherent network computing architectures based on NTT Researchs coherent Ising machines (CIM). In CCVMs, the physical properties of optical pulses (e.g., mean-field quadrature amplitudes and phase) represent the continuous variables of a given optimization problem. Various features of CCVMs can be used along with programming techniques to implement the constraints imposed by such an optimization problem. Included are methods for solving box-constrained quadratic programming (BoxQP) problems using CCVM simulators by mapping the variables of the problems into the random variables of CCVMs.

Table of Contents

  1. Requirements
  2. Quickstart
  3. Usage
  4. Documentation
  5. Contributing
  6. References
  7. License

Requirements

  • Python (supported version: 3.10)

Supported operating systems

  • macOS (Monterey, Big Sur)
  • Ubuntu (20.04)

Quickstart

  1. Once you have cloned the repository, install the package using pip. pip install ccvm-simulators

  2. Go into examples/ and run the demo scripts.

    • ccvm_boxqp_dl.py: Solve a BoxQP problem using a CCVM simulator, w/o plotting
    • ccvm_boxqp_plot.py: Solve a BoxQP problem using a CCVM simulator, w/ time-to-solution (TTS) plotting
    • For more demo scripts see examples/README.md
  3. View the generated plot.

    • The ccvm_boxqp_plot.py script solves a single problem instance, and will create an image of the resulting TTS plot in a plots/ directory. The resulting output image, DL-CCVM_TTS_cpu_plot.png, will look something like this:

Extending the Example

  1. Plotting larger datasets
    • The ccvm_boxqp_plot.py script is a toy example that plots the TTS for only a single problem instance.
    • It can be extended to solve multiple problems over a range of problem sizes.
    • When solution metadata is saved for multiple problems, the graph becomes more informative, for example:

  1. Other types of plots
    • ccvmplotlib can also plot the success probability data, for example:

Usage

Solving a BoxQP Problem

1. Import Modules

python from ccvm_simulators.problem_classes.boxqp import ProblemInstance from ccvm_simulators.solvers import DLSolver

2. Define a Solver

python solver = DLSolver(device="cpu", batch_size=100) # or "cuda" solver.parameter_key = { 20: {"pump": 2.0, "dt": 0.005, "iterations": 15000, "noise_ratio": 10}, }

3. Load a Problem Instance

python boxqp_instance = ProblemInstance( instance_type="test", file_path="./examples/benchmarking_instances/single_test_instance/test020-100-10.in", device=solver.device, )

4. Scale the Coefficients

The BoxQP problem matrix Q and vector V are normalized to obtain a uniform performance across different problem sizes and densities. The ideal range depends on the solver. For best results, Q should be passed to the solver's get_scaling_factor() method to determine the best scaling value for the problemsolver combination.

python boxqp_instance.scale_coefs(solver.get_scaling_factor(boxqp_instance.q_matrix))

5. Solve the Problem Instance

```python solution = solver( instance=boxqpinstance, postprocessor=None, )

print(f"The best known solution to this problem is {solution.optimal_value}")

The best known solution to this problem is 799.560976

print(f"The best objective value found by the solver was {solution.bestobjectivevalue}")

The best objective value found by the solver was 798.1630859375

print(f"The solving process took effectively {solution.solve_time} seconds to solve a single instance")

The solving process took 0.008949262142181396 seconds

```

Documentation

The package documentation can be found here.

Additional links: - Problem definition: BoxQP problem class - Plotting library: ccvmplotlib

Contributing

We appreciate your pull requests and welcome opportunities to discuss new ideas. Check out our contribution guide and feel free to improve the ccvm_simulators package. For major changes, please open an issue first to discuss any suggestions for changes you might have.

Thank you for considering making a contribution to our project! We appreciate your help and support.

References

This repository contains architectures and simulators presented in the paper "Non-convex Quadratic Programming Using Coherent Optical Networks" by Farhad Khosravi, Ugur Yildiz, Martin Perreault, Artur Scherer, and Pooya Ronagh.

License

APGLv3

Owner

  • Name: 1QBit
  • Login: 1QB-Information-Technologies
  • Kind: organization
  • Location: Vancouver, BC

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use the `ccvm-simulators` package in your work, please cite the following paper:"
authors:
- family-names: Khosravi
  given-names: Farhad
- family-names: Yildiz
  given-names: Ugur
- family-names: Scherer
  given-names: Artur
- family-names: Ronagh
  given-names: Pooya
title: "Non-convex Quadratic Programming Using Coherent Optical Networks"
journal: arXiv
version: 0.1.0
year: 2022
volume: abs/2209.04415
doi: 10.48550/arxiv.2209.04415

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 111
  • Total pull requests: 79
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 8 days
  • Total issue authors: 8
  • Total pull request authors: 9
  • Average comments per issue: 0.18
  • Average comments per pull request: 0.35
  • Merged pull requests: 73
  • Bot issues: 0
  • Bot pull requests: 5
Past Year
  • Issues: 0
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 2
Top Authors
Issue Authors
  • KatieO4t1qbit (33)
  • fredp4t1qbit (29)
  • FarhadK-1QBit (16)
  • Estella-Wang-1qbit (15)
  • MehmetC-1QBit (11)
  • KyleM4t1qbit (3)
  • ChanWooY-1QBit (1)
  • saneer1996 (1)
Pull Request Authors
  • KatieO4t1qbit (29)
  • Estella-Wang-1qbit (22)
  • MehmetC-1QBit (13)
  • saneer1996 (11)
  • FarhadK-1QBit (10)
  • dependabot[bot] (7)
  • ChanWooY-1QBit (5)
  • fredp4t1qbit (4)
  • MarkoB4t1qbit (1)
Top Labels
Issue Labels
enhancement (26) bug (10) done (10) Testing (9) needs review (3)
Pull Request Labels
needs review (17) done (8) dependencies (7)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 27 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 2
pypi.org: ccvm-simulators

Solve continuous non-convex optimization problems with CCVM architectures and simulators

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 27 Last month
Rankings
Dependent packages count: 6.6%
Average: 19.2%
Downloads: 20.5%
Dependent repos count: 30.6%
Maintainers (2)
Last synced: 11 months ago