Experimental characterization of the energetics of quantum logic gates