qat.qpus.LinAlg
Warning
This is a newer version of the previous LinAlg simulator. The older simulators may still be imported
as LinAlgLegacy.
As a result, the following parameters are deprecated: gpu_group_size, gpu_buffer_size, group_size, feynman_factor,
extract_causal_cones, density_matrix.
LinAlgLegacy is still used as the main backend of NoisyQProc.
- class qat.qpus.LinAlg(*, nb_nodes: int = 1, nb_processes_per_node: int = 1, precision: int | None = None, gpu: bool = False, fusion: bool = True, localize: bool | None = None, seed: int | None = None, sparse: bool | None = None, tqdm: bool = False, individual_terms_values: bool = False, gpu_index: int | None = None, filename: str | None = None, skip_optimize: bool | None = None, temp_dir: str | None = None, state_vector_dump: str | None = None, mpi_args: list | None = None, srun_args: list | None = None, chunk_size: int | None = None, com_mant_nbbits: int | None = None, **kwargs)
LinAlg simulator for Qaptiva.
- Provides two simulation modes:
Single-process (default): Standard execution on a single process.
Multi-process: Leverages multiple GPUs using MPI for inter-GPU communication. Can be configured by setting nb_processes_per_node.
- Parameters:
nb_nodes (int, optional) – number of nodes to be used in the MPI or SLURM environment
nb_processes_per_node (int, optional) – number of processes per node to be used in the MPI or SLURM environment Default: 1
precision (int, optional) – precision used for the simulation, either 1 (single) or 2 (double) Default: 2
gpu (bool, optional) – if True, the simulation will be done using GPUs Default: False
use_gpu (bool, optional) – alias for gpu
fusion (bool, optional) – if True, compile jobs with FusionPlugin before execution Default: True
localize (bool, optional) – if True, compile jobs with Localizer before execution (multiple nodes only) Default: True
seed (int, optional) – if set, use the seed for the random number generator in sampling Default: None (will use a random seed)
sparse (bool, optional) – whether or not to return a sparse result (single node only) Default: False
tqdm (bool, optional) – use tqdm to display circuit simulation progress (single node only) Default: False
individual_terms_values (bool, optional) – if True, each observable term expectation value will be individually filled into value_data and error_data maps. Slight performance decrease. This is not compatible with GPU mode (single node only) Default: False
gpu_index (int, optional) – what GPU device should be used (single node only, ignored with Qaptiva Access)
filename (str, optional) – Set the name of the generated .batch and .res files if passed, else temporary files will be generated (multiple nodes only)
state_vector_dump (str, optional) – Dump the state vector into a binary file with the string as name if passed (multiple nodes only)
skip_optimize (bool, optional) – if True, no optimization will be done for diagonal, permutation and SWAP operations (multiple nodes only) Default: False
temp_dir (str, optional) – The directory of a temporary folder where a .batch file and a .res file can be written (multiple nodes only)
mpi_args (list, optional) – Additional arguments to be passed to mpirun command (multiple nodes only)
srun_args (list, optional) – Additional arguments to be passed to srun command (multiple nodes only)
chunk_size (int, optional) – chunk size for MPI communications (multiple nodes only)
com_mant_nbbits – (int, optional): number of mantissa bits to be kept in communication: 52 (default), 48, 40, 36, 0. If 0 all the double values are communicated. (multiple nodes only)
- submit(batch: Batch, meta_data: dict = None) BatchResult
Executes a batch of jobs and returns the corresponding list of Results.
- Parameters:
batch (
Batch) – a batch of jobs. If a single job is provided, the job is embedded into a Batch, executed, and the first result is returned.- Returns:
a batch result
- Return type: