1

I am trying to use the code tutorials/finance/09_credit_risk_analysis.html for 3 assets. Face problem in running line 13: # define the registers for convenience and readability. The error: ---> state_preparation.append(agg.to_gate(), qr_state[:] + qr_sum[:] + qr_carry[:]) CircuitError: 'The amount of qubit/clbit arguments does not match the gate expectation.' Please help me to debug.

dedek
  • 6,771
  • 3
  • 33
  • 66
Aryabhat
  • 11
  • 2
  • Hello! I tried the cell 13 of [the tuto](https://qiskit.org/documentation/tutorials/finance/09_credit_risk_analysis.html) you are talking about and did not run into the error, did you change the code? Could you put more details of what you did/change exactly? It is a little difficult to help without more information – Lena Mar 15 '21 at 09:06
  • Yes, I have changed the code. I am using the code to use 3 assets instead of two. Accordingly, I have changed the following: # n_z = 2 # for 3 assets 6 qubits are required n_z = 3 # n_z = 4 # z_max = 2 z_max = 3 # z_max = 4 z_values = np.linspace(-z_max, z_max, 2**n_z) # p_zeros = [0.15, 0.25] p_zeros = [0.15, 0.25, 0.6] # rhos = [0.1, 0.05] rhos = [0.1, 0.05, 0.25] # lgd = [1, 2] lgd = [1, 2, 3] K = len(p_zeros) alpha = 0.05 – Aryabhat Mar 16 '21 at 13:33

0 Answers0