Skip to content

Commit

Permalink
Merge pull request #27 from psrenergy/px/embed-anneal
Browse files Browse the repository at this point in the history
Embed Anneal.jl
  • Loading branch information
pedromxavier authored Mar 24, 2022
2 parents 185c880 + 29e004f commit f873a8a
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 20 deletions.
7 changes: 7 additions & 0 deletions CondaPkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
channels = ["anaconda", "conda-forge"]

[deps]
python = ">=3.7,<4"

[pip.deps]
dwave-neal = ">=0.5.6"
12 changes: 8 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ version = "0.1.0"
[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
# Anneal.jl Deps below:
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[compat]
MathOptInterface = "1"
julia = "1.6"
MathOptInterface = "1"
# Anneal.jl Compat below:
PythonCall = "0.8"

[extras]
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"

[targets]
test = ["Pkg", "Test", "TOML"]
test = ["Test", "TOML"]
14 changes: 5 additions & 9 deletions src/Anneal.jl/src/Anneal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ const SAT{T} = MOI.ScalarAffineTerm{T}
const VI = MOI.VariableIndex
const CI = MOI.ConstraintIndex

# -*- Exports: Submodules -*-
export ExactSampler, RandomSampler, IdentitySampler
export SimulatedAnnealer

# -*- Includes: Anneal -*-
include("error.jl")
include("qubo.jl")
Expand All @@ -24,16 +20,16 @@ include("MOI_wrapper.jl")
# -*- Includes: Submodules -*-
# :: Samplers ::
include("samplers/random/random.jl")
using .RandomSampler
export RandomSampler

include("samplers/exact/exact.jl")
using .ExactSampler
export ExactSampler

include("samplers/identity/identity.jl")
using .IdentitySampler
export IdentitySampler

# :: Annealers ::
include("annealers/simulated/simulated.jl")
using .SimulatedAnnealer
export SimulatedAnnealer

end # module
end # module
2 changes: 1 addition & 1 deletion src/Anneal.jl/src/annealers/simulated/simulated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module SimulatedAnnealer

using PythonCall

using Anneal
using ..Anneal
using MathOptInterface
const MOI = MathOptInterface
const VI = MOI.VariableIndex
Expand Down
2 changes: 1 addition & 1 deletion src/Anneal.jl/src/samplers/exact/exact.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module ExactSampler

using Anneal
using ..Anneal
using MathOptInterface
const MOI = MathOptInterface
const VI = MOI.VariableIndex
Expand Down
2 changes: 1 addition & 1 deletion src/Anneal.jl/src/samplers/identity/identity.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module IdentitySampler

using Anneal
using ..Anneal
using MathOptInterface
const MOI = MathOptInterface
const VI = MOI.VariableIndex
Expand Down
2 changes: 1 addition & 1 deletion src/Anneal.jl/src/samplers/random/random.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module RandomSampler

using Anneal
using ..Anneal
using Random
using MathOptInterface
const MOI = MathOptInterface
Expand Down
4 changes: 4 additions & 0 deletions src/ToQUBO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@ include("qubo.jl")
# -*- MOI Wrapper -*-
include("MOI_wrapper.jl")

# -*- Temporarily: Anneal -*-
include("Anneal.jl/src/Anneal.jl")
export Anneal

end # module
4 changes: 1 addition & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Test
using Pkg
Pkg.develop(path=joinpath(@__DIR__, "..", "src", "Anneal.jl"))

# -*- MOI -*-
import MathOptInterface
Expand All @@ -10,7 +8,7 @@ const VI = MOI.VariableIndex

# -*- Imports -*-
using ToQUBO
using Anneal
using .Anneal
using LinearAlgebra
using TOML

Expand Down

0 comments on commit f873a8a

Please sign in to comment.