This function performs linear tomography, a set of simple calculations to find a state relatively close to the state of interest. For the purpose of this library, linear tomography is generally used to find the starting state for the more rigorous Maximum Likelihood method.
The tomography_LINEAR function first ensures that the measurement states you are using are a minimal spanning set. If not, it transforms them into a minimal spanning set.
The coincidences and measurements are then transformed so that only those corresponding to the measurements needed to create an independent set are used.
The function uses the independent sets of coincidences and measurements to add measurement density matrices to the estimated state, weighted by their corresponding coincidence counts.
The state is normalized by its trace to transform into a valid density matrix and is returned.