Learning Quantum States and Unitaries of Bounded Gate Complexity