qsimcirq.QSimOptions
Container for options to the QSimSimulator.
qsimcirq.QSimOptions(
max_fused_gate_size: int = 2,
cpu_threads: int = 1,
ev_noisy_repetitions: int = 1,
use_gpu: bool = False,
gpu_mode: int = 0,
gpu_state_threads: int = 512,
gpu_data_blocks: int = 16,
verbosity: int = 0,
denormals_are_zeros: bool = False
)
Options for the simulator can also be provided as a {string: value} dict,
using the format shown in the 'as_dict' function for this class.
Args |
max_fused_gate_size
|
maximum number of qubits allowed per fused gate.
Circuits of less than 22 qubits usually perform best with this set
to 2 or 3, while larger circuits (with >= 22 qubits) typically
perform better with it set to 3 or 4.
|
cpu_threads
|
number of threads to use when running on CPU. For best
performance, this should equal the number of cores on the device.
|
ev_noisy_repetitions
|
number of repetitions used for estimating
expectation values of a noisy circuit. Does not affect other
simulation modes.
|
use_gpu
|
whether to use GPU instead of CPU for simulation. The "gpu_"
arguments below are only considered if this is set to True.
|
gpu_mode
|
use CUDA if set to 0 (default value) or use the NVIDIA
cuStateVec library if set to any other value. The "gpu_"
arguments below are only considered if this is set to 0.
|
gpu_state_threads
|
number of threads per CUDA block to use for the GPU
StateSpace. This must be a power of 2 in the range [32, 1024].
|
gpu_data_blocks
|
number of data blocks to use for the GPU StateSpace.
Below 16 data blocks, performance is noticeably reduced.
|
verbosity
|
Logging verbosity.
|
denormals_are_zeros
|
if true, set flush-to-zero and denormals-are-zeros
MXCSR control flags. This prevents rare cases of performance
slowdown potentially at the cost of a tiny precision loss.
|
Attributes |
max_fused_gate_size
|
Dataclass field
|
cpu_threads
|
Dataclass field
|
ev_noisy_repetitions
|
Dataclass field
|
use_gpu
|
Dataclass field
|
gpu_mode
|
Dataclass field
|
gpu_state_threads
|
Dataclass field
|
gpu_data_blocks
|
Dataclass field
|
verbosity
|
Dataclass field
|
denormals_are_zeros
|
Dataclass field
|
Methods
as_dict
View source
as_dict()
Generates an options dict from this object.
Options to QSimSimulator can also be provided in this format directly.
__eq__
__eq__(
other
)
Return self==value.
Class Variables |
cpu_threads
|
1
|
denormals_are_zeros
|
False
|
ev_noisy_repetitions
|
1
|
gpu_data_blocks
|
16
|
gpu_mode
|
0
|
gpu_state_threads
|
512
|
max_fused_gate_size
|
2
|
use_gpu
|
False
|
verbosity
|
0
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-05-25 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-05-25 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-05-25 UTC."],[],[]]