iqm.benchmarks.entanglement.ghz_optimal.select_ghz_tree#
- iqm.benchmarks.entanglement.ghz_optimal.select_ghz_tree(qubit_layout: Sequence[int], backend: IQMBackendBase, metrics: Mapping[str, Mapping[int | tuple[int, int], float]], num_qubits: int | None = None, options: TreeSearchOptions | None = None, rank: int = 0) TreeCandidate#
Choose the qubits, the tree and the gate order of the GHZ state.
- Parameters:
qubit_layout (Sequence[int]) – The subset of system-qubits used in the protocol, indexed from 0.
backend (IQMBackendBase) – The backend whose coupling map defines the connectivity.
metrics (Mapping[str, Mapping[int | tuple[int, int], float]]) – The metrics dictionary from
extract_fidelities_unified().num_qubits (int | None) – Size of the GHZ state;
Noneuses every qubit of the layout.options (TreeSearchOptions | None) – What the search minimizes; defaults to
TreeSearchOptions.rank (int) – Which candidate of
rank_ghz_trees()to use,0being the best-scoring one. A rank beyond the last candidate falls back to the last one with a warning, rather than failing a run that has already built its circuits.
- Returns:
The chosen candidate.
- Raises:
ValueError – If
options.objectiveis not one ofTREE_OBJECTIVES.- Return type: