ProcessTomographyFitter.fit¶
- ProcessTomographyFitter.fit(method='auto', standard_weights=True, beta=0.5, **kwargs)[source]¶
Reconstruct a quantum channel using CVXPY convex optimization.
Choi matrix
The Choi matrix object is a QuantumChannel representation which may be converted to other representations using the classes SuperOp, Kraus, Stinespring, PTM, Chi from the module qiskit.quantum_info.operators. The raw matrix data for the representation may be obtained by channel.data.
Fitter method
The
cvx
fitter method used CVXPY convex optimization package. Thelstsq
method uses least-squares fitting (linear inversion). Theauto
method will usecvx
if the CVXPY package is found on the system, otherwise it will default tolstsq
.Objective function
This fitter solves the constrained least-squares minimization: \(minimize: ||a \cdot x - b ||_2\)
subject to:
\(x >> 0\) (PSD)
\(\text{trace}(x) = \text{dim}\) (trace)
\(\text{partial_trace}(x) = \text{identity}\) (trace_preserving)
where:
a is the matrix of measurement operators \(a[i] = \text{vec}(M_i).H\)
b is the vector of expectation value data for each projector \(b[i] \sim \text{Tr}[M_i.H \cdot x] = (a \cdot x)[i]\)
x is the vectorized Choi-matrix to be fitted
PSD constraint
The PSD keyword constrains the fitted matrix to be postive-semidefinite. For the
lstsq
fitter method the fitted matrix is rescaled using the method proposed in Reference [1]. For thecvx
fitter method the convex constraint makes the optimization problem a SDP. If PSD=False the fitted matrix will still be constrained to be Hermitian, but not PSD. In this case the optimization problem becomes a SOCP.Trace constraint
The trace keyword constrains the trace of the fitted matrix. If trace=None there will be no trace constraint on the fitted matrix. This constraint should not be used for process tomography and the trace preserving constraint should be used instead.
Trace preserving (TP) constraint
The trace_preserving keyword constrains the fitted matrix to be TP. This should only be used for process tomography, not state tomography. Note that the TP constraint implicitly enforces the trace of the fitted matrix to be equal to the square-root of the matrix dimension. If a trace constraint is also specified that differs from this value the fit will likely fail. Note that this can only be used for the CVX method.
CVXPY Solvers:
Various solvers can be called in CVXPY using the solver keyword argument. See the CVXPY documentation for more information on solvers.
References:
- [1] J Smolin, JM Gambetta, G Smith, Phys. Rev. Lett. 108, 070502
(2012). Open access: arXiv:1106.5458 [quant-ph].
- Parameters
method (
str
) – (default: ‘auto’) the fitter method ‘auto’, ‘cvx’ or ‘lstsq’.standard_weights (
bool
) – (default: True) apply weights to tomography data based on count probabilitybeta (
float
) – (default: 0.5) hedging parameter for converting counts to probabilities**kwargs – kwargs for fitter method.
- Raises
ValueError – In case the input data is no a valid process matrix
QiskitError – If the fit method is unrecognized
- Returns
The fitted Choi-matrix J for the channel that maximizes \(||\text{basis_matrix} \cdot \text{vec}(J) - \text{data}||_2\). The Numpy matrix can be obtained from Choi.data.
- Return type