Tomographer  v4.0
Tomographer C++ Framework Documentation
Tomographer::DenseDM::TSpace::LLHMHWalker< DenseLLH_, Rng, LoggerType > Class Template Reference

A random walk in the density matrix space of a Hilbert state space of a quantum system. More...

#include <tomographer/densedm/tspacellhwalker.h>

+ Inheritance diagram for Tomographer::DenseDM::TSpace::LLHMHWalker< DenseLLH_, Rng, LoggerType >:
+ Collaboration diagram for Tomographer::DenseDM::TSpace::LLHMHWalker< DenseLLH_, Rng, LoggerType >:

Public Types

enum  
 see MHWalker Interface More...
 
typedef DenseLLH_ DenseLLH
 The DenseLLH interface object type.
 
typedef DenseLLH::DMTypes DMTypes
 The data types of our problem.
 
typedef DenseLLH::LLHValueType LLHValueType
 The loglikelihood function value type (see DenseLLH Interface e.g. IndepMeasLLH)
 
typedef DMTypes::MatrixType MatrixType
 The matrix type for a density operator on our quantum system.
 
typedef DMTypes::VectorParamType VectorParamType
 Type of an X-parameterization of a density operator (see X Parameterization)
 
typedef DMTypes::RealScalar RealScalar
 The real scalar corresponding to our data types. Usually a double.
 
typedef DMTypes::ComplexScalar ComplexScalar
 The complex real scalar corresponding to our data types. Usually a std::complex<double>.
 
typedef RealScalar StepRealType
 The real scalar type for the step size — this is our scalar type (see MHWalker Interface)
 
typedef MatrixType PointType
 Provided for MHRandomWalk. A point in our random walk = a density matrix.
 
typedef LLHValueType FnValueType
 Provided for MHRandomWalk. The function value type is the loglikelihood value type.
 

Public Member Functions

 LLHMHWalker (const MatrixType &startpt, const DenseLLH &llh, Rng &rng, LoggerType &log_)
 Constructor which just initializes the given fields. More...
 
 LLHMHWalker (LLHMHWalker &&moveother)
 A MHWalker Interface needs to have a move constructor. More...
 
void init ()
 Provided for MHRandomWalk. Initializes some fields and prepares for a random walk. More...
 
const MatrixTypestartPoint ()
 Return the starting point given in the constructor, or a random start point.
 
void thermalizingDone ()
 Callback for after thermalizing is done. No-op.
 
void done ()
 Callback for after random walk is finished. No-op.
 
template<ENABLED_IF( DenseLLH::LLHCalcType==LLHCalcTypeX) >
LLHValueType fnLogVal (const MatrixType &T) const
 Calculate the logarithm of the Metropolis-Hastings function value. More...
 
template<ENABLED_IF( DenseLLH::LLHCalcType==LLHCalcTypeRho) >
LLHValueType fnLogVal (const MatrixType &T) const
 Calculate the logarithm of the Metropolis-Hastings function value. More...
 
MatrixType jumpFn (const MatrixType &cur_T, RealScalar step_size)
 Decides of a new point to jump to for the random walk.
 

Detailed Description

template<typename DenseLLH_, typename Rng, typename LoggerType>
class Tomographer::DenseDM::TSpace::LLHMHWalker< DenseLLH_, Rng, LoggerType >

A random walk in the density matrix space of a Hilbert state space of a quantum system.

The random walk explores the density operators on a Hilbert space of a given dimension, according to the distribution given by the likelihood function on the Hilbert-schmidt uniform prior.

Template Parameters
DenseLLHa type satisfying the DenseLLH type interface (DenseLLH Interface)
Rnga std::random random number generator (such as std::mt19937)
LoggerTypea logger type (see Logging and Loggers)

Definition at line 72 of file tspacellhwalker.h.

Member Enumeration Documentation

§ anonymous enum

template<typename DenseLLH_ , typename Rng , typename LoggerType >
anonymous enum

see MHWalker Interface

Enumerator
UseFnSyntaxType 

We will calculate the log-likelihood function, which is the logarithm of the Metropolis-Hastings function we should be calculating.

Definition at line 101 of file tspacellhwalker.h.

Constructor & Destructor Documentation

§ LLHMHWalker() [1/2]

template<typename DenseLLH_ , typename Rng , typename LoggerType >
Tomographer::DenseDM::TSpace::LLHMHWalker< DenseLLH_, Rng, LoggerType >::LLHMHWalker ( const MatrixType startpt,
const DenseLLH llh,
Rng &  rng,
LoggerType &  log_ 
)
inline

Constructor which just initializes the given fields.

The llh object is responsible for calculating the log-likelihood function of the tomography experiment (see class documentation).

The startpt argument specifies the starting point for the random walk (matrix in T Parameterization). If you provide a zero startpt here, then a random starting point will be chosen using the rng random number generator to generate a random point on the sphere.

Definition at line 131 of file tspacellhwalker.h.

§ LLHMHWalker() [2/2]

template<typename DenseLLH_ , typename Rng , typename LoggerType >
Tomographer::DenseDM::TSpace::LLHMHWalker< DenseLLH_, Rng, LoggerType >::LLHMHWalker ( LLHMHWalker< DenseLLH_, Rng, LoggerType > &&  moveother)
inline

A MHWalker Interface needs to have a move constructor.

[This explicit definition seems to be needed for g++ 4.6.]

Definition at line 146 of file tspacellhwalker.h.

Member Function Documentation

§ fnLogVal() [1/2]

template<typename DenseLLH_ , typename Rng , typename LoggerType >
template<ENABLED_IF( DenseLLH::LLHCalcType==LLHCalcTypeX) >
LLHValueType Tomographer::DenseDM::TSpace::LLHMHWalker< DenseLLH_, Rng, LoggerType >::fnLogVal ( const MatrixType T) const
inline

Calculate the logarithm of the Metropolis-Hastings function value.

Returns
the log-likelihood, which is computed via the DenseLLH object.

This implementation deals for DenseLLH objects which expose a logLikelihoodX() function (see DenseLLH Interface)

Definition at line 213 of file tspacellhwalker.h.

§ fnLogVal() [2/2]

template<typename DenseLLH_ , typename Rng , typename LoggerType >
template<ENABLED_IF( DenseLLH::LLHCalcType==LLHCalcTypeRho) >
LLHValueType Tomographer::DenseDM::TSpace::LLHMHWalker< DenseLLH_, Rng, LoggerType >::fnLogVal ( const MatrixType T) const
inline

Calculate the logarithm of the Metropolis-Hastings function value.

Returns
the log-likelihood, which is computed via the DenseLLH object.

This implementation deals for DenseLLH objects which expose a logLikelihoodRho() function (see DenseLLH Interface)

Definition at line 230 of file tspacellhwalker.h.

§ init()

template<typename DenseLLH_ , typename Rng , typename LoggerType >
void Tomographer::DenseDM::TSpace::LLHMHWalker< DenseLLH_, Rng, LoggerType >::init ( )
inline

Provided for MHRandomWalk. Initializes some fields and prepares for a random walk.

Note
If the startpt given to the constructor is zero (or has very small norm), then a uniformly random starting point is chosen. The starting point is chosen randomly according to the Haar-invariant measure on the state space. This corresponds to choosing a uniform point on the sphere corresponding to the T-parameterization of the density matrices.

Definition at line 166 of file tspacellhwalker.h.


The documentation for this class was generated from the following file: