GPU-Accelerated Models


These models demonstrate using GPU acceleration with PyOpenCL to efficiently perform likelihood calls.

AcceleratedPrecessionModel - GPU model for a single qubit Larmor precession

class qinfer.AcceleratedPrecessionModel(context=None)[source]

Bases: qinfer.abstract_model.FiniteOutcomeModel

Reimplementation of qinfer.test_models.SimplePrecessionModel, using OpenCL to accelerate computation.


Returns True if and only if the number of outcomes for each experiment is independent of the experiment being performed.

This property is assumed by inference engines to be constant for the lifetime of a Model instance.

static are_models_valid(modelparams)[source]

Returns an array of dtype uint describing the number of outcomes for each experiment specified by expparams.

Parameters:expparams (numpy.ndarray) – Array of experimental parameters. This array must be of dtype agreeing with the expparams_dtype property.
likelihood(outcomes, modelparams, expparams)[source]