Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openjij.BinaryQuadraticModel does not support dwave's EmbeddingComposite etc. #263

Open
tatsuyagoto-Jij opened this issue May 27, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@tatsuyagoto-Jij
Copy link
Contributor

Describe the bug
openjij.BinaryQuadraticModelから生成したインスタンス(例えばbqm = dimod.BinaryQuadraticModel.from_qubo(Q=qubo, offset=offset))は、dwave.system.compositesのEmbeddingCompositeなどに投げると
AttributeError: 'BinaryQuadraticModel' object has no attribute 'spin'というエラーが出ます。

To Reproduce
Steps to reproduce the behavior:

  1. openjijチュートリアルの9-Solving Graph Coloring Problem with PyQUBOのコードをqubo, offset = model.to_qubo()の部分まで実行してqubo, offsetを得る
  2. bqm = oj.BinaryQuadraticModel.from_qubo(Q=qubo, offset=offset)によりbqmを得る
  3. 以下のようにしてdwave.system.compositesのEmbeddingCompositeにbqmを投げると、上記のエラーが得られる

from dwave.system.composites import EmbeddingComposite
dw = DWaveSampler(token="XX")
sampler = EmbeddingComposite(child_sampler=dw)
response = sampler.sample(bqm)

Expected behavior
EmbeddingCompositeによるsampleが問題なく行える

Additional context
原因は、EmbeddingCompositeのソースコードかわかるように
openjij.BinaryQuadraticModelにspinアトリビュートがないことだと思われます。

@tatsuyagoto-Jij tatsuyagoto-Jij added the bug Something isn't working label May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant