Tell me about Spin Reversal Transforms (SRTs)

The QPU Usage Guidelines offer 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_qpu_3.html#using-spin-reversal-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/c_handbook_6.html#using-spin-reversal-gauge-transforms

The handbook goes into further, more technical description:
https://docs.dwavesys.com/docs/latest/c_handbook_9.html#detailsgaugetransformations

 

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_1.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_dimod/reference/sampler_composites/composites.html#dimod.reference.composites.spin_transform.SpinReversalTransformComposite

 

Here is a link to the implementation:
https://docs.ocean.dwavesys.com/en/stable/_modules/dimod/reference/composites/spin_transform.html

 

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!

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.