The End of the Getting Started Guide offers a high level description of the benefits of using SRTs, as well as a number of other ways to maximize performance:
https://docs.dwavesys.com/docs/latest/c_gs_9.html#num-spin-reversal-transforms
For more information, check out the Problem Solving Handbook:
https://docs.dwavesys.com/docs/latest/handbook_qpu.html#spin-reversal-gauge-transforms
This could be a good place to start, placing SRTs in the broader context of other manners of performance tuning.
In our Problem Solving Handbook the topic is introduced and the benefits of using SRTs and why they were introduced is discussed:
https://docs.dwavesys.com/docs/latest/handbook_qpu.html#spin-reversal-gauge-transforms
There are two ways to apply an SRT to your problem data.
Method 1: Server-Side SRT
As mentioned in the Problem Solving Handbook, the num_spin_reversal_transforms parameter can be used to request that SRTs are applied to the sample request data.
This parameter is included in the sample call to the sampler object like this:
sampleset = sampler.sample(bqm, num_spin_reversal_transforms=3, num_reads=3)
The num_spin_reversal_transforms parameter tells the server how many times to do an SRT throughout the process of doing num_reads.
This means, for example, that if you had equal values for both num_spin_reversal_transforms and num_reads, an SRT would be applied to each.
For more information about the num_spin_reversal_transforms parameter and SRTs performed on the server, please read:
https://docs.dwavesys.com/docs/latest/c_solver_parameters.html#num-spin-reversal-transforms
There are many advantages to performing the SRTs on the server-side, such as efficiency, and the ability to apply post-processing operations with SRTs in mind, to name a few.
Unfortunately, as the SRT is on the server in this case, it is not possible to see the code used.
That said, the client-side implementation is a comparable implementation.
Method 2: Client-Side SRT
Additionally, SRTs can be performed on the client side by using the SpinReversalTransformComposite class.
This class will automatically apply SRTs, before sending the problems to the server, and then reverse the SRTs after the results are returned.
Here is a link to the documentation:
https://docs.ocean.dwavesys.com/en/stable/docs_preprocessing/reference/composites.html?highlight=SpinReversalTransformComposite#dwave.preprocessing.composites.SpinReversalTransformComposite
Here is a link to the implementation:
https://github.com/dwavesystems/dimod/blob/main/dimod/reference/composites/spin_transform.py
If for whatever reason, you need slightly different functionality, or have an optimization that you think would speed things up, it's always possible to write your own implementation and share it with the community as well!
Comments
Please sign in to leave a comment.