3.8.1. qupulse.utils.numeric

qupulse.utils.numeric.approximate_double(x, abs_err, fraction_type)[source]

Return the fraction with the smallest denominator in (x - abs_err, x + abs_err).

Return type

Rational

qupulse.utils.numeric.approximate_rational(x, abs_err, fraction_type)[source]

Return the fraction with the smallest denominator in (x - abs_err, x + abs_err)

Return type

Rational

qupulse.utils.numeric.lcm(a, b)[source]

least common multiple