Skip to content

84monta/SimulatedAnnealing

Repository files navigation

Simulated Annealing for QNNCloud

To compare quantum annealing with traditional way, I created this example code.

Requirement

  • Python 3.x

Optional

if you want to use GPU(CUDA), get libraries as followings:

pip install cupy
pip install chainer

https://qnncloud.com/index-jp.html

Usage

  1. Put code and inputdata(*.jij) in same directory

  2. just run python SimulatedAnnealing.py

no argument. Non :(

Change code directly

Variables

Simulated Annealing definition

#Definition 
T_MAX  = 100.0
T_MIN  = 0.001
MAX_STEMPS = 20

T_LOOP = 600
  • T_MAX A starting temperature for a simulation
  • T_MIN A final temperature for a simulation
  • MAX_STEMPS How many numbers do you chop between T_MAX and T_MIN
  • T_LOOP How many time do you try to change a status on each temperature

Input data

You can use data which is donwloaded from QNNCloud web page.

#f = open('201712030215556824-Jij.json', 'r') # for 100 CHANGE PERSON =100
f = open('201711282214561557-Jij.json', 'r') # for 1000 CHANGE PERSON =1000
#f = open('201712052235195895-Jij.json', 'r') # for 2000 CHANGE PERSON =2000

Size of problem

Adjust "PERSON" to fit a problem size. (equal to input data)

PERSONS = 1000
  • PERSONS You can change this variable to fit Input data size

Trial number

TRIAL=1
  • TRIAL How many times do you wanna repeat Simulated Annealing?

Enjoy!

About

to compare quantum anealing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages