cutting#

Circuit cutting

Functions

combine_barriers(operators)

Mutate operators to combine barriers with common names into a single barrier.

decompose_observables(observables, qubit_labels)

Decompose the observables with respect to qubit partition labels.

get_qpd_operators(operators, qubit_labels)

Replace all nonlocal gates belonging to more than one partition with two-qubit QPD gates.

label_operators(operators, qubit_map)

Generate a list of operators for each partition of the circuit.

map_qubit(qubit_labels)

Generate a qubit map given a qubit partitioning.

partition_labels(operators, ignore, ...)

Generate partition labels from the connectivity of a quantum circuit.

partition_problem(operators[, qubit_labels, ...])

Separate the circuit and observables.

separate_operators(operators[, qubit_labels])

Separate the circuit into its disconnected components.

split_barriers(operators)

Mutate operators to split barriers into single-qubit barriers.

transform_cut2move(operators, cut_lst[, ...])

Transform WireCut to Move and expand the observables accordingly.

combine_barriers(operators: Sequential) Sequential[source]#

Mutate operators to combine barriers with common names into a single barrier.

decompose_observables(observables: ModuleList | None, qubit_labels: Sequence[Hashable]) dict | None[source]#

Decompose the observables with respect to qubit partition labels.

get_qpd_operators(operators: Sequential, qubit_labels: Sequence[Hashable]) Sequential[source]#

Replace all nonlocal gates belonging to more than one partition with two-qubit QPD gates.

label_operators(operators: Sequential, qubit_map: Sequence[tuple]) dict[Hashable, list][source]#

Generate a list of operators for each partition of the circuit.

map_qubit(qubit_labels: Sequence[Hashable]) tuple[list[tuple], dict[Hashable, list]][source]#

Generate a qubit map given a qubit partitioning.

partition_labels(operators: Sequential, ignore: Callable = <function <lambda>>, keep_idle_wires: bool = False) list[int | None][source]#

Generate partition labels from the connectivity of a quantum circuit.

partition_problem(operators: Sequential, qubit_labels: Sequence[Hashable] | None = None, observables: ModuleList | None = None) tuple[dict, dict | None][source]#

Separate the circuit and observables.

separate_operators(operators: Sequential, qubit_labels: Sequence[Hashable] | None = None) dict[source]#

Separate the circuit into its disconnected components.

split_barriers(operators: Sequential) Sequential[source]#

Mutate operators to split barriers into single-qubit barriers.

transform_cut2move(operators: Sequential, cut_lst: list[tuple[int, int]], observables: ModuleList | None = None, qpd_form: bool = False) tuple[Sequential, ModuleList | None][source]#

Transform WireCut to Move and expand the observables accordingly.