Giter Site home page Giter Site logo

dwave-examples / anneal-schedule-notebook Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 6.0 202 KB

Demonstrates configuring the annealing schedule on D-Wave quantum computers.

License: Other

Jupyter Notebook 80.96% Python 19.04%
advanced bqm jupyter-notebook sampling-distribution

anneal-schedule-notebook's People

Contributors

joelpasvolsky avatar randomir avatar vgoliber avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

anneal-schedule-notebook's Issues

Cell 18 fails as its problem exceeds the max runtime and gets rejected

Now that problems exceeding 1s in duration get rejected, cell 18 of this notebook fails to run completely as it tries to submit a problem with a long pause in the anneal schedule.

Cell 18:

anneal_time=[10.0, 100.0, 500.0]
pause_duration=[10.0, 100.0, 500.0]

# Create list of start times
num_points=5
s_low=0.2
s_high=0.6
pause_start=np.linspace(s_low, s_high, num=num_points)

success_prob = pd.DataFrame(index=range(len(anneal_time)*len(pause_duration)*len(pause_start)),
                                columns=["anneal_time", "pause_duration", "s_feature", "success_frac"],
                                data=None)
counter=0

print("Starting QPU calls...")
QPU_time=0.0
for anneal in anneal_time:
    for pause in pause_duration:
        for start in pause_start:
            schedule=[[0.0,0.0],[start*anneal,start],[start*anneal+pause, start],[anneal+pause, 1.0]]
            runs=950
            results = sampler_embedded.sample_ising(h, J,
                anneal_schedule=schedule,
                num_reads=runs, 
                answer_mode='raw',
                label='Notebook - Anneal Schedule',
                num_spin_reversal_transforms=1)
            success_prob.iloc[counter]={"anneal_time":anneal, 
                                        "pause_duration":pause, 
                                        "s_feature":start,
                                        "success_frac":np.count_nonzero(results.record.energy == -20.0)/runs}
            counter+=1
            QPU_time+=results.info['timing']['qpu_access_time']
        print("QPU calls remaining: ", len(anneal_time)*len(pause_duration)*len(pause_start)-counter)
            
print("QPU calls complete using", QPU_time/1000000.0, "seconds of QPU time.")

It returns the following error when fewer than 5 QPU calls are remaining:
SolverFailureError: The problem cannot be submitted because the estimated QPU access time of 1076943 microseconds for one or more of the problem's spin-reversal transforms exceeds the maximum of 1000000 microseconds for <solver name>. To resolve this issue, see the topic at https://docs.dwavesys.com/docs/latest/c_qpu_timing.html#keeping-within-the-runtime-limit.

Possible solutions: Reduce the pause, the number of reads, or increase the number of spin-reversal transforms.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.