Skip to content

Commit

Permalink
move qsd from qiskit/quantum_info/synthesis to qiskit/synthesis/unitary
Browse files Browse the repository at this point in the history
  • Loading branch information
ShellyGarion committed Dec 28, 2023
1 parent 70efcb2 commit 340ef4c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion qiskit/circuit/library/generalized_gates/unitary.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def _define(self):
elif self.num_qubits == 2:
self.definition = two_qubit_cnot_decompose(self.to_matrix())
else:
from qiskit.quantum_info.synthesis.qsd import ( # pylint: disable=cyclic-import
from qiskit.synthesis.unitary.qsd import ( # pylint: disable=cyclic-import
qs_decomposition,
)

Expand Down
5 changes: 5 additions & 0 deletions qiskit/synthesis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
.. autofunction:: synth_qft_line
Unitary Synthesis
=================
.. autofunction:: qs_decomposition
"""

from .evolution import (
Expand Down Expand Up @@ -126,3 +130,4 @@
from .stabilizer import synth_stabilizer_layers, synth_stabilizer_depth_lnn
from .discrete_basis import SolovayKitaevDecomposition, generate_basic_approximations
from .qft import synth_qft_line
from .unitary.qsd import qs_decomposition
13 changes: 13 additions & 0 deletions qiskit/synthesis/unitary/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017 - 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Module containing unitary synthesis methods."""
File renamed without changes.
2 changes: 1 addition & 1 deletion qiskit/transpiler/passes/synthesis/unitary_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ def run(self, unitary, **options):
default=None,
)
else:
from qiskit.quantum_info.synthesis.qsd import ( # pylint: disable=cyclic-import
from qiskit.synthesis.unitary.qsd import ( # pylint: disable=cyclic-import
qs_decomposition,
)

Expand Down
2 changes: 1 addition & 1 deletion test/python/synthesis/test_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
)

from qiskit.circuit.library.standard_gates.equivalence_library import _cnot_rxx_decompose
from qiskit.quantum_info.synthesis import qsd
from qiskit.synthesis.unitary import qsd
from qiskit.test import QiskitTestCase


Expand Down

0 comments on commit 340ef4c

Please sign in to comment.