Quantum Devices: Microscopic Theory and Simulation