Skip to content

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Dec 24, 2024

Summary

The circuit library modernization from #13046 introduced some pending deprecations that this PR is moving to deprecations.

reno is still missing.

@Cryoris
Copy link
Contributor

Cryoris commented Feb 7, 2025

We could just have a single reno for the deprecation of BlueprintCircuit and mention the deprecation of all subclasses therein. That would be a bit cleaner for the users than having multiple 🙂

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.

Thanks for taking care of this, this LGTM but it seems to only miss the catches in the tests 🙂

@1ucian0 1ucian0 changed the base branch from stable/1.4 to main February 10, 2025 13:19
@1ucian0 1ucian0 linked an issue Feb 15, 2025 that may be closed by this pull request
@1ucian0 1ucian0 self-assigned this Feb 20, 2025
@1ucian0 1ucian0 added this to the 2.0.0 milestone Feb 20, 2025
@1ucian0
Copy link
Member Author

1ucian0 commented Feb 20, 2025

Most of the problems are coming from an internal call to a deprecated method:

qiskit/circuit/library/standard_gates/x.py", line 1148, in __init__
    num_ancilla_qubits = self.__class__.get_num_ancilla_qubits(num_ctrl_qubits)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

There is also some issues with BlueprintCircuit subclasses. From @Cryoris :

There's currently 5 subclasses:
QFT and NLocal are already deprecated
all others should be taken care of by #13371

Still working on the rest.

@1ucian0 1ucian0 added the on hold Can not fix yet label Feb 20, 2025
Copy link
Member

@alexanderivrii alexanderivrii left a comment

Choose a reason for hiding this comment

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

Thanks for all the hard work, the PR is in a very good shape.

The most important comment for 2.1: should we also deprecate the following quantum circuits (all of which have gate equivalents):ExactReciprocal, LinearAmplitudeFunction, QuantumVolume, PhaseOracle, GR, GRX, GRY, GRZ?

Less important for now (and can be done in a follow-up): we should update the the docstrings for the classes PiecewisePolynomialPauliRotationsGate, zz_feature_map, z_feature_map (they refer to the quantum circuits that are being deprecated).

Less important for now (and should be done in a follow-up): multiple tests need to be updated to check gates/functions and not quantum circuits.

@ShellyGarion
Copy link
Member

I think that there are some circuit library circuits that should be deprecated but were still not pending deprecated. Do you think it could be part of this PR?

@alexanderivrii
Copy link
Member

@ShellyGarion: these classes are already marked for deprecation in this PR -- they inherit from Adder or Multiplier classes that are being explicitly deprecated. In other words, if you instantiate an instance of DraperQFTAdder, it will call the parent's __init__ method and you will get the deprecation message.

Copy link
Member

@alexanderivrii alexanderivrii left a comment

Choose a reason for hiding this comment

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

Thanks again for working on this, Luciano and Julien. We have decided to leave the additional deprecations mentioned in #13604 (review) for a follow-up, so this is off to the merge queue.

@alexanderivrii alexanderivrii added this pull request to the merge queue May 28, 2025
Merged via the queue into Qiskit:main with commit 7b0c1d6 May 28, 2025
26 checks passed
@eliarbel eliarbel added the Changelog: Deprecation Include in "Deprecated" section of changelog label Jun 3, 2025
rahaman-quantum pushed a commit to rahaman-quantum/qiskit that referenced this pull request Jun 20, 2025
…it#13604)

* blueprint deprecation + reno

* unittest test.python.transpiler.test_star_prerouting

* test.python.transpiler.test_solovay_kitaev

* test.python.transpiler.test_linear_functions_passes

* unittest test.python.synthesis.test_qft_synthesis

* test.python.synthesis.test_cz_synthesis

* test.python.transpiler.test_parameterizedgate_translator

* test.python.quantum_info.operators.test_operator

* test.python.primitives.test_statevector_sampler

* test.python.primitives.test_sampler

* test.python.primitives.test_statevector_estimator

* test.python.primitives.test_estimator

* test.python.primitives.test_backend_sampler_v2

* test.python.primitives.test_backend_sampler

* test.python.primitives.test_backend_estimator_v2

* test.python.primitives.test_backend_estimator

* test.python.circuit.library.test_blueprintcircuit

* test.python.transpiler.test_high_level_synthesis.TestHighLevelSynthesisModifiers.test_circuit_with_mcx

* test.python.circuit.test_controlled_gate.TestControlledGate.test_mcxrecursive_clean_ancilla_cx_count

* some less errors

* capture the deprecations for internal usage

* test.python.visualization.test_circuit_text_drawer.TestTextOpenControlledGate

* test.python.circuit.library.test_boolean_logic

* test.python.transpiler.test_swap_strategy_router

* test.python.transpiler.test_high_level_synthesis

* test.python.circuit.library.test_qft.TestQFT

* test.python.circuit.test_controlled_gate.TestControlledGate

* test.python.circuit.test_controlled_gate.TestControlledGate.test_mcxvchain_dirty_ancilla_action_only

* test.python.circuit.test_controlled_gate.TestControlledGate

* test.python.transpiler.test_high_level_synthesis

* test.python.qasm2.test_export

* EvolvedOperatorAnsatz

* fix tests in circuit library

* more controlled gate fixes

* I can see light at the end of the tunnel

* updating to 2.1

* black

* filterwarnings

* filterwarnings

* last update of a since

* pylint

* test.python.circuit.library

* Fix mcry and gray code deprecation msg

* test.python.circuit.test_controlled_gate.TestControlledGate

* test.python.circuit.test_controlled_gate.TestControlledStandardGates

* qiskit/circuit/library/standard_gates/x.py:1533

* mpl.circuit.test_circuit_matplotlib_drawer.TestCircuitMatplotlibDrawer.test_cnot

* https://github.com/Qiskit/qiskit/pull/13604/files/395658b3fbf603a7272bbf5179d7604ef608aed6#r2106219162

* addressing Qiskit#13604 (comment)

---------

Co-authored-by: Julien Gacon <jules.gacon@googlemail.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate BlueprintCircuit in 2.0 Deprecate in 1.4 the pending deprecations from the 1.* cycle
7 participants