GPU-Accelerated Models

Introduction

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.Model

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

n_modelparams
expparams_dtype
is_n_outcomes_constant

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]
n_outcomes(expparams)[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]