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]#
Provides an estimate to 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. For greater control of the problem Hamiltonian or more general samplers, maximum_pseudolikelihood_temperature should be preferred.
- Parameters:
sampler (
dimod.Sampler
, optional, default=DWaveSampler
) – A dimod sampler.num_reads (int, optional) – Number of reads to use. Default is 100 if not specified in
sampler_params
.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 a D-Wave 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. If not provided defaulted to the nodelist of the structured sampler (QPU) specified.
sampler_params (dict, optional) – Any additional non-defaulted sampler parameterization. If
num_reads
is a key, must be compatible withnum_reads
argument.optimize_method (str, optional) – Optimize method used by SciPy
root_scalar
method. The default method works well under default operation, ‘bisect’ 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 is defaulted to 0.
- Returns:
The effective temperature describing single qubit problems in an external field, and a standard error (+/- 1 sigma). By default the confidence interval is set as 0.
- Return type:
- Raises:
ValueError – If the sampler is not structured, and no nodelist is provided.
ValueError – If num_reads is inconsistent with sampler_params
Examples
Draw samples from a
DWaveSampler
and establish the 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
See also
The function
freezeout_effective_temperature
may be used in combination with published device values to estimate single-qubit freeze-out, in approximate agreement with empirical estimates of this function.