Options#
See Options for what each option does.
- class QCut.CutOptions(consolidate: Literal['auto', 'always', 'never'] | bool = 'auto', joint_rotation_cuts: bool = True, wire_cut_communication: Literal['auto', 'always', 'never'] | bool = 'auto', expansion: Literal['auto', 'exact', 'sample'] = 'auto', max_exact_groups: int = 1000, num_samples: int | None = None, seed: int | None = None, deduplicate: bool = True, finder_candidates: int = 5, finder_cut_mode: Literal['both', 'wire', 'gate'] = 'both', finder_max_qubits: int | list[int] | None = None, finder_num_partitions: int | None = None)[source]#
Bases:
objectConfiguration for a cutting run.
consolidatemerges runs of gates acting on the same qubit pair into one gate before cutting, so the pair costs one cut instead of several. SeeConsolidateStrategy. Merging can cost more than it saves once joint cutting is in play, because a merged run of gates about different axes is no longer a single-axis rotation and cannot be bundled, so"auto"compares the two plans outright rather than guessing.joint_rotation_cutscuts parallel two-qubit rotation gates with one joint decomposition instead of one each, which costs strictly less in both sampling overhead and circuit count.wire_cut_communicationlets the two sides of a wire cut exchange the measured outcome, which lowers the overhead of a block ofnparallel wires from4**nto2**(n+1) - 1. It makes those experiments run in two phases, since the state one side prepares depends on what the other measured. SeeCommunicationStrategy.expansiondecides how the decomposition becomes experiment circuits, seeExpansionStrategy. Under"auto",max_exact_groupsis the largest exact group count still enumerated rather than sampled. When sampling,num_samplesdraws are taken, defaulting tomax_exact_groups, andseedfixes the sampler for a reproducible experiment set. Without one, a seed is drawn and kept asCutExperiment.seed.deduplicatesubmits each distinct experiment circuit once and shares its result between every slot it fills, rather than running the same circuit once per group. The slot count grows exponentially in the number of pieces while the distinct count grows linearly, so this is most of the cost of a run.shotsstill means shots per circuit, so the total spent drops by the same factor; what it bought before was re-measuring circuits already measured. Turn it off to submit one circuit per slot.finder_candidatesis how many candidate partitions the cut finder generates and costs before keeping the cheapest. METIS returns only the partitioning that minimises its own objective, the weighted edge cut, which stops being the true cost once cuts share a decomposition, so several are generated and compared on what they actually cost. Under a qubit budget they vary by how much imbalance METIS is allowed before they vary by seed, since that changes the partition more. Both are fixed, which makes the finder reproducible;seedshifts the seeds as a set.finder_cut_modelimits the finder to wire cuts, to gate cuts, or lets it use both.finder_num_partitionsasks for a number of pieces andfinder_max_qubitsfor a size limit per piece, either one number for all of them or a list with one entry per partition. With neither given the finder splits in two.- consolidate: Literal['auto', 'always', 'never'] | bool = 'auto'#
- joint_rotation_cuts: bool = True#
- wire_cut_communication: Literal['auto', 'always', 'never'] | bool = 'auto'#
- expansion: Literal['auto', 'exact', 'sample'] = 'auto'#
- max_exact_groups: int = 1000#
- num_samples: int | None = None#
- seed: int | None = None#
- deduplicate: bool = True#
- finder_candidates: int = 5#
- finder_cut_mode: Literal['both', 'wire', 'gate'] = 'both'#
- finder_max_qubits: int | list[int] | None = None#
- finder_num_partitions: int | None = None#
- property consolidate_mode: str#
The consolidation strategy, with
TrueandFalsenormalised.
- property min_communicating_block: int#
Smallest wire cut block that will use classical communication.
- property sample_count: int#
Number of draws to use when sampling.
- property num_partitions: int#
Number of partitions to cut the circuit into.
- property max_qubits: list[int] | None#
- should_sample(exact_groups: int) bool[source]#
Whether an experiment of
exact_groupscombinations should be sampled.
- replace(**changes) CutOptions[source]#
Return a copy with
changesapplied.
- __init__(consolidate: Literal['auto', 'always', 'never'] | bool = 'auto', joint_rotation_cuts: bool = True, wire_cut_communication: Literal['auto', 'always', 'never'] | bool = 'auto', expansion: Literal['auto', 'exact', 'sample'] = 'auto', max_exact_groups: int = 1000, num_samples: int | None = None, seed: int | None = None, deduplicate: bool = True, finder_candidates: int = 5, finder_cut_mode: Literal['both', 'wire', 'gate'] = 'both', finder_max_qubits: int | list[int] | None = None, finder_num_partitions: int | None = None) None#
- QCut.DEFAULT_OPTIONS#
The
CutOptionsused when none are passed. Reassign it to change the defaults process-wide.