def __init__(self, linear=None, quadratic=None):
        """Determines the sample values by minimizing the local energy.

        Args:
            linear (dict): The linear biases of the source model. Should be a dict of
                the form {v: bias, ...} where v is a variable in the source model
                and bias is the linear bias associated with v.
            quadratic (dict): The quadratic biases of the source model. Should be a dict
                of the form {(u, v): bias, ...} where u, v are variables in the
                source model and bias is the quadratic bias associated with (u, v).
        """
        if linear is None and quadratic is None:
            raise TypeError("the minimize_energy method requires `linear` and `quadratic` keyword arguments")
        self._linear = linear if linear is not None else defaultdict(float)
        self._quadratic = quadratic if quadratic is not None else dict()
def __init__ ( self , linear = None , quadratic = None ) : if linear is None and quadratic is None : raise TypeError ( "the minimize_energy method requires `linear` and `quadratic` keyword arguments" ) self . _linear = linear if linear is not None else defaultdict ( float ) self . _quadratic = quadratic if quadratic is not None else dict ( )
Determines the sample values by minimizing the local energy.

        Args:
            linear (dict): The linear biases of the source model. Should be a dict of
                the form {v: bias, ...} where v is a variable in the source model
                and bias is the linear bias associated with v.
            quadratic (dict): The quadratic biases of the source model. Should be a dict
                of the form {(u, v): bias, ...} where u, v are variables in the
                source model and bias is the quadratic bias associated with (u, v).