def fit_tomography_data(tomo_data, method='wizard', options=None):
    "\n    Reconstruct a density matrix or process-matrix from tomography data.\n\n    If the input data is state_tomography_data the returned operator will\n    be a density matrix. If the input data is process_tomography_data the\n    returned operator will be a Choi-matrix in the column-vectorization\n    convention.\n\n    Args:\n        tomo_data (dict): process tomography measurement data.\n        method (str): the fitting method to use.\n            Available methods:\n                - 'wizard' (default)\n                - 'leastsq'\n        options (dict or None): additional options for fitting method.\n\n    Returns:\n        numpy.array: The fitted operator.\n\n    Available methods:\n        - 'wizard' (Default): The returned operator will be constrained to be\n                              positive-semidefinite.\n            Options:\n            - 'trace': the trace of the returned operator.\n                       The default value is 1.\n            - 'beta': hedging parameter for computing frequencies from\n                      zero-count data. The default value is 0.50922.\n            - 'epsilon: threshold for truncating small eigenvalues to zero.\n                        The default value is 0\n        - 'leastsq': Fitting without positive-semidefinite constraint.\n            Options:\n            - 'trace': Same as for 'wizard' method.\n            - 'beta': Same as for 'wizard' method.\n    Raises:\n        Exception: if the `method` parameter is not valid.\n    "
    if (isinstance(method, str) and (method.lower() in ['wizard', 'leastsq'])):
        trace = __get_option('trace', options)
        beta = __get_option('beta', options)
        rho = __leastsq_fit(tomo_data, trace=trace, beta=beta)
        if (method == 'wizard'):
            epsilon = __get_option('epsilon', options)
            rho = __wizard(rho, epsilon=epsilon)
        return rho
    else:
        raise Exception(('Invalid reconstruction method "%s"' % method))
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.
def fit_tomography_data(tomo_data, method='wizard', options=None):
    "\n    Reconstruct a density matrix or process-matrix from tomography data.\n\n    If the input data is state_tomography_data the returned operator will\n    be a density matrix. If the input data is process_tomography_data the\n    returned operator will be a Choi-matrix in the column-vectorization\n    convention.\n\n    Args:\n        tomo_data (dict): process tomography measurement data.\n        method (str): the fitting method to use.\n            Available methods:\n                - 'wizard' (default)\n                - 'leastsq'\n        options (dict or None): additional options for fitting method.\n\n    Returns:\n        numpy.array: The fitted operator.\n\n    Available methods:\n        - 'wizard' (Default): The returned operator will be constrained to be\n                              positive-semidefinite.\n            Options:\n            - 'trace': the trace of the returned operator.\n                       The default value is 1.\n            - 'beta': hedging parameter for computing frequencies from\n                      zero-count data. The default value is 0.50922.\n            - 'epsilon: threshold for truncating small eigenvalues to zero.\n                        The default value is 0\n        - 'leastsq': Fitting without positive-semidefinite constraint.\n            Options:\n            - 'trace': Same as for 'wizard' method.\n            - 'beta': Same as for 'wizard' method.\n    Raises:\n        Exception: if the `method` parameter is not valid.\n    "
    if (isinstance(method, str) and (method.lower() in ['wizard', 'leastsq'])):
        trace = __get_option('trace', options)
        beta = __get_option('beta', options)
        rho = __leastsq_fit(tomo_data, trace=trace, beta=beta)
        if (method == 'wizard'):
            epsilon = __get_option('epsilon', options)
            rho = __wizard(rho, epsilon=epsilon)
        return rho
    else:
        raise Exception(('Invalid reconstruction method "%s"' % method))