Skip to content

JuliaQUBO/CIMOptimizer.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CIMOptimizer.jl

cim-optimizer Coherent Ising Machine wrapper for JuMP

DOI QUBODRIVERS

Installation

julia> import Pkg; Pkg.add(url="https://github.com/JuliaQUBO/CIMOptimizer.jl")

julia> using CIMOptimizer

Python runtime compatibility

CIMOptimizer uses PythonCall and CondaPkg to install cim-optimizer ==1.0.4 with conda pytorch-cpu. The CondaPkg runtime supports Python >=3.10,<3.12, including Python 3.11 for shared benchmark environments with DWave v0.7.2.

QiskitOpt v0.7.0 currently requires an isolated Python environment when used alongside CIMOptimizer. Its PyPI numpy ~=2.2.0 constraint conflicts with the conda NumPy version pinned by the pytorch-cpu stack used here.

Getting started

using JuMP
using CIMOptimizer
const CIM = CIMOptimizer

model = Model(CIM.Optimizer)

n = 3
Q = [ -1  2  2
       2 -1  2
       2  2 -1 ]

@variable(model, x[1:n], Bin)
@objective(model, Min, x' * Q * x)

optimize!(model)

for i = 1:result_count(model)
    xi = value.(x; result = i)
    yi = objective_value(model; result = i)

    println("[$i] f($(xi)) = $(yi)")
end

Note: The cim-optimizer wrapper for Julia is not officially supported by Cornell University's McMahon Lab. If you are interested in official support for Julia from McMachon Lab, let them know!

Note: If you are using CoherentIsingMachine.jl in your project, we recommend you to include the .CondaPkg entry in your .gitignore file. The PythonCall module will place a lot of files in this folder when building its Python environment.

About

cim-optimizer wrapper for JuMP

Topics

Resources

License

Stars

2 stars

Watchers

2 watching

Forks

Contributors

Languages