cirq.TwoQubitNumericalCompiler

A two-qubit gate compiler based on numerical optimization (NuOp).

Holds a fixed set of hardware base gates (and optionally their error rates) so that arbitrary two-qubit unitaries can be compiled repeatedly with the same configuration via compile_two_qubit_gate. See cirq.two_qubit_gate_numerical_compilation for details of the algorithm.

This class supports JSON serialization, but only when random_state is None or an integer seed; a live numpy random generator cannot be serialized.

base_gates Dataclass field
base_gate_error_rates Dataclass field
target_fidelity Dataclass field
max_layers Dataclass field
single_qubit_error_rates Dataclass field
num_restarts Dataclass field
maxiter Dataclass field
max_cache_size Dataclass field
random_state Dataclass field

Methods

compile_two_qubit_gate

View source

Compile the given 4x4 unitary onto this compiler's base gate(s).

Results are memoized (least-recently-used, up to max_cache_size entries): compiling a unitary whose entries are all within 1e-10 of a cached unitary returns the cached result instead of re-running the numerical optimization, so unitaries differing only by floating-point noise (e.g. from different fusion orders) still hit.

__eq__

View source

Return self==value.

base_gate_error_rates None
max_cache_size 128
max_layers 3
maxiter 1000
num_restarts 5
random_state None
single_qubit_error_rates None
target_fidelity None