You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When binding multiple Parameters, i.e. by using a ParameterVector or a circuit generated by TwoLocal, with pulse gates, i.e. those generated by RZXCalibrationBuilder, the following error occurs when running the job via the Sampler:
qiskit.providers.exceptions.JobError: 'Unable to retrieve result for job sampler_cektfmliubo4gdosfftg_a89a_0. Job has failed: Instruction rzx is not supported. Error code: 7001.'
Steps to reproduce
The following code runs successfully for the first circuit and fails for the second:
from qiskit import transpile
from qiskit.circuit import ParameterVector, QuantumCircuit
from qiskit.converters import circuit_to_dag, dag_to_circuit
from qiskit.pulse import Play, ScheduleBlock
from qiskit.quantum_info import Operator
from qiskit.transpiler import PassManager
from qiskit.transpiler.passes import RZXCalibrationBuilder
from qiskit_ibm_runtime import QiskitRuntimeService, Session, Sampler, Options
from qiskit_ibm_runtime.options import EnvironmentOptions, ExecutionOptions, TranspilationOptions
from copy import deepcopy
import numpy as np
service = QiskitRuntimeService(channel='ibm_quantum')
backend = service.backend("ibm_perth")
inst_sched_map = backend.defaults().instruction_schedule_map
channel_map = backend.configuration().qubit_channel_mapping
rng = np.random.default_rng(12345)
param_bind = rng.uniform(-np.pi, np.pi, 5)
qc1 = QuantumCircuit(2)
qc1.rx(param_bind[0], 0)
qc1.rx(param_bind[1], 1)
qc1.rz(param_bind[2], 0)
qc1.rz(param_bind[3], 1)
qc1.rzx(param_bind[4], 0, 1)
qc1.draw()
I had a dig, and yeah, I think this is a problem in QPY, though I'm suspicious that the real cause is sympy/symengine being not quite as precise as Python when displaying floats as text. With Python, if you need, you can rely on float(str(x)) == x for all x (except for nan which satisfies nan != nan per the IEEE-754 spec). I've opened the issue linked above on Terra to track.
Describe the bug
When binding multiple
Parameters
, i.e. by using aParameterVector
or a circuit generated byTwoLocal
, with pulse gates, i.e. those generated byRZXCalibrationBuilder
, the following error occurs when running the job via theSampler
:Steps to reproduce
The following code runs successfully for the first circuit and fails for the second:
yields
and
yields similarly
and
is
True
. The following block is a workaround for Runtime Issue #657:Then the job is run via
Interestingly, these both run successfully when only using a
ParameterVector
of length 1 with a singlerzx
pulse gate.Expected behavior
Both circuits should run successfully with the
Sampler
because they are equivalent, as they do when usingbackend.run()
.Suggested solutions
My feeling is that something in the
Parameter
binding process is causing the primitive to not recognize the attached pulse gate.Additional Information
The text was updated successfully, but these errors were encountered: