From 749c6c49cfc2f19343dab113717e4454dc2067f6 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 14:55:15 +0000 Subject: [PATCH] small doc improvements (backport #12553) (#12555) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * small doc improvements (#12553) * small doc improvements * Update qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py Co-authored-by: Jake Lishman --------- Co-authored-by: Jake Lishman (cherry picked from commit 8d2144cec32d5f20e03a8c9af1999a0b7b7a1645) # Conflicts: # qiskit/transpiler/preset_passmanagers/__init__.py * Apply suggestions from code review --------- Co-authored-by: Luciano Bello Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com> --- qiskit/dagcircuit/dagcircuit.py | 2 +- .../operators/symplectic/sparse_pauli_op.py | 2 +- .../preset_passmanagers/__init__.py | 28 ++++++++++++++++++- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/qiskit/dagcircuit/dagcircuit.py b/qiskit/dagcircuit/dagcircuit.py index 831851bee36d..96562a37b151 100644 --- a/qiskit/dagcircuit/dagcircuit.py +++ b/qiskit/dagcircuit/dagcircuit.py @@ -544,7 +544,7 @@ def remove_qubits(self, *qubits): def remove_qregs(self, *qregs): """ - Remove classical registers from the circuit, leaving underlying bits + Remove quantum registers from the circuit, leaving underlying bits in place. Raises: diff --git a/qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py b/qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py index 440a0319c33a..f8d25a6e8daa 100644 --- a/qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py +++ b/qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py @@ -54,7 +54,7 @@ class SparsePauliOp(LinearOp): :class:`~qiskit.quantum_info.Operator` in terms of N-qubit :class:`~qiskit.quantum_info.PauliList` and complex coefficients. - It can be used for performing operator arithmetic for hundred of qubits + It can be used for performing operator arithmetic for hundreds of qubits if the number of non-zero Pauli basis terms is sufficiently small. The Pauli basis components are stored as a diff --git a/qiskit/transpiler/preset_passmanagers/__init__.py b/qiskit/transpiler/preset_passmanagers/__init__.py index 8d653ed3a1a9..748a896cf422 100644 --- a/qiskit/transpiler/preset_passmanagers/__init__.py +++ b/qiskit/transpiler/preset_passmanagers/__init__.py @@ -99,8 +99,34 @@ def generate_preset_pass_manager( This function is used to quickly generate a preset pass manager. A preset pass manager are the default pass managers used by the :func:`~.transpile` function. This function provides a convenient and simple method to construct - a standalone :class:`~.PassManager` object that mirrors what the transpile + a standalone :class:`~.PassManager` object that mirrors what the :func:`~.transpile` + function internally builds and uses. + The target constraints for the pass manager construction can be specified through a :class:`.Target` + instance, a :class:`.BackendV1` or :class:`.BackendV2` instance, or via loose constraints + (``basis_gates``, ``inst_map``, ``coupling_map``, ``backend_properties``, ``instruction_durations``, + ``dt`` or ``timing_constraints``). + The order of priorities for target constraints works as follows: if a ``target`` + input is provided, it will take priority over any ``backend`` input or loose constraints. + If a ``backend`` is provided together with any loose constraint + from the list above, the loose constraint will take priority over the corresponding backend + constraint. This behavior is independent of whether the ``backend`` instance is of type + :class:`.BackendV1` or :class:`.BackendV2`, as summarized in the table below. The first column + in the table summarizes the potential user-provided constraints, and each cell shows whether + the priority is assigned to that specific constraint input or another input + (`target`/`backend(V1)`/`backend(V2)`). + + ============================ ========= ======================== ======================= + User Provided target backend(V1) backend(V2) + ============================ ========= ======================== ======================= + **basis_gates** target basis_gates basis_gates + **coupling_map** target coupling_map coupling_map + **instruction_durations** target instruction_durations instruction_durations + **inst_map** target inst_map inst_map + **dt** target dt dt + **timing_constraints** target timing_constraints timing_constraints + **backend_properties** target backend_properties backend_properties + ============================ ========= ======================== ======================= Args: optimization_level (int): The optimization level to generate a