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

Deprecate qiskit/quantum_info/synthesis and move to qiskit/synthesis #11460

Merged
merged 38 commits into from
Jan 23, 2024

Conversation

ShellyGarion
Copy link
Member

@ShellyGarion ShellyGarion commented Dec 27, 2023

Summary

Deprecate qiskit/quantum_info/synthesis and move to qiskit/synthesis:

  • Move qsd to qiskit/synthesis/unitary
  • Move OneQubitEulerDecomposer to qiskit/synthesis/one_qubit
  • Move XXDecomposer, TwoQubitBasisDecomposer and two_qubit_cnot_decompose to qiskit/synthesis/two_qubits (the latter function is removed from the docs, since it has no docstring)

Except of the following:

  • Remove the code of decompose_clifford and decompose_cnotdihedral since they have already been deprecated in a previous release.
  • Deprecate cnot_rxx_decompose and use it as an internal function in the equivalence_library.
  • Move the Quaternion class to quantum_info.

Details and comments

After #11426 and this PR will be merged, it will be possible to close the following issues:

close #4311
close #4699
close #9667

partially handles #7986

@ShellyGarion ShellyGarion added the Changelog: Deprecation Include in "Deprecated" section of changelog label Dec 27, 2023
@ShellyGarion ShellyGarion added this to the 0.46.0 milestone Dec 27, 2023
@qiskit-bot
Copy link
Collaborator

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core
  • @ikkoham

@coveralls
Copy link

coveralls commented Dec 27, 2023

Pull Request Test Coverage Report for Build 7627549240

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 89.526%

Totals Coverage Status
Change from base Build 7627307951: 0.02%
Covered Lines: 59515
Relevant Lines: 66478

💛 - Coveralls

@ShellyGarion ShellyGarion changed the title Deprecate qiskit/quantum_info/synthesis and move to qiskit/synthesis [WIP] Deprecate qiskit/quantum_info/synthesis and move to qiskit/synthesis Dec 28, 2023
@ShellyGarion
Copy link
Member Author

Like the deprecation of qiskit.extensions in #10725, I deprecated the qiskit.quantum_info.synthesis module by putting a deprecation warning in the __init__ file, and adding links to the new locations in qiskit.synthesis. Is it enough?


warnings.warn(
"The qiskit.quantum_info.synthesis module is deprecated since Qiskit 0.46.0."
"It will be removed in Qiskit 1.0 release.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"It will be removed in Qiskit 1.0 release.",
"It will be removed in the Qiskit 1.0 release.",

cnot_rxx_decompose(plus_ry=True, plus_rxx=False),
cnot_rxx_decompose(plus_ry=False, plus_rxx=True),
cnot_rxx_decompose(plus_ry=False, plus_rxx=False),
_cnot_rxx_decompose(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that this is a private method, do we still need to test it or is it tested enough in the context of the composer? If yes, I'd think we can skip testing this

Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Cryoris Cryoris added this pull request to the merge queue Jan 23, 2024
@Cryoris Cryoris added the Changelog: Removal Include in the Removed section of the changelog label Jan 23, 2024
Merged via the queue into Qiskit:main with commit 8887f44 Jan 23, 2024
12 checks passed
@Cryoris
Copy link
Contributor

Cryoris commented Jan 24, 2024

@Mergifyio backport stable/0.46

Copy link
Contributor

mergify bot commented Jan 24, 2024

backport stable/0.46

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jan 24, 2024
…11460)

* remove deprecated code in clifford_decompose and cnotdihedral_decompose

* move tests from test/python/quantum_info to test/python/synthesis

* move the Quaternion class from quantum_info/synthesis to quantum_info

* deprecate cnot_rxx_decompose, and move to an internal code in the equivalence_library

* deprecate cnot_rxx_decompose

* move qsd from qiskit/quantum_info/synthesis to qiskit/synthesis/unitary

* handle lint and docs errors in qsd

* handle lint and docs errors in qsd

* handle lint and docs errors in qsd

* handle lint and docs errors in qsd

* handle lint and docs errors in qsd

* handle cyclic imports in qsd

* minor

* update qsd docs

* move one_qubit_decompose from qiskit/quantum_info/synthesis to qiskit/synthesis/one_qubit

* move xx_decompose from qiskit/quantum_info/synthesis to qiskit/synthesis/two_qubits

* handle cyclic imports

* move two-qubit synthesis code from qiskit/quantum_info/synthesis to qiskit/synthesis/two_qubits

* update qsd docs

* minor

* add release notes

* updates following review

* add disable cyclic import to rv.py

* add deprecation warning in qiskit/quantum_info/__init__.py

* fix links

* improve qsd docs following review

* update qsd after review

* change pending deprecatrion to deprecation in ion_decompose

* update release notes following review

* update pending deprecation to deprecation

* add test for a deprecation

* add more tests for deprecations

* add another test for deprecation

* handle lint errors

* minor fix following review

* remove test for _cnot_rxx_decompose() private method

(cherry picked from commit 8887f44)

# Conflicts:
#	qiskit/synthesis/__init__.py
#	qiskit/transpiler/synthesis/qsd.py
#	test/benchmarks/random_circuit_hex.py
github-merge-queue bot pushed a commit that referenced this pull request Jan 26, 2024
…(backport #11460) (#11635)

* Deprecate qiskit/quantum_info/synthesis and move to qiskit/synthesis (#11460)

* remove deprecated code in clifford_decompose and cnotdihedral_decompose

* move tests from test/python/quantum_info to test/python/synthesis

* move the Quaternion class from quantum_info/synthesis to quantum_info

* deprecate cnot_rxx_decompose, and move to an internal code in the equivalence_library

* deprecate cnot_rxx_decompose

* move qsd from qiskit/quantum_info/synthesis to qiskit/synthesis/unitary

* handle lint and docs errors in qsd

* handle lint and docs errors in qsd

* handle lint and docs errors in qsd

* handle lint and docs errors in qsd

* handle lint and docs errors in qsd

* handle cyclic imports in qsd

* minor

* update qsd docs

* move one_qubit_decompose from qiskit/quantum_info/synthesis to qiskit/synthesis/one_qubit

* move xx_decompose from qiskit/quantum_info/synthesis to qiskit/synthesis/two_qubits

* handle cyclic imports

* move two-qubit synthesis code from qiskit/quantum_info/synthesis to qiskit/synthesis/two_qubits

* update qsd docs

* minor

* add release notes

* updates following review

* add disable cyclic import to rv.py

* add deprecation warning in qiskit/quantum_info/__init__.py

* fix links

* improve qsd docs following review

* update qsd after review

* change pending deprecatrion to deprecation in ion_decompose

* update release notes following review

* update pending deprecation to deprecation

* add test for a deprecation

* add more tests for deprecations

* add another test for deprecation

* handle lint errors

* minor fix following review

* remove test for _cnot_rxx_decompose() private method

(cherry picked from commit 8887f44)

# Conflicts:
#	qiskit/synthesis/__init__.py
#	qiskit/transpiler/synthesis/qsd.py
#	test/benchmarks/random_circuit_hex.py

* fix merge conflicts

* fix merge conflicts

* minor fix

* update release notes

---------

Co-authored-by: Shelly Garion <46566946+ShellyGarion@users.noreply.github.com>
Co-authored-by: Shelly Garion <shelly@il.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Deprecation Include in "Deprecated" section of changelog Changelog: Removal Include in the Removed section of the changelog
Projects
None yet
6 participants