physical learning and molecular computation by phase transitions