qat.qpus.CLinalg
The quantum state is stored as a complex valued vector of length \(2^{N}\), with each element being the complex amplitude of the particular state:
where \(|i\rangle\) represents a computational basis state.
Quantum gates are manipulated as complex valued matrices. Applying a gate consists in selecting the groups of \(2^{arity}\) amplitudes in the state vector, and doing a dot product of each group with the matrix representing the gate.
High-level Quantum Processing Unit
- class qat.qpus.CLinalg(gpu: bool = False, gpu_index: int | None = None, use_nbthreads_heuristic: bool = True, precision: int = 2, sparse: bool | None = None, light_circuit: bool = False, tqdm: bool = False, fusion: bool = True, readonly_statevector: bool = False, individual_terms_values: bool = False, seed: int = None, **kwargs)
CLinalg simulator
- Parameters:
gpu (bool) – use the GPU backend (may not be available on your version of NewLinAlg) Default: False
gpu_index (int, optional) – what GPU device should be used (ignored with Qaptiva Access)
use_nbthreads_heuristic (bool) – use heuristic for choosing the number of threads setting this parameter to False will result in using OMP_NUM_THREADS Default: True
precision (int) – precision used for the simulation, either 1(single) or 2(double) Default: 2
sparse (bool) – whether or not to return a sparse result Default: False
light_circuit (bool) – deprecated, only works for some named gates Default: False
tqdm (bool) – use tqdm to display progress in simulating the circuit Default: False
fusion (bool) – use the FusionPlugin as a pre-processing step, merging gates together (only for at least 23 qubits) Default: True
readonly_statevector (bool) – the statevector included in the result is returned directly in memory from the C++ array. This statevector will then be in convention lsb first. This option only makes sense for perfect sampling where all qubits are measured. Default: False
individual_terms_values (bool) – if True, each observable term exceptation value will be individually filled into value_data and error_data maps. Slight performance decrease. This is not compatible with GPU mode. Default: False
seed (int) – seed of the random number generator Default: None (will use a random seed)
- 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:
This high-level class wrapping the simulator follows the convention
of the qat.qpus.QPUHandler structure.
Note
CLinAlg is an alias of CLinalg.