56 template<
typename MatrQ_,
typename LLHValueType_ =
double,
bool UseCLoopInstead = false>
60 typedef LLHValueType_ LLHValueType;
101 NMeasAmplifyFactor(1),
102 rho_MLE(matq.initMatrixType()),
103 T_MLE(matq.initMatrixType()),
104 x_MLE(matq.initVectorParamType())
123 namespace tomo_internal
132 template<
typename MatrQ,
typename LLHValueType,
bool UseCLoopInstead>
133 struct LLH_Calculator
144 static inline LLHValueType calc_llh(
const IndepMeasTomoProblem<MatrQ,LLHValueType,UseCLoopInstead> *data,
147 return -2 * data->NMeasAmplifyFactor * (
148 data->Nx.template cast<LLHValueType>() * (data->Exn * x).array().log()
158 template<
typename MatrQ,
typename LLHValueType>
159 struct LLH_Calculator<MatrQ, LLHValueType, true>
161 static inline LLHValueType calc_llh(
const IndepMeasTomoProblem<MatrQ,LLHValueType,true> *data,
166 for (k = 0; k < (
std::size_t)data->Exn.rows(); ++k) {
169 val += data->Nx[k] *
std::log(thisval);
172 return -2 * data->NMeasAmplifyFactor * val;
178 template<
typename MatrQ,
typename LLHValueType,
bool UseCLoopInstead>
183 return tomo_internal::LLH_Calculator<MatrQ, LLHValueType, UseCLoopInstead>::calc_llh(
this, x);
Eigen::Matrix< std::complex< RealScalar >, FixedDim, FixedDim > MatrixType
Complex dim x dim Matrix.
Base namespace for the Tomographer project.
IndepMeasTomoProblem(MatrQ matq_)
Constructs an IndepMeasTomoProblem instance.
const MatrQ matq
The data types for this problem.
Eigen::Array< IntFreqType, Eigen::Dynamic, 1, 0, FixedMaxParamList, 1 > FreqListType
dynamic Array of integers [maximum FixedMaxParamList entries or Dynamic]
const int dim2
The square of the dimension of the Hilbert space, dim2=dim*dim.
MatrQ::MatrixType T_MLE
Maximum likelihood estimate as T-parameterized density matrix.
const int Ndof
The number of degrees of freedom, .
MatrQ::FreqListType Nx
The frequency list, i.e. number of times each POVM effect was observed.
tomo_internal::matrq_traits< MatrQ< FixedDim_, FixedMaxParamList_, RealScalar_, IntFreqType_ > >::RealScalar RealScalar
Real scalar type (usually double)
The dimension of the quantum system, or Eigen::Dynamic.
MatrQ::VectorParamType x_MLE
X-Parameterized version of rho_MLE (param_herm_to_x())
Eigen::Matrix< RealScalar, Eigen::Dynamic, FixedDim2, Eigen::RowMajor, FixedMaxParamList, FixedDim2 > VectorParamListType
dynamic Matrix with rows = dim*dim Vectors (row-major) [maximum FixedMaxParamList rows...
MatrQ::MatrixType rho_MLE
Maximum likelihood estimate as density matrix.
LLHValueType calc_llh(const typename MatrQ::VectorParamType &x) const
Calculates the log-likelihood function.
const int dim
The dimension of the Hilbert space.
Eigen::Matrix< RealScalar, FixedDim2, 1 > VectorParamType
Real dim*dim Vector.
Stores data for a tomography problem with independent measurements.
LLHValueType NMeasAmplifyFactor
A factor to artificially amplify the number of measurements by.
MatrQ::VectorParamListType Exn
The POVM Entries, parameterized with X-param (param_herm_to_x())