|View source on GitHub|
Generate a random two-qubit quantum circuit.
cirq.experiments.random_quantum_circuit_generation.random_rotations_between_two_qubit_circuit( q0: 'cirq.Qid', q1: 'cirq.Qid', depth: int, two_qubit_op_factory: Callable[['cirq.Qid', 'cirq.Qid', 'np.random.RandomState'], 'cirq.OP_TREE'] = (lambda a, b, _: ops.CZPowGate()(a, b)), 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 uses a similar structure to those in the paper https://www.nature.com/articles/s41586-019-1666-5
The generated circuit consists of a number of "cycles", this number being
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 first qubit|
||The second qubit|
||The number of cycles.|
A callable that returns a two-qubit operation.
These operations will be generated with calls of the form
||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.|
||Whether to include a final layer of single-qubit gates after the last cycle (subject to the same non-consecutivity constraint).|
||A seed or random state to use for the pseudorandom number generator.|