def estimation_stats(self):  # pragma: no cover
        """Returns some statistics about the memory usage and quality of the approximation."""

        num_coefs_used = sum([Mi.data.size for Mi in self._M])
        memory_bytes = sum([Mi.data.nbytes for Mi in self._M])

        # The computation below is done for numerical stability, instead of directly using the
        # formula:
        # estimated_fidelity = \prod_i (1 - estimated_gate_error_list_i)
        estimated_fidelity = 1.0 + np.expm1(
            sum(np.log1p(-x) for x in self._estimated_gate_error_list)
        )
        estimated_fidelity = round(estimated_fidelity, ndigits=3)

        return {
            "num_coefs_used": num_coefs_used,
            "memory_bytes": memory_bytes,
            "estimated_fidelity": estimated_fidelity,
        }
Returns some statistics about the memory usage and quality of the approximation.
cirq-core/cirq/contrib/quimb/mps_simulator.py