![]() |
Generate a random quantum circuit of a particular form.
cirq.experiments.random_rotations_between_grid_interaction_layers_circuit(
qubits: Iterable['cirq.GridQubit'],
depth: int,
*,
two_qubit_op_factory: Callable[['cirq.GridQubit', 'cirq.GridQubit', 'np.random.RandomState'],
'cirq.OP_TREE'] = (lambda a, b, _: ops.CZPowGate()(a, b)),
pattern: Sequence[cirq.experiments.GridInteractionLayer
] = cirq.experiments.GRID_STAGGERED_PATTERN
,
single_qubit_gates: Sequence['cirq.Gate'] = (ops.X ** 0.5, ops.Y ** 0.5, ops.PhasedXPowGate(phase_exponent=0.25,\n exponent=0.5)),
add_final_single_qubit_layer: bool = True,
seed: 'cirq.RANDOM_STATE_OR_SEED_LIKE' = None
) -> 'cirq.Circuit'
Used in the notebooks
Used in the tutorials |
---|
This construction is based on the circuits used in the paper https://www.nature.com/articles/s41586-019-1666-5
The generated circuit consists of a number of "cycles", this number being
specified by depth
. Each cycle is actually composed of two sub-layers:
a layer of single-qubit gates followed by a layer of two-qubit gates,
controlled by their respective arguments, see below. The pairs of qubits
in a given entangling layer is controlled by the pattern
argument,
see below.
Args | |
---|---|
qubits
|
The qubits to use. |
depth
|
The number of cycles. |
two_qubit_op_factory
|
A callable that returns a two-qubit operation.
These operations will be generated with calls of the form
two_qubit_op_factory(q0, q1, prng) , where prng is the
pseudorandom number generator.
|
pattern
|
A sequence of GridInteractionLayers, each of which determine
which pairs of qubits are entangled. The layers in a pattern are
iterated through sequentially, repeating until depth is reached.
|
single_qubit_gates
|
Single-qubit gates are selected randomly from this sequence. No qubit is acted upon by the same single-qubit gate in consecutive cycles. If only one choice of single-qubit gate is given, then this constraint is not enforced. |
add_final_single_qubit_layer
|
Whether to include a final layer of single-qubit gates after the last cycle. |
seed
|
A seed or random state to use for the pseudorandom number generator. |