Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type hint on find_basic_approximation in SolovayKitaevDecomposition #12627

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions qiskit/synthesis/discrete_basis/solovay_kitaev.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

import numpy as np

from qiskit.circuit.gate import Gate

from .gate_sequence import GateSequence
from .commutator_decompose import commutator_decompose
from .generate_basis_approximations import generate_basic_approximations, _1q_gates, _1q_inverses
Expand Down Expand Up @@ -157,14 +155,14 @@ def _recurse(self, sequence: GateSequence, n: int, check_input: bool = True) ->
w_n1 = self._recurse(w_n, n - 1, check_input=check_input)
return v_n1.dot(w_n1).dot(v_n1.adjoint()).dot(w_n1.adjoint()).dot(u_n1)

def find_basic_approximation(self, sequence: GateSequence) -> Gate:
"""Finds gate in ``self._basic_approximations`` that best represents ``sequence``.
def find_basic_approximation(self, sequence: GateSequence) -> GateSequence:
"""Find ``GateSequence`` in ``self._basic_approximations`` that approximates ``sequence``.

Args:
sequence: The gate to find the approximation to.
sequence: ``GateSequence`` to find the approximation to.

Returns:
Gate in basic approximations that is closest to ``sequence``.
``GateSequence`` in ``self._basic_approximations`` that approximates ``sequence``.
"""
# TODO explore using a k-d tree here

Expand Down
Loading