0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【備忘録】dwave-ocean-sdkのサンプラーでパラメータβを固定する

Posted at

概要

dwave-ocean-sdkのサンプラーを使うことで量子アニーリングができる
量子アニーリングによっての基底状態周辺をサンプリングすることができる
ところで量子アニーラーを用いて単純にボルツマン分布からサンプリングがしたい場合、つまりMCMCを行いたい場合どうすれば良いのか
それを行うために、ボルツマン分布βの値を固定したい
例えばβ=1のMCMCを走らせ、逆温度1のボルツマン分布に従うサンプルを集めるにはどう実装すれば良いのか

実装

ソルバーはDW_2000Q_VFYC_6を使う

from dwave.system.samplers import DWaveSampler
from dwave.system.composites import EmbeddingComposite

token = '*****************'
solver = 'DW_2000Q_VFYC_6'

dw = DWaveSampler(token=token, solver=solver)
sampler = EmbeddingComposite(dw)

このソルバーではパラメータβを固定することができる。
DW_2000Q_6とかだとβを指定することができず量子アニーリングになる

NUM_READS = 1000
sample_params={'beta': 1, 'num_reads': NUM_READS}

sampleset = sampler.sample_ising(h=h, J=J, **sample_params)

まとめ

時間があったらもっと丁寧に書きたい

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?