Closed salperinlea closed 2 years ago
@mtreinish It looks to be something to do with transpiling to different basis gates, though I'm not sure why this would cause an issue. Here is a more minimal example that avoids the execute
function.
import numpy as np
from qiskit import QuantumCircuit, transpile
from qiskit.circuit import Parameter
from qiskit.providers.aer import AerSimulator
a = Parameter('a')
qc = QuantumCircuit(1, 1)
qc.rx(a,0)
qc.measure(0,0)
# Transpile rx -> u3
tqc = transpile(qc, basis_gates=['u3'])
binds = [{a: np.array([np.pi])}]
result = AerSimulator().run(tqc, parameter_binds=binds).result()
Simulation failed and returned the following error message:
ERROR: Failed to load qobj: Invalid parameterized qobj: parameterization value out of range
Informations
What is the current behavior?
parameters must be manually bound beforehand or else noisy simulations cannot be executed. One of three errors arises, which will be different depending on what you pass as a parameter bind. If binds are List of Dict(Parameter, number), the following error occurs:
Whereas, if one attempts to rectify this with binds as List of Dict(Parameter,array), one gets either
if using np.asarray([number]). if using np.array(number), one instead gets:
Steps to reproduce the problem
What is the expected behavior?
Parameter binds of List of Dict(Parameter,number) should be acceptable as a pass-down.
Suggested solutions
No clue. The fix to one problem keeps creating a new one. This is potentially related to the fix to Qiskit/qiskit-aer#1249.