A quantum computer can be modeled as a single unitary transition of a (large) effective quantum state to another. In order to get errors under control, quantum error correction is assumed. A logical qbit lives in a "logical heat bath" which must have an effective entropy and temperature far below that of the ambient world in order for the error rate of the computation to be below unity.
Thus it should be possible to compute the energy cost of any quantum computation as the entropy difference between the required effective "logical heat bath" and the ambient environment. As entropy scales as $$dS = \frac{dQ}{T_A} - \frac{dQ}{T_B},$$ this would imply that an arbitrarily long/large calculation requires zero temperature and an infinite amount of energy, in apparent contradiction with the quantum threshold theorem. Such an energy cost would apply to classical calculations as well.
Is there an error in my reasoning? If not, has anyone published actual calculations of the required energy to perform a computation of a given size or have a formula for the entropy of the needed heat bath that satisfies the threshold theorem? This would seem to imply that cryptographically relevant computations like Shor's algorithm will never be practical on energy grounds. The required precision on the logical state is exponential in the number of bits, and the corresponding requirement on the heat bath should be also.