Loss In Superconducting Quantum Devices From Non-Equilibrium Quasiparticles And Inhomogeneity In Energy Gap