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

D-Wave examples break during scheduled maintenance windows #117

Closed
jonbest-aws opened this issue Feb 23, 2022 · 11 comments
Closed

D-Wave examples break during scheduled maintenance windows #117

jonbest-aws opened this issue Feb 23, 2022 · 11 comments
Labels
good first issue Good for newcomers

Comments

@jonbest-aws
Copy link

At least the max cut example [0] breaks during D-Wave maintenance windows due to the Advantage_system4 ARN being hardcoded. Should these use auto-selection?

[0] https://github.com/aws/amazon-braket-examples/blob/main/examples/quantum_annealing/Dwave_MaximumCut.ipynb

@christianbmadsen
Copy link
Contributor

christianbmadsen commented Mar 1, 2022

Thank you for the call-out @jonbest-aws.

For DWave we have two options to prevent the issue

Option 1 - Instantiate sampler without specifying the device
Use the first available DWave device for the sampler so long as the problem allows it (see https://github.com/aws/amazon-braket-ocean-plugin-python/blob/main/src/braket/ocean_plugin/braket_sampler.py#L61-L63).

Option 2 - Use branching logic to find an online solver
If the Advantage solver is needed branching logic like the following can be used instead

device_arns = [device.arn for device in AwsDevice.get_devices(provider_names=["D-Wave Systems"], statuses=["ONLINE"])]
adv_device_arns = filter(lambda arn: "Advantage" in arn, device_arns)
sampler = BraketDWaveSampler(adv_device_arns[0])

For completeness, we are using the Advantage_system4 ARN explicitly in 7 files

  1. Getting_Devices_and_Checking_Device_Properties.ipynb
  2. Dwave_GraphPartitioning.ipynb
  3. Dwave_MinimumVertexCoverProblem.ipynb
  4. Dwave_MaximumCut.ipynb
  5. Dwave_Anatomy.ipynb
  6. Dwave_StructuralImbalance/Dwave_StructuralImbalance.ipynb
  7. Running_large_problems_using_QBSolv.ipynb

As a final note it looks like cell 3 in https://github.com/aws/amazon-braket-examples/blob/main/examples/quantum_annealing/Dwave_MaximumCut.ipynb could just be removed.

@kshitijc kshitijc added the good first issue Good for newcomers label Mar 1, 2022
@JuanGiraldo0212
Copy link

Hi, I'm working on this issue.

@christianbmadsen
Copy link
Contributor

Great! Thank you @JuanGiraldo0212. If you have questions as you go along just post them to this issue and we will provide answers.

@christianbmadsen
Copy link
Contributor

@JuanGiraldo0212 that would be great! Thanks!

@JuanGiraldo0212
Copy link

Thanks @christianbmadsen, do I need some permissions to push the branch and create the PR?

@christianbmadsen
Copy link
Contributor

@JuanGiraldo0212 have you forked the repo? You want to fork the repo, do your development and then create the PR from your fork.

@JuanGiraldo0212
Copy link

Sorry I forgot to fork it, my bad. I just created the PR @christianbmadsen

@christianbmadsen
Copy link
Contributor

Thank you for the PR. We will take a look and provide feedback!

@JuanGiraldo0212
Copy link

Thanks

@christianbmadsen
Copy link
Contributor

DWave examples were removed in November. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants