qiskit-community / qiskit-algorithms

A library of quantum algorithms for Qiskit.
https://qiskit-community.github.io/qiskit-algorithms/
Apache License 2.0
89 stars 43 forks source link

Nightly test against Qiskit main failing #181

Open woodsp-ibm opened 2 weeks ago

woodsp-ibm commented 2 weeks ago

Some gradient tests are failing due to changes in QuantumCircuit

      File "/home/runner/work/qiskit-algorithms/qiskit-algorithms/qiskit_algorithms/gradients/reverse/derive_circuit.py", line 135, in derive_circuit
    if len(circuit._parameter_table[parameter]) > 1:

    AttributeError: 'QuantumCircuit' object has no attribute '_parameter_table'

The change came from Qiskit/qiskit#12459 which is moving circuit logic into Rust.

woodsp-ibm commented 2 weeks ago

In chatting with Matthew

The parameter table was moved to rust though, if you're testing against main and want the number of parameter entries for a give parameter you can use QuantumCircuit._data._get_entry_count(parameter) which will return the count

In looking at this briefly I see there is no test case for the check that is failing (no coverage to have that error raised by tests) hence doing some different logic would ideally want a test case that checks that the error is raised so it can validate the new way, as well as the old!!, works as expected.