dwave.system.temperatures.fast_effective_temperature#

fast_effective_temperature(sampler: Sampler, num_reads: int | None = None, seed: None | int | RandomState = None, h_range: Tuple = (-0.1639344262295082, 0.1639344262295082), nodelist: List | None = None, sampler_params: dict | None = None, optimize_method: str | None = 'bisect', num_bootstrap_samples: int | None = 0) Tuple[float64, float64][source]#

Estimate the effective temperature, \(T\), of a sampler.

This function submits a set of single-qubit problems to a sampler and uses the rate of excitations to infer a maximum-likelihood estimate of temperature.

Use the maximum_pseudolikelihood_temperature() function for greater control of the problem Hamiltonian or more-general samplers.

Parameters:
  • sampler (dimod.Sampler, optional, default=DWaveSampler) – A dimod sampler.

  • num_reads (int, optional) – Number of reads to use. Defaults to 100 when not specified in the sampler_params parameter.

  • seed (int, optional) – Seeds the problem-generation process, allowing reproducibility from pseudo-random samplers.

  • h_range (float, default = \([-1/6.1,1/6.1]\)) – Determines the range of external fields probed for temperature inference. Default is based on D-Wave’s Advantage processor, where single-qubit freeze-out implies an effective temperature of 6.1 (see freezeout_effective_temperature). The range should be chosen inversely proportional to the anticipated temperature for statistical efficiency, and to accomodate precision and other nonidealities such as precision limitations.

  • nodelist (list, optional) – Variables included in the estimator. Defaults to the node list (DWaveSampler.nodelist) of the structured sampler (QPU) being used.

  • sampler_params (dict, optional) – Any additional non-default sampler parameters. If num_reads is provided, must be compatible with num_reads parameter.

  • optimize_method (str, optional) – Optimization method used by the SciPy root_scalar algorithm. The default method works well under default operation; the ‘bisect’ method can be numerically more stable when operated without defaults.

  • num_bootstrap_samples (int, optional, default=0) – Number of bootstrap samples to use for estimation of the standard error. By default no bootstrapping is performed and the standard error defaults to 0.

Returns:

Effective temperature describing single-qubit problems in an external field, and a standard error (\(\pm 1\) sigma). By default the confidence interval is set as 0.

Return type:

Tuple[float, float]

Raises:
  • ValueError – If the sampler is not structured, and no nodelist is provided.

  • ValueError – If num_reads is inconsistent with num_reads specified in the sampler_params parameter.

See also

Examples

This example draws samples from a quantum computer (using the DWaveSampler class) and establishs its temperature.

>>> from dwave.system.temperatures import fast_effective_temperature
>>> from dwave.system import DWaveSampler
>>> sampler = DWaveSampler()
...
>>> T, _ = fast_effective_temperature(sampler)
>>> print('Effective temperature at freeze-out is',T)    
Effective temperature at freeze-out is  0.21685104745347336