Duality relation for quantum ratchets