Module: cirq.experiments.random_quantum_circuit_generation

Code for generating random quantum circuits.

Classes

class CircuitLibraryCombination: For a given layer (specifically, a set of pairs of qubits), combinations is a 2d array

class GridInteractionLayer: A layer of aligned or staggered two-qubit interactions on a grid.

Functions

generate_library_of_2q_circuits(...): Generate a library of two-qubit Circuits.

get_grid_interaction_layer_circuit(...): Create a circuit representation of a grid interaction pattern on a given device topology.

get_random_combinations_for_device(...): For a given device, prepare a set of combinations to efficiently sample

get_random_combinations_for_layer_circuit(...): For a layer circuit, prepare a set of combinations to efficiently sample

get_random_combinations_for_pairs(...): For an explicit nested list of pairs, prepare a set of combinations to efficiently sample

random_rotations_between_grid_interaction_layers_circuit(...): Generate a random quantum circuit of a particular form.

random_rotations_between_two_qubit_circuit(...): Generate a random two-qubit quantum circuit.

Type Aliases

GridQubitPairT: The central part of internal API.

QidPairT: The central part of internal API.

GRID_ALIGNED_PATTERN (cirq.experiments.GridInteractionLayer(col_offset=0, vertical=False, stagger=False), cirq.experiments.GridInteractionLayer(col_offset=1, vertical=False, stagger=False), cirq.experiments.GridInteractionLayer(col_offset=0, vertical=True, stagger=False), cirq.experiments.GridInteractionLayer(col_offset=1, vertical=True, stagger=False))

A pattern of two-qubit gates that is easy to simulate.

This pattern of gates was used in the paper
https://www.nature.com/articles/s41586-019-1666-5
to evaluate the performance of a quantum computer.

GRID_STAGGERED_PATTERN (cirq.experiments.GridInteractionLayer(col_offset=0, vertical=True, stagger=True), cirq.experiments.GridInteractionLayer(col_offset=1, vertical=True, stagger=True), cirq.experiments.GridInteractionLayer(col_offset=1, vertical=False, stagger=True), cirq.experiments.GridInteractionLayer(col_offset=0, vertical=False, stagger=True), cirq.experiments.GridInteractionLayer(col_offset=1, vertical=False, stagger=True), cirq.experiments.GridInteractionLayer(col_offset=0, vertical=False, stagger=True), cirq.experiments.GridInteractionLayer(col_offset=0, vertical=True, stagger=True), cirq.experiments.GridInteractionLayer(col_offset=1, vertical=True, stagger=True))

A pattern of two-qubit gates that is hard to simulate.

This pattern of gates was used in the paper
https://www.nature.com/articles/s41586-019-1666-5
to demonstrate quantum supremacy.

HALF_GRID_STAGGERED_PATTERN (cirq.experiments.GridInteractionLayer(col_offset=0, vertical=True, stagger=True), cirq.experiments.GridInteractionLayer(col_offset=1, vertical=True, stagger=True), cirq.experiments.GridInteractionLayer(col_offset=1, vertical=False, stagger=True), cirq.experiments.GridInteractionLayer(col_offset=0, vertical=False, stagger=True))

A pattern that is half of GRID_STAGGERED_PATTERN.

It activates each link in a grid once in a staggered way permits
easier simulation.

TYPE_CHECKING False