Skip to content

dq.set_precision

set_precision(precision: Literal['single', 'double'])

Configure the default floating point precision.

Two options are available:

  • 'single' sets default precision to float32 and complex64 (default setting),
  • 'double' sets default precision to float64 and complex128.
Equivalent JAX syntax

This function is equivalent to

if precision == 'single':
    jax.config.update('jax_enable_x64', False)
elif precision == 'double':
    jax.config.update('jax_enable_x64', True)
See JAX documentation on double precision.

Parameters

  • precision (string 'single' or 'double') –

    Default precision.