Գրեք սա: Quantum metrology with imperfect states and detectors