cirq.google.XmonOptions

class cirq.google.XmonOptions(num_shards: int = None, min_qubits_before_shard: int = 18, use_processes: bool = False)[source]

XmonOptions for the XmonSimulator.

num_prefix_qubits
Sharding of the wave function is performed over 2
raised to this value number of qubits.
min_qubits_before_shard
Sharding will be done only for this number
of qubits or more. The default is 18.
use_processes
Whether or not to use processes instead of threads.
Processes can improve the performance slightly (varies by machine
but on the order of 10 percent faster). However this varies
significantly by architecture, and processes should not be used
for interactive use on Windows.
__init__(num_shards: int = None, min_qubits_before_shard: int = 18, use_processes: bool = False) → None[source]

XmonSimulator options constructor.

Parameters:
  • num_shards – sharding will be done for the greatest value of a power of two less than this value. If None, the default will be used which is the smallest power of two less than or equal to the number of CPUs.
  • min_qubits_before_shard – Sharding will be done only for this number of qubits or more. The default is 18.
  • use_processes – Whether or not to use processes instead of threads. Processes can improve the performance slightly (varies by machine but on the order of 10 percent faster). However this varies significantly by architecture, and processes should not be used for interactive python use on Windows.

Methods