/// Get the number of qubits needed to represent a number.
////// Equivilent to ceil(log2(n))s
pubfnget_width(n:i32)->i32{((n asf32)+1.0).log2().ceil()asi32}/// Calculate the greatest common divisor (Euclid's algorithm)
pubfngcd(muta:i32, mutb:i32)->i32{while b !=0{let tmp = a;
a = b;
b = tmp % b;}
a
}