CanonicalPartitionFunction