def fit_tomography_data(tomo_data, method='<STR_LIT>', options=None):
if isinstance(method, str) and method.lower() in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>trace = __get_option('<STR_LIT>', options)<EOL>beta = __get_option('<STR_LIT>', options)<EOL>rho = __leastsq_fit(tomo_data, trace=trace, beta=beta)<EOL>if method == '<STR_LIT>':<EOL><INDENT>epsilon = __get_option('<STR_LIT>', options)<EOL>rho = __wizard(rho, epsilon=epsilon)<EOL><DEDENT>return rho<EOL><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>' % method)<EOL><DEDENT>
Reconstruct a density matrix or process-matrix from tomography data.

If the input data is state_tomography_data the returned operator will
be a density matrix. If the input data is process_tomography_data the
returned operator will be a Choi-matrix in the column-vectorization
convention.

Args:
    tomo_data (dict): process tomography measurement data.
    method (str): the fitting method to use.
        Available methods:
            - 'wizard' (default)
            - 'leastsq'
    options (dict or None): additional options for fitting method.

Returns:
    numpy.array: The fitted operator.

Available methods:
    - 'wizard' (Default): The returned operator will be constrained to be
                          positive-semidefinite.
        Options:
        - 'trace': the trace of the returned operator.
                   The default value is 1.
        - 'beta': hedging parameter for computing frequencies from
                  zero-count data. The default value is 0.50922.
        - 'epsilon: threshold for truncating small eigenvalues to zero.
                    The default value is 0
    - 'leastsq': Fitting without positive-semidefinite constraint.
        Options:
        - 'trace': Same as for 'wizard' method.
        - 'beta': Same as for 'wizard' method.
Raises:
    Exception: if the `method` parameter is not valid.