Utilities#

Utility functions.

common_working_graph(graph0, graph1)

Creates a graph using the common nodes and edges of two given graphs.

coupling_groups(hardware_graph)

Generate groups of couplers for which a limit on total coupling applies for each group.

Temperature and Unit-Conversion Utilities#

The following parameter estimation methods are provided:

  • 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. The following links describe features of the estimator in application to equilibrium distribution drawn from binary quadratic models and non-equilibrium distributions generated by annealing: https://www.jstor.org/stable/25464568 https://doi.org/10.3389/fict.2016.00023

  • An effective temperature can also be inferred assuming freeze-out during the anneal at \(s=t/t_a\), an annealing schedule, and a device physical temperature. Necessary device-specific properties are published for online solvers in the Per-QPU Solver Properties and Schedules section.

  • Maximum pseudo-likelihood can be used to infer multiple parameters of an exponential (Boltzmann) distribution given fair samples. Code supports inference for the probability distributions structured as \(P(s) = \exp(-\text{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 h1, h2 and J12 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 code is not optimized for inferring many local terms, but rather parameters controlling the energy of many degrees of freedom (spins). A practically important example is the case that \(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.

  • The biases (h) equivalent to application of flux bias, or vice-versa, can be inferred as a function of the anneal progress \(s=t/t_a\) by device-specific unit conversion. The necessary parameters for estimation [Mafm, B(s)] are published for online solvers in the Per-QPU Solver Properties and Schedules section

effective_field(bqm[, samples, ...])

Returns the effective field for all variables and all samples.

fast_effective_temperature(sampler[, ...])

Provides an estimate to the effective temperature, \(T\), of a sampler.

fluxbias_to_h([fluxbias, Ip, B, MAFM, ...])

Convert flux biases to equivalent problem Hamiltonian bias h.

freezeout_effective_temperature(freezeout_B, ...)

Provides an effective temperature as a function of freezeout information.

h_to_fluxbias([h, Ip, B, MAFM, units_Ip, ...])

Convert problem Hamiltonian bias h to equivalent flux bias.

Ip_in_units_of_B([Ip, B, MAFM, units_Ip, ...])

Estimate qubit persistent current \(I_p(s)\) in schedule units.

maximum_pseudolikelihood([en1, bqms, ...])

Maximimum pseudolikelihood estimator for exponential models.

maximum_pseudolikelihood_temperature([bqm, ...])

Returns a sampling-based temperature estimate.

background_susceptibility_ising(h, J)

Create the field and couplings for the background susceptibility correction.

background_susceptibility_bqm(bqm[, chi])

Create the binary quadratic model for the background susceptibility correction.