  We propose a class of randomized quantum algorithms for the task of sampling
from matrix functions, without the use of quantum block encodings or any other
coherent oracle access to the matrix elements. As such, our use of qubits is
purely algorithmic, and no additional qubits are required for quantum data
structures. Our algorithms start from a classical data structure in which the
matrix of interest is specified in the Pauli basis. For $N\times N$ Hermitian
matrices, the space cost is $\log(N)+1$ qubits and depending on the structure
of the matrices, the gate complexity can be comparable to state-of-the-art
methods that use quantum data structures of up to size $O(N^2)$, when
considering equivalent end-to-end problems. Within our framework, we present a
quantum linear system solver that allows one to sample properties of the
solution vector, as well as algorithms for sampling properties of ground states
and Gibbs states of Hamiltonians. As a concrete application, we combine these
sub-routines to present a scheme for calculating Green's functions of quantum
many-body systems.
