Skip to content

Conversation

@giovanipollachini
Copy link

In the documentation for the classical simulation (Getting Started -> Initial Setup -> Using a Classical Solver), there is only an example about an Ising problem. This pull request adds an example about local classical simulation of a QUBO problem and adds minor changes to the text.

These changes are meant to make it easier for the reader to try out classical simulation of the examples that appear later on, in the documentation. These examples are frequently formulated as QUBO problems, such as the Boolean NOT Gate (https://docs.ocean.dwavesys.com/en/latest/examples/not.html#not).

Organize the text in subsections 'Examples: Solving Ising Models' and 'Examples: Solving QUBO Models'.
Small editings on subsection 'Example: Solving Ising Models'. Writing the content of the subsection 'Example: Solving QUBO Models'.
Copy link
Collaborator

@JoelPasvolsky JoelPasvolsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giovanipollachini, thank you for contributing! You raise a good point about examples formulated as QUBOs and helping users see how to move between Ising and QUBO forms. When you worked through these examples yourself, on which did you start feeling you'd have benefited from this additional information? My thinking is that this section (a) comes before https://docs.ocean.dwavesys.com/en/latest/overview/solving_problems.html where input formats are introduced and (b) is focused on showing the interchangeability of dimod samplers rather than solving Ising/QUBO problems -- for newcomers it can be hard to get one's head around all the new concepts so adding conversions here might make the section daunting for those looking just at what is required to work with the system. To keep this section focused, can you update the local change to a reference existing conversion material (e.g., https://docs.dwavesys.com/docs/latest/c_handbook_3.html#native-formulations-ising-and-qubo-and-mis), add your example to dimod (i.e., https://docs.ocean.dwavesys.com/projects/dimod/en/latest/reference/utilities.html#vartype-conversion), and add a reference to your dimod example in the QUBO-based example where you feel it most needed?

@giovanipollachini
Copy link
Author

@JoelPasvolsky , thank you for the comments!
I missed this information about solving QUBO problems via classical simulation while working through some examples at https://docs.ocean.dwavesys.com/en/latest/getting_started.html#examples . And I thought updating https://docs.ocean.dwavesys.com/en/latest/overview/cpu.html would be a good idea, since this was the only section mentioning the classical solver in Ocean Documentation. But your comments made me realize it was not the main point of that section, and it seems too early to present this information there.

I'll check the other links you sent

Do you think it would be useful to include a subsection inside "Examples" about classical simulation of QUBO? I though about something along the lines of :

  • Examples
    • Classical Simulation
    • Beginner-Level Examples
    • Intermediate-Level Examples
    • Advanced-Level Examples

Or, perhaps, to include this example on classical simulation as one of the beginner-level examples.
What do you think?

@JoelPasvolsky
Copy link
Collaborator

@giovanipollachini, thank you for following up on this. Currently the examples under https://docs.ocean.dwavesys.com/en/latest/getting_started.html#examples begin with classical sampling in the 2nd and 3rd beginners' examples:

A new user going through the Getting Started examples experiences a learning trajectory of using (1) a hybrid sampler that abstracts the underlying hardware (2) the interchangeability of dimod samplers (classical and quantum) (3) QPU/hybrid usage

From our discussion I understand that what is missing for you is the separate aspect of applying different problem formulations, Ising and QUBO, to the sampling, which could be classical or quantum. Considering two places for that info: (1) a sixth beginners' example (2) providing the Ising formulation in the https://docs.ocean.dwavesys.com/en/latest/examples/not.html#not example, my preference is for (2) in order to not dilute the functioning of these examples as entry points of various programming models: CS, math, physics. Another point to keep in mind is that the overall purpose is to encourage quantum programming, not classical :-).

Would you like update your PR accordingly? You could add a section, say "Alternative Formulation: Ising" between sections https://docs.ocean.dwavesys.com/en/latest/examples/not.html#solve-the-problem-by-sampling and https://docs.ocean.dwavesys.com/en/latest/examples/not.html#summary, where you's reuse your proposed content for QUBO --> Ising translation ("change of variables :math:a = 2r-1 and :math:b = 2s-1") and maybe even use a classical sampler (e.g., neal rather than the earlier dimod) instead of the QPU used for the QUBO.

See also something similar I did for the Leap Quantum Coding Challenge back in February: https://support.dwavesys.com/hc/en-us/community/posts/360027456373-Problem-5-Find-the-Ising-Equivalent-of-a-QUBO-Representing-a-NOT-Gate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants