2
$\begingroup$

I am working with Aqua sample (qiskit-aqua/test/finance/test_readme_sample.py ) that uses the FixedIncomeExpectedValue and the AmplitudeEstimation.

It is qiskit 0.18

This sample was previously working with qiskit 0.16.2 when Statevector_simulator was used for AmplitudeEstimation. Though I used to run into an error ERROR_RUNNING_JOB when running on ibmq_ hardware. I was told to upgrade to qiskit 0.18 to fix that.

Since the update it now fails in _check_conflicting_argument with the message "The parameters pass_manager conflicts with the following parameter(s): backend." as shown below is a stack trace

    :
qc = compiler.transpile(circuit, BasicAer.get_backend('qasm_simulator'), pass_manager=p_m)

File "C:\Users\-----\Anaconda3\envs\qiskite\lib\site-packages\qiskit\compiler\transpile.py", line 188, in transpile
        routing_method=routing_method, backend=backend)

File "C:\Users\------\Anaconda3\envs\qiskite\lib\site-packages\qiskit\compiler\transpile.py", line 225, in _check_conflicting_argument
        "parameter(s): {}.".format(', '.join(conflicting_args)))

TranspilerError: 'The parameters pass_manager conflicts with the following parameter(s): backend.'

Further walk through the stack trace shows the following

bckend = set_backend('STATEVEC')

ampest = AmplitudeEstimation(m, fixed_income)
result = ampest.run(quantum_instance=bckend)
..quantum_algorithm.run()
....ae.run
......if _quantum_instance.is_statevector:
........construct_circuit(measurement = False)
..........pec = PhaseEstimationCircuit(...)
..........pec.construct_circuit(measurement = False)
............._state_n_circuit_factory(qc,q,aux)
................uncertainty_model.build(...) #fixed_income_....py
..................cs = Custom(...) #multivariate_distribution.py
..................extend(cs.construct_circuit('circuit',q))   
.....................cs.construct_circuit('circuit')
........................svc = StateVectorCircuit(_state_vector)
........................sv.construct_circuit(...)
..........................convert_to_basis_gates()
............................Unroller(...)
............................PassManager(...)
............................compiler.transpile(circuit, BasicAer.get_backend('qasm_simulator)...)
.............................. transpile (....)
................................._check_conflicting_argument(...backend=backend)

It is in this _check_conflicting_argument that the error message is raised "The parameters pass_manager conflicts with the following parameter(s): backend." and the script stops execution.

Please let me know what am I missing something here.

Thank you

$\endgroup$
6
  • 1
    $\begingroup$ Concerning the gates after the measurements; this was a bug that was fixed recently, are you using the latest version of Aqua? $\endgroup$
    – Cryoris
    Commented Apr 13, 2020 at 10:45
  • $\begingroup$ @jul - thank you - it was qiskit 0.16.2 - I updated to qiskit 0.18 - I updated the description above $\endgroup$
    – abhi-rao
    Commented Apr 14, 2020 at 1:22
  • 1
    $\begingroup$ Hi! If you want to transpile the circuit for a specific backend, that should be the one you use in the transpile function. If you want to run it on a simulator you can just call execute $\endgroup$
    – met927
    Commented Apr 14, 2020 at 9:28
  • 1
    $\begingroup$ @abhi I'm not certain this caused your error, just a thought :) perhaps if you could share more of the code that is causing the error we could debug further? $\endgroup$
    – met927
    Commented Apr 14, 2020 at 18:39
  • 1
    $\begingroup$ @Abhi Thanks for the info. This bug is resolved in the latest master version, which is not yet in stable. Installing from source should resolve the issue, see my response. $\endgroup$
    – Cryoris
    Commented Apr 14, 2020 at 20:49

1 Answer 1

1
$\begingroup$

The quick answer to your problem is to install Qiskit Aqua directly from GitHub instead of via pip. On the lastest master version, this bug is fixed. You can do this using

git clone https://github.com/Qiskit/qiskit-aqua
cd qiskit-aqua
pip install .

more detailed instructions are given on Qiskit's webpage.

As to why you're getting this error: This comes from a change in Qiskit Terra which resulted in an incompatibility with the current implementation in Qiskit Aqua. That was fixed in this commit on GitHub. This fix is in the master branch of the repository, however when you're installing via pip you're getting the last stable version, where this fix is not yet included. With the next release of Aqua (this will be 0.7.0) this bug is resolved in the pip version, too.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.