I'm trying to use the parametrized circuits to run a single model of quantum circuit with different values. Here's part of my code:
from qiskit import IBMQ
provider = IBMQ.load_account()
sim = provider.backends.ibmq_qasm_simulator
backend = provider.get_backend('ibmq_qasm_simulator')
probsu = []
for i in range(L):
circuit = circuit.assign_parameters({Ei: EWi[i]})
circuit = qc(Ei)
job_manager = IBMQJobManager()
**MExperiment = job_manager.run(circuit, backend=backend, name='MExperiment')**
result = MExperiment.result()
Ta = '1'*N
counts = result.get_counts(circuit)
if Ta in counts:
prob = counts[Ta]/sum(counts.values())
else:
prob = 0
probsu.append(prob)
Where qc(Ei) is a function of the quantum circuit model. EWi is an array of possible parameters that will be used. An error occurred at the line marked with **. Here's what qiskit shows me:
CircuitError: "Cannot bind parameters (['Ei']) not present in the circuit."
I'm not exactly sure, but it looks like parameterization requires the label 'Ei' to appear in the circuit. However, my circuit function takes the argument to accept some input like Ei. Is there a way I can fix this error? Thanks a lot for your help:)