-
Notifications
You must be signed in to change notification settings - Fork 64
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
Deprecate VirtualGraphComposite
#532
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,11 @@ | |
# limitations under the License. | ||
|
||
""" | ||
Deprecated. | ||
Virtual graphs are deprecated due to improved calibration of newer QPUs; to | ||
calibrate chains for residual biases, follow the instructions in the | ||
`shimming tutorial <https://github.com/dwavesystems/shimming-tutorial>`_. | ||
|
||
A :std:doc:`dimod composite <oceandocs:docs_dimod/reference/samplers>` that | ||
uses the D-Wave virtual graph feature for improved | ||
:std:doc:`minor-embedding <oceandocs:docs_system/intro>`. | ||
|
@@ -32,14 +37,19 @@ | |
from dwave.system.composites.embedding import FixedEmbeddingComposite | ||
from dwave.system.flux_bias_offsets import get_flux_biases | ||
|
||
from warnings import warn | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python libraries get imported first. Also, IMO it's nicer to just |
||
|
||
FLUX_BIAS_KWARG = 'flux_biases' | ||
|
||
__all__ = ['VirtualGraphComposite'] | ||
|
||
|
||
class VirtualGraphComposite(FixedEmbeddingComposite): | ||
"""Composite to use the D-Wave virtual graph feature for minor-embedding. | ||
"""Deprecated. Composite to use the D-Wave virtual graph feature for minor-embedding. | ||
|
||
This class is deprecated due to improved calibration of newer QPUs; to | ||
calibrate chains for residual biases, follow the instructions in the | ||
`shimming tutorial <https://github.com/dwavesystems/shimming-tutorial>`_. | ||
|
||
Calibrates qubits in chains to compensate for the effects of biases and enables easy | ||
creation, optimization, use, and reuse of an embedding for a given working graph. | ||
|
@@ -127,6 +137,13 @@ def __init__(self, sampler, embedding, | |
flux_bias_max_age=3600): | ||
|
||
super(VirtualGraphComposite, self).__init__(sampler, embedding) | ||
warn( | ||
"'VirtualGraphComposite' is deprecated due to improved calibration " | ||
"of newer QPUs and in future will raise an exception; if needed, " | ||
"follow the instructions in the shimming tutorial at " | ||
"https://github.com/dwavesystems/shimming-tutorial instead. ", | ||
DeprecationWarning | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we might need to set the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I saw that we are inconsistent. LeapHybridDQMSampler sets the |
||
) | ||
self.parameters.update(apply_flux_bias_offsets=[]) | ||
|
||
# Validate the chain strength, or obtain it from J-range if chain strength is not provided. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using
.. deprecated:: version
Sphinx directive.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that now for the class (line 50 below).