Skip to content

Commit

Permalink
Make explicitly_supported_gates private and remove its release note
Browse files Browse the repository at this point in the history
It's not clear that this function remains useful now that we
support essentially all 2-qubit gates.  If we find a use for it
in the future, we can re-introduce it (or something like it) as a
public interface.
  • Loading branch information
garrison committed Jul 24, 2023
1 parent f43d474 commit 8e95c4a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
1 change: 0 additions & 1 deletion circuit_knitting/cutting/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
qpd.generate_qpd_weights
qpd.generate_qpd_samples
qpd.decompose_qpd_instructions
qpd.explicitly_supported_gates
qpd.qpdbasis_from_gate
CutQC
Expand Down
2 changes: 0 additions & 2 deletions circuit_knitting/cutting/qpd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
decompose_qpd_instructions,
WeightType,
qpdbasis_from_gate,
explicitly_supported_gates,
)
from .instructions import (
BaseQPDGate,
Expand All @@ -32,7 +31,6 @@
"generate_qpd_weights",
"generate_qpd_samples",
"decompose_qpd_instructions",
"explicitly_supported_gates",
"QPDBasis",
"BaseQPDGate",
"TwoQubitQPDGate",
Expand Down
11 changes: 5 additions & 6 deletions circuit_knitting/cutting/qpd/qpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,11 +559,10 @@ def qpdbasis_from_gate(gate: Gate) -> QPDBasis:
"""
Generate a :class:`.QPDBasis` object, given a supported operation.
The operations with explicit support can be obtained by calling
:func:`explicitly_supported_gates`.
Additionally, all two-qubit gates which implement the :meth:`.Gate.to_matrix` method are
supported via a KAK decomposition (:class:`.TwoQubitWeylDecomposition`).
All two-qubit gates which implement the :meth:`.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
<https://github.com/Qiskit/qiskit-terra/issues/10396>`__).
Returns:
The newly-instantiated :class:`QPDBasis` object
Expand Down Expand Up @@ -602,7 +601,7 @@ def qpdbasis_from_gate(gate: Gate) -> QPDBasis:
raise ValueError(f"Gate not supported: {gate.name}") from None


def explicitly_supported_gates() -> set[str]:
def _explicitly_supported_gates() -> set[str]:
"""
Return a set of instruction names with explicit support for automatic decomposition.
Expand Down
4 changes: 0 additions & 4 deletions releasenotes/notes/supported-gates-d2156f58bc07fc7a.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion test/cutting/qpd/test_qpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
_generate_exact_weights_and_conditional_probabilities,
_nonlocal_qpd_basis_from_u,
_u_from_thetavec,
_explicitly_supported_gates,
)


Expand Down Expand Up @@ -426,7 +427,7 @@ def from_theta(theta):
assert weights[map_ids][1] == WeightType.SAMPLED

def test_explicitly_supported_gates(self):
gates = explicitly_supported_gates()
gates = _explicitly_supported_gates()
self.assertEqual(
{
"rxx",
Expand Down

0 comments on commit 8e95c4a

Please sign in to comment.