Utilities#
Utility functions.
|
Calculates the anneal schedule for a given anneal offset. |
|
Creates a graph using the common nodes and edges of two given graphs. |
|
Generate groups of couplers for which a limit on total coupling applies for each group. |
Generates the energy scales for a custom anneal schedule. |
Temperature and Unit-Conversion Utilities#
Some notes on the parameter-estimation methods provided below:
fluxbias_to_h()
andh_to_fluxbias()
The biases (\(h\)) equivalent to application of flux bias or vice-versa can be inferred as a function of the normalized anneal fraction, \(s=t/t_a\), by device-specific unit conversion. The needed parameters for estimation (\(\textrm M_{\textrm{AFM}}\), \(B(s)\)) are published for online solvers in the Per-QPU Solver Properties and Schedules section.
freezeout_effective_temperature()
An effective temperature can be inferred from assuming freeze-out during the anneal, at \(s=t/t_a\), an annealing schedule, and a physical temperature for the device. The needed device-specific properties are published for online solvers in the Per-QPU Solver Properties and Schedules section.
maximum_pseudolikelihood_temperature()
Maximum pseudo-likelihood is an efficient estimator for the temperature describing a classical Boltzmann distribution, \(P(s) = \exp(-H(s)/T)/Z(T)\), given samples from that distribution, where \(H(x)\) is the classical energy function. [Chat2007] and [Ray2016] describe features of the estimator in application to equilibrium distribution drawn from binary quadratic models and non-equilibrium distributions generated by annealing.
-
Maximum pseudo-likelihood can be used to infer multiple parameters of an exponential (Boltzmann) distribution given fair samples. The method supports inference for probability distributions structured as \(P(s) = \exp(-\sum_i x_i H_i(s)) /Z(x)\), a generalization of a Boltzmann distribution parameterized only by the temperature (\(T=1/x\) for one \(H\)). \(H_i\) are binary quadratic models defined on a common set of variables. E.g.: To infer \(h_1\), \(h_2\) and \(J_{12}\) for a 2-qubit spin system at temperature 1 consider:
>>> H_1 = dimod.BinaryQuadraticModel.from_ising({0:1, 0: 0}, {}) >>> H_2 = dimod.BinaryQuadraticModel.from_ising({0:0, 0: 1}, {}) >>> H_3 = dimod.BinaryQuadraticModel.from_ising({}, {(0,1): 1})
This method is not optimized for inferring many local terms, but rather parameters controlling the energy of many degrees of freedom (spins). An example of practical importance is the case where \(h_1\) is the programmed Hamiltonian (\(x_1\) is inverse temperature, beta) and \(h_2\) is a correction accounting for imbalance in \(h/J\) asymmetry or background susceptibility.
|
Create the binary quadratic model for the background susceptibility correction. |
Calculate the biases and couplings due to background susceptibility. |
|
|
Returns the effective field for all variables and all samples. |
|
Estimate the effective temperature, \(T\), of a sampler. |
|
Convert flux biases to equivalent problem Hamiltonian bias |
|
Calculate an effective temperature for a freezeout point. |
|
Convert problem Hamiltonian bias |
|
Estimate qubit persistent current \(I_p(s)\) in schedule units. |
|
Maximimum pseudolikelihood estimator for exponential models. |
|
Return a sampling-based temperature estimate. |
Chatterjee, Sourav. “Estimation in Spin Glasses: A First Step.” The Annals of Statistics 35, no. 5 (2007): 1931-46. http://www.jstor.org/stable/25464568