Skip to content

dq.set_precision

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

Configure the default floating point precision.

Two options are available:

  • 'simple' 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 == 'simple':
    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 'simple' or 'double') –

    Default precision.