psrenergy / dwave.jl Goto Github PK
View Code? Open in Web Editor NEW๐ D-Wave Quantum Annealing Interface for JuMP
License: MIT License
๐ D-Wave Quantum Annealing Interface for JuMP
License: MIT License
DWave currently offers other solvers besides direct access to the QPU, such as their Hybrid Solver Service (HSS).
This package should provide support for those.
I'll look into that, but just reporting it here.
Running the example in the README.md file, I get the following error when executing optimize!()
ERROR: cannot convert this Python 'Variables' to a Julia 'Int64'
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] macro expansion
@ ~/.julia/packages/PythonCall/S5MOg/src/Convert/pyconvert.jl:357 [inlined]
[3] macro expansion
@ ~/.julia/packages/PythonCall/S5MOg/src/Core/Py.jl:132 [inlined]
[4] pyconvert(#unused#::Type{Int64}, x::PythonCall.Core.Py)
@ PythonCall.Convert ~/.julia/packages/PythonCall/S5MOg/src/Convert/pyconvert.jl:372
[5] _broadcast_getindex_evalf
@ ./broadcast.jl:683 [inlined]
[6] _broadcast_getindex
@ ./broadcast.jl:666 [inlined]
[7] getindex
@ ./broadcast.jl:610 [inlined]
[8] copy
@ ./broadcast.jl:888 [inlined]
[9] materialize
@ ./broadcast.jl:873 [inlined]
[10] sample(sampler::DWave.Neal.Optimizer{Float64})
@ DWave.Neal ~/.julia/packages/DWave/Ui1Yj/src/neal/sampler.jl:60
[11] macro expansion
@ ./timing.jl:501 [inlined]
[12] _sample!(sampler::DWave.Neal.Optimizer{Float64})
@ QUBODrivers ~/.julia/packages/QUBODrivers/LBuLL/src/interface/sampler.jl:21
[13] optimize!
@ ~/.julia/packages/QUBODrivers/LBuLL/src/library/sampler/wrappers/moi.jl:52 [inlined]
[14] optimize!
@ ~/.julia/packages/MathOptInterface/2rAFb/src/MathOptInterface.jl:85 [inlined]
[15] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{DWave.Neal.Optimizer{Float64}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
@ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/2rAFb/src/Utilities/cachingoptimizer.jl:316
[16] optimize!
@ ~/.julia/packages/MathOptInterface/2rAFb/src/Bridges/bridge_optimizer.jl:380 [inlined]
[17] optimize!
@ ~/.julia/packages/MathOptInterface/2rAFb/src/MathOptInterface.jl:85 [inlined]
[18] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{DWave.Neal.Optimizer{Float64}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
@ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/2rAFb/src/Utilities/cachingoptimizer.jl:316
[19] optimize!(model::Model; ignore_optimize_hook::Bool, _differentiation_backend::MathOptInterface.Nonlinear.SparseReverseMode, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ JuMP ~/.julia/packages/JuMP/as6Ji/src/optimizer_interface.jl:457
[20] optimize!(model::Model)
@ JuMP ~/.julia/packages/JuMP/as6Ji/src/optimizer_interface.jl:409
[21] top-level scope
@ REPL[32]:1
After installing dwave_networkx
manually in Python, using DWave
will raise the following error.
CondaPkg Found dependencies: /local/scratch/a/peng372/.julia/environments/v1.10/CondaPkg.toml
CondaPkg Found dependencies: /local/scratch/a/peng372/.julia/packages/PythonCall/wXfah/CondaPkg.toml
CondaPkg Found dependencies: /local/scratch/a/peng372/.julia/packages/DWave/Ui1Yj/CondaPkg.toml
CondaPkg Resolving changes
+ dwave_networkx
CondaPkg Installing packages
โ /local/scratch/a/peng372/.julia/artifacts/87052ac9aec71548f804b30280151288cb1ed40e/bin/micromamba
โ -r /local/scratch/a/peng372/.julia/scratchspaces/0b3b1443-0f03-428d-bdfb-f27f9c1191ea/root
โ install
โ -y
โ -p /local/scratch/a/peng372/.julia/environments/v1.10/.CondaPkg/env
โ --override-channels
โ --no-channel-priority
โ dwave_networkx[version='*']
โ minorminer[version='*']
โ pip[version='>=22.0.0']
โ python[version='>=3.7,<4',channel='anaconda']
โ python[version='>=3.7,<=3.11']
โ seaborn[version='*']
โ -c anaconda
โ -c conda-forge
anaconda/linux-64 Using cache
anaconda/noarch Using cache
conda-forge/linux-64 Using cache
conda-forge/noarch Using cache
error libmamba Could not solve for environment specs
The following package could not be installed
โโ dwave_networkx * does not exist (perhaps a typo or a missing channel).
critical libmamba Could not solve for environment specs
ERROR: InitError: failed process: Process(`/local/scratch/a/peng372/.julia/artifacts/87052ac9aec71548f804b30280151288cb1ed40e/bin/micromamba -r /local/scratch/a/peng372/.julia/scratchspaces/0b3b1443-0f03-428d-bdfb-f27f9c1191ea/root install -y -p /local/scratch/a/peng372/.julia/environments/v1.10/.CondaPkg/env --override-channels --no-channel-priority "dwave_networkx[version='*']" "minorminer[version='*']" "pip[version='>=22.0.0']" "python[version='>=3.7,<4',channel='anaconda']" "python[version='>=3.7,<=3.11']" "seaborn[version='*']" -c anaconda -c conda-forge`, ProcessExited(1)) [1]
Stacktrace:
[1] pipeline_error
@ Base ./process.jl:565 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base ./process.jl:480
[3] run(::Cmd)
@ Base ./process.jl:477
[4] _run(io::IO, cmd::Cmd, args::Any; flags::Any)
@ CondaPkg ~/.julia/packages/CondaPkg/MmzxM/src/resolve.jl:398
[5] _resolve_conda_install(io::Any, conda_env::Any, specs::Any, channels::Any; create::Any)
@ CondaPkg ~/.julia/packages/CondaPkg/MmzxM/src/resolve.jl:299
[6] _resolve_conda_install(io::Any, conda_env::Any, specs::Any, channels::Any)
@ CondaPkg ~/.julia/packages/CondaPkg/MmzxM/src/resolve.jl:287
[7] resolve(; force::Bool, io::IO, interactive::Bool, dry_run::Bool)
@ CondaPkg ~/.julia/packages/CondaPkg/MmzxM/src/resolve.jl:525
[8] resolve()
@ CondaPkg ~/.julia/packages/CondaPkg/MmzxM/src/resolve.jl:405
[9] envdir()
@ CondaPkg ~/.julia/packages/CondaPkg/MmzxM/src/env.jl:70
[10] init_context()
@ PythonCall.C ~/.julia/packages/PythonCall/wXfah/src/cpython/context.jl:63
[11] __init__()
@ PythonCall.C ~/.julia/packages/PythonCall/wXfah/src/cpython/CPython.jl:21
[12] run_module_init(mod::Module, i::Int64)
@ Base ./loading.jl:1128
[13] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
@ Base ./loading.jl:1116
[14] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
@ Base ./loading.jl:1061
[15] _tryrequire_from_serialized(modkey::Base.PkgId, path::String, ocachepath::String, sourcepath::String, depmods::Vector{Any})
@ Base ./loading.jl:1475
[16] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
@ Base ./loading.jl:1568
[17] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1932
[18] __require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1806
[19] #invoke_in_world#3
@ Base ./essentials.jl:921 [inlined]
[20] invoke_in_world
@ Base ./essentials.jl:918 [inlined]
[21] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1797
[22] macro expansion
@ Base ./loading.jl:1784 [inlined]
[23] macro expansion
@ Base ./lock.jl:267 [inlined]
[24] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:1747
[25] #invoke_in_world#3
@ Base ./essentials.jl:921 [inlined]
[26] invoke_in_world
@ Base ./essentials.jl:918 [inlined]
[27] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1740
during initialization of module C
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.