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

Remove qiskit.transpiler.synthesis for Qiskit 1.0 release #11570

Merged
merged 32 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
081c540
deprecate transpiler/synthesis/graysynth.py
ShellyGarion Dec 18, 2023
de19803
style
ShellyGarion Dec 18, 2023
2bf99a3
style
ShellyGarion Dec 18, 2023
f884e6d
move aqc_plugin to qiskit/transpiler/passes/synthesis
ShellyGarion Dec 19, 2023
54f0bab
remove code from qiskit/transpiler/synthesis/aqc/aqc_plugin.py
ShellyGarion Dec 25, 2023
2ea0016
copy qiskit/transpiler/synthesis/aqc to qiskit/synthesis/unitary
ShellyGarion Dec 25, 2023
05b50e5
move tests from test/python/transpiler/aqc to test/python/synthesis/aqc
ShellyGarion Dec 25, 2023
3262d00
update imports in aqc_plugin
ShellyGarion Dec 25, 2023
dc316df
add deprecation warning to AQC module
ShellyGarion Dec 25, 2023
4381198
handle cyclic imports
ShellyGarion Dec 25, 2023
6404bf9
handle cyclic imports
ShellyGarion Dec 25, 2023
f88c2ff
update link in docs
ShellyGarion Dec 25, 2023
8078f2e
update init in qiskit/transpiler/synthesis/aqc
ShellyGarion Dec 25, 2023
bfaa805
style
ShellyGarion Dec 25, 2023
cb042f3
temporary remove deprecation warning test
ShellyGarion Dec 26, 2023
3ebbc8c
remove files from qiskit/transpiler/synthesis/aqc
ShellyGarion Dec 26, 2023
aeb1a2d
update link in test
ShellyGarion Dec 26, 2023
e9fce2e
add release notes
ShellyGarion Dec 26, 2023
cc35802
update docs
ShellyGarion Dec 27, 2023
6b4cfec
update docs/apidocs/synthesis_aqc.rst
ShellyGarion Dec 27, 2023
cdb0d68
resolve conflict with main branch
ShellyGarion Jan 3, 2024
d1a5591
add deprecations to qiskit/transpiler/synthesis/__init__.py
ShellyGarion Jan 9, 2024
6ec572f
Merge branch 'main' into transpiler_synth_deprecate
ShellyGarion Jan 9, 2024
7e16f4a
Merge branch 'main' into transpiler_synth_deprecate
ShellyGarion Jan 9, 2024
947b01e
Merge branch 'main' into transpiler_synth_deprecate
ShellyGarion Jan 16, 2024
52e851f
fix link
ShellyGarion Jan 16, 2024
87e9035
remove qiskit/transpiler/synthesis
ShellyGarion Jan 16, 2024
65a6dde
add release notes
ShellyGarion Jan 16, 2024
a03c618
improve docs
ShellyGarion Jan 18, 2024
b56d15d
add import aqc to qiskit.synthesis
ShellyGarion Jan 22, 2024
dd210ef
fix conflicts with main branch
ShellyGarion Jan 25, 2024
a2a5844
fix lint errors
ShellyGarion Jan 25, 2024
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
16 changes: 0 additions & 16 deletions qiskit/transpiler/synthesis/__init__.py

This file was deleted.

37 changes: 0 additions & 37 deletions qiskit/transpiler/synthesis/aqc/__init__.py

This file was deleted.

123 changes: 0 additions & 123 deletions qiskit/transpiler/synthesis/graysynth.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
upgrade:
- |
Removed the ``qiskit.transpiler.synthesis`` module, which has been deprecated since the 0.46 release.
The following objects have been moved:

* :mod:`qiskit.transpiler.synthesis.aqc` has been moved to :mod:`qiskit.synthesis.unitary.aqc`
(except of :class:`qiskit.synthesis.unitary.aqc.AQCSynthesisPlugin`).
* :class:`qiskit.synthesis.unitary.aqc.AQCSynthesisPlugin` has been moved to
:class:`qiskit.transpiler.passes.synthesis.AQCSynthesisPlugin`.
* :func:`qiskit.transpiler.synthesis.graysynth` has been moved to
:func:`qiskit.synthesis.synth_cnot_phase_aam`.
* :func:`qiskit.transpiler.synthesis.cnot_synth` has been moved to
:func:`qiskit.synthesis.synth_cnot_count_full_pmh`.
6 changes: 0 additions & 6 deletions test/python/synthesis/aqc/test_aqc.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,6 @@ def test_aqc_determinant_minus_one(self):
error = 0.5 * (np.linalg.norm(approx_matrix - target_matrix, "fro") ** 2)
self.assertTrue(error < 1e-3)

def test_deprecation(self):
"""Test that importing this module is deprecated."""
# pylint: disable = unused-import
with self.assertWarns(DeprecationWarning):
import qiskit.transpiler.synthesis.aqc


if __name__ == "__main__":
unittest.main()
40 changes: 8 additions & 32 deletions test/python/synthesis/test_cnot_phase_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,14 @@
from qiskit.quantum_info.operators import Operator
from qiskit.synthesis.linear import synth_cnot_count_full_pmh
from qiskit.synthesis.linear_phase import synth_cnot_phase_aam
from qiskit.transpiler.synthesis.graysynth import (
cnot_synth,
graysynth,
)
from qiskit.test import QiskitTestCase


@ddt.ddt
class TestGraySynth(QiskitTestCase):
"""Test the Gray-Synth algorithm."""

@ddt.data(synth_cnot_phase_aam, graysynth)
def test_gray_synth(self, synth_func):
def test_gray_synth(self):
"""Test synthesis of a small parity network via gray_synth.

The algorithm should take the following matrix as an input:
Expand Down Expand Up @@ -75,11 +70,7 @@ def test_gray_synth(self, synth_func):
[0, 1, 0, 0, 1, 0],
]
angles = ["s", "t", "z", "s", "t", "t"]
if synth_func.__name__ == "graysynth":
with self.assertWarns(DeprecationWarning):
c_gray = synth_func(cnots, angles)
else:
c_gray = synth_func(cnots, angles)
c_gray = synth_cnot_phase_aam(cnots, angles)
unitary_gray = UnitaryGate(Operator(c_gray))

# Create the circuit displayed above:
Expand Down Expand Up @@ -108,8 +99,7 @@ def test_gray_synth(self, synth_func):
# Check if the two circuits are equivalent
self.assertEqual(unitary_gray, unitary_compare)

@ddt.data(synth_cnot_phase_aam, graysynth)
def test_paper_example(self, synth_func):
def test_paper_example(self):
"""Test synthesis of a diagonal operator from the paper.

The diagonal operator in Example 4.2
Expand Down Expand Up @@ -137,11 +127,7 @@ def test_paper_example(self, synth_func):
"""
cnots = [[0, 1, 1, 1, 1, 1], [1, 0, 0, 1, 1, 1], [1, 0, 0, 1, 0, 0], [0, 0, 1, 0, 1, 0]]
angles = ["t"] * 6
if synth_func.__name__ == "graysynth":
with self.assertWarns(DeprecationWarning):
c_gray = synth_func(cnots, angles)
else:
c_gray = synth_func(cnots, angles)
c_gray = synth_cnot_phase_aam(cnots, angles)
unitary_gray = UnitaryGate(Operator(c_gray))

# Create the circuit displayed above:
Expand All @@ -167,8 +153,7 @@ def test_paper_example(self, synth_func):
# Check if the two circuits are equivalent
self.assertEqual(unitary_gray, unitary_compare)

@ddt.data(synth_cnot_phase_aam, graysynth)
def test_ccz(self, synth_func):
def test_ccz(self):
"""Test synthesis of the doubly-controlled Z gate.

The diagonal operator in Example 4.3
Expand All @@ -194,11 +179,7 @@ def test_ccz(self, synth_func):
"""
cnots = [[1, 0, 0, 1, 1, 0, 1], [0, 1, 0, 1, 0, 1, 1], [0, 0, 1, 0, 1, 1, 1]]
angles = ["t", "t", "t", "tdg", "tdg", "tdg", "t"]
if synth_func.__name__ == "graysynth":
with self.assertWarns(DeprecationWarning):
c_gray = synth_func(cnots, angles)
else:
c_gray = synth_func(cnots, angles)
c_gray = synth_cnot_phase_aam(cnots, angles)
unitary_gray = UnitaryGate(Operator(c_gray))

# Create the circuit displayed above:
Expand Down Expand Up @@ -228,8 +209,7 @@ class TestPatelMarkovHayes(QiskitTestCase):
"""Test the Patel-Markov-Hayes algorithm for synthesizing linear
CNOT-only circuits."""

@ddt.data(synth_cnot_count_full_pmh, cnot_synth)
def test_patel_markov_hayes(self, synth_func):
def test_patel_markov_hayes(self):
"""Test synthesis of a small linear circuit
(example from paper, Figure 3).

Expand Down Expand Up @@ -264,11 +244,7 @@ def test_patel_markov_hayes(self, synth_func):
[1, 1, 0, 1, 1, 1],
[0, 0, 1, 1, 1, 0],
]
if synth_func.__name__ == "cnot_synth":
with self.assertWarns(DeprecationWarning):
c_patel = synth_func(state)
else:
c_patel = synth_func(state)
c_patel = synth_cnot_count_full_pmh(state)
unitary_patel = UnitaryGate(Operator(c_patel))

# Create the circuit displayed above:
Expand Down
Loading