From f1f452b577bafa1e183fa0562372728a15a845f6 Mon Sep 17 00:00:00 2001 From: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:12:49 -0500 Subject: [PATCH] Update some Qiskit Terra links to Qiskit repo (#705) (cherry picked from commit 6f9c2edeb48bf7ef813bbca5dbc1ef7d93d961e4) --- qiskit_addon_cutting/qpd/decompositions.py | 6 +++--- qiskit_addon_cutting/utils/observable_grouping.py | 4 ++-- test/qpd/test_qpd_basis.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qiskit_addon_cutting/qpd/decompositions.py b/qiskit_addon_cutting/qpd/decompositions.py index 512763f12..77c09d45c 100644 --- a/qiskit_addon_cutting/qpd/decompositions.py +++ b/qiskit_addon_cutting/qpd/decompositions.py @@ -83,7 +83,7 @@ def qpdbasis_from_instruction(gate: Instruction, /) -> QPDBasis: All two-qubit gates which implement the :meth:`~qiskit.circuit.Gate.to_matrix` method are supported. This should include the vast majority of gates with no unbound parameters, but there are some special cases (see, e.g., `qiskit issue #10396 - `__). + `__). The :class:`.Move` operation, which can be used to specify a wire cut, is also supported. @@ -323,7 +323,7 @@ def _(unused_gate: iSwapGate): def _(unused_gate: DCXGate): retval = qpdbasis_from_instruction(iSwapGate()) # Modify basis according to DCXGate definition in Qiskit circuit library - # https://github.com/Qiskit/qiskit-terra/blob/e9f8b7c50968501e019d0cb426676ac606eb5a10/qiskit/circuit/library/standard_gates/equivalence_library.py#L938-L944 + # https://github.com/Qiskit/qiskit/blob/e9f8b7c50968501e019d0cb426676ac606eb5a10/qiskit/circuit/library/standard_gates/equivalence_library.py#L938-L944 for operations in unique_by_id(m[0] for m in retval.maps): operations.insert(0, SdgGate()) operations.insert(0, HGate()) @@ -486,7 +486,7 @@ def _(gate: CXGate | CYGate | CZGate | CHGate): def _(unused_gate: ECRGate): retval = qpdbasis_from_instruction(CXGate()) # Modify basis according to ECRGate definition in Qiskit circuit library - # https://github.com/Qiskit/qiskit-terra/blob/d9763523d45a747fd882a7e79cc44c02b5058916/qiskit/circuit/library/standard_gates/equivalence_library.py#L656-L663 + # https://github.com/Qiskit/qiskit/blob/d9763523d45a747fd882a7e79cc44c02b5058916/qiskit/circuit/library/standard_gates/equivalence_library.py#L656-L663 for operations in unique_by_id(m[0] for m in retval.maps): operations.insert(0, SGate()) operations.append(XGate()) diff --git a/qiskit_addon_cutting/utils/observable_grouping.py b/qiskit_addon_cutting/utils/observable_grouping.py index 1d45ba9ec..8ab12c532 100644 --- a/qiskit_addon_cutting/utils/observable_grouping.py +++ b/qiskit_addon_cutting/utils/observable_grouping.py @@ -92,7 +92,7 @@ def most_general_observable( # it _could_ be, *especially* if given a PauliList. # # Indeed, this can be made better by using pauli.x and pauli.z arrays - # https://github.com/Qiskit/qiskit-terra/blob/061aee2685676271fd0860d0a2d699e36941ae5e/qiskit/primitives/backend_estimator.py#L403-L404 + # https://github.com/Qiskit/qiskit/blob/061aee2685676271fd0860d0a2d699e36941ae5e/qiskit/primitives/backend_estimator.py#L403-L404 for j, obs in enumerate(commuting_observables): if not isinstance(obs, Pauli): raise ValueError("Input sequence includes something other than a Pauli.") @@ -135,7 +135,7 @@ class CommutingObservableGroup: def __post_init__(self) -> None: """Post-init method for the data class.""" - # TODO(perf): These loops could be faster; see e.g. https://github.com/Qiskit/qiskit-terra/blob/061aee2685676271fd0860d0a2d699e36941ae5e/qiskit/primitives/backend_estimator.py#L398-L413 + # TODO(perf): These loops could be faster; see e.g. https://github.com/Qiskit/qiskit/blob/061aee2685676271fd0860d0a2d699e36941ae5e/qiskit/primitives/backend_estimator.py#L398-L413 pauli_indices: list[int] = [ i for i, pauli in enumerate(self.general_observable) if pauli != _I ] diff --git a/test/qpd/test_qpd_basis.py b/test/qpd/test_qpd_basis.py index ace200598..11593ca89 100644 --- a/test/qpd/test_qpd_basis.py +++ b/test/qpd/test_qpd_basis.py @@ -136,7 +136,7 @@ def test_unbound_parameter(self): with self.subTest("Implicitly supported gate"): # For implicitly supported gates, we can detect that `to_matrix` # failed, but there are other possible explanations, too. See - # https://github.com/Qiskit/qiskit-terra/issues/10396 + # https://github.com/Qiskit/qiskit/issues/10396 with pytest.raises(ValueError) as e_info: QPDBasis.from_instruction(XXPlusYYGate(Parameter("θ"))) assert (