# Cirq ## Notice We only document what is different from Google's `qsimcirq`. For more information, please review [Google's Documentation](https://quantumai.google/reference/python/qsimcirq/QSimOptions). For information on using qsim, refer to [its documentation](https://quantumai.google/qsim). For getting started using the NVIDIA cuQuantum Appliance with Cirq, visit the [overview on NGC](./index.rst). ## API Reference ### `qsimcirq.QSimOptions` ```python qsimcirq.QSimOptions( max_fused_gate_size: int = 4, cpu_threads: int = 1, ev_noisy_repetitions: int = 1, disable_gpu: bool = False, gpu_mode: Union[int, Sequence[int]] = (0,), gpu_sim_threads: int = 256, gpu_state_threads: int = 512, gpu_data_blocks: int = 16, verbosity: int = 0, denormals_are_zeros: bool = False, n_subsvs: int = -1, use_sampler Union[bool, None] = None, ) ``` --- | Keyword | Description | |------------|-------------| | `gpu_mode` | The GPU simulator backend to use. If `1`, the simulator backend will use cuStateVec. If `n`, an integer greater than 1, the simulator will use the multi-GPU backend with the first `n` devices. If a sequence of integers, the simulator will use the multi-GPU backend with devices whose ordinals match the values in the list. Default is to use the multi-GPU backend with device 0 | | `n_subsvs` | The number of state-vector partitions. This option is ignored unless the multi-GPU backend is in use. If `-1`, the number of partitions equals the number of GPUs. For optimal performance, ensure that the number of partitions equals the number of GPUs, and that both are a power of two | | `use_sampler`| If `None`, the multi-GPU backend will use its sampler, and all other backends will use their default sampler. If `True`, use the multi-GPU backend's sampler. If `False`, the multi-GPU backend's sampler is disabled | | `disable_gpu` | Whether or not to disable the GPU simulator backend. All GPU options are only considered when this is `False` (default). Note the difference from `qsimcirq`'s `use_gpu` keyword | --- **Some examples** ```python options = qsimcirq.QSimOptions(gpu_mode=1) # use cuStateVec (single-GPU) backend options = qsimcirq.QSimOptions(gpu_mode=(0,)) # use multi-GPU backend with GPU #0 options = qsimcirq.QSimOptions(gpu_mode=2) # use multi-GPU backend with the first 2 devices options = qsimcirq.QSimOptions(gpu_mode=(0,2)) # use multi-GPU backend with GPU #0 & #2 ```