code to convert quant to Eulers