# Error using FixedIncomeExpectedValue sample

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

• Concerning the gates after the measurements; this was a bug that was fixed recently, are you using the latest version of Aqua? – Cryoris Apr 13 at 10:45
• @jul - thank you - it was qiskit 0.16.2 - I updated to qiskit 0.18 - I updated the description above – imabhi Apr 14 at 1:22
• 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 – met927 Apr 14 at 9:28
• @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? – met927 Apr 14 at 18:39
• @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. – Cryoris Apr 14 at 20:49

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