Config

class exqalibur.Config

Exqalibur global configuration

All its members are statically accessed and there is no need to create an instance of this class.

Static properties:

  • compute_max_thread_count - Maximum number of CPU threads to use for parallel algorithms.

    By default, exqalibur uses as many CPU cores as possible.

    Current parallel algorithms are:

    • CircuitOptimizer

    • Clifford & Clifford sampling back-end

    • Permanent computation

    • Permanent estimate with Gurvits method

  • use_single_precision - Switch between single and double precision for algorithms which supports it (currently, only Clifford & Clifford back-end).

    When True set the floating point precision to 32 bits (64 bits per complex value), 64 bits otherwise (128 bits per complex value)

  • unitary_check_precision - Precision to use when testing whether a matrix is unitary or not. It might be required to increase this value for larger matrices.

    Default is the same value as in numpy (1e-6).

Usage example:

>>> import exqalibur as xq
>>> xq.Config.unitary_check_precision = 1e-4
Config.compute_max_thread_count = 0
Config.use_single_precision = False
Config.unitary_check_precision = 1e-06

set_seed

exqalibur.set_seed(seed: SupportsInt) None

Fix a seed in the random number generator through the whole library. This call is thread safe and parallel computations are deterministic once a seed has been set.

Parameters:

seed – The seed value