  Adopting a resource theory framework of thermodynamics for quantum and nano
systems pioneered by Janzing et al. [Int. J. Th. Phys. 39, 2717 (2000)], we
formulate the cost in useful work of transforming one resource state into
another as a linear program of convex optimization. This approach is based on
the characterization of thermal quasiorder given by Janzing et al. and later by
Horodecki and Oppenheim [Nat. Comm. 4, 2059 (2013)]. Both characterizations are
related to an extended version of majorization studied by Ruch, Schranner, and
Seligman under the name mixing distance [J. Chem. Phys. 69, 386 (1978)].
